From b7700247d26e345782e43499172be005363909b1 Mon Sep 17 00:00:00 2001 From: Thijs Kuilman Date: Wed, 22 Jan 2025 10:59:43 +0100 Subject: [PATCH 1/4] Fixed entanglement of the state --- resources/views/tiptap-editor.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/tiptap-editor.blade.php b/resources/views/tiptap-editor.blade.php index b7db9c7..871ae58 100644 --- a/resources/views/tiptap-editor.blade.php +++ b/resources/views/tiptap-editor.blade.php @@ -38,7 +38,7 @@ class="relative z-0 tiptap-wrapper rounded-md bg-white dark:bg-gray-900 focus-within:ring focus-within:ring-primary-500 focus-within:z-10" x-bind:class="{ 'tiptap-fullscreen': fullScreenMode }" x-data="tiptap({ - state: $wire.{{ $applyStateBindingModifiers("entangle('{$statePath}')", isOptimisticallyLive: true) }}, + state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')", isOptimisticallyLive: true) }}, statePath: '{{ $statePath }}', tools: @js($tools), disabled: @js($isDisabled), From ff02872fab0c40d49b0e58404d8ccd7f9e485173 Mon Sep 17 00:00:00 2001 From: Thijs Kuilman Date: Wed, 22 Jan 2025 11:00:21 +0100 Subject: [PATCH 2/4] Respect a passed debounce --- resources/dist/filament-tiptap-editor.js | 44 ++++++++++++------------ resources/js/plugin.js | 6 +++- resources/views/tiptap-editor.blade.php | 3 +- 3 files changed, 29 insertions(+), 24 deletions(-) diff --git a/resources/dist/filament-tiptap-editor.js b/resources/dist/filament-tiptap-editor.js index 8bd71b3..95da364 100644 --- a/resources/dist/filament-tiptap-editor.js +++ b/resources/dist/filament-tiptap-editor.js @@ -1,10 +1,10 @@ var uO=Object.create;var yy=Object.defineProperty;var dO=Object.getOwnPropertyDescriptor;var fO=Object.getOwnPropertyNames;var pO=Object.getPrototypeOf,hO=Object.prototype.hasOwnProperty;var Qd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var mO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fO(e))!hO.call(t,i)&&i!==n&&yy(t,i,{get:()=>e[i],enumerable:!(r=dO(e,i))||r.enumerable});return t};var ef=(t,e,n)=>(n=t!=null?uO(pO(t)):{},mO(e||!t||!t.__esModule?yy(n,"default",{value:t,enumerable:!0}):n,t));var vS=Qd((mq,ES)=>{function aS(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&aS(n)}),t}var Nu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function lS(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ai(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var eH="",tS=t=>!!t.scope,tH=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Im=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=lS(e)}openNode(e){if(!tS(e))return;let n=tH(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){tS(e)&&(this.buffer+=eH)}value(){return this.buffer}span(e){this.buffer+=``}},nS=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Dm=class t{constructor(){this.rootNode=nS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=nS({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Lm=class extends Dm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Im(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ma(t){return t?typeof t=="string"?t:t.source:null}function cS(t){return vo("(?=",t,")")}function nH(t){return vo("(?:",t,")*")}function rH(t){return vo("(?:",t,")?")}function vo(...t){return t.map(n=>Ma(n)).join("")}function iH(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Bm(...t){return"("+(iH(t).capture?"":"?:")+t.map(r=>Ma(r)).join("|")+")"}function uS(t){return new RegExp(t.toString()+"|").exec("").length-1}function oH(t,e){let n=t&&t.exec(e);return n&&n.index===0}var sH=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ma(r),s="";for(;o.length>0;){let l=sH.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var aH=/\b\B/,dS="[a-zA-Z]\\w*",Hm="[a-zA-Z_]\\w*",fS="\\b\\d+(\\.\\d+)?",pS="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",hS="\\b(0b[01]+)",lH="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cH=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=vo(e,/.*\b/,t.binary,/\b.*/)),Ai({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Na={begin:"\\\\[\\s\\S]",relevance:0},uH={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Na]},dH={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Na]},fH={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ou=function(t,e,n={}){let r=Ai({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Bm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:vo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pH=Ou("//","$"),hH=Ou("/\\*","\\*/"),mH=Ou("#","$"),gH={scope:"number",begin:fS,relevance:0},bH={scope:"number",begin:pS,relevance:0},yH={scope:"number",begin:hS,relevance:0},EH={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Na,{begin:/\[/,end:/\]/,relevance:0,contains:[Na]}]}]},vH={scope:"title",begin:dS,relevance:0},wH={scope:"title",begin:Hm,relevance:0},xH={begin:"\\.\\s*"+Hm,relevance:0},_H=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Mu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:aH,IDENT_RE:dS,UNDERSCORE_IDENT_RE:Hm,NUMBER_RE:fS,C_NUMBER_RE:pS,BINARY_NUMBER_RE:hS,RE_STARTERS_RE:lH,SHEBANG:cH,BACKSLASH_ESCAPE:Na,APOS_STRING_MODE:uH,QUOTE_STRING_MODE:dH,PHRASAL_WORDS_MODE:fH,COMMENT:Ou,C_LINE_COMMENT_MODE:pH,C_BLOCK_COMMENT_MODE:hH,HASH_COMMENT_MODE:mH,NUMBER_MODE:gH,C_NUMBER_MODE:bH,BINARY_NUMBER_MODE:yH,REGEXP_MODE:EH,TITLE_MODE:vH,UNDERSCORE_TITLE_MODE:wH,METHOD_GUARD:xH,END_SAME_AS_BEGIN:_H});function SH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function TH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function CH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=SH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function AH(t,e){Array.isArray(t.illegal)&&(t.illegal=Bm(...t.illegal))}function MH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function NH(t,e){t.relevance===void 0&&(t.relevance=1)}var kH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=vo(n.beforeMatch,cS(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},OH=["of","and","for","in","not","or","if","then","parent","list","value"],RH="keyword";function mS(t,e,n=RH){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,mS(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,IH(u[0],u[1])]})}}function IH(t,e){return e?Number(e):DH(t)?0:1}function DH(t){return OH.includes(t.toLowerCase())}var rS={},Eo=t=>{console.error(t)},iS=(t,...e)=>{console.log(`WARN: ${t}`,...e)},fs=(t,e)=>{rS[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),rS[`${t}/${e}`]=!0)},ku=new Error;function gS(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=uS(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function LH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Eo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ku;if(typeof t.beginScope!="object"||t.beginScope===null)throw Eo("beginScope must be object"),ku;gS(t,t.begin,{key:"beginScope"}),t.begin=Fm(t.begin,{joinWith:""})}}function PH(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Eo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ku;if(typeof t.endScope!="object"||t.endScope===null)throw Eo("endScope must be object"),ku;gS(t,t.end,{key:"endScope"}),t.end=Fm(t.end,{joinWith:""})}}function BH(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function FH(t){BH(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),LH(t),PH(t)}function HH(t){function e(s,l){return new RegExp(Ma(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=uS(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Fm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[TH,MH,FH,kH].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[CH,AH,NH].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=mS(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ma(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return $H(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ai(t.classNameAliases||{}),o(t)}function bS(t){return t?t.endsWithParent||bS(t.starts):!1}function $H(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ai(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:bS(t)?Ai(t,{starts:t.starts?Ai(t.starts):null}):Object.isFrozen(t)?Ai(t):t}var zH="11.8.0",Pm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Rm=lS,oS=Ai,sS=Symbol("nomatch"),UH=7,yS=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lm};function u(A){return l.noHighlightRe.test(A)}function d(A){let I=A.className+" ";I+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(I);if(z){let j=q(z[1]);return j||(iS(o.replace("{}",z[1])),iS("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return I.split(/\s+/).find(j=>u(j)||q(j))}function f(A,I,z){let j="",ie="";typeof I=="object"?(j=A,z=I.ignoreIllegals,ie=I.language):(fs("10.7.0","highlight(lang, code, ...args) has been deprecated."),fs("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(D,H){return D.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let D=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(D,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=UH&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];D=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(D),_e.addText(X)}function je(){if(pe==="")return;let D=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}D=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=D._top}else D=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=D.relevance),_e.__addSublanguage(D._emitter,D.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(D,H){D!==""&&(_e.startScope(H),_e.addText(D),_e.endScope())}function _t(D,H){let X=1,se=H.length-1;for(;X<=se;){if(!D._emit[X]){X++;continue}let Fe=Je.classNameAliases[D[X]]||D[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(D,H){return D.scope&&typeof D.scope=="string"&&_e.openNode(Je.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(Be(pe,Je.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),pe=""):D.beginScope._multi&&(_t(D.beginScope,H),pe="")),V=Object.create(D,{parent:{value:V}}),V}function Re(D,H,X){let se=oH(D.endRe,X);if(se){if(D["on:end"]){let Fe=new Nu(D);D["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return Re(D.parent,H,X)}function St(D){return V.matcher.regexIndex===0?(pe+=D[0],1):(Ot=!0,0)}function Xt(D){let H=D[0],X=D.rule,se=new Nu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(D,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,D),X.returnBegin?0:H.length}function pt(D){let H=D[0],X=I.substring(D.index),se=Re(V,D,X);if(!se)return sS;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,D)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,D),Fe.returnEnd?0:H.length}function an(){let D=[];for(let H=V;H!==Je;H=H.parent)H.scope&&D.unshift(H.scope);D.forEach(H=>_e.openNode(H))}let Zt={};function Tt(D,H){let X=H&&H[0];if(pe+=D,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==sS)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw Eo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=HH(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let D=V.matcher.exec(I);if(!D)break;let H=I.substring(dt,D.index),X=Tt(H,D);dt=D.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:A,value:Rm(I),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:dt,context:I.slice(dt-100,dt+100),mode:D.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:Rm(I),illegal:!1,relevance:0,errorRaised:D,_emitter:_e,_top:V};throw D}}function m(A){let I={value:Rm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function y(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function v(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Pm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,y(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=oS(l,A)}let S=()=>{T(),fs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){T(),fs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function T(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(v)}function B(){L&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(Eo("Language definition for '{}' could not be registered.".replace("{}",A)),i)Eo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return fs("10.7.0","highlightBlock will be removed entirely in v12.0"),fs("10.7.0","Please use highlightElement now."),v(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:v,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:O,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:oS,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=zH,t.regex={concat:vo,lookahead:cS,either:Bm,optional:rH,anyNumberOfTimes:nH};for(let A in Mu)typeof Mu[A]=="object"&&aS(Mu[A]);return Object.assign(t,Mu),t},ps=yS({});ps.newInstance=()=>yS({});ES.exports=ps;ps.HighlightJS=ps;ps.default=ps});var xS=Qd((bq,$m)=>{(function(){var t;typeof $m<"u"?t=$m.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,u=i.length,d="",f,h=!1,m,g,y=!1,v,w=function(){return s[o++]},S=function(){for(var O="";/\d/.test(i[l]);)O+=i[l++],f=i[l];return O.length>0?parseInt(O):null};l{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",d=1,f=2,h=4,m=1,g=2,y=1,v=2,w=4,S=8,O=16,L=32,T=64,B=128,R=256,Y=512,ne=30,q="...",Q=800,fe=16,we=1,me=2,Ce=3,ge=1/0,ye=9007199254740991,A=17976931348623157e292,I=NaN,z=4294967295,j=z-1,ie=z>>>1,xe=[["ary",B],["bind",y],["bindKey",v],["curry",S],["curryRight",O],["flip",Y],["partial",L],["partialRight",T],["rearg",R]],Ae="[object Arguments]",je="[object Array]",Ne="[object AsyncFunction]",Be="[object Boolean]",_t="[object Date]",kt="[object DOMException]",Re="[object Error]",St="[object Function]",Xt="[object GeneratorFunction]",pt="[object Map]",an="[object Number]",Zt="[object Null]",Tt="[object Object]",Je="[object Promise]",jn="[object Proxy]",Pt="[object RegExp]",V="[object Set]",yt="[object String]",_e="[object Symbol]",pe="[object Undefined]",ut="[object WeakMap]",dt="[object WeakSet]",Bt="[object ArrayBuffer]",Ot="[object DataView]",D="[object Float32Array]",H="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",Fe="[object Int32Array]",rt="[object Uint8Array]",wr="[object Uint8ClampedArray]",F="[object Uint16Array]",ae="[object Uint32Array]",Se=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ft=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,Zr=RegExp(Ft.source),Da=RegExp(ln.source),xr=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Ni=/<%=([\s\S]+?)%>/g,jr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zu=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qr=/[\\^$.*+?()[\]{}|]/g,zS=RegExp(Qr.source),Uu=/^\s+/,US=/\s/,WS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,KS=/\{\n\/\* \[wrapped with (.+)\] \*/,VS=/,? & /,GS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qS=/[()=,{}\[\]\/\s]/,YS=/\\(\\)?/g,JS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gm=/\w*$/,XS=/^[-+]0x[0-9a-f]+$/i,ZS=/^0b[01]+$/i,jS=/^\[object .+?Constructor\]$/,QS=/^0o[0-7]+$/i,eT=/^(?:0|[1-9]\d*)$/,tT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,La=/($^)/,nT=/['\n\r\u2028\u2029\\]/g,Pa="\\ud800-\\udfff",rT="\\u0300-\\u036f",iT="\\ufe20-\\ufe2f",oT="\\u20d0-\\u20ff",qm=rT+iT+oT,Ym="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",sT="\\xac\\xb1\\xd7\\xf7",aT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lT="\\u2000-\\u206f",cT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",Zm="\\ufe0e\\ufe0f",jm=sT+aT+lT+cT,Wu="['\u2019]",uT="["+Pa+"]",Qm="["+jm+"]",Ba="["+qm+"]",eg="\\d+",dT="["+Ym+"]",tg="["+Jm+"]",ng="[^"+Pa+jm+eg+Ym+Jm+Xm+"]",Ku="\\ud83c[\\udffb-\\udfff]",fT="(?:"+Ba+"|"+Ku+")",rg="[^"+Pa+"]",Vu="(?:\\ud83c[\\udde6-\\uddff]){2}",Gu="[\\ud800-\\udbff][\\udc00-\\udfff]",xo="["+Xm+"]",ig="\\u200d",og="(?:"+tg+"|"+ng+")",pT="(?:"+xo+"|"+ng+")",sg="(?:"+Wu+"(?:d|ll|m|re|s|t|ve))?",ag="(?:"+Wu+"(?:D|LL|M|RE|S|T|VE))?",lg=fT+"?",cg="["+Zm+"]?",hT="(?:"+ig+"(?:"+[rg,Vu,Gu].join("|")+")"+cg+lg+")*",mT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ug=cg+lg+hT,bT="(?:"+[dT,Vu,Gu].join("|")+")"+ug,yT="(?:"+[rg+Ba+"?",Ba,Vu,Gu,uT].join("|")+")",ET=RegExp(Wu,"g"),vT=RegExp(Ba,"g"),qu=RegExp(Ku+"(?="+Ku+")|"+yT+ug,"g"),wT=RegExp([xo+"?"+tg+"+"+sg+"(?="+[Qm,xo,"$"].join("|")+")",pT+"+"+ag+"(?="+[Qm,xo+og,"$"].join("|")+")",xo+"?"+og+"+"+sg,xo+"+"+ag,gT,mT,eg,bT].join("|"),"g"),xT=RegExp("["+ig+Pa+qm+Zm+"]"),_T=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ST=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],TT=-1,it={};it[D]=it[H]=it[X]=it[se]=it[Fe]=it[rt]=it[wr]=it[F]=it[ae]=!0,it[Ae]=it[je]=it[Bt]=it[Be]=it[Ot]=it[_t]=it[Re]=it[St]=it[pt]=it[an]=it[Tt]=it[Pt]=it[V]=it[yt]=it[ut]=!1;var tt={};tt[Ae]=tt[je]=tt[Bt]=tt[Ot]=tt[Be]=tt[_t]=tt[D]=tt[H]=tt[X]=tt[se]=tt[Fe]=tt[pt]=tt[an]=tt[Tt]=tt[Pt]=tt[V]=tt[yt]=tt[_e]=tt[rt]=tt[wr]=tt[F]=tt[ae]=!0,tt[Re]=tt[St]=tt[ut]=!1;var CT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},AT={"&":"&","<":"<",">":">",'"':""","'":"'"},MT={"&":"&","<":"<",">":">",""":'"',"'":"'"},NT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kT=parseFloat,OT=parseInt,dg=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ht=dg||RT||Function("return this")(),Yu=typeof gs=="object"&&gs&&!gs.nodeType&&gs,ki=Yu&&typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,fg=ki&&ki.exports===Yu,Ju=fg&&dg.process,Rn=function(){try{var N=ki&&ki.require&&ki.require("util").types;return N||Ju&&Ju.binding&&Ju.binding("util")}catch{}}(),pg=Rn&&Rn.isArrayBuffer,hg=Rn&&Rn.isDate,mg=Rn&&Rn.isMap,gg=Rn&&Rn.isRegExp,bg=Rn&&Rn.isSet,yg=Rn&&Rn.isTypedArray;function Tn(N,$,P){switch(P.length){case 0:return N.call($);case 1:return N.call($,P[0]);case 2:return N.call($,P[0],P[1]);case 3:return N.call($,P[0],P[1],P[2])}return N.apply($,P)}function IT(N,$,P,oe){for(var Me=-1,Ye=N==null?0:N.length;++Me-1}function Xu(N,$,P){for(var oe=-1,Me=N==null?0:N.length;++oe-1;);return P}function Cg(N,$){for(var P=N.length;P--&&_o($,N[P],0)>-1;);return P}function UT(N,$){for(var P=N.length,oe=0;P--;)N[P]===$&&++oe;return oe}var WT=ed(CT),KT=ed(AT);function VT(N){return"\\"+NT[N]}function GT(N,$){return N==null?t:N[$]}function So(N){return xT.test(N)}function qT(N){return _T.test(N)}function YT(N){for(var $,P=[];!($=N.next()).done;)P.push($.value);return P}function id(N){var $=-1,P=Array(N.size);return N.forEach(function(oe,Me){P[++$]=[Me,oe]}),P}function Ag(N,$){return function(P){return N($(P))}}function ni(N,$){for(var P=-1,oe=N.length,Me=0,Ye=[];++P-1}function L1(a,c){var p=this.__data__,b=tl(p,a);return b<0?(++this.size,p.push([a,c])):p[b][1]=c,this}_r.prototype.clear=O1,_r.prototype.delete=R1,_r.prototype.get=I1,_r.prototype.has=D1,_r.prototype.set=L1;function Sr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,b,E,_){var C,M=c&d,k=c&f,U=c&h;if(p&&(C=E?p(a,b,E,_):p(a)),C!==t)return C;if(!ft(a))return a;var W=ke(a);if(W){if(C=HC(a),!M)return bn(a,C)}else{var G=Qt(a),te=G==St||G==Xt;if(ci(a))return cb(a,M);if(G==Tt||G==Ae||te&&!E){if(C=k||te?{}:Mb(a),!M)return k?MC(a,Z1(C,a)):AC(a,Hg(C,a))}else{if(!tt[G])return E?a:{};C=$C(a,G,M)}}_||(_=new er);var de=_.get(a);if(de)return de;_.set(a,C),ry(a)?a.forEach(function(ve){C.add(Pn(ve,c,p,ve,a,_))}):ty(a)&&a.forEach(function(ve,$e){C.set($e,Pn(ve,c,p,$e,a,_))});var Ee=U?k?kd:Nd:k?En:$t,Le=W?t:Ee(a);return In(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ts(C,$e,Pn(ve,c,p,$e,a,_))}),C}function j1(a){var c=$t(a);return function(p){return $g(p,a,c)}}function $g(a,c,p){var b=p.length;if(a==null)return!b;for(a=Qe(a);b--;){var E=p[b],_=c[E],C=a[E];if(C===t&&!(E in a)||!_(C))return!1}return!0}function zg(a,c,p){if(typeof a!="function")throw new Dn(i);return Rs(function(){a.apply(t,p)},c)}function Cs(a,c,p,b){var E=-1,_=Fa,C=!0,M=a.length,k=[],U=c.length;if(!M)return k;p&&(c=lt(c,Cn(p))),b?(_=Xu,C=!1):c.length>=n&&(_=Es,C=!1,c=new Ii(c));e:for(;++EE?0:E+p),b=b===t||b>E?E:Ie(b),b<0&&(b+=E),b=p>b?0:oy(b);p0&&p(M)?c>1?Vt(M,c-1,p,b,E):ti(E,M):b||(E[E.length]=M)}return E}var dd=mb(),Kg=mb(!0);function ur(a,c){return a&&dd(a,c,$t)}function fd(a,c){return a&&Kg(a,c,$t)}function rl(a,c){return ei(c,function(p){return Nr(a[p])})}function Li(a,c){c=ai(c,a);for(var p=0,b=c.length;a!=null&&pc}function tC(a,c){return a!=null&&Ze.call(a,c)}function nC(a,c){return a!=null&&c in Qe(a)}function rC(a,c,p){return a>=jt(c,p)&&a=120&&W.length>=120)?new Ii(C&&W):t}W=a[0];var G=-1,te=M[0];e:for(;++G-1;)M!==a&&Ya.call(M,k,1),Ya.call(a,k,1);return a}function tb(a,c){for(var p=a?c.length:0,b=p-1;p--;){var E=c[p];if(p==b||E!==_){var _=E;Mr(E)?Ya.call(a,E,1):xd(a,E)}}return a}function Ed(a,c){return a+Za(Lg()*(c-a+1))}function gC(a,c,p,b){for(var E=-1,_=It(Xa((c-a)/(p||1)),0),C=P(_);_--;)C[b?_:++E]=a,a+=p;return C}function vd(a,c){var p="";if(!a||c<1||c>ye)return p;do c%2&&(p+=a),c=Za(c/2),c&&(a+=a);while(c);return p}function He(a,c){return Bd(Ob(a,c,vn),a+"")}function bC(a){return Fg(Do(a))}function yC(a,c){var p=Do(a);return hl(p,Di(c,0,p.length))}function Ns(a,c,p,b){if(!ft(a))return a;c=ai(c,a);for(var E=-1,_=c.length,C=_-1,M=a;M!=null&&++E<_;){var k=fr(c[E]),U=p;if(k==="__proto__"||k==="constructor"||k==="prototype")return a;if(E!=C){var W=M[k];U=b?b(W,k,M):t,U===t&&(U=ft(W)?W:Mr(c[E+1])?[]:{})}Ts(M,k,U),M=M[k]}return a}var nb=ja?function(a,c){return ja.set(a,c),a}:vn,EC=Ja?function(a,c){return Ja(a,"toString",{configurable:!0,enumerable:!1,value:qd(c),writable:!0})}:vn;function vC(a){return hl(Do(a))}function Bn(a,c,p){var b=-1,E=a.length;c<0&&(c=-c>E?0:E+c),p=p>E?E:p,p<0&&(p+=E),E=c>p?0:p-c>>>0,c>>>=0;for(var _=P(E);++b>>1,C=a[_];C!==null&&!Mn(C)&&(p?C<=c:C=n){var U=c?null:RC(a);if(U)return $a(U);C=!1,E=Es,k=new Ii}else k=c?[]:M;e:for(;++b<_;){var W=a[b],G=c?c(W):W;if(W=p||W!==0?W:0,C&&G===G){for(var te=k.length;te--;)if(k[te]===G)continue e;c&&k.push(G),M.push(W)}else E(k,G,p)||(k!==M&&k.push(G),M.push(W))}return M}function xd(a,c){return c=ai(c,a),a=Rb(a,c),a==null||delete a[fr(Fn(c))]}function ob(a,c,p,b){return Ns(a,c,p(Li(a,c)),b)}function sl(a,c,p,b){for(var E=a.length,_=b?E:-1;(b?_--:++_=b?a:Bn(a,c,p)}var lb=c1||function(a){return Ht.clearTimeout(a)};function cb(a,c){if(c)return a.slice();var p=a.length,b=kg?kg(p):new a.constructor(p);return a.copy(b),b}function Cd(a){var c=new a.constructor(a.byteLength);return new Ga(c).set(new Ga(a)),c}function _C(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function SC(a){var c=new a.constructor(a.source,Gm.exec(a));return c.lastIndex=a.lastIndex,c}function TC(a){return Ss?Qe(Ss.call(a)):{}}function ub(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function db(a,c){if(a!==c){var p=a!==t,b=a===null,E=a===a,_=Mn(a),C=c!==t,M=c===null,k=c===c,U=Mn(c);if(!M&&!U&&!_&&a>c||_&&C&&k&&!M&&!U||b&&C&&k||!p&&k||!E)return 1;if(!b&&!_&&!U&&a=M)return k;var U=p[b];return k*(U=="desc"?-1:1)}}return a.index-c.index}function fb(a,c,p,b){for(var E=-1,_=a.length,C=p.length,M=-1,k=c.length,U=It(_-C,0),W=P(k+U),G=!b;++M1?p[E-1]:t,C=E>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(E--,_):t,C&&un(p[0],p[1],C)&&(_=E<3?t:_,E=1),c=Qe(c);++b-1?E[_?c[C]:C]:t}}function yb(a){return Ar(function(c){var p=c.length,b=p,E=Ln.prototype.thru;for(a&&c.reverse();b--;){var _=c[b];if(typeof _!="function")throw new Dn(i);if(E&&!C&&fl(_)=="wrapper")var C=new Ln([],!0)}for(b=C?b:p;++b1&&Ve.reverse(),W&&k<$e&&(Ve.length=k),this&&this!==Ht&&this instanceof ve&&(Or=Le||ks(Or)),Or.apply(nr,Ve)}return ve}function Eb(a,c){return function(p,b){return iC(p,a,c(b),{})}}function cl(a,c){return function(p,b){var E;if(p===t&&b===t)return c;if(p!==t&&(E=p),b!==t){if(E===t)return b;typeof p=="string"||typeof b=="string"?(p=An(p),b=An(b)):(p=ib(p),b=ib(b)),E=a(p,b)}return E}}function Ad(a){return Ar(function(c){return c=lt(c,Cn(be())),He(function(p){var b=this;return a(c,function(E){return Tn(E,b,p)})})})}function ul(a,c){c=c===t?" ":An(c);var p=c.length;if(p<2)return p?vd(c,a):c;var b=vd(c,Xa(a/To(c)));return So(c)?li(Qn(b),0,a).join(""):b.slice(0,a)}function OC(a,c,p,b){var E=c&y,_=ks(a);function C(){for(var M=-1,k=arguments.length,U=-1,W=b.length,G=P(W+k),te=this&&this!==Ht&&this instanceof C?_:a;++UM))return!1;var U=_.get(a),W=_.get(c);if(U&&W)return U==c&&W==a;var G=-1,te=!0,de=p&g?new Ii:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[b],c=c.join(p>2?", ":" "),a.replace(WS,`{ +https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=UH&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=oH(L.endRe,X);if(se){if(L["on:end"]){let Fe=new Nu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new Nu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=I.substring(L.index),se=Re(V,L,X);if(!se)return sS;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==sS)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw Eo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=HH(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(I);if(!L)break;let H=I.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:Rm(I),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:I.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:Rm(I),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let I={value:Rm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function b(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Pm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,b(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=oS(l,A)}let S=()=>{T(),fs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){T(),fs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function B(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(Eo("Language definition for '{}' could not be registered.".replace("{}",A)),i)Eo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return fs("10.7.0","highlightBlock will be removed entirely in v12.0"),fs("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:N,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:oS,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=zH,t.regex={concat:vo,lookahead:cS,either:Bm,optional:rH,anyNumberOfTimes:nH};for(let A in Mu)typeof Mu[A]=="object"&&aS(Mu[A]);return Object.assign(t,Mu),t},ps=yS({});ps.newInstance=()=>yS({});ES.exports=ps;ps.HighlightJS=ps;ps.default=ps});var xS=Qd((bq,$m)=>{(function(){var t;typeof $m<"u"?t=$m.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,u=i.length,d="",f,h=!1,m,g,b=!1,E,w=function(){return s[o++]},S=function(){for(var N="";/\d/.test(i[l]);)N+=i[l++],f=i[l];return N.length>0?parseInt(N):null};l{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",d=1,f=2,h=4,m=1,g=2,b=1,E=2,w=4,S=8,N=16,D=32,T=64,B=128,R=256,Y=512,ne=30,q="...",Q=800,fe=16,we=1,me=2,Ce=3,ge=1/0,ye=9007199254740991,A=17976931348623157e292,I=NaN,z=4294967295,j=z-1,ie=z>>>1,xe=[["ary",B],["bind",b],["bindKey",E],["curry",S],["curryRight",N],["flip",Y],["partial",D],["partialRight",T],["rearg",R]],Ae="[object Arguments]",je="[object Array]",Ne="[object AsyncFunction]",Be="[object Boolean]",_t="[object Date]",kt="[object DOMException]",Re="[object Error]",St="[object Function]",Xt="[object GeneratorFunction]",pt="[object Map]",an="[object Number]",Zt="[object Null]",Tt="[object Object]",Je="[object Promise]",jn="[object Proxy]",Pt="[object RegExp]",V="[object Set]",yt="[object String]",_e="[object Symbol]",pe="[object Undefined]",ut="[object WeakMap]",dt="[object WeakSet]",Bt="[object ArrayBuffer]",Ot="[object DataView]",L="[object Float32Array]",H="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",Fe="[object Int32Array]",rt="[object Uint8Array]",wr="[object Uint8ClampedArray]",F="[object Uint16Array]",ae="[object Uint32Array]",Se=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ft=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,Zr=RegExp(Ft.source),Da=RegExp(ln.source),xr=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Ni=/<%=([\s\S]+?)%>/g,jr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zu=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qr=/[\\^$.*+?()[\]{}|]/g,zS=RegExp(Qr.source),Uu=/^\s+/,US=/\s/,WS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,KS=/\{\n\/\* \[wrapped with (.+)\] \*/,VS=/,? & /,GS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qS=/[()=,{}\[\]\/\s]/,YS=/\\(\\)?/g,JS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gm=/\w*$/,XS=/^[-+]0x[0-9a-f]+$/i,ZS=/^0b[01]+$/i,jS=/^\[object .+?Constructor\]$/,QS=/^0o[0-7]+$/i,eT=/^(?:0|[1-9]\d*)$/,tT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,La=/($^)/,nT=/['\n\r\u2028\u2029\\]/g,Pa="\\ud800-\\udfff",rT="\\u0300-\\u036f",iT="\\ufe20-\\ufe2f",oT="\\u20d0-\\u20ff",qm=rT+iT+oT,Ym="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",sT="\\xac\\xb1\\xd7\\xf7",aT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lT="\\u2000-\\u206f",cT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",Zm="\\ufe0e\\ufe0f",jm=sT+aT+lT+cT,Wu="['\u2019]",uT="["+Pa+"]",Qm="["+jm+"]",Ba="["+qm+"]",eg="\\d+",dT="["+Ym+"]",tg="["+Jm+"]",ng="[^"+Pa+jm+eg+Ym+Jm+Xm+"]",Ku="\\ud83c[\\udffb-\\udfff]",fT="(?:"+Ba+"|"+Ku+")",rg="[^"+Pa+"]",Vu="(?:\\ud83c[\\udde6-\\uddff]){2}",Gu="[\\ud800-\\udbff][\\udc00-\\udfff]",xo="["+Xm+"]",ig="\\u200d",og="(?:"+tg+"|"+ng+")",pT="(?:"+xo+"|"+ng+")",sg="(?:"+Wu+"(?:d|ll|m|re|s|t|ve))?",ag="(?:"+Wu+"(?:D|LL|M|RE|S|T|VE))?",lg=fT+"?",cg="["+Zm+"]?",hT="(?:"+ig+"(?:"+[rg,Vu,Gu].join("|")+")"+cg+lg+")*",mT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ug=cg+lg+hT,bT="(?:"+[dT,Vu,Gu].join("|")+")"+ug,yT="(?:"+[rg+Ba+"?",Ba,Vu,Gu,uT].join("|")+")",ET=RegExp(Wu,"g"),vT=RegExp(Ba,"g"),qu=RegExp(Ku+"(?="+Ku+")|"+yT+ug,"g"),wT=RegExp([xo+"?"+tg+"+"+sg+"(?="+[Qm,xo,"$"].join("|")+")",pT+"+"+ag+"(?="+[Qm,xo+og,"$"].join("|")+")",xo+"?"+og+"+"+sg,xo+"+"+ag,gT,mT,eg,bT].join("|"),"g"),xT=RegExp("["+ig+Pa+qm+Zm+"]"),_T=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ST=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],TT=-1,it={};it[L]=it[H]=it[X]=it[se]=it[Fe]=it[rt]=it[wr]=it[F]=it[ae]=!0,it[Ae]=it[je]=it[Bt]=it[Be]=it[Ot]=it[_t]=it[Re]=it[St]=it[pt]=it[an]=it[Tt]=it[Pt]=it[V]=it[yt]=it[ut]=!1;var tt={};tt[Ae]=tt[je]=tt[Bt]=tt[Ot]=tt[Be]=tt[_t]=tt[L]=tt[H]=tt[X]=tt[se]=tt[Fe]=tt[pt]=tt[an]=tt[Tt]=tt[Pt]=tt[V]=tt[yt]=tt[_e]=tt[rt]=tt[wr]=tt[F]=tt[ae]=!0,tt[Re]=tt[St]=tt[ut]=!1;var CT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},AT={"&":"&","<":"<",">":">",'"':""","'":"'"},MT={"&":"&","<":"<",">":">",""":'"',"'":"'"},NT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kT=parseFloat,OT=parseInt,dg=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ht=dg||RT||Function("return this")(),Yu=typeof gs=="object"&&gs&&!gs.nodeType&&gs,ki=Yu&&typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,fg=ki&&ki.exports===Yu,Ju=fg&&dg.process,Rn=function(){try{var k=ki&&ki.require&&ki.require("util").types;return k||Ju&&Ju.binding&&Ju.binding("util")}catch{}}(),pg=Rn&&Rn.isArrayBuffer,hg=Rn&&Rn.isDate,mg=Rn&&Rn.isMap,gg=Rn&&Rn.isRegExp,bg=Rn&&Rn.isSet,yg=Rn&&Rn.isTypedArray;function Tn(k,$,P){switch(P.length){case 0:return k.call($);case 1:return k.call($,P[0]);case 2:return k.call($,P[0],P[1]);case 3:return k.call($,P[0],P[1],P[2])}return k.apply($,P)}function IT(k,$,P,oe){for(var Me=-1,Ye=k==null?0:k.length;++Me-1}function Xu(k,$,P){for(var oe=-1,Me=k==null?0:k.length;++oe-1;);return P}function Cg(k,$){for(var P=k.length;P--&&_o($,k[P],0)>-1;);return P}function UT(k,$){for(var P=k.length,oe=0;P--;)k[P]===$&&++oe;return oe}var WT=ed(CT),KT=ed(AT);function VT(k){return"\\"+NT[k]}function GT(k,$){return k==null?t:k[$]}function So(k){return xT.test(k)}function qT(k){return _T.test(k)}function YT(k){for(var $,P=[];!($=k.next()).done;)P.push($.value);return P}function id(k){var $=-1,P=Array(k.size);return k.forEach(function(oe,Me){P[++$]=[Me,oe]}),P}function Ag(k,$){return function(P){return k($(P))}}function ni(k,$){for(var P=-1,oe=k.length,Me=0,Ye=[];++P-1}function L1(a,c){var p=this.__data__,y=tl(p,a);return y<0?(++this.size,p.push([a,c])):p[y][1]=c,this}_r.prototype.clear=O1,_r.prototype.delete=R1,_r.prototype.get=I1,_r.prototype.has=D1,_r.prototype.set=L1;function Sr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,y,v,_){var C,M=c&d,O=c&f,U=c&h;if(p&&(C=v?p(a,y,v,_):p(a)),C!==t)return C;if(!ft(a))return a;var W=ke(a);if(W){if(C=HC(a),!M)return bn(a,C)}else{var G=Qt(a),te=G==St||G==Xt;if(ci(a))return cb(a,M);if(G==Tt||G==Ae||te&&!v){if(C=O||te?{}:Mb(a),!M)return O?MC(a,Z1(C,a)):AC(a,Hg(C,a))}else{if(!tt[G])return v?a:{};C=$C(a,G,M)}}_||(_=new er);var de=_.get(a);if(de)return de;_.set(a,C),ry(a)?a.forEach(function(ve){C.add(Pn(ve,c,p,ve,a,_))}):ty(a)&&a.forEach(function(ve,$e){C.set($e,Pn(ve,c,p,$e,a,_))});var Ee=U?O?kd:Nd:O?En:$t,Le=W?t:Ee(a);return In(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ts(C,$e,Pn(ve,c,p,$e,a,_))}),C}function j1(a){var c=$t(a);return function(p){return $g(p,a,c)}}function $g(a,c,p){var y=p.length;if(a==null)return!y;for(a=Qe(a);y--;){var v=p[y],_=c[v],C=a[v];if(C===t&&!(v in a)||!_(C))return!1}return!0}function zg(a,c,p){if(typeof a!="function")throw new Dn(i);return Rs(function(){a.apply(t,p)},c)}function Cs(a,c,p,y){var v=-1,_=Fa,C=!0,M=a.length,O=[],U=c.length;if(!M)return O;p&&(c=lt(c,Cn(p))),y?(_=Xu,C=!1):c.length>=n&&(_=Es,C=!1,c=new Ii(c));e:for(;++vv?0:v+p),y=y===t||y>v?v:Ie(y),y<0&&(y+=v),y=p>y?0:oy(y);p0&&p(M)?c>1?Vt(M,c-1,p,y,v):ti(v,M):y||(v[v.length]=M)}return v}var dd=mb(),Kg=mb(!0);function ur(a,c){return a&&dd(a,c,$t)}function fd(a,c){return a&&Kg(a,c,$t)}function rl(a,c){return ei(c,function(p){return Nr(a[p])})}function Li(a,c){c=ai(c,a);for(var p=0,y=c.length;a!=null&&pc}function tC(a,c){return a!=null&&Ze.call(a,c)}function nC(a,c){return a!=null&&c in Qe(a)}function rC(a,c,p){return a>=jt(c,p)&&a=120&&W.length>=120)?new Ii(C&&W):t}W=a[0];var G=-1,te=M[0];e:for(;++G-1;)M!==a&&Ya.call(M,O,1),Ya.call(a,O,1);return a}function tb(a,c){for(var p=a?c.length:0,y=p-1;p--;){var v=c[p];if(p==y||v!==_){var _=v;Mr(v)?Ya.call(a,v,1):xd(a,v)}}return a}function Ed(a,c){return a+Za(Lg()*(c-a+1))}function gC(a,c,p,y){for(var v=-1,_=It(Xa((c-a)/(p||1)),0),C=P(_);_--;)C[y?_:++v]=a,a+=p;return C}function vd(a,c){var p="";if(!a||c<1||c>ye)return p;do c%2&&(p+=a),c=Za(c/2),c&&(a+=a);while(c);return p}function He(a,c){return Bd(Ob(a,c,vn),a+"")}function bC(a){return Fg(Do(a))}function yC(a,c){var p=Do(a);return hl(p,Di(c,0,p.length))}function Ns(a,c,p,y){if(!ft(a))return a;c=ai(c,a);for(var v=-1,_=c.length,C=_-1,M=a;M!=null&&++v<_;){var O=fr(c[v]),U=p;if(O==="__proto__"||O==="constructor"||O==="prototype")return a;if(v!=C){var W=M[O];U=y?y(W,O,M):t,U===t&&(U=ft(W)?W:Mr(c[v+1])?[]:{})}Ts(M,O,U),M=M[O]}return a}var nb=ja?function(a,c){return ja.set(a,c),a}:vn,EC=Ja?function(a,c){return Ja(a,"toString",{configurable:!0,enumerable:!1,value:qd(c),writable:!0})}:vn;function vC(a){return hl(Do(a))}function Bn(a,c,p){var y=-1,v=a.length;c<0&&(c=-c>v?0:v+c),p=p>v?v:p,p<0&&(p+=v),v=c>p?0:p-c>>>0,c>>>=0;for(var _=P(v);++y>>1,C=a[_];C!==null&&!Mn(C)&&(p?C<=c:C=n){var U=c?null:RC(a);if(U)return $a(U);C=!1,v=Es,O=new Ii}else O=c?[]:M;e:for(;++y<_;){var W=a[y],G=c?c(W):W;if(W=p||W!==0?W:0,C&&G===G){for(var te=O.length;te--;)if(O[te]===G)continue e;c&&O.push(G),M.push(W)}else v(O,G,p)||(O!==M&&O.push(G),M.push(W))}return M}function xd(a,c){return c=ai(c,a),a=Rb(a,c),a==null||delete a[fr(Fn(c))]}function ob(a,c,p,y){return Ns(a,c,p(Li(a,c)),y)}function sl(a,c,p,y){for(var v=a.length,_=y?v:-1;(y?_--:++_=y?a:Bn(a,c,p)}var lb=c1||function(a){return Ht.clearTimeout(a)};function cb(a,c){if(c)return a.slice();var p=a.length,y=kg?kg(p):new a.constructor(p);return a.copy(y),y}function Cd(a){var c=new a.constructor(a.byteLength);return new Ga(c).set(new Ga(a)),c}function _C(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function SC(a){var c=new a.constructor(a.source,Gm.exec(a));return c.lastIndex=a.lastIndex,c}function TC(a){return Ss?Qe(Ss.call(a)):{}}function ub(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function db(a,c){if(a!==c){var p=a!==t,y=a===null,v=a===a,_=Mn(a),C=c!==t,M=c===null,O=c===c,U=Mn(c);if(!M&&!U&&!_&&a>c||_&&C&&O&&!M&&!U||y&&C&&O||!p&&O||!v)return 1;if(!y&&!_&&!U&&a=M)return O;var U=p[y];return O*(U=="desc"?-1:1)}}return a.index-c.index}function fb(a,c,p,y){for(var v=-1,_=a.length,C=p.length,M=-1,O=c.length,U=It(_-C,0),W=P(O+U),G=!y;++M1?p[v-1]:t,C=v>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(v--,_):t,C&&un(p[0],p[1],C)&&(_=v<3?t:_,v=1),c=Qe(c);++y-1?v[_?c[C]:C]:t}}function yb(a){return Ar(function(c){var p=c.length,y=p,v=Ln.prototype.thru;for(a&&c.reverse();y--;){var _=c[y];if(typeof _!="function")throw new Dn(i);if(v&&!C&&fl(_)=="wrapper")var C=new Ln([],!0)}for(y=C?y:p;++y1&&Ve.reverse(),W&&O<$e&&(Ve.length=O),this&&this!==Ht&&this instanceof ve&&(Or=Le||ks(Or)),Or.apply(nr,Ve)}return ve}function Eb(a,c){return function(p,y){return iC(p,a,c(y),{})}}function cl(a,c){return function(p,y){var v;if(p===t&&y===t)return c;if(p!==t&&(v=p),y!==t){if(v===t)return y;typeof p=="string"||typeof y=="string"?(p=An(p),y=An(y)):(p=ib(p),y=ib(y)),v=a(p,y)}return v}}function Ad(a){return Ar(function(c){return c=lt(c,Cn(be())),He(function(p){var y=this;return a(c,function(v){return Tn(v,y,p)})})})}function ul(a,c){c=c===t?" ":An(c);var p=c.length;if(p<2)return p?vd(c,a):c;var y=vd(c,Xa(a/To(c)));return So(c)?li(Qn(y),0,a).join(""):y.slice(0,a)}function OC(a,c,p,y){var v=c&b,_=ks(a);function C(){for(var M=-1,O=arguments.length,U=-1,W=y.length,G=P(W+O),te=this&&this!==Ht&&this instanceof C?_:a;++UM))return!1;var U=_.get(a),W=_.get(c);if(U&&W)return U==c&&W==a;var G=-1,te=!0,de=p&g?new Ii:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[y],c=c.join(p>2?", ":" "),a.replace(WS,`{ /* [wrapped with `+c+`] */ -`)}function UC(a){return ke(a)||Fi(a)||!!(Ig&&a&&a[Ig])}function Mr(a,c){var p=typeof a;return c=c??ye,!!c&&(p=="number"||p!="symbol"&&eT.test(a))&&a>-1&&a%1==0&&a0){if(++c>=Q)return arguments[0]}else c=0;return a.apply(t,arguments)}}function hl(a,c){var p=-1,b=a.length,E=b-1;for(c=c===t?b:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Wb(a,p)});function Kb(a){var c=x(a);return c.__chain__=!0,c}function QA(a,c){return c(a),a}function ml(a,c){return c(a)}var eM=Ar(function(a){var c=a.length,p=c?a[0]:0,b=this.__wrapped__,E=function(_){return ud(_,a)};return c>1||this.__actions__.length||!(b instanceof Ue)||!Mr(p)?this.thru(E):(b=b.slice(p,+p+(c?1:0)),b.__actions__.push({func:ml,args:[E],thisArg:t}),new Ln(b,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function tM(){return Kb(this)}function nM(){return new Ln(this.value(),this.__chain__)}function rM(){this.__values__===t&&(this.__values__=iy(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function iM(){return this}function oM(a){for(var c,p=this;p instanceof el;){var b=Bb(p);b.__index__=0,b.__values__=t,c?E.__wrapped__=b:c=b;var E=b;p=p.__wrapped__}return E.__wrapped__=a,c}function sM(){var a=this.__wrapped__;if(a instanceof Ue){var c=a;return this.__actions__.length&&(c=new Ue(this)),c=c.reverse(),c.__actions__.push({func:ml,args:[Fd],thisArg:t}),new Ln(c,this.__chain__)}return this.thru(Fd)}function aM(){return sb(this.__wrapped__,this.__actions__)}var lM=al(function(a,c,p){Ze.call(a,p)?++a[p]:Tr(a,p,1)});function cM(a,c,p){var b=ke(a)?Eg:Q1;return p&&un(a,c,p)&&(c=t),b(a,be(c,3))}function uM(a,c){var p=ke(a)?ei:Wg;return p(a,be(c,3))}var dM=bb(Fb),fM=bb(Hb);function pM(a,c){return Vt(gl(a,c),1)}function hM(a,c){return Vt(gl(a,c),ge)}function mM(a,c,p){return p=p===t?1:Ie(p),Vt(gl(a,c),p)}function Vb(a,c){var p=ke(a)?In:oi;return p(a,be(c,3))}function Gb(a,c){var p=ke(a)?DT:Ug;return p(a,be(c,3))}var gM=al(function(a,c,p){Ze.call(a,p)?a[p].push(c):Tr(a,p,[c])});function bM(a,c,p,b){a=yn(a)?a:Do(a),p=p&&!b?Ie(p):0;var E=a.length;return p<0&&(p=It(E+p,0)),wl(a)?p<=E&&a.indexOf(c,p)>-1:!!E&&_o(a,c,p)>-1}var yM=He(function(a,c,p){var b=-1,E=typeof c=="function",_=yn(a)?P(a.length):[];return oi(a,function(C){_[++b]=E?Tn(c,C,p):As(C,c,p)}),_}),EM=al(function(a,c,p){Tr(a,p,c)});function gl(a,c){var p=ke(a)?lt:Jg;return p(a,be(c,3))}function vM(a,c,p,b){return a==null?[]:(ke(c)||(c=c==null?[]:[c]),p=b?t:p,ke(p)||(p=p==null?[]:[p]),Qg(a,c,p))}var wM=al(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function xM(a,c,p){var b=ke(a)?Zu:_g,E=arguments.length<3;return b(a,be(c,4),p,E,oi)}function _M(a,c,p){var b=ke(a)?LT:_g,E=arguments.length<3;return b(a,be(c,4),p,E,Ug)}function SM(a,c){var p=ke(a)?ei:Wg;return p(a,El(be(c,3)))}function TM(a){var c=ke(a)?Fg:bC;return c(a)}function CM(a,c,p){(p?un(a,c,p):c===t)?c=1:c=Ie(c);var b=ke(a)?Y1:yC;return b(a,c)}function AM(a){var c=ke(a)?J1:vC;return c(a)}function MM(a){if(a==null)return 0;if(yn(a))return wl(a)?To(a):a.length;var c=Qt(a);return c==pt||c==V?a.size:gd(a).length}function NM(a,c,p){var b=ke(a)?ju:wC;return p&&un(a,c,p)&&(c=t),b(a,be(c,3))}var kM=He(function(a,c){if(a==null)return[];var p=c.length;return p>1&&un(a,c[0],c[1])?c=[]:p>2&&un(c[0],c[1],c[2])&&(c=[c[0]]),Qg(a,Vt(c,1),[])}),bl=u1||function(){return Ht.Date.now()};function OM(a,c){if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){if(--a<1)return c.apply(this,arguments)}}function qb(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,B,t,t,t,t,c)}function Yb(a,c){var p;if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var $d=He(function(a,c,p){var b=y;if(p.length){var E=ni(p,Ro($d));b|=L}return Cr(a,b,c,p,E)}),Jb=He(function(a,c,p){var b=y|v;if(p.length){var E=ni(p,Ro(Jb));b|=L}return Cr(c,b,a,p,E)});function Xb(a,c,p){c=p?t:c;var b=Cr(a,S,t,t,t,t,t,c);return b.placeholder=Xb.placeholder,b}function Zb(a,c,p){c=p?t:c;var b=Cr(a,O,t,t,t,t,t,c);return b.placeholder=Zb.placeholder,b}function jb(a,c,p){var b,E,_,C,M,k,U=0,W=!1,G=!1,te=!0;if(typeof a!="function")throw new Dn(i);c=Hn(c)||0,ft(p)&&(W=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,te="trailing"in p?!!p.trailing:te);function de(vt){var nr=b,Or=E;return b=E=t,U=vt,C=a.apply(Or,nr),C}function Ee(vt){return U=vt,M=Rs($e,c),W?de(vt):C}function Le(vt){var nr=vt-k,Or=vt-U,by=c-nr;return G?jt(by,_-Or):by}function ve(vt){var nr=vt-k,Or=vt-U;return k===t||nr>=c||nr<0||G&&Or>=_}function $e(){var vt=bl();if(ve(vt))return Ve(vt);M=Rs($e,Le(vt))}function Ve(vt){return M=t,te&&b?de(vt):(b=E=t,C)}function Nn(){M!==t&&lb(M),U=0,b=k=E=M=t}function dn(){return M===t?C:Ve(bl())}function kn(){var vt=bl(),nr=ve(vt);if(b=arguments,E=this,k=vt,nr){if(M===t)return Ee(k);if(G)return lb(M),M=Rs($e,c),de(k)}return M===t&&(M=Rs($e,c)),C}return kn.cancel=Nn,kn.flush=dn,kn}var RM=He(function(a,c){return zg(a,1,c)}),IM=He(function(a,c,p){return zg(a,Hn(c)||0,p)});function DM(a){return Cr(a,Y)}function yl(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Dn(i);var p=function(){var b=arguments,E=c?c.apply(this,b):b[0],_=p.cache;if(_.has(E))return _.get(E);var C=a.apply(this,b);return p.cache=_.set(E,C)||_,C};return p.cache=new(yl.Cache||Sr),p}yl.Cache=Sr;function El(a){if(typeof a!="function")throw new Dn(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function LM(a){return Yb(2,a)}var PM=xC(function(a,c){c=c.length==1&&ke(c[0])?lt(c[0],Cn(be())):lt(Vt(c,1),Cn(be()));var p=c.length;return He(function(b){for(var E=-1,_=jt(b.length,p);++E<_;)b[E]=c[E].call(this,b[E]);return Tn(a,this,b)})}),zd=He(function(a,c){var p=ni(c,Ro(zd));return Cr(a,L,t,c,p)}),Qb=He(function(a,c){var p=ni(c,Ro(Qb));return Cr(a,T,t,c,p)}),BM=Ar(function(a,c){return Cr(a,R,t,t,t,c)});function FM(a,c){if(typeof a!="function")throw new Dn(i);return c=c===t?c:Ie(c),He(a,c)}function HM(a,c){if(typeof a!="function")throw new Dn(i);return c=c==null?0:It(Ie(c),0),He(function(p){var b=p[c],E=li(p,0,c);return b&&ti(E,b),Tn(a,this,E)})}function $M(a,c,p){var b=!0,E=!0;if(typeof a!="function")throw new Dn(i);return ft(p)&&(b="leading"in p?!!p.leading:b,E="trailing"in p?!!p.trailing:E),jb(a,c,{leading:b,maxWait:c,trailing:E})}function zM(a){return qb(a,1)}function UM(a,c){return zd(Td(c),a)}function WM(){if(!arguments.length)return[];var a=arguments[0];return ke(a)?a:[a]}function KM(a){return Pn(a,h)}function VM(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function GM(a){return Pn(a,d|h)}function qM(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function YM(a,c){return c==null||$g(a,c,$t(c))}function tr(a,c){return a===c||a!==a&&c!==c}var JM=dl(pd),XM=dl(function(a,c){return a>=c}),Fi=Gg(function(){return arguments}())?Gg:function(a){return ht(a)&&Ze.call(a,"callee")&&!Rg.call(a,"callee")},ke=P.isArray,ZM=pg?Cn(pg):oC;function yn(a){return a!=null&&vl(a.length)&&!Nr(a)}function Et(a){return ht(a)&&yn(a)}function jM(a){return a===!0||a===!1||ht(a)&&cn(a)==Be}var ci=f1||jd,QM=hg?Cn(hg):sC;function eN(a){return ht(a)&&a.nodeType===1&&!Is(a)}function tN(a){if(a==null)return!0;if(yn(a)&&(ke(a)||typeof a=="string"||typeof a.splice=="function"||ci(a)||Io(a)||Fi(a)))return!a.length;var c=Qt(a);if(c==pt||c==V)return!a.size;if(Os(a))return!gd(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function nN(a,c){return Ms(a,c)}function rN(a,c,p){p=typeof p=="function"?p:t;var b=p?p(a,c):t;return b===t?Ms(a,c,t,p):!!b}function Ud(a){if(!ht(a))return!1;var c=cn(a);return c==Re||c==kt||typeof a.message=="string"&&typeof a.name=="string"&&!Is(a)}function iN(a){return typeof a=="number"&&Dg(a)}function Nr(a){if(!ft(a))return!1;var c=cn(a);return c==St||c==Xt||c==Ne||c==jn}function ey(a){return typeof a=="number"&&a==Ie(a)}function vl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ye}function ft(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function ht(a){return a!=null&&typeof a=="object"}var ty=mg?Cn(mg):lC;function oN(a,c){return a===c||md(a,c,Rd(c))}function sN(a,c,p){return p=typeof p=="function"?p:t,md(a,c,Rd(c),p)}function aN(a){return ny(a)&&a!=+a}function lN(a){if(VC(a))throw new Me(r);return qg(a)}function cN(a){return a===null}function uN(a){return a==null}function ny(a){return typeof a=="number"||ht(a)&&cn(a)==an}function Is(a){if(!ht(a)||cn(a)!=Tt)return!1;var c=qa(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wa.call(p)==s1}var Wd=gg?Cn(gg):cC;function dN(a){return ey(a)&&a>=-ye&&a<=ye}var ry=bg?Cn(bg):uC;function wl(a){return typeof a=="string"||!ke(a)&&ht(a)&&cn(a)==yt}function Mn(a){return typeof a=="symbol"||ht(a)&&cn(a)==_e}var Io=yg?Cn(yg):dC;function fN(a){return a===t}function pN(a){return ht(a)&&Qt(a)==ut}function hN(a){return ht(a)&&cn(a)==dt}var mN=dl(bd),gN=dl(function(a,c){return a<=c});function iy(a){if(!a)return[];if(yn(a))return wl(a)?Qn(a):bn(a);if(vs&&a[vs])return YT(a[vs]());var c=Qt(a),p=c==pt?id:c==V?$a:Do;return p(a)}function kr(a){if(!a)return a===0?a:0;if(a=Hn(a),a===ge||a===-ge){var c=a<0?-1:1;return c*A}return a===a?a:0}function Ie(a){var c=kr(a),p=c%1;return c===c?p?c-p:c:0}function oy(a){return a?Di(Ie(a),0,z):0}function Hn(a){if(typeof a=="number")return a;if(Mn(a))return I;if(ft(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ft(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=Sg(a);var p=ZS.test(a);return p||QS.test(a)?OT(a.slice(2),p?2:8):XS.test(a)?I:+a}function sy(a){return dr(a,En(a))}function bN(a){return a?Di(Ie(a),-ye,ye):a===0?a:0}function Xe(a){return a==null?"":An(a)}var yN=ko(function(a,c){if(Os(c)||yn(c)){dr(c,$t(c),a);return}for(var p in c)Ze.call(c,p)&&Ts(a,p,c[p])}),ay=ko(function(a,c){dr(c,En(c),a)}),xl=ko(function(a,c,p,b){dr(c,En(c),a,b)}),EN=ko(function(a,c,p,b){dr(c,$t(c),a,b)}),vN=Ar(ud);function wN(a,c){var p=No(a);return c==null?p:Hg(p,c)}var xN=He(function(a,c){a=Qe(a);var p=-1,b=c.length,E=b>2?c[2]:t;for(E&&un(c[0],c[1],E)&&(b=1);++p1),_}),dr(a,kd(a),p),b&&(p=Pn(p,d|f|h,IC));for(var E=c.length;E--;)xd(p,c[E]);return p});function $N(a,c){return cy(a,El(be(c)))}var zN=Ar(function(a,c){return a==null?{}:hC(a,c)});function cy(a,c){if(a==null)return{};var p=lt(kd(a),function(b){return[b]});return c=be(c),eb(a,p,function(b,E){return c(b,E[0])})}function UN(a,c,p){c=ai(c,a);var b=-1,E=c.length;for(E||(E=1,a=t);++bc){var b=a;a=c,c=b}if(p||a%1||c%1){var E=Lg();return jt(a+E*(c-a+kT("1e-"+((E+"").length-1))),c)}return Ed(a,c)}var QN=Oo(function(a,c,p){return c=c.toLowerCase(),a+(p?fy(c):c)});function fy(a){return Gd(Xe(a).toLowerCase())}function py(a){return a=Xe(a),a&&a.replace(tT,WT).replace(vT,"")}function ek(a,c,p){a=Xe(a),c=An(c);var b=a.length;p=p===t?b:Di(Ie(p),0,b);var E=p;return p-=c.length,p>=0&&a.slice(p,E)==c}function tk(a){return a=Xe(a),a&&Da.test(a)?a.replace(ln,KT):a}function nk(a){return a=Xe(a),a&&zS.test(a)?a.replace(Qr,"\\$&"):a}var rk=Oo(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),ik=Oo(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),ok=gb("toLowerCase");function sk(a,c,p){a=Xe(a),c=Ie(c);var b=c?To(a):0;if(!c||b>=c)return a;var E=(c-b)/2;return ul(Za(E),p)+a+ul(Xa(E),p)}function ak(a,c,p){a=Xe(a),c=Ie(c);var b=c?To(a):0;return c&&b>>0,p?(a=Xe(a),a&&(typeof c=="string"||c!=null&&!Wd(c))&&(c=An(c),!c&&So(a))?li(Qn(a),0,p):a.split(c,p)):[]}var hk=Oo(function(a,c,p){return a+(p?" ":"")+Gd(c)});function mk(a,c,p){return a=Xe(a),p=p==null?0:Di(Ie(p),0,a.length),c=An(c),a.slice(p,p+c.length)==c}function gk(a,c,p){var b=x.templateSettings;p&&un(a,c,p)&&(c=t),a=Xe(a),c=xl({},c,b,_b);var E=xl({},c.imports,b.imports,_b),_=$t(E),C=rd(E,_),M,k,U=0,W=c.interpolate||La,G="__p += '",te=od((c.escape||La).source+"|"+W.source+"|"+(W===Ni?JS:La).source+"|"+(c.evaluate||La).source+"|$","g"),de="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++TT+"]")+` +`)}function UC(a){return ke(a)||Fi(a)||!!(Ig&&a&&a[Ig])}function Mr(a,c){var p=typeof a;return c=c??ye,!!c&&(p=="number"||p!="symbol"&&eT.test(a))&&a>-1&&a%1==0&&a0){if(++c>=Q)return arguments[0]}else c=0;return a.apply(t,arguments)}}function hl(a,c){var p=-1,y=a.length,v=y-1;for(c=c===t?y:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Wb(a,p)});function Kb(a){var c=x(a);return c.__chain__=!0,c}function QA(a,c){return c(a),a}function ml(a,c){return c(a)}var eM=Ar(function(a){var c=a.length,p=c?a[0]:0,y=this.__wrapped__,v=function(_){return ud(_,a)};return c>1||this.__actions__.length||!(y instanceof Ue)||!Mr(p)?this.thru(v):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:ml,args:[v],thisArg:t}),new Ln(y,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function tM(){return Kb(this)}function nM(){return new Ln(this.value(),this.__chain__)}function rM(){this.__values__===t&&(this.__values__=iy(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function iM(){return this}function oM(a){for(var c,p=this;p instanceof el;){var y=Bb(p);y.__index__=0,y.__values__=t,c?v.__wrapped__=y:c=y;var v=y;p=p.__wrapped__}return v.__wrapped__=a,c}function sM(){var a=this.__wrapped__;if(a instanceof Ue){var c=a;return this.__actions__.length&&(c=new Ue(this)),c=c.reverse(),c.__actions__.push({func:ml,args:[Fd],thisArg:t}),new Ln(c,this.__chain__)}return this.thru(Fd)}function aM(){return sb(this.__wrapped__,this.__actions__)}var lM=al(function(a,c,p){Ze.call(a,p)?++a[p]:Tr(a,p,1)});function cM(a,c,p){var y=ke(a)?Eg:Q1;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}function uM(a,c){var p=ke(a)?ei:Wg;return p(a,be(c,3))}var dM=bb(Fb),fM=bb(Hb);function pM(a,c){return Vt(gl(a,c),1)}function hM(a,c){return Vt(gl(a,c),ge)}function mM(a,c,p){return p=p===t?1:Ie(p),Vt(gl(a,c),p)}function Vb(a,c){var p=ke(a)?In:oi;return p(a,be(c,3))}function Gb(a,c){var p=ke(a)?DT:Ug;return p(a,be(c,3))}var gM=al(function(a,c,p){Ze.call(a,p)?a[p].push(c):Tr(a,p,[c])});function bM(a,c,p,y){a=yn(a)?a:Do(a),p=p&&!y?Ie(p):0;var v=a.length;return p<0&&(p=It(v+p,0)),wl(a)?p<=v&&a.indexOf(c,p)>-1:!!v&&_o(a,c,p)>-1}var yM=He(function(a,c,p){var y=-1,v=typeof c=="function",_=yn(a)?P(a.length):[];return oi(a,function(C){_[++y]=v?Tn(c,C,p):As(C,c,p)}),_}),EM=al(function(a,c,p){Tr(a,p,c)});function gl(a,c){var p=ke(a)?lt:Jg;return p(a,be(c,3))}function vM(a,c,p,y){return a==null?[]:(ke(c)||(c=c==null?[]:[c]),p=y?t:p,ke(p)||(p=p==null?[]:[p]),Qg(a,c,p))}var wM=al(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function xM(a,c,p){var y=ke(a)?Zu:_g,v=arguments.length<3;return y(a,be(c,4),p,v,oi)}function _M(a,c,p){var y=ke(a)?LT:_g,v=arguments.length<3;return y(a,be(c,4),p,v,Ug)}function SM(a,c){var p=ke(a)?ei:Wg;return p(a,El(be(c,3)))}function TM(a){var c=ke(a)?Fg:bC;return c(a)}function CM(a,c,p){(p?un(a,c,p):c===t)?c=1:c=Ie(c);var y=ke(a)?Y1:yC;return y(a,c)}function AM(a){var c=ke(a)?J1:vC;return c(a)}function MM(a){if(a==null)return 0;if(yn(a))return wl(a)?To(a):a.length;var c=Qt(a);return c==pt||c==V?a.size:gd(a).length}function NM(a,c,p){var y=ke(a)?ju:wC;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}var kM=He(function(a,c){if(a==null)return[];var p=c.length;return p>1&&un(a,c[0],c[1])?c=[]:p>2&&un(c[0],c[1],c[2])&&(c=[c[0]]),Qg(a,Vt(c,1),[])}),bl=u1||function(){return Ht.Date.now()};function OM(a,c){if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){if(--a<1)return c.apply(this,arguments)}}function qb(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,B,t,t,t,t,c)}function Yb(a,c){var p;if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var $d=He(function(a,c,p){var y=b;if(p.length){var v=ni(p,Ro($d));y|=D}return Cr(a,y,c,p,v)}),Jb=He(function(a,c,p){var y=b|E;if(p.length){var v=ni(p,Ro(Jb));y|=D}return Cr(c,y,a,p,v)});function Xb(a,c,p){c=p?t:c;var y=Cr(a,S,t,t,t,t,t,c);return y.placeholder=Xb.placeholder,y}function Zb(a,c,p){c=p?t:c;var y=Cr(a,N,t,t,t,t,t,c);return y.placeholder=Zb.placeholder,y}function jb(a,c,p){var y,v,_,C,M,O,U=0,W=!1,G=!1,te=!0;if(typeof a!="function")throw new Dn(i);c=Hn(c)||0,ft(p)&&(W=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,te="trailing"in p?!!p.trailing:te);function de(vt){var nr=y,Or=v;return y=v=t,U=vt,C=a.apply(Or,nr),C}function Ee(vt){return U=vt,M=Rs($e,c),W?de(vt):C}function Le(vt){var nr=vt-O,Or=vt-U,by=c-nr;return G?jt(by,_-Or):by}function ve(vt){var nr=vt-O,Or=vt-U;return O===t||nr>=c||nr<0||G&&Or>=_}function $e(){var vt=bl();if(ve(vt))return Ve(vt);M=Rs($e,Le(vt))}function Ve(vt){return M=t,te&&y?de(vt):(y=v=t,C)}function Nn(){M!==t&&lb(M),U=0,y=O=v=M=t}function dn(){return M===t?C:Ve(bl())}function kn(){var vt=bl(),nr=ve(vt);if(y=arguments,v=this,O=vt,nr){if(M===t)return Ee(O);if(G)return lb(M),M=Rs($e,c),de(O)}return M===t&&(M=Rs($e,c)),C}return kn.cancel=Nn,kn.flush=dn,kn}var RM=He(function(a,c){return zg(a,1,c)}),IM=He(function(a,c,p){return zg(a,Hn(c)||0,p)});function DM(a){return Cr(a,Y)}function yl(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Dn(i);var p=function(){var y=arguments,v=c?c.apply(this,y):y[0],_=p.cache;if(_.has(v))return _.get(v);var C=a.apply(this,y);return p.cache=_.set(v,C)||_,C};return p.cache=new(yl.Cache||Sr),p}yl.Cache=Sr;function El(a){if(typeof a!="function")throw new Dn(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function LM(a){return Yb(2,a)}var PM=xC(function(a,c){c=c.length==1&&ke(c[0])?lt(c[0],Cn(be())):lt(Vt(c,1),Cn(be()));var p=c.length;return He(function(y){for(var v=-1,_=jt(y.length,p);++v<_;)y[v]=c[v].call(this,y[v]);return Tn(a,this,y)})}),zd=He(function(a,c){var p=ni(c,Ro(zd));return Cr(a,D,t,c,p)}),Qb=He(function(a,c){var p=ni(c,Ro(Qb));return Cr(a,T,t,c,p)}),BM=Ar(function(a,c){return Cr(a,R,t,t,t,c)});function FM(a,c){if(typeof a!="function")throw new Dn(i);return c=c===t?c:Ie(c),He(a,c)}function HM(a,c){if(typeof a!="function")throw new Dn(i);return c=c==null?0:It(Ie(c),0),He(function(p){var y=p[c],v=li(p,0,c);return y&&ti(v,y),Tn(a,this,v)})}function $M(a,c,p){var y=!0,v=!0;if(typeof a!="function")throw new Dn(i);return ft(p)&&(y="leading"in p?!!p.leading:y,v="trailing"in p?!!p.trailing:v),jb(a,c,{leading:y,maxWait:c,trailing:v})}function zM(a){return qb(a,1)}function UM(a,c){return zd(Td(c),a)}function WM(){if(!arguments.length)return[];var a=arguments[0];return ke(a)?a:[a]}function KM(a){return Pn(a,h)}function VM(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function GM(a){return Pn(a,d|h)}function qM(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function YM(a,c){return c==null||$g(a,c,$t(c))}function tr(a,c){return a===c||a!==a&&c!==c}var JM=dl(pd),XM=dl(function(a,c){return a>=c}),Fi=Gg(function(){return arguments}())?Gg:function(a){return ht(a)&&Ze.call(a,"callee")&&!Rg.call(a,"callee")},ke=P.isArray,ZM=pg?Cn(pg):oC;function yn(a){return a!=null&&vl(a.length)&&!Nr(a)}function Et(a){return ht(a)&&yn(a)}function jM(a){return a===!0||a===!1||ht(a)&&cn(a)==Be}var ci=f1||jd,QM=hg?Cn(hg):sC;function eN(a){return ht(a)&&a.nodeType===1&&!Is(a)}function tN(a){if(a==null)return!0;if(yn(a)&&(ke(a)||typeof a=="string"||typeof a.splice=="function"||ci(a)||Io(a)||Fi(a)))return!a.length;var c=Qt(a);if(c==pt||c==V)return!a.size;if(Os(a))return!gd(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function nN(a,c){return Ms(a,c)}function rN(a,c,p){p=typeof p=="function"?p:t;var y=p?p(a,c):t;return y===t?Ms(a,c,t,p):!!y}function Ud(a){if(!ht(a))return!1;var c=cn(a);return c==Re||c==kt||typeof a.message=="string"&&typeof a.name=="string"&&!Is(a)}function iN(a){return typeof a=="number"&&Dg(a)}function Nr(a){if(!ft(a))return!1;var c=cn(a);return c==St||c==Xt||c==Ne||c==jn}function ey(a){return typeof a=="number"&&a==Ie(a)}function vl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ye}function ft(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function ht(a){return a!=null&&typeof a=="object"}var ty=mg?Cn(mg):lC;function oN(a,c){return a===c||md(a,c,Rd(c))}function sN(a,c,p){return p=typeof p=="function"?p:t,md(a,c,Rd(c),p)}function aN(a){return ny(a)&&a!=+a}function lN(a){if(VC(a))throw new Me(r);return qg(a)}function cN(a){return a===null}function uN(a){return a==null}function ny(a){return typeof a=="number"||ht(a)&&cn(a)==an}function Is(a){if(!ht(a)||cn(a)!=Tt)return!1;var c=qa(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wa.call(p)==s1}var Wd=gg?Cn(gg):cC;function dN(a){return ey(a)&&a>=-ye&&a<=ye}var ry=bg?Cn(bg):uC;function wl(a){return typeof a=="string"||!ke(a)&&ht(a)&&cn(a)==yt}function Mn(a){return typeof a=="symbol"||ht(a)&&cn(a)==_e}var Io=yg?Cn(yg):dC;function fN(a){return a===t}function pN(a){return ht(a)&&Qt(a)==ut}function hN(a){return ht(a)&&cn(a)==dt}var mN=dl(bd),gN=dl(function(a,c){return a<=c});function iy(a){if(!a)return[];if(yn(a))return wl(a)?Qn(a):bn(a);if(vs&&a[vs])return YT(a[vs]());var c=Qt(a),p=c==pt?id:c==V?$a:Do;return p(a)}function kr(a){if(!a)return a===0?a:0;if(a=Hn(a),a===ge||a===-ge){var c=a<0?-1:1;return c*A}return a===a?a:0}function Ie(a){var c=kr(a),p=c%1;return c===c?p?c-p:c:0}function oy(a){return a?Di(Ie(a),0,z):0}function Hn(a){if(typeof a=="number")return a;if(Mn(a))return I;if(ft(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ft(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=Sg(a);var p=ZS.test(a);return p||QS.test(a)?OT(a.slice(2),p?2:8):XS.test(a)?I:+a}function sy(a){return dr(a,En(a))}function bN(a){return a?Di(Ie(a),-ye,ye):a===0?a:0}function Xe(a){return a==null?"":An(a)}var yN=ko(function(a,c){if(Os(c)||yn(c)){dr(c,$t(c),a);return}for(var p in c)Ze.call(c,p)&&Ts(a,p,c[p])}),ay=ko(function(a,c){dr(c,En(c),a)}),xl=ko(function(a,c,p,y){dr(c,En(c),a,y)}),EN=ko(function(a,c,p,y){dr(c,$t(c),a,y)}),vN=Ar(ud);function wN(a,c){var p=No(a);return c==null?p:Hg(p,c)}var xN=He(function(a,c){a=Qe(a);var p=-1,y=c.length,v=y>2?c[2]:t;for(v&&un(c[0],c[1],v)&&(y=1);++p1),_}),dr(a,kd(a),p),y&&(p=Pn(p,d|f|h,IC));for(var v=c.length;v--;)xd(p,c[v]);return p});function $N(a,c){return cy(a,El(be(c)))}var zN=Ar(function(a,c){return a==null?{}:hC(a,c)});function cy(a,c){if(a==null)return{};var p=lt(kd(a),function(y){return[y]});return c=be(c),eb(a,p,function(y,v){return c(y,v[0])})}function UN(a,c,p){c=ai(c,a);var y=-1,v=c.length;for(v||(v=1,a=t);++yc){var y=a;a=c,c=y}if(p||a%1||c%1){var v=Lg();return jt(a+v*(c-a+kT("1e-"+((v+"").length-1))),c)}return Ed(a,c)}var QN=Oo(function(a,c,p){return c=c.toLowerCase(),a+(p?fy(c):c)});function fy(a){return Gd(Xe(a).toLowerCase())}function py(a){return a=Xe(a),a&&a.replace(tT,WT).replace(vT,"")}function ek(a,c,p){a=Xe(a),c=An(c);var y=a.length;p=p===t?y:Di(Ie(p),0,y);var v=p;return p-=c.length,p>=0&&a.slice(p,v)==c}function tk(a){return a=Xe(a),a&&Da.test(a)?a.replace(ln,KT):a}function nk(a){return a=Xe(a),a&&zS.test(a)?a.replace(Qr,"\\$&"):a}var rk=Oo(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),ik=Oo(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),ok=gb("toLowerCase");function sk(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;if(!c||y>=c)return a;var v=(c-y)/2;return ul(Za(v),p)+a+ul(Xa(v),p)}function ak(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;return c&&y>>0,p?(a=Xe(a),a&&(typeof c=="string"||c!=null&&!Wd(c))&&(c=An(c),!c&&So(a))?li(Qn(a),0,p):a.split(c,p)):[]}var hk=Oo(function(a,c,p){return a+(p?" ":"")+Gd(c)});function mk(a,c,p){return a=Xe(a),p=p==null?0:Di(Ie(p),0,a.length),c=An(c),a.slice(p,p+c.length)==c}function gk(a,c,p){var y=x.templateSettings;p&&un(a,c,p)&&(c=t),a=Xe(a),c=xl({},c,y,_b);var v=xl({},c.imports,y.imports,_b),_=$t(v),C=rd(v,_),M,O,U=0,W=c.interpolate||La,G="__p += '",te=od((c.escape||La).source+"|"+W.source+"|"+(W===Ni?JS:La).source+"|"+(c.evaluate||La).source+"|$","g"),de="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++TT+"]")+` `;a.replace(te,function(ve,$e,Ve,Nn,dn,kn){return Ve||(Ve=Nn),G+=a.slice(U,kn).replace(nT,VT),$e&&(M=!0,G+=`' + __e(`+$e+`) + -'`),dn&&(k=!0,G+=`'; +'`),dn&&(O=!0,G+=`'; `+dn+`; __p += '`),Ve&&(G+=`' + ((__t = (`+Ve+`)) == null ? '' : __t) + @@ -12,25 +12,25 @@ __p += '`),Ve&&(G+=`' + `;var Ee=Ze.call(c,"variable")&&c.variable;if(!Ee)G=`with (obj) { `+G+` } -`;else if(qS.test(Ee))throw new Me(o);G=(k?G.replace(Se,""):G).replace(qe,"$1").replace(Ke,"$1;"),G="function("+(Ee||"obj")+`) { +`;else if(qS.test(Ee))throw new Me(o);G=(O?G.replace(Se,""):G).replace(qe,"$1").replace(Ke,"$1;"),G="function("+(Ee||"obj")+`) { `+(Ee?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(k?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(O?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+G+`return __p -}`;var Le=my(function(){return Ye(_,de+"return "+G).apply(t,C)});if(Le.source=G,Ud(Le))throw Le;return Le}function bk(a){return Xe(a).toLowerCase()}function yk(a){return Xe(a).toUpperCase()}function Ek(a,c,p){if(a=Xe(a),a&&(p||c===t))return Sg(a);if(!a||!(c=An(c)))return a;var b=Qn(a),E=Qn(c),_=Tg(b,E),C=Cg(b,E)+1;return li(b,_,C).join("")}function vk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.slice(0,Mg(a)+1);if(!a||!(c=An(c)))return a;var b=Qn(a),E=Cg(b,Qn(c))+1;return li(b,0,E).join("")}function wk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.replace(Uu,"");if(!a||!(c=An(c)))return a;var b=Qn(a),E=Tg(b,Qn(c));return li(b,E).join("")}function xk(a,c){var p=ne,b=q;if(ft(c)){var E="separator"in c?c.separator:E;p="length"in c?Ie(c.length):p,b="omission"in c?An(c.omission):b}a=Xe(a);var _=a.length;if(So(a)){var C=Qn(a);_=C.length}if(p>=_)return a;var M=p-To(b);if(M<1)return b;var k=C?li(C,0,M).join(""):a.slice(0,M);if(E===t)return k+b;if(C&&(M+=k.length-M),Wd(E)){if(a.slice(M).search(E)){var U,W=k;for(E.global||(E=od(E.source,Xe(Gm.exec(E))+"g")),E.lastIndex=0;U=E.exec(W);)var G=U.index;k=k.slice(0,G===t?M:G)}}else if(a.indexOf(An(E),M)!=M){var te=k.lastIndexOf(E);te>-1&&(k=k.slice(0,te))}return k+b}function _k(a){return a=Xe(a),a&&Zr.test(a)?a.replace(Ft,jT):a}var Sk=Oo(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Gd=gb("toUpperCase");function hy(a,c,p){return a=Xe(a),c=p?t:c,c===t?qT(a)?t1(a):FT(a):a.match(c)||[]}var my=He(function(a,c){try{return Tn(a,t,c)}catch(p){return Ud(p)?p:new Me(p)}}),Tk=Ar(function(a,c){return In(c,function(p){p=fr(p),Tr(a,p,$d(a[p],a))}),a});function Ck(a){var c=a==null?0:a.length,p=be();return a=c?lt(a,function(b){if(typeof b[1]!="function")throw new Dn(i);return[p(b[0]),b[1]]}):[],He(function(b){for(var E=-1;++Eye)return[];var p=z,b=jt(a,z);c=be(c),a-=z;for(var E=nd(b,c);++p0||c<0)?new Ue(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Ie(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ue.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ue.prototype.toArray=function(){return this.take(z)},ur(Ue.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),b=/^(?:head|last)$/.test(c),E=x[b?"take"+(c=="last"?"Right":""):c],_=b||/^find/.test(c);E&&(x.prototype[c]=function(){var C=this.__wrapped__,M=b?[1]:arguments,k=C instanceof Ue,U=M[0],W=k||ke(C),G=function($e){var Ve=E.apply(x,ti([$e],M));return b&&te?Ve[0]:Ve};W&&p&&typeof U=="function"&&U.length!=1&&(k=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=_&&!te,Le=k&&!de;if(!_&&W){C=Le?C:new Ue(this);var ve=a.apply(C,M);return ve.__actions__.push({func:ml,args:[G],thisArg:t}),new Ln(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(G),Ee?b?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=za[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);x.prototype[a]=function(){var E=arguments;if(b&&!this.__chain__){var _=this.value();return c.apply(ke(_)?_:[],E)}return this[p](function(C){return c.apply(ke(C)?C:[],E)})}}),ur(Ue.prototype,function(a,c){var p=x[c];if(p){var b=p.name+"";Ze.call(Mo,b)||(Mo[b]=[]),Mo[b].push({name:c,func:p})}}),Mo[ll(t,v).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=_1,Ue.prototype.reverse=S1,Ue.prototype.value=T1,x.prototype.at=eM,x.prototype.chain=tM,x.prototype.commit=nM,x.prototype.next=rM,x.prototype.plant=oM,x.prototype.reverse=sM,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=aM,x.prototype.first=x.prototype.head,vs&&(x.prototype[vs]=iM),x},ri=n1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ht._=ri,define(function(){return ri})):ki?((ki.exports=ri)._=ri,Yu._=ri):Ht._=ri}).call(gs)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var tf=en;function My(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=My(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ny(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;de&&r(u,i+l,o||null,s)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?_l(r+1,s):_l(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Ge.none=[];var zi=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Oy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ky(this.content,e+this.openStart,n+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,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(K.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(K.empty,0,0);function ky(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ky(o.content,e-i-1,n-i-1)))}function Oy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Oy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function gO(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return Ry(t,e,n,0)}function Ry(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ds(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Hi(t.nodeAfter,r),o++));for(let l=o;li&&of(t,e,i+1),s=r.depth>i&&of(n,r,i+1),l=[];return Ds(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Iy(o,s),Hi($i(o,Dy(t,e,n,r,i+1)),l)):(o&&Hi($i(o,Cl(t,e,i+1)),l),Ds(e,n,i,l),s&&Hi($i(s,Cl(n,r,i+1)),l)),Ds(r,null,i,l),new K(l)}function Cl(t,e,n){let r=[];if(Ds(null,t,n,r),t.depth>n){let i=of(t,e,n+1);Hi($i(i,Cl(t,e,n+1)),r)}return Ds(e,null,n,r),new K(r)}function bO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Al=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new t(n,r,o)}static resolveCached(e,n){let r=Ey.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ly(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=K.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=K.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};$n.prototype.text=void 0;var af=class t extends $n{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ly(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ly(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Wi=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new lf(e,n);if(r.next==null)return t.empty;let i=Py(r);r.next&&r.err("Unexpected trailing text");let o=CO(TO(i));return AO(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +}`;var Le=my(function(){return Ye(_,de+"return "+G).apply(t,C)});if(Le.source=G,Ud(Le))throw Le;return Le}function bk(a){return Xe(a).toLowerCase()}function yk(a){return Xe(a).toUpperCase()}function Ek(a,c,p){if(a=Xe(a),a&&(p||c===t))return Sg(a);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Qn(c),_=Tg(y,v),C=Cg(y,v)+1;return li(y,_,C).join("")}function vk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.slice(0,Mg(a)+1);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Cg(y,Qn(c))+1;return li(y,0,v).join("")}function wk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.replace(Uu,"");if(!a||!(c=An(c)))return a;var y=Qn(a),v=Tg(y,Qn(c));return li(y,v).join("")}function xk(a,c){var p=ne,y=q;if(ft(c)){var v="separator"in c?c.separator:v;p="length"in c?Ie(c.length):p,y="omission"in c?An(c.omission):y}a=Xe(a);var _=a.length;if(So(a)){var C=Qn(a);_=C.length}if(p>=_)return a;var M=p-To(y);if(M<1)return y;var O=C?li(C,0,M).join(""):a.slice(0,M);if(v===t)return O+y;if(C&&(M+=O.length-M),Wd(v)){if(a.slice(M).search(v)){var U,W=O;for(v.global||(v=od(v.source,Xe(Gm.exec(v))+"g")),v.lastIndex=0;U=v.exec(W);)var G=U.index;O=O.slice(0,G===t?M:G)}}else if(a.indexOf(An(v),M)!=M){var te=O.lastIndexOf(v);te>-1&&(O=O.slice(0,te))}return O+y}function _k(a){return a=Xe(a),a&&Zr.test(a)?a.replace(Ft,jT):a}var Sk=Oo(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Gd=gb("toUpperCase");function hy(a,c,p){return a=Xe(a),c=p?t:c,c===t?qT(a)?t1(a):FT(a):a.match(c)||[]}var my=He(function(a,c){try{return Tn(a,t,c)}catch(p){return Ud(p)?p:new Me(p)}}),Tk=Ar(function(a,c){return In(c,function(p){p=fr(p),Tr(a,p,$d(a[p],a))}),a});function Ck(a){var c=a==null?0:a.length,p=be();return a=c?lt(a,function(y){if(typeof y[1]!="function")throw new Dn(i);return[p(y[0]),y[1]]}):[],He(function(y){for(var v=-1;++vye)return[];var p=z,y=jt(a,z);c=be(c),a-=z;for(var v=nd(y,c);++p0||c<0)?new Ue(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Ie(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ue.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ue.prototype.toArray=function(){return this.take(z)},ur(Ue.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),v=x[y?"take"+(c=="last"?"Right":""):c],_=y||/^find/.test(c);v&&(x.prototype[c]=function(){var C=this.__wrapped__,M=y?[1]:arguments,O=C instanceof Ue,U=M[0],W=O||ke(C),G=function($e){var Ve=v.apply(x,ti([$e],M));return y&&te?Ve[0]:Ve};W&&p&&typeof U=="function"&&U.length!=1&&(O=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=_&&!te,Le=O&&!de;if(!_&&W){C=Le?C:new Ue(this);var ve=a.apply(C,M);return ve.__actions__.push({func:ml,args:[G],thisArg:t}),new Ln(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(G),Ee?y?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=za[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",y=/^(?:pop|shift)$/.test(a);x.prototype[a]=function(){var v=arguments;if(y&&!this.__chain__){var _=this.value();return c.apply(ke(_)?_:[],v)}return this[p](function(C){return c.apply(ke(C)?C:[],v)})}}),ur(Ue.prototype,function(a,c){var p=x[c];if(p){var y=p.name+"";Ze.call(Mo,y)||(Mo[y]=[]),Mo[y].push({name:c,func:p})}}),Mo[ll(t,E).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=_1,Ue.prototype.reverse=S1,Ue.prototype.value=T1,x.prototype.at=eM,x.prototype.chain=tM,x.prototype.commit=nM,x.prototype.next=rM,x.prototype.plant=oM,x.prototype.reverse=sM,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=aM,x.prototype.first=x.prototype.head,vs&&(x.prototype[vs]=iM),x},ri=n1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ht._=ri,define(function(){return ri})):ki?((ki.exports=ri)._=ri,Yu._=ri):Ht._=ri}).call(gs)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var tf=en;function My(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=My(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ny(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;de&&r(u,i+l,o||null,s)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?_l(r+1,s):_l(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Ge.none=[];var zi=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Oy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ky(this.content,e+this.openStart,n+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,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(K.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(K.empty,0,0);function ky(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ky(o.content,e-i-1,n-i-1)))}function Oy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Oy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function gO(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return Ry(t,e,n,0)}function Ry(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ds(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Hi(t.nodeAfter,r),o++));for(let l=o;li&&of(t,e,i+1),s=r.depth>i&&of(n,r,i+1),l=[];return Ds(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Iy(o,s),Hi($i(o,Dy(t,e,n,r,i+1)),l)):(o&&Hi($i(o,Cl(t,e,i+1)),l),Ds(e,n,i,l),s&&Hi($i(s,Cl(n,r,i+1)),l)),Ds(r,null,i,l),new K(l)}function Cl(t,e,n){let r=[];if(Ds(null,t,n,r),t.depth>n){let i=of(t,e,n+1);Hi($i(i,Cl(t,e,n+1)),r)}return Ds(e,null,n,r),new K(r)}function bO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Al=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new t(n,r,o)}static resolveCached(e,n){let r=Ey.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ly(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=K.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=K.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};$n.prototype.text=void 0;var af=class t extends $n{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ly(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ly(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Wi=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new lf(e,n);if(r.next==null)return t.empty;let i=Py(r);r.next&&r.err("Unexpected trailing text");let o=CO(TO(i));return AO(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}};Wi.empty=new Wi(!0);var lf=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 Py(t){let e=[];do e.push(vO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function vO(t){let e=[];do e.push(wO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function wO(t){let e=SO(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=xO(t,e);else break;return e}function vy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function xO(t,e){let n=vy(t),r=n;return t.eat(",")&&(t.next!="}"?r=vy(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _O(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function SO(t){if(t.eat("(")){let e=Py(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=_O(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function TO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,u){let d={term:u,to:l};return e[s].push(d),d}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,d)=>u.concat(o(d,l)),[]);if(s.type=="seq")for(let u=0;;u++){let d=o(s.exprs[u],l);if(u==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let d=0;d{t[s].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[r.join(",")]=new Wi(r.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Hy(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $n(this,this.computeAttrs(e),K.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=K.from(n),this.checkContent(n),new $n(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=K.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(K.empty,!0);return o?new $n(this,e,n.append(o),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new t(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function MO(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var cf=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?MO(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},Ps=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=zy(e,i.attrs),this.excluded=null;let o=Fy(this.attrs);this.instance=o?new Ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,Hy(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new t(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},Bs=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=tf.from(e.nodes),n.marks=tf.from(e.marks||{}),this.nodes=Ml.compile(this.spec.nodes,this),this.marks=Ps.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Wi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?xy(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:xy(this,s.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,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ml){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new af(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return $n.fromJSON(this,e)}markFromJSON(e){return Ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function xy(t,e){let n=[];for(let r=0;r-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function NO(t){return t.tag!=null}function kO(t){return t.style!=null}var Rr=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(NO(i))this.tags.push(i);else if(kO(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Nl(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Nl(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Sy(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Sy(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},Uy={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},OO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wy={ol:!0,ul:!0},Fs=1,uf=2,Ls=4;function _y(t,e,n){return e!=null?(e?Fs:0)|(e==="full"?uf:0):t&&t.whitespace=="pre"?Fs|uf:n&~Ls}var Lo=class{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ge.none,this.match=o||(s&Ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(K.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Fs)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=K.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Uy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Nl=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=_y(null,n.preserveWhitespace,0)|(r?Ls:0);i?o=new Lo(i.type,i.attrs,Ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Lo(null,null,Ge.none,!0,null,s):o=new Lo(e.schema.topNodeType,null,Ge.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&uf?"full":this.localPreserveWS||(i.options&Fs)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Wy.hasOwnProperty(s)&&this.parser.normalizeLists&&RO(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:OO.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,f=this.needsBlock;if(Uy.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=u&&u.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),d&&this.sync(o),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(d.type):Ty(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Lo(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Fs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function RO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function IO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sy(t){let e={};for(let n in t)e[n]=t[n];return e}function Ty(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Sl(rf(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Sl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cy(e.marks)}};function Cy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function rf(t){return t.document||window.document}var Ay=new WeakMap;function DO(t){let e=Ay.get(t);return e===void 0&&Ay.set(t,e=LO(t)),e}function LO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):u.setAttribute(h,d[h])}}for(let h=f;hf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:y}=Sl(t,m,n,r);if(u.appendChild(g),y){if(l)throw new RangeError("Multiple content holes");l=y}}}return{dom:u,contentDOM:l}}var Gy=65535,qy=Math.pow(2,16);function PO(t,e){return t+e*qy}function Ky(t){return t&Gy}function BO(t){return(t-(t&Gy))/qy}var Yy=1,Jy=2,kl=4,Xy=8,zs=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Xy)>0}get deletedBefore(){return(this.delInfo&(Yy|kl))>0}get deletedAfter(){return(this.delInfo&(Jy|kl))>0}get deletedAcross(){return(this.delInfo&kl)>0}},Dr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Ky(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,g=u+i+(m<0?0:f);if(r)return g;let y=e==(n<0?u:h)?null:PO(l/3,e-u),v=e==u?Jy:e==h?Yy:kl;return(n<0?e!=u:e!=h)&&(v|=Xy),new zs(g,v,y)}i+=f-d}return r?e+i:new zs(e+i,0,null)}touches(e,n){let r=0,i=Ky(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("addMark",Ws);var Ki=class t extends zt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(gf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,r)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("removeMark",Ki);var Ks=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};zt.jsonID("replaceAround",Ct);function hf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function FO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),g=Math.min(d+u.nodeSize,n),y=r.addToSet(h);for(let v=0;vt.step(u)),o.forEach(u=>t.step(u))}function HO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Ps){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;ft.step(new Ki(s.from,s.to,s.style)))}function bf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let u=0;u=0;u--)t.step(s[u])}function $O(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;y--)v||r.index(y)>0?(v=!0,f=K.from(r.node(y).copy(f)),h++):u--;let m=K.empty,g=0;for(let y=o,v=!1;y>n;y--)v||i.after(y+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ct(i,o,i,o,new Z(r,0,0),n.length,!0))}function VO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&GO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",y=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!y?d=!1:!g&&y&&(d=!0)}d===!1&&jy(t,s,l,o),bf(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new Ct(h,m,h+1,m-1,new Z(K.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&Zy(t,s,l,o),!1}})}function Zy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function jy(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function GO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function qO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ct(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(K.from(s),0,0),1,!0))}function zn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),y=r&&r[f+1];y&&(g=g.replaceChild(0,y.type.create(y.attrs)));let v=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!v.type.validContent(g))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function YO(t,e,n=1,r){let i=t.doc.resolve(e),o=K.empty,s=K.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=K.from(i.node(l).copy(o));let f=r&&r[d];s=K.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new tn(e,e,new Z(o.append(s),n,n),!0))}function rr(t,e){let n=t.resolve(e),r=n.index();return Qy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JO(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Qy(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XO(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);jy(t,f.node(),f.before(),l)}s.inlineContent&&bf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new tn(d,u.map(e+n,-1),Z.empty,!0)),r===!0){let f=t.doc.resolve(d);Zy(t,f.node(),f.before(),t.steps.length)}return t}function ZO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Gs(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return e0(i,o,r)?new tn(e,n,r):new mf(i,o,r).fit()}function e0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var mf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new Z(o,s,l);return e>-1?new Ct(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ff(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(K.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Hs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Hs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v1||u==0||v.content.size)&&(h=w,f.push(t0(v.mark(m.allowedMarks(v.marks)),d==1?u:0,d==l.childCount?g:-1)))}let y=d==l.childCount;y||(g=-1),this.placed=$s(this.placed,n,K.from(f)),this.frontier[n].match=h,y&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=l;v1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:d}=this.frontier[l],f=pf(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$s(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=$s(this.placed,this.depth,K.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=$s(this.placed,this.frontier.length,n))}};function Hs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hs(t.firstChild.content,e-1,n)))}function $s(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($s(t.lastChild.content,e-1,n)))}function ff(t,e){for(let n=0;n1&&(r=r.replaceChild(0,t0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),t.copy(r)}function pf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!jO(n,o.content,s)?l:null}function jO(t,e,n){for(let r=n;r0;m--,g--){let y=i.node(m).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==g&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,g=0;;g++){let y=m.firstChild;if(d.push(y),g==r.openStart)break;m=y.content}for(let m=f-1;m>=0;m--){let g=d[m],y=QO(g.type);if(y&&!g.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(y||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),y=d[g];if(y)for(let v=0;v=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let g=s[m];g<0||(e=i.before(g),n=o.after(g))}}function n0(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(K.empty,!0))}return t}function tR(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=ZO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(K.from(r),0,0))}function nR(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=r0(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function r0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Ol=class t extends zt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(i),0,n.isLeaf?0:1))}getMap(){return Dr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};zt.jsonID("attr",Ol);var Rl=class t extends zt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Gt.ok(r)}getMap(){return Dr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};zt.jsonID("docAttr",Rl);var Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";var ui=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Us}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(K.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return eR(this,e,n,r),this}replaceRangeWith(e,n,r){return tR(this,e,n,r),this}deleteRange(e,n){return nR(this,e,n),this}lift(e,n){return zO(this,e,n),this}join(e,n=1){return XO(this,e,n),this}wrap(e,n){return KO(this,e,n),this}setBlockType(e,n=e,r,i=null){return VO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return qO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ol(e,n,r)),this}setDocAttribute(e,n){return this.step(new Rl(e,n)),this}addNodeMark(e,n){return this.step(new Ks(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Vs(e,n)),this}split(e,n=1,r){return YO(this,e,n,r),this}addMark(e,n,r){return FO(this,e,n,r),this}removeMark(e,n,r){return HO(this,e,n,r),this}clearIncompatible(e,n,r){return bf(this,e,n,r),this}};var yf=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $o(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Ho(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ho(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fn(e.node(0))}static atStart(e){return Ho(e,e,0,0,1)||new fn(e)}static atEnd(e){return Ho(e,e,e.content.size,e.childCount,-1)||new fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yf)throw new RangeError("Duplicate use of selection JSON ID "+e);return yf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var $o=class{constructor(e,n){this.$from=e,this.$to=n}},i0=!1;function o0(t){!i0&&!t.parent.inlineContent&&(i0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var le=class t extends ue{constructor(e,n=e){o0(e),o0(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ll(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.create(t,n-(i<0?l.nodeSize:0))}else{let u=Ho(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function s0(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var a0=1,Dl=2,l0=4,wf=class extends ui{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Dl,this}ensureMarks(e){return Ge.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(this.updated&Dl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Dl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=l0,this}get scrolledIntoView(){return(this.updated&l0)>0}};function c0(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=c0(n.init,r),this.apply=c0(n.apply,r)}},iR=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],qs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iR.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Vi(r.key,r.spec.state,r))})}},Pl=class t{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new qs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=$n.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function u0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=u0(i,e,{})),n[r]=i}return n}var Oe=class{constructor(e){this.spec=e,this.props={},e.props&&u0(e.props,this,this.props),this.key=e.key?e.key.key:d0("plugin")}getState(e){return e[this.key]}},Ef=Object.create(null);function d0(t){return t in Ef?t+"$"+ ++Ef[t]:(Ef[t]=0,t+"$")}var ze=class{constructor(e="key"){this.key=d0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var qt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Af=null,Br=function(t,e,n){let r=Af||(Af=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},oR=function(){Af=null},ji=function(t,e,n,r){return n&&(f0(t,e,n,r,-1)||f0(t,e,n,r,1))},sR=/^(img|br|input|textarea|hr)$/i;function f0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Wn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ta(t)||sR.test(t.nodeName)||t.contentEditable=="false")return!1;e=qt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Wn(t):0}else return!1}}function Wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aR(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Wn(t)}else if(t.parentNode&&!ta(t))e=qt(t),t=t.parentNode;else return null}}function lR(t,e){for(;;){if(t.nodeType==3&&e2),Un=Vo||(pr?/Mac/.test(pr.platform):!1),fR=pr?/Win/.test(pr.platform):!1,Fr=/Android \d/.test(gi),na=!!p0&&"webkitFontSmoothing"in p0.documentElement.style,pR=na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function mR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function h0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Zs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?hR(o):mR(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,g=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let y=l.scrollLeft-m,v=l.scrollTop-g;e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function gR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:q0(t.dom)}}function q0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zs(r));return e}function bR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Y0(n,r==0?0:r-e)}function Y0(t,e){for(let n=0;n=l){s=Math.max(y.bottom,s),l=Math.min(y.top,l);let v=y.left>e.left?y.left-e.left:y.right=(y.left+y.right)/2?1:0));continue}}else y.top>e.top&&!u&&y.left<=e.left&&y.right>=e.left&&(u=f,d={left:Math.max(y.left,Math.min(y.right,e.left)),top:y.top});!n&&(e.left>=y.right&&e.top>=y.top||e.left>=y.left&&e.top>=y.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?ER(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:J0(n,i)}function ER(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Vf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function xR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right-1?i:t.docView.posFromDOM(e,n,-1)}function X0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;na&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=xR(t,r,i,e))}l==null&&(l=wR(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function m0(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ys(di(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return xf(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,Wn(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ys(di(d,1),!1)}if(o==null&&i=0)}function Ys(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function j0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function TR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return j0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Z0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var CR=/[\u0590-\u08ac]/;function AR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!CR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:j0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:y,focusOffset:v}=t.domSelectionRange(),w=y&&!g.contains(y.nodeType==1?y:y.parentNode)||u==y&&d==v;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}var g0=null,b0=null,y0=!1;function MR(t,e,n){return g0==e&&b0==n?y0:(g0=e,b0=n,y0=n=="up"||n=="down"?TR(t,e,n):AR(t,e,n))}var Kn=0,E0=1,qi=2,hr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Kn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nqt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Hl){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Bl&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?qt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=qt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;fy&&sn){let y=l;l=u,u=y}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:E0,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:hr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:E0;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Kn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},Of=class extends Qi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Go=class t extends Qi{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ir.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Lf(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ir.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=tE(f,r,n),d?u=new Rf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Fl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,n,r){return this.dirty==Kn&&e.eq(this.node)&&$l(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new Df(this,s&&s.node,e);RR(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let g;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,g,e)||u.updateNextNode(d,f,h,e,m,i)||u.addNode(d,f,h,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==qi)&&(s&&this.protectLocalComposition(e,s),Q0(this.contentDOM,this.children,e),Vo&&IR(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=DR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;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 s=new Of(this,o,n,i);e.input.compositionNodes.push(s),this.children=Lf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Kn}updateOuterDeco(e){if($l(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=eE(this.dom,this.nodeDOM,If(this.outerDeco,this.node,n),If(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function v0(t,e,n,r,i){tE(r,e,t);let o=new mi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Fl=class t extends mi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=Kn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Kn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Hl=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Rf=class extends mi{constructor(e,n,r,i,o,s,l,u,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Q0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Go.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Go)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function OR(t,e){return t.type.side-e.type.side}function RR(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let y=o+m.nodeSize;if(m.isText){let w=y;s!w.inline):l.slice();r(m,v,e.forChild(o,m),g),o=y}}function IR(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function DR(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Lf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Gf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,d;if(Yl(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&he.isSelectable(h)&&i.parent&&!(h.isInline&&cR(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new he(s==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let g=0;g{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!nE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function PR(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,qt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&hi<=11&&(r.disabled=!0,r.disabled=!1)}function rE(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(T0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else T0(t)}function T0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function qf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function C0(t){return t.editable&&!t.hasFocus()?!1:iE(t)}function iE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function BR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Pf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function fi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function A0(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fi(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Pf(t.state,e);return i&&i instanceof he?fi(t,i):!1}else if(!(Un&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?he.isSelectable(o)?fi(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):na?fi(t,new le(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return fi(t,new le(e>0?r.$to:r.$from));{let i=Pf(t.state,e);return i?fi(t,i):!1}}}function zl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Xs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Uo(t,e){return e<0?FR(t):HR(t)}function FR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Xs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(oE(n))break;{let l=n.previousSibling;for(;l&&Xs(l,-1);)i=n.parentNode,o=qt(l),l=l.previousSibling;if(l)n=l,r=zl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Bf(t,n,r):i&&Bf(t,i,o)}function HR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=zl(n),o,s;for(;;)if(r{t.state==i&&Hr(t)},50)}function M0(t,e){let n=t.state.doc.resolve(e);if(!(rn||fR)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function N0(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Pf(t.state,e);if(s&&s instanceof he)return fi(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fn?ue.near(s,e):ue.findFrom(s,e);return l?fi(t,l):!1}return!1}function k0(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function O0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function UR(t){if(!pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;O0(t,r,"true"),setTimeout(()=>O0(t,r,"false"),20)}return!1}function WR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function KR(t,e){let n=e.keyCode,r=WR(e);if(n==8||Un&&n==72&&r=="c")return k0(t,-1)||Uo(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return k0(t,1)||Uo(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?M0(t,t.state.selection.from)=="ltr"?-1:1:-1;return A0(t,i,r)||Uo(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?M0(t,t.state.selection.from)=="ltr"?1:-1:1;return A0(t,i,r)||Uo(t,i)}else{if(n==38||Un&&n==80&&r=="c")return N0(t,-1,r)||Uo(t,-1);if(n==40||Un&&n==78&&r=="c")return UR(t)||N0(t,1,r)||Uo(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function sE(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=fE(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=dE[d.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let y=l.createElement(f[g]);for(;u.firstChild;)y.appendChild(u.firstChild);u.appendChild(y),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(d.type):Ty(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Lo(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Fs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function RO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function IO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sy(t){let e={};for(let n in t)e[n]=t[n];return e}function Ty(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Sl(rf(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Sl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cy(e.marks)}};function Cy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function rf(t){return t.document||window.document}var Ay=new WeakMap;function DO(t){let e=Ay.get(t);return e===void 0&&Ay.set(t,e=LO(t)),e}function LO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):u.setAttribute(h,d[h])}}for(let h=f;hf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:b}=Sl(t,m,n,r);if(u.appendChild(g),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:u,contentDOM:l}}var Gy=65535,qy=Math.pow(2,16);function PO(t,e){return t+e*qy}function Ky(t){return t&Gy}function BO(t){return(t-(t&Gy))/qy}var Yy=1,Jy=2,kl=4,Xy=8,zs=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Xy)>0}get deletedBefore(){return(this.delInfo&(Yy|kl))>0}get deletedAfter(){return(this.delInfo&(Jy|kl))>0}get deletedAcross(){return(this.delInfo&kl)>0}},Dr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Ky(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,g=u+i+(m<0?0:f);if(r)return g;let b=e==(n<0?u:h)?null:PO(l/3,e-u),E=e==u?Jy:e==h?Yy:kl;return(n<0?e!=u:e!=h)&&(E|=Xy),new zs(g,E,b)}i+=f-d}return r?e+i:new zs(e+i,0,null)}touches(e,n){let r=0,i=Ky(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("addMark",Ws);var Ki=class t extends zt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(gf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,r)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("removeMark",Ki);var Ks=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};zt.jsonID("replaceAround",Ct);function hf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function FO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),g=Math.min(d+u.nodeSize,n),b=r.addToSet(h);for(let E=0;Et.step(u)),o.forEach(u=>t.step(u))}function HO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Ps){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;ft.step(new Ki(s.from,s.to,s.style)))}function bf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let u=0;u=0;u--)t.step(s[u])}function $O(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;b--)E||r.index(b)>0?(E=!0,f=K.from(r.node(b).copy(f)),h++):u--;let m=K.empty,g=0;for(let b=o,E=!1;b>n;b--)E||i.after(b+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ct(i,o,i,o,new Z(r,0,0),n.length,!0))}function VO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&GO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!b?d=!1:!g&&b&&(d=!0)}d===!1&&jy(t,s,l,o),bf(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new Ct(h,m,h+1,m-1,new Z(K.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&Zy(t,s,l,o),!1}})}function Zy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function jy(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function GO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function qO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ct(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(K.from(s),0,0),1,!0))}function zn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(g=g.replaceChild(0,b.type.create(b.attrs)));let E=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!E.type.validContent(g))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function YO(t,e,n=1,r){let i=t.doc.resolve(e),o=K.empty,s=K.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=K.from(i.node(l).copy(o));let f=r&&r[d];s=K.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new tn(e,e,new Z(o.append(s),n,n),!0))}function rr(t,e){let n=t.resolve(e),r=n.index();return Qy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JO(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Qy(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XO(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);jy(t,f.node(),f.before(),l)}s.inlineContent&&bf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new tn(d,u.map(e+n,-1),Z.empty,!0)),r===!0){let f=t.doc.resolve(d);Zy(t,f.node(),f.before(),t.steps.length)}return t}function ZO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Gs(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return e0(i,o,r)?new tn(e,n,r):new mf(i,o,r).fit()}function e0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var mf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new Z(o,s,l);return e>-1?new Ct(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ff(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(K.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Hs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Hs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let E=0;E1||u==0||E.content.size)&&(h=w,f.push(t0(E.mark(m.allowedMarks(E.marks)),d==1?u:0,d==l.childCount?g:-1)))}let b=d==l.childCount;b||(g=-1),this.placed=$s(this.placed,n,K.from(f)),this.frontier[n].match=h,b&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,w=l;E1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:d}=this.frontier[l],f=pf(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$s(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=$s(this.placed,this.depth,K.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=$s(this.placed,this.frontier.length,n))}};function Hs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hs(t.firstChild.content,e-1,n)))}function $s(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($s(t.lastChild.content,e-1,n)))}function ff(t,e){for(let n=0;n1&&(r=r.replaceChild(0,t0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),t.copy(r)}function pf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!jO(n,o.content,s)?l:null}function jO(t,e,n){for(let r=n;r0;m--,g--){let b=i.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==g&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,g=0;;g++){let b=m.firstChild;if(d.push(b),g==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let g=d[m],b=QO(g.type);if(b&&!g.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(b||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),b=d[g];if(b)for(let E=0;E=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let g=s[m];g<0||(e=i.before(g),n=o.after(g))}}function n0(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(K.empty,!0))}return t}function tR(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=ZO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(K.from(r),0,0))}function nR(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=r0(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function r0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Ol=class t extends zt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(i),0,n.isLeaf?0:1))}getMap(){return Dr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};zt.jsonID("attr",Ol);var Rl=class t extends zt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Gt.ok(r)}getMap(){return Dr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};zt.jsonID("docAttr",Rl);var Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";var ui=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Us}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(K.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return eR(this,e,n,r),this}replaceRangeWith(e,n,r){return tR(this,e,n,r),this}deleteRange(e,n){return nR(this,e,n),this}lift(e,n){return zO(this,e,n),this}join(e,n=1){return XO(this,e,n),this}wrap(e,n){return KO(this,e,n),this}setBlockType(e,n=e,r,i=null){return VO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return qO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ol(e,n,r)),this}setDocAttribute(e,n){return this.step(new Rl(e,n)),this}addNodeMark(e,n){return this.step(new Ks(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Vs(e,n)),this}split(e,n=1,r){return YO(this,e,n,r),this}addMark(e,n,r){return FO(this,e,n,r),this}removeMark(e,n,r){return HO(this,e,n,r),this}clearIncompatible(e,n,r){return bf(this,e,n,r),this}};var yf=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $o(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Ho(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ho(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fn(e.node(0))}static atStart(e){return Ho(e,e,0,0,1)||new fn(e)}static atEnd(e){return Ho(e,e,e.content.size,e.childCount,-1)||new fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yf)throw new RangeError("Duplicate use of selection JSON ID "+e);return yf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var $o=class{constructor(e,n){this.$from=e,this.$to=n}},i0=!1;function o0(t){!i0&&!t.parent.inlineContent&&(i0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var le=class t extends ue{constructor(e,n=e){o0(e),o0(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ll(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.create(t,n-(i<0?l.nodeSize:0))}else{let u=Ho(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function s0(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var a0=1,Dl=2,l0=4,wf=class extends ui{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Dl,this}ensureMarks(e){return Ge.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(this.updated&Dl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Dl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=l0,this}get scrolledIntoView(){return(this.updated&l0)>0}};function c0(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=c0(n.init,r),this.apply=c0(n.apply,r)}},iR=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],qs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iR.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Vi(r.key,r.spec.state,r))})}},Pl=class t{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new qs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=$n.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function u0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=u0(i,e,{})),n[r]=i}return n}var Oe=class{constructor(e){this.spec=e,this.props={},e.props&&u0(e.props,this,this.props),this.key=e.key?e.key.key:d0("plugin")}getState(e){return e[this.key]}},Ef=Object.create(null);function d0(t){return t in Ef?t+"$"+ ++Ef[t]:(Ef[t]=0,t+"$")}var ze=class{constructor(e="key"){this.key=d0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var qt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Af=null,Br=function(t,e,n){let r=Af||(Af=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},oR=function(){Af=null},ji=function(t,e,n,r){return n&&(f0(t,e,n,r,-1)||f0(t,e,n,r,1))},sR=/^(img|br|input|textarea|hr)$/i;function f0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Wn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ta(t)||sR.test(t.nodeName)||t.contentEditable=="false")return!1;e=qt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Wn(t):0}else return!1}}function Wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aR(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Wn(t)}else if(t.parentNode&&!ta(t))e=qt(t),t=t.parentNode;else return null}}function lR(t,e){for(;;){if(t.nodeType==3&&e2),Un=Vo||(pr?/Mac/.test(pr.platform):!1),fR=pr?/Win/.test(pr.platform):!1,Fr=/Android \d/.test(gi),na=!!p0&&"webkitFontSmoothing"in p0.documentElement.style,pR=na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function mR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function h0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Zs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?hR(o):mR(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,g=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-m,E=l.scrollTop-g;e={left:e.left-b,top:e.top-E,right:e.right-b,bottom:e.bottom-E}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function gR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:q0(t.dom)}}function q0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zs(r));return e}function bR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Y0(n,r==0?0:r-e)}function Y0(t,e){for(let n=0;n=l){s=Math.max(b.bottom,s),l=Math.min(b.top,l);let E=b.left>e.left?b.left-e.left:b.right=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!u&&b.left<=e.left&&b.right>=e.left&&(u=f,d={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?ER(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:J0(n,i)}function ER(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Vf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function xR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right-1?i:t.docView.posFromDOM(e,n,-1)}function X0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;na&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=xR(t,r,i,e))}l==null&&(l=wR(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function m0(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ys(di(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return xf(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,Wn(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ys(di(d,1),!1)}if(o==null&&i=0)}function Ys(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function j0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function TR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return j0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Z0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var CR=/[\u0590-\u08ac]/;function AR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!CR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:j0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:E}=t.domSelectionRange(),w=b&&!g.contains(b.nodeType==1?b:b.parentNode)||u==b&&d==E;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}var g0=null,b0=null,y0=!1;function MR(t,e,n){return g0==e&&b0==n?y0:(g0=e,b0=n,y0=n=="up"||n=="down"?TR(t,e,n):AR(t,e,n))}var Kn=0,E0=1,qi=2,hr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Kn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nqt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Hl){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Bl&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?qt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=qt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;fb&&sn){let b=l;l=u,u=b}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:E0,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:hr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:E0;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Kn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},Of=class extends Qi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Go=class t extends Qi{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ir.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Lf(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ir.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=tE(f,r,n),d?u=new Rf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Fl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,n,r){return this.dirty==Kn&&e.eq(this.node)&&$l(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new Df(this,s&&s.node,e);RR(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let g;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,g,e)||u.updateNextNode(d,f,h,e,m,i)||u.addNode(d,f,h,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==qi)&&(s&&this.protectLocalComposition(e,s),Q0(this.contentDOM,this.children,e),Vo&&IR(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=DR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;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 s=new Of(this,o,n,i);e.input.compositionNodes.push(s),this.children=Lf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Kn}updateOuterDeco(e){if($l(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=eE(this.dom,this.nodeDOM,If(this.outerDeco,this.node,n),If(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function v0(t,e,n,r,i){tE(r,e,t);let o=new mi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Fl=class t extends mi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=Kn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Kn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Hl=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Rf=class extends mi{constructor(e,n,r,i,o,s,l,u,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Q0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Go.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Go)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function OR(t,e){return t.type.side-e.type.side}function RR(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let b=o+m.nodeSize;if(m.isText){let w=b;s!w.inline):l.slice();r(m,E,e.forChild(o,m),g),o=b}}function IR(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function DR(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Lf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Gf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,d;if(Yl(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&he.isSelectable(h)&&i.parent&&!(h.isInline&&cR(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new he(s==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let g=0;g{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!nE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function PR(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,qt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&hi<=11&&(r.disabled=!0,r.disabled=!1)}function rE(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(T0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else T0(t)}function T0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function qf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function C0(t){return t.editable&&!t.hasFocus()?!1:iE(t)}function iE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function BR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Pf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function fi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function A0(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fi(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Pf(t.state,e);return i&&i instanceof he?fi(t,i):!1}else if(!(Un&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?he.isSelectable(o)?fi(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):na?fi(t,new le(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return fi(t,new le(e>0?r.$to:r.$from));{let i=Pf(t.state,e);return i?fi(t,i):!1}}}function zl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Xs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Uo(t,e){return e<0?FR(t):HR(t)}function FR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Xs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(oE(n))break;{let l=n.previousSibling;for(;l&&Xs(l,-1);)i=n.parentNode,o=qt(l),l=l.previousSibling;if(l)n=l,r=zl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Bf(t,n,r):i&&Bf(t,i,o)}function HR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=zl(n),o,s;for(;;)if(r{t.state==i&&Hr(t)},50)}function M0(t,e){let n=t.state.doc.resolve(e);if(!(rn||fR)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function N0(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Pf(t.state,e);if(s&&s instanceof he)return fi(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fn?ue.near(s,e):ue.findFrom(s,e);return l?fi(t,l):!1}return!1}function k0(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function O0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function UR(t){if(!pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;O0(t,r,"true"),setTimeout(()=>O0(t,r,"false"),20)}return!1}function WR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function KR(t,e){let n=e.keyCode,r=WR(e);if(n==8||Un&&n==72&&r=="c")return k0(t,-1)||Uo(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return k0(t,1)||Uo(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?M0(t,t.state.selection.from)=="ltr"?-1:1:-1;return A0(t,i,r)||Uo(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?M0(t,t.state.selection.from)=="ltr"?1:-1:1;return A0(t,i,r)||Uo(t,i)}else{if(n==38||Un&&n==80&&r=="c")return N0(t,-1,r)||Uo(t,-1);if(n==40||Un&&n==78&&r=="c")return UR(t)||N0(t,1,r)||Uo(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function sE(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=fE(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=dE[d.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let b=l.createElement(f[g]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:u,text:m,slice:e}}function aE(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let u=e&&(r||o||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,o||r,t)}),o)return e?new Z(K.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:g}=t.state,y=Ir.fromSchema(g);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=s.appendChild(document.createElement("p"));v&&w.appendChild(y.serializeNode(g.text(v,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=YR(n),na&&JR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Rr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!VR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=XR(R0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(GR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let g=l.content.firstChild;h{l=h(l,t)}),l}var VR=/^(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 GR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&cE(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=uE(s[s.length-1],o.length));let f=lE(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return K.from(s)}return t}function lE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,K.from(t));return t}function cE(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function R0(t,e,n){return en})),Sf.createHTML(t)):t}function YR(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=fE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dE[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=qR(t),i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=K.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},ZR={touchstart:!0,touchmove:!0},Hf=class{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function jR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eI(t,r)&&!Yf(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},ZR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),$f(t)}function pi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function QR(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $f(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Yf(t,r))})}function Yf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tI(t,e){!Yf(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fr&&rn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Vo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||KR(t,n)?n.preventDefault():pi(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(hE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Jl(t){return{left:t.clientX,top:t.clientY}}function nI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Jf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ko(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function rI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Ko(t,new he(n),"pointer"),!0):!1}function iI(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(he.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ko(t,he.create(t.state.doc,i),"pointer"),!0):!1}function oI(t,e,n,r,i){return Jf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?iI(t,n):rI(t,n))}function sI(t,e,n,r){return Jf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function aI(t,e,n,r){return Jf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||lI(t,n,r)}function lI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ko(t,le.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Ko(t,le.create(r,l+1,l+1+s.content.size),"pointer");else if(he.isSelectable(s))Ko(t,he.create(r,l),"pointer");else continue;return!0}}function Xf(t){return Ul(t)}var pE=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&nI(n,t.input.lastClick)&&!n[pE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Jl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zf(t,s,n,!!r)):(o=="doubleClick"?sI:aI)(t,s.pos,s.inside,n)?n.preventDefault():pi(t,"pointer"))};var zf=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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)),pi(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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?pi(this.view,"pointer"):oI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&this.mightDrag&&!this.mightDrag.node.isAtom||rn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ko(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pi(this.view,"pointer")}move(e){this.updateAllowDefault(e),pi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),Xf(t),pi(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),pi(t,"pointer")};hn.contextmenu=t=>Xf(t);function hE(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var cI=Fr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ul(t,!0),t.markCursor=null;else if(Ul(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}mE(t,cI)};mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mE(t,20))};function mE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ul(t),e))}function gE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function uI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aR(e.focusNode,e.focusOffset),r=lR(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function dI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ul(t,e=!1){if(!(Fr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gE(t),e||t.docView&&t.docView.dirty){let n=Gf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function fI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var js=wn&&hi<15||Vo&&pR<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=js?null:n.clipboardData,s=r.content(),{dom:l,text:u}=sE(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):fI(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qs(t,r.value,null,i,e):Qs(t,r.textContent,r.innerHTML,i,e)},50)}function Qs(t,e,n,r,i){let o=aE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=pI(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!Fr)return;let r=js?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qs(t,bE(r),r.getData("text/html"),i,n)?n.preventDefault():hI(t,n)};var Wl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},yE=Un?"altKey":"ctrlKey";hn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Jl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=he.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d,slice:f}=sE(t,l);(!n.dataTransfer.files.length||!rn||G0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",js||n.dataTransfer.setData("text/plain",d),t.dragging=new Wl(f,!n[yE],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Jl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",y=>{s=y(s,t)}):s=aE(t,bE(n.dataTransfer),js?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[yE]);if(t.someProp("handleDrop",y=>y(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Il(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:y}=r;y?y.replace(d):d.deleteSelection()}let f=d.mapping.map(u),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let g=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(g));else{let y=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((v,w,S,O)=>y=O),d.setSelection(qf(t,g,d.doc.resolve(y)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Hr(t)},20))};hn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,e)=>{if(rn&&Fr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in mn)hn[t]=mn[t];function ea(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Kl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ea(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=vE(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;in instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let w=v-y-(g-m);for(let S=0;SO+f-h)continue;let L=l[S]+f-h;g>=L?l[S+1]=m<=L?-2:-1:m>=f&&w&&(l[S]+=w,l[S+1]+=w)}h+=w}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),g=m-i,{index:y,offset:v}=r.content.findIndex(h),w=r.maybeChild(y);if(w&&v==h&&v+w.nodeSize==g){let S=l[d+2].mapInner(n,w,f+1,t[d]+o+1,s);S!=nn?(l[d]=h,l[d+1]=g,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=gI(l,t,e,n,i,o,s),f=Gl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=vE(t,l,u+n);if(d){o=!0;let f=Gl(d,l,n+u+1,r);f!=nn&&i.push(u,u+l.nodeSize,f)}});let s=EE(o?wE(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function Tf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nn&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),Vl.from(e)}var bI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yI=wn&&hi<=11,Wf=class{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}},Kf=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),yI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,bI)),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 n=0;nthis.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(C0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(wn&&hi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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 n=new Set,r;for(let o=e.focusNode;o;o=Zs(o))n.add(o);for(let o=e.anchorNode;o;o=Zs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&C0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;fh.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||wI(e,h)!=g)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),EI(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;fi;w--){let S=r.childNodes[w-1],O=S.pmViewDesc;if(S.nodeName=="BR"&&!O){o=w;break}if(!O||O.size)break}let h=t.state.doc,m=t.someProp("domParser")||Rr.fromSchema(t.state.schema),g=h.resolve(s),y=null,v=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:_I,context:g});if(d&&d[0].pos!=null){let w=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=w),y={anchor:w+s,head:S+s}}return{doc:v,sel:y,from:s,to:l}}function _I(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var SI=/^(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 TI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let q=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=Gf(t,q);if(Q&&!t.state.selection.eq(Q)){if(rn&&Fr&&t.input.lastKeyCode===13&&Date.now()-100we(t,Gi(13,"Enter"))))return;let fe=t.state.tr.setSelection(Q);q=="pointer"?fe.setMeta("pointer",!0):q=="key"&&fe.scrollIntoView(),o&&fe.setMeta("composition",o),t.dispatch(fe)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=xI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,g;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Fr)&&i.some(q=>q.nodeType==1&&!SI.test(q.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",q=>q(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&u instanceof le&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))y={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let q=F0(t,t.state.doc,d.sel);if(q&&!q.eq(t.state.selection)){let Q=t.state.tr.setSelection(q);o&&Q.setMeta("composition",o),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?y.start=t.state.selection.from:y.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),wn&&hi<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>d.from&&d.doc.textBetween(y.start-d.from-1,y.start-d.from+1)==" \xA0"&&(y.start--,y.endA--,y.endB--);let v=d.doc.resolveNoCache(y.start-d.from),w=d.doc.resolveNoCache(y.endB-d.from),S=f.resolve(y.start),O=v.sameParent(w)&&v.parent.inlineContent&&S.end()>=y.endA,L;if((Vo&&t.input.lastIOSEnter>Date.now()-225&&(!O||i.some(q=>q.nodeName=="DIV"||q.nodeName=="P"))||!O&&v.posq(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&AI(f,y.start,y.endA,v,w)&&t.someProp("handleKeyDown",q=>q(t,Gi(8,"Backspace")))){Fr&&rn&&t.domObserver.suppressSelectionUpdates();return}rn&&y.endB==y.start&&(t.input.lastChromeDelete=Date.now()),Fr&&!O&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==y.endA&&(y.endB-=2,w=d.doc.resolveNoCache(y.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(q){return q(t,Gi(13,"Enter"))})},20));let T=y.start,B=y.endA,R,Y,ne;if(O){if(v.pos==w.pos)wn&&hi<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),R=t.state.tr.delete(T,B),Y=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(ne=CI(v.parent.content.cut(v.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,y.endA-S.start()))))R=t.state.tr,ne.type=="add"?R.addMark(T,B,ne.mark):R.removeMark(T,B,ne.mark);else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let q=v.parent.textBetween(v.parentOffset,w.parentOffset);if(t.someProp("handleTextInput",Q=>Q(t,T,B,q)))return;R=t.state.tr.insertText(q,T,B)}}if(R||(R=t.state.tr.replace(T,B,d.doc.slice(y.start-d.from,y.endB-d.from))),d.sel){let q=F0(t,R.doc,d.sel);q&&!(rn&&t.composing&&q.empty&&(y.start!=y.endB||t.input.lastChromeDeletee.content.size?null:qf(t,e.resolve(n.anchor),e.resolve(n.head))}function CI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;fn||Cf(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function MI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var ql=class{constructor(e,n){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 Hf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(K0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=U0(this),z0(this),this.nodeViews=W0(this),this.docView=v0(this.state.doc,$0(this),Tf(this),this.dom,this),this.domObserver=new Kf(this,(r,i,o,s)=>TI(this,r,i,o,s)),this.domObserver.start(),jR(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$f(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(K0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(gE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=W0(this);kI(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&$f(this),this.editable=U0(this),z0(this);let u=Tf(this),d=$0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&gR(this);if(s){this.domObserver.stop();let g=h&&(wn||rn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&NI(i.selection,e.selection);if(h){let y=rn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=uI(this)),(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=v0(e.doc,d,u,this.dom,this)),y&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BR(this))?Hr(this,g):(rE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&bR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&h0(this,n.getBoundingClientRect(),e)}else h0(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Wl(e.slice,e.move,i<0?void 0:he.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _R(this,e)}coordsAtPos(e,n=1){return Z0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return MR(this,n||this.state,e)}pasteHTML(e,n){return Qs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qs(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(QR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Tf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,oR())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tI(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?pn&&this.root.nodeType===11&&uR(this.dom.ownerDocument)==this.dom&&vI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function $0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[wt.node(0,t.state.doc.content.size,e)]}function z0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:wt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function U0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function NI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function W0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function kI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function K0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}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:"'"},Zl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OI=typeof navigator<"u"&&/Mac/.test(navigator.platform),RI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(At=0;At<10;At++)$r[48+At]=$r[96+At]=String(At);var At;for(At=1;At<=24;At++)$r[At+111]="F"+At;var At;for(At=65;At<=90;At++)$r[At]=String.fromCharCode(At+32),Zl[At]=String.fromCharCode(At);var At;for(Xl in $r)Zl.hasOwnProperty(Xl)||(Zl[Xl]=$r[Xl]);var Xl;function xE(t){var e=OI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||RI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Zl:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var II=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=$r[r.keyCode])&&o!=i){let l=e[jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var jl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function TE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ep=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);if(!i){let s=r.blockRange(),l=s&&Lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(DE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(qo(o,"end")||he.isSelectable(o)))for(let s=r.depth;;s--){let l=Gs(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},CE=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);return i?ME(t,i,e):!1},AE=(t,e,n)=>{let r=NE(t,n);if(!r)return!1;let i=op(r);return i?ME(t,i,e):!1};function ME(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Gs(t.doc,o,u,Z.empty);if(!d||d.from!=o||d instanceof tn&&d.slice.size>=u-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(le.create(f.doc,o)),n(f.scrollIntoView())}return!0}function qo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var tp=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=np(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function np(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=NE(t,n);if(!r)return!1;let i=op(r);if(!i)return!1;let o=i.nodeAfter;if(DE(t,i,e,1))return!0;if(r.parent.content.size==0&&(qo(o,"start")||he.isSelectable(o))){let s=Gs(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,i;if(r){if(n.node.isTextblock||!rr(t.doc,n.from))return!1;i=n.from}else if(i=Fo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OE=(t,e)=>{let n=t.selection,r;if(n instanceof he){if(n.node.isTextblock||!rr(t.doc,n.to))return!1;r=n.to}else if(r=Fo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},RE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},sp=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function ap(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ap(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},cp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ap(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function PI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,u=!1,d=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),d=r.start(g)==r.pos-(r.depth-g),l=ap(r.node(g-1).contentMatchAt(r.indexAfter(g-1)));let v=t&&t(i.parent,u,r);o.unshift(v||(u&&l?{type:l}:null)),s=g;break}else{if(g==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof le||e.selection instanceof fn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=zn(f.doc,h,o.length,o);if(m||(o[0]=l?{type:l}:null,m=zn(f.doc,h,o.length,o)),f.split(h,o.length,o),!u&&d&&r.node(s).type!=l){let g=f.mapping.map(r.before(s)),y=f.doc.resolve(g);l&&r.node(s-1).canReplaceWith(y.index(),y.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(s)),l)}return n&&n(f.scrollIntoView()),!0}}var BI=PI();var IE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(he.create(t.doc,i))),!0)},FI=(t,e)=>(e&&e(t.tr.setSelection(new fn(t.doc))),!0);function HI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function DE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&HI(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let g=e.pos+o.nodeSize,y=K.empty;for(let S=s.length-1;S>=0;S--)y=K.from(s[S].create(null,y));y=K.from(i.copy(y));let v=t.tr.step(new Ct(e.pos-1,g,e.pos,g,new Z(y,1,0),s.length,!0)),w=v.doc.resolve(g+2*s.length);w.nodeAfter&&w.nodeAfter.type==i.type&&rr(v.doc,w.pos)&&v.join(w.pos),n(v.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Lr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&qo(o,"start",!0)&&qo(i,"end")){let g=i,y=[];for(;y.push(g),!g.isTextblock;)g=g.lastChild;let v=o,w=1;for(;!v.isTextblock;v=v.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,v.content)){if(n){let S=K.empty;for(let L=y.length-1;L>=0;L--)S=K.from(y[L].copy(S));let O=t.tr.step(new Ct(e.pos-y.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new Z(S,y.length,0),0,!0));n(O.scrollIntoView())}return!0}}return!1}function LE(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var dp=LE(-1),fp=LE(1);function PE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Bo(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function pp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=s.resolve(e.start-2);o=new Ui(u,u,e.depth),e.endIndex=0;f--)o=K.from(n[f].type.create(n[f].attrs,o));t.step(new Ct(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?WI(e,n,t,o):KI(e,n,o):!0:!1}}function WI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);ov;y--)g-=i.child(y).nodeSize,r.delete(g-1,g+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(u?K.empty:K.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Ct(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?K.empty:K.from(i.copy(K.empty))).append(u?K.empty:K.from(i.copy(K.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function HE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=K.from(d?t.create():null),h=new Z(K.from(t.create(null,K.from(l.type.create(null,f)))),d?3:1,0),m=o.start,g=o.end;n(e.tr.step(new Ct(m-(d?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}function ac(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Yo=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{let h=u(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,d=e||o.tr,f=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,g])=>[m,(...v)=>{let w=this.buildProps(d,n),S=g(...v)(w);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ac({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...f)=>d(...f)(l)]))}};return l}},yp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){let r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}};function re(t,e,n){return t.config[e]===void 0&&t.parent?re(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?re(t.parent,e,n):null}):t.config[e]}function lc(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function qE(t){let e=[],{nodeExtensions:n,markExtensions:r}=lc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},u=re(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,g])=>{e.push({type:h,name:m,attribute:{...o,...g}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=re(s,"addAttributes",l);if(!u)return;let d=u();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function Ut(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ee(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){let l=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),l.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Ep(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ee(n,r),{})}function YE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return YE(t)?e?t.bind(e)(...n):t(...n):t}function VI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function $E(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):GI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function zE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&VI(n)?!1:n!=null))}function qI(t,e){var n;let r=qE(t),{nodeExtensions:i,markExtensions:o}=lc(t),s=(n=i.find(d=>re(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,O)=>{let L=re(O,"extendNodeSchema",h);return{...S,...L?L(d):{}}},{}),g=zE({...m,content:Te(re(d,"content",h)),marks:Te(re(d,"marks",h)),group:Te(re(d,"group",h)),inline:Te(re(d,"inline",h)),atom:Te(re(d,"atom",h)),selectable:Te(re(d,"selectable",h)),draggable:Te(re(d,"draggable",h)),code:Te(re(d,"code",h)),whitespace:Te(re(d,"whitespace",h)),linebreakReplacement:Te(re(d,"linebreakReplacement",h)),defining:Te(re(d,"defining",h)),isolating:Te(re(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var O;return[S.name,{default:(O=S?.attribute)===null||O===void 0?void 0:O.default}]}))}),y=Te(re(d,"parseHTML",h));y&&(g.parseDOM=y.map(S=>$E(S,f)));let v=re(d,"renderHTML",h);v&&(g.toDOM=S=>v({node:S,HTMLAttributes:Ep(S,f)}));let w=re(d,"renderText",h);return w&&(g.toText=w),[d.name,g]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(w=>w.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((w,S)=>{let O=re(S,"extendMarkSchema",h);return{...w,...O?O(d):{}}},{}),g=zE({...m,inclusive:Te(re(d,"inclusive",h)),excludes:Te(re(d,"excludes",h)),group:Te(re(d,"group",h)),spanning:Te(re(d,"spanning",h)),code:Te(re(d,"code",h)),attrs:Object.fromEntries(f.map(w=>{var S;return[w.name,{default:(S=w?.attribute)===null||S===void 0?void 0:S.default}]}))}),y=Te(re(d,"parseHTML",h));y&&(g.parseDOM=y.map(w=>$E(w,f)));let v=re(d,"renderHTML",h);return v&&(g.toDOM=w=>v({mark:w,HTMLAttributes:Ep(w,f)})),[d.name,g]}));return new Bs({topNode:s,nodes:l,marks:u})}function mp(t,e){return e.nodes[t]||e.marks[t]||null}function UE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tp(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}var YI=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,d;let f=((d=(u=i.type.spec).toText)===null||d===void 0?void 0:d.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function Cp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Jo=class{constructor(e){this.find=e.find,this.handler=e.handler}},JI=(t,e)=>{if(Cp(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ql(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;let d=u.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=YI(d)+o;return s.forEach(m=>{if(f)return;let g=JI(h,m.find);if(!g)return;let y=u.state.tr,v=ac({state:u.state,transaction:y}),w={from:r-(g[0].length-o.length),to:i},{commands:S,chain:O,can:L}=new Yo({editor:n,state:v});m.handler({state:v,range:w,match:g,commands:S,chain:O,can:L})===null||!y.steps.length||(y.setMeta(l,{transform:y,from:r,to:i,text:o}),u.dispatch(y),f=!0)}),f}function XI(t){let{editor:e,rules:n}=t,r=new Oe({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Tp(K.from(f),s.schema);let{from:h}=u,m=h+f.length;Ql({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Ql({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Ql({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Ql({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZI(t){return Object.prototype.toString.call(t).slice(8,-1)}function ec(t){return ZI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function cc(t,e){let n={...t};return ec(t)&&ec(e)&&Object.keys(e).forEach(r=>{ec(e[r])&&ec(t[r])?n[r]=cc(t[r],e[r]):n[r]=e[r]}),n}var st=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let u=s.find(d=>d?.type.name===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}};function jI(t){return typeof t=="number"}var vp=class{constructor(e){this.find=e.find,this.handler=e.handler}},QI=(t,e,n)=>{if(Cp(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function eD(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Yo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,y)=>{if(!g.isTextblock||g.type.spec.code)return;let v=Math.max(r,y),w=Math.min(i,y+g.content.size),S=g.textBetween(v-y,w-y,void 0,"\uFFFC");QI(S,o.find,s).forEach(L=>{if(L.index===void 0)return;let T=v+L.index+1,B=T+L[0].length,R={from:n.tr.mapping.map(T),to:n.tr.mapping.map(B)},Y=o.handler({state:n,range:R,match:L,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(g=>g!==null)}var tc=null,tD=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function nD(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let u=({state:f,from:h,to:m,rule:g,pasteEvt:y})=>{let v=f.tr,w=ac({state:f,transaction:v});if(!(!eD({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:y,dropEvent:l})||!v.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return n.map(f=>new Oe({view(h){let m=y=>{var v;r=!((v=h.dom.parentElement)===null||v===void 0)&&v.contains(y.target)?h.dom.parentElement:null,r&&(tc=e)},g=()=>{tc&&(tc=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,l=m,!o){let g=tc;g&&setTimeout(()=>{let y=g.state.selection;y&&g.commands.deleteRange({from:y.from,to:y.to})},10)}return!1},paste:(h,m)=>{var g;let y=(g=m.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=m,i=!!y?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,g)=>{let y=h[0],v=y.getMeta("uiEvent")==="paste"&&!i,w=y.getMeta("uiEvent")==="drop"&&!o,S=y.getMeta("applyPasteRules"),O=!!S;if(!v&&!w&&!O)return;if(O){let{text:B}=S;typeof B=="string"?B=B:B=Tp(K.from(B),g.schema);let{from:R}=S,Y=R+B.length,ne=tD(B);return u({rule:f,state:g,from:R,to:{b:Y},pasteEvt:ne})}let L=m.doc.content.findDiffStart(g.doc.content),T=m.doc.content.findDiffEnd(g.doc.content);if(!(!jI(L)||!T||L===T.b))return u({rule:f,state:g,from:L,to:T,pasteEvt:s})}}))}function rD(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var wp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=qI(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=rD(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=re(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=re(r,"priority")||100,s=re(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:mp(n.name,this.schema)},i=re(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:mp(s.name,this.schema)},u=[],d=re(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&re(s,"exitable",l)&&(f.ArrowRight=()=>st.handleExit({editor:e,mark:s})),d){let v=Object.fromEntries(Object.entries(d()).map(([w,S])=>[w,()=>S({editor:e})]));f={...f,...v}}let h=_E(f);u.push(h);let m=re(s,"addInputRules",l);UE(s,e.options.enableInputRules)&&m&&r.push(...m());let g=re(s,"addPasteRules",l);UE(s,e.options.enablePasteRules)&&g&&i.push(...g());let y=re(s,"addProseMirrorPlugins",l);if(y){let v=y();u.push(...v)}return u}).flat();return[XI({editor:e,rules:r}),...nD({editor:e,rules:i}),...o]}get attributes(){return qE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=lc(this.extensions);return Object.fromEntries(n.filter(r=>!!re(r,"addNodeView")).map(r=>{let i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ut(r.name,this.schema)},s=re(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h,m)=>{let g=Ep(u,i);return s()({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:g})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:mp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(re(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=re(e,"onBeforeCreate",r),o=re(e,"onCreate",r),s=re(e,"onUpdate",r),l=re(e,"onSelectionUpdate",r),u=re(e,"onTransaction",r),d=re(e,"onFocus",r),f=re(e,"onBlur",r),h=re(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},We=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function JE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` +`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:g}=t.state,b=Ir.fromSchema(g);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let w=s.appendChild(document.createElement("p"));E&&w.appendChild(b.serializeNode(g.text(E,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=YR(n),na&&JR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Rr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!VR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=XR(R0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(GR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let g=l.content.firstChild;h{l=h(l,t)}),l}var VR=/^(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 GR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&cE(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=uE(s[s.length-1],o.length));let f=lE(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return K.from(s)}return t}function lE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,K.from(t));return t}function cE(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function R0(t,e,n){return en})),Sf.createHTML(t)):t}function YR(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=fE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dE[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=qR(t),i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=K.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},ZR={touchstart:!0,touchmove:!0},Hf=class{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function jR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eI(t,r)&&!Yf(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},ZR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),$f(t)}function pi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function QR(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $f(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Yf(t,r))})}function Yf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tI(t,e){!Yf(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fr&&rn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Vo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||KR(t,n)?n.preventDefault():pi(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(hE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Jl(t){return{left:t.clientX,top:t.clientY}}function nI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Jf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ko(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function rI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Ko(t,new he(n),"pointer"),!0):!1}function iI(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(he.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ko(t,he.create(t.state.doc,i),"pointer"),!0):!1}function oI(t,e,n,r,i){return Jf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?iI(t,n):rI(t,n))}function sI(t,e,n,r){return Jf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function aI(t,e,n,r){return Jf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||lI(t,n,r)}function lI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ko(t,le.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Ko(t,le.create(r,l+1,l+1+s.content.size),"pointer");else if(he.isSelectable(s))Ko(t,he.create(r,l),"pointer");else continue;return!0}}function Xf(t){return Ul(t)}var pE=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&nI(n,t.input.lastClick)&&!n[pE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Jl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zf(t,s,n,!!r)):(o=="doubleClick"?sI:aI)(t,s.pos,s.inside,n)?n.preventDefault():pi(t,"pointer"))};var zf=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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)),pi(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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?pi(this.view,"pointer"):oI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&this.mightDrag&&!this.mightDrag.node.isAtom||rn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ko(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pi(this.view,"pointer")}move(e){this.updateAllowDefault(e),pi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),Xf(t),pi(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),pi(t,"pointer")};hn.contextmenu=t=>Xf(t);function hE(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var cI=Fr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ul(t,!0),t.markCursor=null;else if(Ul(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}mE(t,cI)};mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mE(t,20))};function mE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ul(t),e))}function gE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function uI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aR(e.focusNode,e.focusOffset),r=lR(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function dI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ul(t,e=!1){if(!(Fr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gE(t),e||t.docView&&t.docView.dirty){let n=Gf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function fI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var js=wn&&hi<15||Vo&&pR<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=js?null:n.clipboardData,s=r.content(),{dom:l,text:u}=sE(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):fI(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qs(t,r.value,null,i,e):Qs(t,r.textContent,r.innerHTML,i,e)},50)}function Qs(t,e,n,r,i){let o=aE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=pI(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!Fr)return;let r=js?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qs(t,bE(r),r.getData("text/html"),i,n)?n.preventDefault():hI(t,n)};var Wl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},yE=Un?"altKey":"ctrlKey";hn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Jl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=he.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d,slice:f}=sE(t,l);(!n.dataTransfer.files.length||!rn||G0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",js||n.dataTransfer.setData("text/plain",d),t.dragging=new Wl(f,!n[yE],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Jl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=aE(t,bE(n.dataTransfer),js?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[yE]);if(t.someProp("handleDrop",b=>b(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Il(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:b}=r;b?b.replace(d):d.deleteSelection()}let f=d.mapping.map(u),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let g=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(g));else{let b=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((E,w,S,N)=>b=N),d.setSelection(qf(t,g,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Hr(t)},20))};hn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,e)=>{if(rn&&Fr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in mn)hn[t]=mn[t];function ea(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Kl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ea(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=vE(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;in instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let w=E-b-(g-m);for(let S=0;SN+f-h)continue;let D=l[S]+f-h;g>=D?l[S+1]=m<=D?-2:-1:m>=f&&w&&(l[S]+=w,l[S+1]+=w)}h+=w}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),g=m-i,{index:b,offset:E}=r.content.findIndex(h),w=r.maybeChild(b);if(w&&E==h&&E+w.nodeSize==g){let S=l[d+2].mapInner(n,w,f+1,t[d]+o+1,s);S!=nn?(l[d]=h,l[d+1]=g,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=gI(l,t,e,n,i,o,s),f=Gl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=vE(t,l,u+n);if(d){o=!0;let f=Gl(d,l,n+u+1,r);f!=nn&&i.push(u,u+l.nodeSize,f)}});let s=EE(o?wE(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function Tf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nn&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),Vl.from(e)}var bI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yI=wn&&hi<=11,Wf=class{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}},Kf=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),yI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,bI)),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 n=0;nthis.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(C0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(wn&&hi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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 n=new Set,r;for(let o=e.focusNode;o;o=Zs(o))n.add(o);for(let o=e.anchorNode;o;o=Zs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&C0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;fh.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||wI(e,h)!=g)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),EI(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;fi;w--){let S=r.childNodes[w-1],N=S.pmViewDesc;if(S.nodeName=="BR"&&!N){o=w;break}if(!N||N.size)break}let h=t.state.doc,m=t.someProp("domParser")||Rr.fromSchema(t.state.schema),g=h.resolve(s),b=null,E=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:_I,context:g});if(d&&d[0].pos!=null){let w=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=w),b={anchor:w+s,head:S+s}}return{doc:E,sel:b,from:s,to:l}}function _I(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var SI=/^(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 TI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let q=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=Gf(t,q);if(Q&&!t.state.selection.eq(Q)){if(rn&&Fr&&t.input.lastKeyCode===13&&Date.now()-100we(t,Gi(13,"Enter"))))return;let fe=t.state.tr.setSelection(Q);q=="pointer"?fe.setMeta("pointer",!0):q=="key"&&fe.scrollIntoView(),o&&fe.setMeta("composition",o),t.dispatch(fe)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=xI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,g;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Fr)&&i.some(q=>q.nodeType==1&&!SI.test(q.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",q=>q(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof le&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let q=F0(t,t.state.doc,d.sel);if(q&&!q.eq(t.state.selection)){let Q=t.state.tr.setSelection(q);o&&Q.setMeta("composition",o),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?b.start=t.state.selection.from:b.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),wn&&hi<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>d.from&&d.doc.textBetween(b.start-d.from-1,b.start-d.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);let E=d.doc.resolveNoCache(b.start-d.from),w=d.doc.resolveNoCache(b.endB-d.from),S=f.resolve(b.start),N=E.sameParent(w)&&E.parent.inlineContent&&S.end()>=b.endA,D;if((Vo&&t.input.lastIOSEnter>Date.now()-225&&(!N||i.some(q=>q.nodeName=="DIV"||q.nodeName=="P"))||!N&&E.posq(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&AI(f,b.start,b.endA,E,w)&&t.someProp("handleKeyDown",q=>q(t,Gi(8,"Backspace")))){Fr&&rn&&t.domObserver.suppressSelectionUpdates();return}rn&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),Fr&&!N&&E.start()!=w.start()&&w.parentOffset==0&&E.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==b.endA&&(b.endB-=2,w=d.doc.resolveNoCache(b.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(q){return q(t,Gi(13,"Enter"))})},20));let T=b.start,B=b.endA,R,Y,ne;if(N){if(E.pos==w.pos)wn&&hi<=11&&E.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),R=t.state.tr.delete(T,B),Y=f.resolve(b.start).marksAcross(f.resolve(b.endA));else if(b.endA==b.endB&&(ne=CI(E.parent.content.cut(E.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start()))))R=t.state.tr,ne.type=="add"?R.addMark(T,B,ne.mark):R.removeMark(T,B,ne.mark);else if(E.parent.child(E.index()).isText&&E.index()==w.index()-(w.textOffset?0:1)){let q=E.parent.textBetween(E.parentOffset,w.parentOffset);if(t.someProp("handleTextInput",Q=>Q(t,T,B,q)))return;R=t.state.tr.insertText(q,T,B)}}if(R||(R=t.state.tr.replace(T,B,d.doc.slice(b.start-d.from,b.endB-d.from))),d.sel){let q=F0(t,R.doc,d.sel);q&&!(rn&&t.composing&&q.empty&&(b.start!=b.endB||t.input.lastChromeDeletee.content.size?null:qf(t,e.resolve(n.anchor),e.resolve(n.head))}function CI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;fn||Cf(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function MI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var ql=class{constructor(e,n){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 Hf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(K0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=U0(this),z0(this),this.nodeViews=W0(this),this.docView=v0(this.state.doc,$0(this),Tf(this),this.dom,this),this.domObserver=new Kf(this,(r,i,o,s)=>TI(this,r,i,o,s)),this.domObserver.start(),jR(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$f(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(K0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(gE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=W0(this);kI(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&$f(this),this.editable=U0(this),z0(this);let u=Tf(this),d=$0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&gR(this);if(s){this.domObserver.stop();let g=h&&(wn||rn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&NI(i.selection,e.selection);if(h){let b=rn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=uI(this)),(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=v0(e.doc,d,u,this.dom,this)),b&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BR(this))?Hr(this,g):(rE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&bR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&h0(this,n.getBoundingClientRect(),e)}else h0(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Wl(e.slice,e.move,i<0?void 0:he.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _R(this,e)}coordsAtPos(e,n=1){return Z0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return MR(this,n||this.state,e)}pasteHTML(e,n){return Qs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qs(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(QR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Tf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,oR())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tI(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?pn&&this.root.nodeType===11&&uR(this.dom.ownerDocument)==this.dom&&vI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function $0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[wt.node(0,t.state.doc.content.size,e)]}function z0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:wt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function U0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function NI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function W0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function kI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function K0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}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:"'"},Zl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OI=typeof navigator<"u"&&/Mac/.test(navigator.platform),RI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(At=0;At<10;At++)$r[48+At]=$r[96+At]=String(At);var At;for(At=1;At<=24;At++)$r[At+111]="F"+At;var At;for(At=65;At<=90;At++)$r[At]=String.fromCharCode(At+32),Zl[At]=String.fromCharCode(At);var At;for(Xl in $r)Zl.hasOwnProperty(Xl)||(Zl[Xl]=$r[Xl]);var Xl;function xE(t){var e=OI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||RI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Zl:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var II=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=$r[r.keyCode])&&o!=i){let l=e[jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var jl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function TE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ep=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);if(!i){let s=r.blockRange(),l=s&&Lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(DE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(qo(o,"end")||he.isSelectable(o)))for(let s=r.depth;;s--){let l=Gs(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},CE=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);return i?ME(t,i,e):!1},AE=(t,e,n)=>{let r=NE(t,n);if(!r)return!1;let i=op(r);return i?ME(t,i,e):!1};function ME(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Gs(t.doc,o,u,Z.empty);if(!d||d.from!=o||d instanceof tn&&d.slice.size>=u-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(le.create(f.doc,o)),n(f.scrollIntoView())}return!0}function qo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var tp=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=np(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function np(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=NE(t,n);if(!r)return!1;let i=op(r);if(!i)return!1;let o=i.nodeAfter;if(DE(t,i,e,1))return!0;if(r.parent.content.size==0&&(qo(o,"start")||he.isSelectable(o))){let s=Gs(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,i;if(r){if(n.node.isTextblock||!rr(t.doc,n.from))return!1;i=n.from}else if(i=Fo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OE=(t,e)=>{let n=t.selection,r;if(n instanceof he){if(n.node.isTextblock||!rr(t.doc,n.to))return!1;r=n.to}else if(r=Fo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},RE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},sp=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function ap(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ap(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},cp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ap(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function PI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,u=!1,d=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),d=r.start(g)==r.pos-(r.depth-g),l=ap(r.node(g-1).contentMatchAt(r.indexAfter(g-1)));let E=t&&t(i.parent,u,r);o.unshift(E||(u&&l?{type:l}:null)),s=g;break}else{if(g==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof le||e.selection instanceof fn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=zn(f.doc,h,o.length,o);if(m||(o[0]=l?{type:l}:null,m=zn(f.doc,h,o.length,o)),f.split(h,o.length,o),!u&&d&&r.node(s).type!=l){let g=f.mapping.map(r.before(s)),b=f.doc.resolve(g);l&&r.node(s-1).canReplaceWith(b.index(),b.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(s)),l)}return n&&n(f.scrollIntoView()),!0}}var BI=PI();var IE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(he.create(t.doc,i))),!0)},FI=(t,e)=>(e&&e(t.tr.setSelection(new fn(t.doc))),!0);function HI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function DE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&HI(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let g=e.pos+o.nodeSize,b=K.empty;for(let S=s.length-1;S>=0;S--)b=K.from(s[S].create(null,b));b=K.from(i.copy(b));let E=t.tr.step(new Ct(e.pos-1,g,e.pos,g,new Z(b,1,0),s.length,!0)),w=E.doc.resolve(g+2*s.length);w.nodeAfter&&w.nodeAfter.type==i.type&&rr(E.doc,w.pos)&&E.join(w.pos),n(E.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Lr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&qo(o,"start",!0)&&qo(i,"end")){let g=i,b=[];for(;b.push(g),!g.isTextblock;)g=g.lastChild;let E=o,w=1;for(;!E.isTextblock;E=E.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,E.content)){if(n){let S=K.empty;for(let D=b.length-1;D>=0;D--)S=K.from(b[D].copy(S));let N=t.tr.step(new Ct(e.pos-b.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new Z(S,b.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function LE(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var dp=LE(-1),fp=LE(1);function PE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Bo(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function pp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=s.resolve(e.start-2);o=new Ui(u,u,e.depth),e.endIndex=0;f--)o=K.from(n[f].type.create(n[f].attrs,o));t.step(new Ct(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?WI(e,n,t,o):KI(e,n,o):!0:!1}}function WI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);oE;b--)g-=i.child(b).nodeSize,r.delete(g-1,g+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(u?K.empty:K.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Ct(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?K.empty:K.from(i.copy(K.empty))).append(u?K.empty:K.from(i.copy(K.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function HE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=K.from(d?t.create():null),h=new Z(K.from(t.create(null,K.from(l.type.create(null,f)))),d?3:1,0),m=o.start,g=o.end;n(e.tr.step(new Ct(m-(d?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}function ac(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Yo=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{let h=u(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,d=e||o.tr,f=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,g])=>[m,(...E)=>{let w=this.buildProps(d,n),S=g(...E)(w);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ac({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...f)=>d(...f)(l)]))}};return l}},yp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){let r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}};function re(t,e,n){return t.config[e]===void 0&&t.parent?re(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?re(t.parent,e,n):null}):t.config[e]}function lc(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function qE(t){let e=[],{nodeExtensions:n,markExtensions:r}=lc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},u=re(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,g])=>{e.push({type:h,name:m,attribute:{...o,...g}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=re(s,"addAttributes",l);if(!u)return;let d=u();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function Ut(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ee(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){let l=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),l.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Ep(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ee(n,r),{})}function YE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return YE(t)?e?t.bind(e)(...n):t(...n):t}function VI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function $E(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):GI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function zE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&VI(n)?!1:n!=null))}function qI(t,e){var n;let r=qE(t),{nodeExtensions:i,markExtensions:o}=lc(t),s=(n=i.find(d=>re(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,N)=>{let D=re(N,"extendNodeSchema",h);return{...S,...D?D(d):{}}},{}),g=zE({...m,content:Te(re(d,"content",h)),marks:Te(re(d,"marks",h)),group:Te(re(d,"group",h)),inline:Te(re(d,"inline",h)),atom:Te(re(d,"atom",h)),selectable:Te(re(d,"selectable",h)),draggable:Te(re(d,"draggable",h)),code:Te(re(d,"code",h)),whitespace:Te(re(d,"whitespace",h)),linebreakReplacement:Te(re(d,"linebreakReplacement",h)),defining:Te(re(d,"defining",h)),isolating:Te(re(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var N;return[S.name,{default:(N=S?.attribute)===null||N===void 0?void 0:N.default}]}))}),b=Te(re(d,"parseHTML",h));b&&(g.parseDOM=b.map(S=>$E(S,f)));let E=re(d,"renderHTML",h);E&&(g.toDOM=S=>E({node:S,HTMLAttributes:Ep(S,f)}));let w=re(d,"renderText",h);return w&&(g.toText=w),[d.name,g]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(w=>w.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((w,S)=>{let N=re(S,"extendMarkSchema",h);return{...w,...N?N(d):{}}},{}),g=zE({...m,inclusive:Te(re(d,"inclusive",h)),excludes:Te(re(d,"excludes",h)),group:Te(re(d,"group",h)),spanning:Te(re(d,"spanning",h)),code:Te(re(d,"code",h)),attrs:Object.fromEntries(f.map(w=>{var S;return[w.name,{default:(S=w?.attribute)===null||S===void 0?void 0:S.default}]}))}),b=Te(re(d,"parseHTML",h));b&&(g.parseDOM=b.map(w=>$E(w,f)));let E=re(d,"renderHTML",h);return E&&(g.toDOM=w=>E({mark:w,HTMLAttributes:Ep(w,f)})),[d.name,g]}));return new Bs({topNode:s,nodes:l,marks:u})}function mp(t,e){return e.nodes[t]||e.marks[t]||null}function UE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tp(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}var YI=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,d;let f=((d=(u=i.type.spec).toText)===null||d===void 0?void 0:d.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function Cp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Jo=class{constructor(e){this.find=e.find,this.handler=e.handler}},JI=(t,e)=>{if(Cp(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ql(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;let d=u.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=YI(d)+o;return s.forEach(m=>{if(f)return;let g=JI(h,m.find);if(!g)return;let b=u.state.tr,E=ac({state:u.state,transaction:b}),w={from:r-(g[0].length-o.length),to:i},{commands:S,chain:N,can:D}=new Yo({editor:n,state:E});m.handler({state:E,range:w,match:g,commands:S,chain:N,can:D})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:i,text:o}),u.dispatch(b),f=!0)}),f}function XI(t){let{editor:e,rules:n}=t,r=new Oe({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Tp(K.from(f),s.schema);let{from:h}=u,m=h+f.length;Ql({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Ql({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Ql({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Ql({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZI(t){return Object.prototype.toString.call(t).slice(8,-1)}function ec(t){return ZI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function cc(t,e){let n={...t};return ec(t)&&ec(e)&&Object.keys(e).forEach(r=>{ec(e[r])&&ec(t[r])?n[r]=cc(t[r],e[r]):n[r]=e[r]}),n}var st=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let u=s.find(d=>d?.type.name===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}};function jI(t){return typeof t=="number"}var vp=class{constructor(e){this.find=e.find,this.handler=e.handler}},QI=(t,e,n)=>{if(Cp(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function eD(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Yo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,b)=>{if(!g.isTextblock||g.type.spec.code)return;let E=Math.max(r,b),w=Math.min(i,b+g.content.size),S=g.textBetween(E-b,w-b,void 0,"\uFFFC");QI(S,o.find,s).forEach(D=>{if(D.index===void 0)return;let T=E+D.index+1,B=T+D[0].length,R={from:n.tr.mapping.map(T),to:n.tr.mapping.map(B)},Y=o.handler({state:n,range:R,match:D,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(g=>g!==null)}var tc=null,tD=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function nD(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let u=({state:f,from:h,to:m,rule:g,pasteEvt:b})=>{let E=f.tr,w=ac({state:f,transaction:E});if(!(!eD({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:b,dropEvent:l})||!E.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(f=>new Oe({view(h){let m=b=>{var E;r=!((E=h.dom.parentElement)===null||E===void 0)&&E.contains(b.target)?h.dom.parentElement:null,r&&(tc=e)},g=()=>{tc&&(tc=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,l=m,!o){let g=tc;g&&setTimeout(()=>{let b=g.state.selection;b&&g.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(h,m)=>{var g;let b=(g=m.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=m,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,g)=>{let b=h[0],E=b.getMeta("uiEvent")==="paste"&&!i,w=b.getMeta("uiEvent")==="drop"&&!o,S=b.getMeta("applyPasteRules"),N=!!S;if(!E&&!w&&!N)return;if(N){let{text:B}=S;typeof B=="string"?B=B:B=Tp(K.from(B),g.schema);let{from:R}=S,Y=R+B.length,ne=tD(B);return u({rule:f,state:g,from:R,to:{b:Y},pasteEvt:ne})}let D=m.doc.content.findDiffStart(g.doc.content),T=m.doc.content.findDiffEnd(g.doc.content);if(!(!jI(D)||!T||D===T.b))return u({rule:f,state:g,from:D,to:T,pasteEvt:s})}}))}function rD(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var wp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=qI(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=rD(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=re(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=re(r,"priority")||100,s=re(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:mp(n.name,this.schema)},i=re(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:mp(s.name,this.schema)},u=[],d=re(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&re(s,"exitable",l)&&(f.ArrowRight=()=>st.handleExit({editor:e,mark:s})),d){let E=Object.fromEntries(Object.entries(d()).map(([w,S])=>[w,()=>S({editor:e})]));f={...f,...E}}let h=_E(f);u.push(h);let m=re(s,"addInputRules",l);UE(s,e.options.enableInputRules)&&m&&r.push(...m());let g=re(s,"addPasteRules",l);UE(s,e.options.enablePasteRules)&&g&&i.push(...g());let b=re(s,"addProseMirrorPlugins",l);if(b){let E=b();u.push(...E)}return u}).flat();return[XI({editor:e,rules:r}),...nD({editor:e,rules:i}),...o]}get attributes(){return qE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=lc(this.extensions);return Object.fromEntries(n.filter(r=>!!re(r,"addNodeView")).map(r=>{let i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ut(r.name,this.schema)},s=re(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h,m)=>{let g=Ep(u,i);return s()({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:g})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:mp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(re(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=re(e,"onBeforeCreate",r),o=re(e,"onCreate",r),s=re(e,"onUpdate",r),l=re(e,"onSelectionUpdate",r),u=re(e,"onTransaction",r),d=re(e,"onFocus",r),f=re(e,"onBlur",r),h=re(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},We=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function JE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=o);let g=s?.[u.type.name];if(g)return f&&(l+=g({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function uc(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var iD=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Oe({key:new ze("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),u=uc(n);return JE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),oD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),sD=(t=!1)=>({commands:e})=>e.setContent("",t),aD=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),g=h.blockRange(m);if(!g)return;let y=Lr(g);if(l.type.isTextblock){let{defaultType:v}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,v)}(y||y===0)&&e.lift(g,y)})}),!0},lD=t=>e=>t(e),cD=()=>({state:t,dispatch:e})=>cp(t,e),uD=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},dD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},fD=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let u=o.before(s),d=o.after(s);e.delete(u,d).scrollIntoView()}return!0}return!1},pD=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},hD=()=>({state:t,dispatch:e})=>jl(t,e),mD=()=>({commands:t})=>t.keyboardShortcut("Enter"),gD=()=>({state:t,dispatch:e})=>lp(t,e);function ic(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function XE(t,e,n={}){return t.find(r=>r.type===e&&ic(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function WE(t,e,n={}){return!!XE(t,e,n)}function Ap(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!XE([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,u=s+1,d=l+i.node.nodeSize;for(;s>0&&WE([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;u({tr:n,state:r,dispatch:i})=>{let o=yi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=Ap(u,o,e);if(h&&h.from<=d&&h.to>=f){let m=le.create(s,h.from,h.to);n.setSelection(m)}}return!0},yD=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!dc(n.state.selection))return s(),!0;let l=ZE(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},vD=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),wD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jE(r)}return t};function nc(t){let e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jE(n)}function oc(t,e,n){if(t instanceof $n||t instanceof K)return t;n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return K.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),oc("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",u=new Bs({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Rr.fromSchema(u).parseSlice(nc(t),n.parseOptions):Rr.fromSchema(u).parse(nc(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Rr.fromSchema(e);return n.slice?o.parseSlice(nc(t),n.parseOptions).content:o.parse(nc(t),n.parseOptions)}return oc("",e,n)}function xD(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var _D=t=>!("type"in t),SD=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=oc(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(y){return o.emit("contentError",{editor:o,error:y,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((_D(l)?l:[l]).forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),u===d&&h){let{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(y=>y.text||"").join("");else if(e instanceof K){let y="";e.forEach(v=>{v.text&&(y+=v.text)}),g=y}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,d)}else g=l,r.replaceWith(u,d,g);n.updateSelection&&xD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},TD=()=>({state:t,dispatch:e})=>kE(t,e),CD=()=>({state:t,dispatch:e})=>OE(t,e),AD=()=>({state:t,dispatch:e})=>ep(t,e),MD=()=>({state:t,dispatch:e})=>rp(t,e),ND=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},OD=()=>({state:t,dispatch:e})=>CE(t,e),RD=()=>({state:t,dispatch:e})=>AE(t,e);function QE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ev(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ID(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=ID(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function ia(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let g=Math.max(r,m),y=Math.min(i,m+h.nodeSize);l.push({node:h,from:g,to:y})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ic(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var LD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?RE(n,r):!1},PD=()=>({state:t,dispatch:e})=>up(t,e),BD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return FE(r)(e,n)},FD=()=>({state:t,dispatch:e})=>sp(t,e);function fc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var HD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,KE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(KE(h.attrs,e)))})})}),!0):!1},$D=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),zD=()=>({tr:t,dispatch:e})=>{if(e){let n=new fn(t.doc);t.setSelection(n)}return!0},UD=()=>({state:t,dispatch:e})=>tp(t,e),WD=()=>({state:t,dispatch:e})=>ip(t,e),KD=()=>({state:t,dispatch:e})=>IE(t,e),VD=()=>({state:t,dispatch:e})=>fp(t,e),GD=()=>({state:t,dispatch:e})=>dp(t,e);function xp(t,e,n={},r={}){return oc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var qD=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var u,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=xp(t,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function tv(t,e){let n=yi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});let l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function nv(t,e){let n=new ui(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Mp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function rv(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Np(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function to(t){return e=>Np(e.$from,t)}function kp(t,e){let n={from:0,to:t.content.size};return JE(t,n,e)}function YD(t,e){let n=Ut(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Op(t,e){let n=fc(typeof e=="string"?e:e.name,t.schema);return n==="node"?YD(t,e):n==="mark"?tv(t,e):{}}function JD(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function XD(t){let e=JD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function iv(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{let{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),XD(r)}function pc(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=Ap(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function rc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function _p(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?yi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>ic(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let g=h.pos,y=m.pos;t.doc.nodesBetween(g,y,(v,w)=>{if(!v.isText&&!v.marks.length)return;let S=Math.max(g,w),O=Math.min(y,w+v.nodeSize),L=O-S;s+=L,l.push(...v.marks.map(T=>({mark:T,from:S,to:O})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>ic(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function Ur(t,e,n={}){if(!e)return ia(t,null,n)||_p(t,null,n);let r=fc(e,t.schema);return r==="node"?ia(t,e,n):r==="mark"?_p(t,e,n):!1}function VE(t,e){let{nodeExtensions:n}=lc(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(re(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function oa(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(oa(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function hc(t){return t instanceof he}function mc(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),g=m-h,y=f-d,S={top:d,bottom:f,left:h,right:m,width:g,height:y,x:h,y:d};return{...S,toJSON:()=>S}}function ZD(t,e,n){var r;let{selection:i}=e,o=null;if(dc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let g=!m||m.type.allowsMarkType(n),y=!!n.isInSet(f.marks)||!f.marks.some(v=>v.type.excludes(n));d=g&&y}return!d}),d})}var jD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=yi(t,r.schema);if(i)if(s){let d=tv(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{let y=Math.max(g,f),v=Math.min(g+m.nodeSize,h);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(y,v,u.create({...S.attrs,...e}))}):n.addMark(y,v,u.create(e))})});return ZD(r,n,u)},QD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),eL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>pp(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>pp(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},nL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,l=le.atEnd(r).to,u=zr(i,s,l),d=zr(o,s,l),f=le.create(r,u,d);e.setSelection(f)}return!0},rL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return HE(r)(e,n)};function GE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var iL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:u}=o,d=i.extensionManager.attributes,f=rc(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&GE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:Mp(l.node(-1).contentMatchAt(l.indexAfter(-1))),g=h&&m?[{type:m,attrs:f}]:void 0,y=zn(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!y&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(y=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(y&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let v=e.mapping.map(l.before()),w=e.doc.resolve(v);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&GE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return y},oL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=Ut(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;let h=u.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=K.empty,O=u.index(-1)?1:u.index(-2)?2:3;for(let ne=u.depth-O;ne>=u.depth-3;ne-=1)S=K.from(u.node(ne).copy(S));let L=u.indexAfter(-1){if(Y>-1)return!1;ne.isTextblock&&ne.content.size===0&&(Y=q+1)}),Y>-1&&n.setSelection(le.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let g=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,y={...rc(m,h.type.name,h.attrs),...e},v={...rc(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);let w=g?[{type:l,attrs:y},{type:g,attrs:v}]:[{type:l,attrs:y}];if(!zn(n.doc,u.pos,2))return!1;if(i){let{selection:S,storedMarks:O}=r,{splittableMarks:L}=o.extensionManager,T=O||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!T||!i)return!0;let B=T.filter(R=>L.includes(R.type.name));n.ensureMarks(B)}return!0},gp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,n.pos)&&t.join(n.pos),!0},bp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,r)&&t.join(r),!0},sL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,g=Ut(t,s.schema),y=Ut(e,s.schema),{selection:v,storedMarks:w}=s,{$from:S,$to:O}=v,L=S.blockRange(O),T=w||v.$to.parentOffset&&v.$from.marks();if(!L)return!1;let B=to(R=>VE(R.type.name,h))(v);if(L.depth>=1&&B&&L.depth-B.depth<=1){if(B.node.type===g)return d.liftListItem(y);if(VE(B.node.type.name,h)&&g.validContent(B.node.content)&&l)return u().command(()=>(o.setNodeMarkup(B.pos,g),!0)).command(()=>gp(o,g)).command(()=>bp(o,g)).run()}return!n||!T||!l?u().command(()=>f().wrapInList(g,r)?!0:d.clearNodes()).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run():u().command(()=>{let R=f().wrapInList(g,r),Y=T.filter(ne=>m.includes(ne.type.name));return o.ensureMarks(Y),R?!0:d.clearNodes()}).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run()},aL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=yi(t,r.schema);return _p(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lL=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema),l=ia(r,o,n),u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(s,u):i.setNode(o,{...u,...n})},cL=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?r.lift(i):r.wrapIn(i,e)},uL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},dL=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},fL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=yi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:g}=l,y=(o=d.marks().find(w=>w.type===u))===null||o===void 0?void 0:o.attrs,v=Ap(d,u,y);v&&(m=v.from,g=v.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},pL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{let d=u.$from.pos,f=u.$to.pos,h,m,g,y;n.selection.empty?r.doc.nodesBetween(d,f,(v,w)=>{o&&o===v.type&&(g=Math.max(w,d),y=Math.min(w+v.nodeSize,f),h=w,m=v)}):r.doc.nodesBetween(d,f,(v,w)=>{w=d&&w<=f&&(o&&o===v.type&&n.setNodeMarkup(w,void 0,{...v.attrs,...e}),s&&v.marks.length&&v.marks.forEach(S=>{if(s===S.type){let O=Math.max(w,d),L=Math.min(w+v.nodeSize,f);n.addMark(O,L,s.create({...S.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(v=>{s===v.type&&n.addMark(g,y,s.create({...v.attrs,...e}))}))}),!0):!1},hL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return PE(i,e)(n,r)},mL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return BE(i,e)(n,r)},gL=Object.freeze({__proto__:null,blur:oD,clearContent:sD,clearNodes:aD,command:lD,createParagraphNear:cD,cut:uD,deleteCurrentNode:dD,deleteNode:fD,deleteRange:pD,deleteSelection:hD,enter:mD,exitCode:gD,extendMarkRange:bD,first:yD,focus:ED,forEach:vD,insertContent:wD,insertContentAt:SD,joinBackward:AD,joinDown:CD,joinForward:MD,joinItemBackward:ND,joinItemForward:kD,joinTextblockBackward:OD,joinTextblockForward:RD,joinUp:TD,keyboardShortcut:DD,lift:LD,liftEmptyBlock:PD,liftListItem:BD,newlineInCode:FD,resetAttributes:HD,scrollIntoView:$D,selectAll:zD,selectNodeBackward:UD,selectNodeForward:WD,selectParentNode:KD,selectTextblockEnd:VD,selectTextblockStart:GD,setContent:qD,setMark:jD,setMeta:QD,setNode:eL,setNodeSelection:tL,setTextSelection:nL,sinkListItem:rL,splitBlock:iL,splitListItem:oL,toggleList:sL,toggleMark:aL,toggleNode:lL,toggleWrap:cL,undoInputRule:uL,unsetAllMarks:dL,unsetMark:fL,updateAttributes:pL,wrapIn:hL,wrapInList:mL}),bL=We.create({name:"commands",addCommands(){return{...gL}}}),yL=We.create({name:"drop",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),EL=We.create({name:"editable",addProseMirrorPlugins(){return[new Oe({key:new ze("editable"),props:{editable:()=>this.editor.options.editable}})]}}),vL=We.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Oe({key:new ze("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wL=We.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,y=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,v=y.parent.type.spec.isolating,w=h.pos-h.parentOffset,S=v&&y.parent.childCount===1?w===h.pos:ue.atStart(d).from===m;return!f||!g.type.isTextblock||g.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return QE()||ev()?o:i},addProseMirrorPlugins(){return[new Oe({key:new ze("clearDocument"),appendTransaction:(t,e,n)=>{let r=t.some(v=>v.docChanged)&&!e.doc.eq(n.doc),i=t.some(v=>v.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,u=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===u&&l===d)||!oa(n.doc))return;let m=n.tr,g=ac({state:n,transaction:m}),{commands:y}=new Yo({editor:this.editor,state:g});if(y.clearNodes(),!!m.steps.length)return m}})]}}),xL=We.create({name:"paste",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_L=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Oe({key:new ze("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Sp=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let u=new t(l,this.editor,i,i?n:null);i&&(u.actualDepth=this.depth+1),e.push(new t(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},SL=`.ProseMirror { +`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=o);let g=s?.[u.type.name];if(g)return f&&(l+=g({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function uc(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var iD=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Oe({key:new ze("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),u=uc(n);return JE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),oD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),sD=(t=!1)=>({commands:e})=>e.setContent("",t),aD=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),g=h.blockRange(m);if(!g)return;let b=Lr(g);if(l.type.isTextblock){let{defaultType:E}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,E)}(b||b===0)&&e.lift(g,b)})}),!0},lD=t=>e=>t(e),cD=()=>({state:t,dispatch:e})=>cp(t,e),uD=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},dD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},fD=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let u=o.before(s),d=o.after(s);e.delete(u,d).scrollIntoView()}return!0}return!1},pD=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},hD=()=>({state:t,dispatch:e})=>jl(t,e),mD=()=>({commands:t})=>t.keyboardShortcut("Enter"),gD=()=>({state:t,dispatch:e})=>lp(t,e);function ic(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function XE(t,e,n={}){return t.find(r=>r.type===e&&ic(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function WE(t,e,n={}){return!!XE(t,e,n)}function Ap(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!XE([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,u=s+1,d=l+i.node.nodeSize;for(;s>0&&WE([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;u({tr:n,state:r,dispatch:i})=>{let o=yi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=Ap(u,o,e);if(h&&h.from<=d&&h.to>=f){let m=le.create(s,h.from,h.to);n.setSelection(m)}}return!0},yD=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!dc(n.state.selection))return s(),!0;let l=ZE(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},vD=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),wD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jE(r)}return t};function nc(t){let e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jE(n)}function oc(t,e,n){if(t instanceof $n||t instanceof K)return t;n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return K.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),oc("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",u=new Bs({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Rr.fromSchema(u).parseSlice(nc(t),n.parseOptions):Rr.fromSchema(u).parse(nc(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Rr.fromSchema(e);return n.slice?o.parseSlice(nc(t),n.parseOptions).content:o.parse(nc(t),n.parseOptions)}return oc("",e,n)}function xD(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var _D=t=>!("type"in t),SD=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=oc(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(b){return o.emit("contentError",{editor:o,error:b,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((_D(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),u===d&&h){let{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof K){let b="";e.forEach(E=>{E.text&&(b+=E.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,d)}else g=l,r.replaceWith(u,d,g);n.updateSelection&&xD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},TD=()=>({state:t,dispatch:e})=>kE(t,e),CD=()=>({state:t,dispatch:e})=>OE(t,e),AD=()=>({state:t,dispatch:e})=>ep(t,e),MD=()=>({state:t,dispatch:e})=>rp(t,e),ND=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},OD=()=>({state:t,dispatch:e})=>CE(t,e),RD=()=>({state:t,dispatch:e})=>AE(t,e);function QE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ev(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ID(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=ID(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function ia(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let g=Math.max(r,m),b=Math.min(i,m+h.nodeSize);l.push({node:h,from:g,to:b})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ic(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var LD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?RE(n,r):!1},PD=()=>({state:t,dispatch:e})=>up(t,e),BD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return FE(r)(e,n)},FD=()=>({state:t,dispatch:e})=>sp(t,e);function fc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var HD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,KE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(KE(h.attrs,e)))})})}),!0):!1},$D=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),zD=()=>({tr:t,dispatch:e})=>{if(e){let n=new fn(t.doc);t.setSelection(n)}return!0},UD=()=>({state:t,dispatch:e})=>tp(t,e),WD=()=>({state:t,dispatch:e})=>ip(t,e),KD=()=>({state:t,dispatch:e})=>IE(t,e),VD=()=>({state:t,dispatch:e})=>fp(t,e),GD=()=>({state:t,dispatch:e})=>dp(t,e);function xp(t,e,n={},r={}){return oc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var qD=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var u,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=xp(t,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function tv(t,e){let n=yi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});let l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function nv(t,e){let n=new ui(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Mp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function rv(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Np(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function to(t){return e=>Np(e.$from,t)}function kp(t,e){let n={from:0,to:t.content.size};return JE(t,n,e)}function YD(t,e){let n=Ut(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Op(t,e){let n=fc(typeof e=="string"?e:e.name,t.schema);return n==="node"?YD(t,e):n==="mark"?tv(t,e):{}}function JD(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function XD(t){let e=JD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function iv(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{let{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),XD(r)}function pc(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=Ap(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function rc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function _p(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?yi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>ic(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let g=h.pos,b=m.pos;t.doc.nodesBetween(g,b,(E,w)=>{if(!E.isText&&!E.marks.length)return;let S=Math.max(g,w),N=Math.min(b,w+E.nodeSize),D=N-S;s+=D,l.push(...E.marks.map(T=>({mark:T,from:S,to:N})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>ic(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function Ur(t,e,n={}){if(!e)return ia(t,null,n)||_p(t,null,n);let r=fc(e,t.schema);return r==="node"?ia(t,e,n):r==="mark"?_p(t,e,n):!1}function VE(t,e){let{nodeExtensions:n}=lc(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(re(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function oa(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(oa(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function hc(t){return t instanceof he}function mc(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),g=m-h,b=f-d,S={top:d,bottom:f,left:h,right:m,width:g,height:b,x:h,y:d};return{...S,toJSON:()=>S}}function ZD(t,e,n){var r;let{selection:i}=e,o=null;if(dc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let g=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(E=>E.type.excludes(n));d=g&&b}return!d}),d})}var jD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=yi(t,r.schema);if(i)if(s){let d=tv(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{let b=Math.max(g,f),E=Math.min(g+m.nodeSize,h);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(b,E,u.create({...S.attrs,...e}))}):n.addMark(b,E,u.create(e))})});return ZD(r,n,u)},QD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),eL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>pp(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>pp(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},nL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,l=le.atEnd(r).to,u=zr(i,s,l),d=zr(o,s,l),f=le.create(r,u,d);e.setSelection(f)}return!0},rL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return HE(r)(e,n)};function GE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var iL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:u}=o,d=i.extensionManager.attributes,f=rc(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&GE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:Mp(l.node(-1).contentMatchAt(l.indexAfter(-1))),g=h&&m?[{type:m,attrs:f}]:void 0,b=zn(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(b&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let E=e.mapping.map(l.before()),w=e.doc.resolve(E);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&GE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},oL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=Ut(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;let h=u.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=K.empty,N=u.index(-1)?1:u.index(-2)?2:3;for(let ne=u.depth-N;ne>=u.depth-3;ne-=1)S=K.from(u.node(ne).copy(S));let D=u.indexAfter(-1){if(Y>-1)return!1;ne.isTextblock&&ne.content.size===0&&(Y=q+1)}),Y>-1&&n.setSelection(le.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let g=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,b={...rc(m,h.type.name,h.attrs),...e},E={...rc(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);let w=g?[{type:l,attrs:b},{type:g,attrs:E}]:[{type:l,attrs:b}];if(!zn(n.doc,u.pos,2))return!1;if(i){let{selection:S,storedMarks:N}=r,{splittableMarks:D}=o.extensionManager,T=N||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!T||!i)return!0;let B=T.filter(R=>D.includes(R.type.name));n.ensureMarks(B)}return!0},gp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,n.pos)&&t.join(n.pos),!0},bp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,r)&&t.join(r),!0},sL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,g=Ut(t,s.schema),b=Ut(e,s.schema),{selection:E,storedMarks:w}=s,{$from:S,$to:N}=E,D=S.blockRange(N),T=w||E.$to.parentOffset&&E.$from.marks();if(!D)return!1;let B=to(R=>VE(R.type.name,h))(E);if(D.depth>=1&&B&&D.depth-B.depth<=1){if(B.node.type===g)return d.liftListItem(b);if(VE(B.node.type.name,h)&&g.validContent(B.node.content)&&l)return u().command(()=>(o.setNodeMarkup(B.pos,g),!0)).command(()=>gp(o,g)).command(()=>bp(o,g)).run()}return!n||!T||!l?u().command(()=>f().wrapInList(g,r)?!0:d.clearNodes()).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run():u().command(()=>{let R=f().wrapInList(g,r),Y=T.filter(ne=>m.includes(ne.type.name));return o.ensureMarks(Y),R?!0:d.clearNodes()}).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run()},aL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=yi(t,r.schema);return _p(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lL=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema),l=ia(r,o,n),u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(s,u):i.setNode(o,{...u,...n})},cL=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?r.lift(i):r.wrapIn(i,e)},uL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},dL=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},fL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=yi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:g}=l,b=(o=d.marks().find(w=>w.type===u))===null||o===void 0?void 0:o.attrs,E=Ap(d,u,b);E&&(m=E.from,g=E.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},pL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{let d=u.$from.pos,f=u.$to.pos,h,m,g,b;n.selection.empty?r.doc.nodesBetween(d,f,(E,w)=>{o&&o===E.type&&(g=Math.max(w,d),b=Math.min(w+E.nodeSize,f),h=w,m=E)}):r.doc.nodesBetween(d,f,(E,w)=>{w=d&&w<=f&&(o&&o===E.type&&n.setNodeMarkup(w,void 0,{...E.attrs,...e}),s&&E.marks.length&&E.marks.forEach(S=>{if(s===S.type){let N=Math.max(w,d),D=Math.min(w+E.nodeSize,f);n.addMark(N,D,s.create({...S.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(E=>{s===E.type&&n.addMark(g,b,s.create({...E.attrs,...e}))}))}),!0):!1},hL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return PE(i,e)(n,r)},mL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return BE(i,e)(n,r)},gL=Object.freeze({__proto__:null,blur:oD,clearContent:sD,clearNodes:aD,command:lD,createParagraphNear:cD,cut:uD,deleteCurrentNode:dD,deleteNode:fD,deleteRange:pD,deleteSelection:hD,enter:mD,exitCode:gD,extendMarkRange:bD,first:yD,focus:ED,forEach:vD,insertContent:wD,insertContentAt:SD,joinBackward:AD,joinDown:CD,joinForward:MD,joinItemBackward:ND,joinItemForward:kD,joinTextblockBackward:OD,joinTextblockForward:RD,joinUp:TD,keyboardShortcut:DD,lift:LD,liftEmptyBlock:PD,liftListItem:BD,newlineInCode:FD,resetAttributes:HD,scrollIntoView:$D,selectAll:zD,selectNodeBackward:UD,selectNodeForward:WD,selectParentNode:KD,selectTextblockEnd:VD,selectTextblockStart:GD,setContent:qD,setMark:jD,setMeta:QD,setNode:eL,setNodeSelection:tL,setTextSelection:nL,sinkListItem:rL,splitBlock:iL,splitListItem:oL,toggleList:sL,toggleMark:aL,toggleNode:lL,toggleWrap:cL,undoInputRule:uL,unsetAllMarks:dL,unsetMark:fL,updateAttributes:pL,wrapIn:hL,wrapInList:mL}),bL=We.create({name:"commands",addCommands(){return{...gL}}}),yL=We.create({name:"drop",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),EL=We.create({name:"editable",addProseMirrorPlugins(){return[new Oe({key:new ze("editable"),props:{editable:()=>this.editor.options.editable}})]}}),vL=We.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Oe({key:new ze("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wL=We.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,E=b.parent.type.spec.isolating,w=h.pos-h.parentOffset,S=E&&b.parent.childCount===1?w===h.pos:ue.atStart(d).from===m;return!f||!g.type.isTextblock||g.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return QE()||ev()?o:i},addProseMirrorPlugins(){return[new Oe({key:new ze("clearDocument"),appendTransaction:(t,e,n)=>{let r=t.some(E=>E.docChanged)&&!e.doc.eq(n.doc),i=t.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,u=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===u&&l===d)||!oa(n.doc))return;let m=n.tr,g=ac({state:n,transaction:m}),{commands:b}=new Yo({editor:this.editor,state:g});if(b.clearNodes(),!!m.steps.length)return m}})]}}),xL=We.create({name:"paste",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_L=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Oe({key:new ze("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Sp=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let u=new t(l,this.editor,i,i?n:null);i&&(u.actualDepth=this.depth+1),e.push(new t(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},SL=`.ProseMirror { position: relative; } @@ -106,16 +106,16 @@ img.ProseMirror-separator { opacity: 0 }`;function TL(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var sc=class extends yp{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=TL(SL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=YE(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;let n=this.state.plugins,r=n;if([].concat(e).forEach(o=>{let s=typeof o=="string"?`${o}$`:o.key;r=n.filter(l=>!l.key.startsWith(s))}),n.length===r.length)return;let i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;let i=[...this.options.enableCoreExtensions?[EL,iD.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),bL,vL,wL,_L,yL,xL].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new wp(i,this)}createCommandManager(){this.commandManager=new Yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let r=ZE(n,this.options.autofocus);this.view=new ql(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Pl.create({doc:n,selection:r||void 0})});let i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();let o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Op(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Ur(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Tp(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` -`,textSerializers:r={}}=e||{};return kp(this.state.doc,{blockSeparator:n,textSerializers:{...uc(this.schema),...r}})}get isEmpty(){return oa(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new Sp(n,this)}get $doc(){return this.$pos(0)}};function Vn(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(pc(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(v=>v===t.type&&v!==g.mark.type)).filter(g=>g.to>d).length)return null;fn.from&&o.delete(n.from+u,d);let m=n.from+u+s.length;o.addMark(n.from+u,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function gc(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,u=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,u)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function sa(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Ei(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Bo(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,y=m||h.$to.parentOffset&&h.$from.marks();if(y){let v=y.filter(w=>g.includes(w.type.name));s.ensureMarks(v)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&rr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var ce=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new vp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],u=r[0],d=n.to;if(l){let f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(pc(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(w=>w===t.type&&w!==y.mark.type)).filter(y=>y.to>h).length)return null;mn.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function ov(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var CL=/^\s*>\s$/,sv=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ei({find:CL,type:this.type})]}});var AL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ML=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,av=st.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Vn({find:AL,type:this.type}),Vn({find:NL,type:this.type})]},addPasteRules(){return[xn({find:ML,type:this.type}),xn({find:kL,type:this.type})]}});var OL="listItem",lv="textStyle",cv=/^\s*([-+*])\s$/,uv=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OL,this.editor.getAttributes(lv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ei({find:cv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:cv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lv),editor:this.editor})),[t]}});var RL=/(^|[^`])`([^`]+)`(?!`)/,IL=/(^|[^`])`([^`]+)`(?!`)/g,dv=st.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Vn({find:RL,type:this.type})]},addPasteRules(){return[xn({find:IL,type:this.type})]}});var DL=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;let o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},fv=st.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&DL(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}});var pv=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var Rp=ce.create({name:"doc",topNode:!0,content:"block+"});function hv(t={}){return new Oe({view(e){return new Ip(e,t)}})}var Ip=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Il(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var mv=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hv(this.options)]}});var on=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Dp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!LL(e)||!PL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(t.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};on.prototype.visible=!1;on.findFrom=on.findGapCursorFrom;ue.jsonID("gapcursor",on);var Dp=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return on.valid(n)?new on(n):ue.near(n)}};function LL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function PL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function gv(){return new Oe({props:{decorations:$L,createSelectionBetween(t,e,n){return e.pos==n.pos&&on.valid(n)?new on(n):null},handleClick:FL,handleKeyDown:BL,handleDOMEvents:{beforeinput:HL}}})}var BL=ra({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=on.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new on(d))),!0):!1}}function FL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!on.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new on(r))),!0)}function HL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof on))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let s=r.length-1;s>=0;s--)i=K.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function $L(t){if(!(t.selection instanceof on))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[wt.widget(t.selection.head,e,{key:"gapcursor"})])}var bv=We.create({name:"gapCursor",addProseMirrorPlugins(){return[gv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var yv=ce.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ee(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){let h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Ev=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var yc=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Yt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new vv(e):Yt.empty};var vv=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=yc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=yc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Yt);Yt.empty=new vv([]);var zL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Yt),Lp=Yt;var UL=500,ro=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let g=h.step.map(i.slice(o)),y;g&&s.maybeStep(g).doc&&(y=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(y,void 0,void 0,d.length+f.length))),o--,y&&i.appendMap(y,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,u=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;fKL&&(l=WL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Us;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let g=o.getMirror(--u);if(g==null)return;s=Math.min(s,g);let y=o.maps[g];if(m.step){let v=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(o.slice(u+1,g));w&&l++,r.push(new mr(y,v,w))}else r.push(new mr(y))},i);let d=[];for(let m=n;mUL&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(h))?i[g]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Lp.from(i.reverse()),o)}};ro.empty=new ro(Lp.empty,0);function WL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},KL=20;function VL(t,e,n,r){let i=n.getMeta(no),o;if(i)return i.historyState;n.getMeta(YL)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(no))return s.getMeta(no).redo?new gr(t.done.addTransform(n,void 0,r,Ec(e)),t.undone,wv(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,Ec(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GL(n,t.prevRanges)),d=s?Pp(t.prevRanges,n.mapping):wv(n.mapping.maps);return new gr(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Ec(e)),ro.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function wv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Pp(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=no.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=qL(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Fp=vc(!1,!0),Hp=vc(!0,!0),$z=vc(!1,!1),zz=vc(!0,!1);var Sv=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fp(t,e),redo:()=>({state:t,dispatch:e})=>Hp(t,e)}},addProseMirrorPlugins(){return[_v(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Tv=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var u;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(he.create(s.doc,d.pos)):s.setSelection(le.create(s.doc,d.pos));else{let h=(u=d.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(s.insert(f,h),s.setSelection(le.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var JL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,XL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ZL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cv=st.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Vn({find:JL,type:this.type}),Vn({find:ZL,type:this.type})]},addPasteRules(){return[xn({find:XL,type:this.type}),xn({find:jL,type:this.type})]}});var $p=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ee(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var QL="listItem",Av="textStyle",Mv=/^(\d+)\.\s$/,Nv=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",ee(this.options.HTMLAttributes,n),0]:["ol",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(QL,this.editor.getAttributes(Av)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ei({find:Mv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:Mv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Av)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var wc=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var kv=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Oe({key:new ze("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let u=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&oa(s);if((u||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=wt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),ot.create(t,i)}}})]}});var eP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ov=st.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Vn({find:eP,type:this.type})]},addPasteRules(){return[xn({find:tP,type:this.type})]}});var Rv=st.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Iv=st.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Up,Wp;if(typeof WeakMap<"u"){let t=new WeakMap;Up=e=>t.get(e),Wp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Up=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-L});break}let T=i+L*e;for(let B=0;Br&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function iP(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function sP(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ac(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Xo(e.$head)||aP(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function aP(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Kp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function lP(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Wv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function io(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Kv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=n.pos-o);u.unshift(n.pos-o);let d=u.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new $o(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Kp(r)&&Kp(i)&&qp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return le.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let u=i.top;u0||w>0){let S=y.attrs;if(v>0&&(S=io(S,0,v)),w>0&&(S=io(S,S.colspan-w,w)),g.lefti.bottom){let S={...y.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.top<=l.top?(s.top>0&&(e=u.resolve(o+i.map[s.left])),l.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.left<=l.left?(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),l.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ot.create(t.doc,e)}function fP({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function pP({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function hP(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=et.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=et.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=et.create(i,u+1,d)}}else r instanceof le&&fP(r)?o=le.create(i,r.from):r instanceof le&&pP(r)&&(o=le.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var mP=new ze("fix-tables");function Gv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=gP(t,i,o,n))};return e?e.doc!=t.doc&&Gv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function gP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);let y=[];for(let w=0;w0?-1:0;cP(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;yP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function wP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof et){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=sP(i.$from),!o)return!1;s=(r=Xo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,u=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let g=0;g{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function xP(t){return function(e,n){if(!or(e))return!1;if(n){let r=sn(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{let y=g+o.tableStart,v=s.doc.nodeAt(y);v&&s.setNodeMarkup(y,m,v.attrs)}),r(s)}return!0}}var CU=Zo("row",{useDeprecatedLogic:!0}),AU=Zo("column",{useDeprecatedLogic:!0}),nw=Zo("cell",{useDeprecatedLogic:!0});function _P(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function xc(t,e){let n=t.selection;if(!(n instanceof et))return!1;if(e){let r=t.tr,i=sn(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function SP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(K.empty),n[i]r&&(m=m.type.createChecked(io(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let g=1;gi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(K.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function AP(t,e,n,r,i,o,s){let l=t.doc.type.schema,u=sn(l),d,f;if(i>e.width)for(let h=0,m=0;he.height){let h=[];for(let y=0,v=(e.height-1)*e.width;y=e.width?!1:n.nodeAt(e.map[v+y]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,K.from(h)),g=[];for(let y=e.height;y{if(!i)return!1;let o=n.selection;if(o instanceof et)return Tc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=iw(i,t,e);if(s==null)return!1;if(t=="horiz")return Tc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=Wv(l,t,e),d;return u?d=ue.near(u,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),Tc(n,r,d)}}}function Sc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof et)s=o;else{let u=iw(i,t,e);if(u==null)return!1;s=new et(n.doc.resolve(u))}let l=Wv(s.$headCell,t,e);return l?Tc(n,r,new et(s.$anchorCell,l)):!1}}function NP(t,e){let n=t.state.doc,r=Xo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function kP(t,e,n){if(!or(t.state))return!1;let r=SP(n),i=t.state.selection;if(i instanceof et){r||(r={width:1,height:1,rows:[K.from(Vp(sn(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=CP(r,l.right-l.left,l.bottom-l.top),Fv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=Ac(t.state),s=o.start(-1);return Fv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function OP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Hv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof et)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Xo(t.state.selection.$anchor))!=null&&((n=zp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=zp(t,d),h=vi.getState(t.state)==null;if(!f||!qp(u,f))if(h)f=u;else return;let m=new et(u,f);if(h||!t.state.selection.eq(m)){let g=t.state.tr.setSelection(m);h&&g.setMeta(vi,u.pos),t.dispatch(g)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),vi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(vi,-1))}function l(u){let d=u,f=vi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Hv(t,d.target)!=r&&(h=zp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function iw(t,e,n){if(!(t.state.selection instanceof le))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function Hv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function zp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Xo(t.state.doc.resolve(n.pos)):null}var RP=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Gp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gp(t,e,n,r,i,o){var s;let l=0,u=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;hnew r(m,n,g)),new IP(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{let l=On.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{DP(s,l,t,i)},mouseleave:s=>{LP(s)},mousedown:(s,l)=>{PP(s,l,e,n)}},decorations:s=>{let l=On.getState(s);if(l&&l.activeHandle>-1)return zP(s,l.activeHandle)},nodeViews:{}}});return o}var IP=class Cc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(On);if(r&&r.setHandle!=null)return new Cc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Cc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Kp(e.doc.resolve(i))||(i=-1),new Cc(i,n.dragging)}return n}};function DP(t,e,n,r){let i=On.getState(t.state);if(i&&!i.dragging){let o=FP(e.target),s=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?s=$v(t,e,"left",n):u-e.clientX<=n&&(s=$v(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){let l=t.state.doc.resolve(s),u=l.node(-1),d=mt.get(u),f=l.start(-1);if(d.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==d.width-1)return}sw(t,s)}}}function LP(t){let e=On.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&sw(t,-1)}function PP(t,e,n,r){var i;let o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=On.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;let l=t.state.doc.nodeAt(s.activeHandle),u=BP(t,s.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(On,{setDragging:{startX:e.clientX,startWidth:u}}));function d(h){o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",f);let m=On.getState(t.state);m?.dragging&&(HP(t,m.activeHandle,zv(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(On,{setDragging:null})))}function f(h){if(!h.which)return d(h);let m=On.getState(t.state);if(m&&m.dragging){let g=zv(m.dragging,h,n);Uv(t,m.activeHandle,g,r)}}return Uv(t,s.activeHandle,u,r),o.addEventListener("mouseup",d),o.addEventListener("mousemove",f),e.preventDefault(),!0}function BP(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let d=0;d{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function KP(t,e,n,r,i){let o=WP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!VP(e))return!1;let n=0,r=Np(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},uw=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Qp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=UP(t,this.options.cellMinWidth);return["table",ee(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=KP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(le.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Yv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Jv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>jv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Qv(t,e),deleteRow:()=>({state:t,dispatch:e})=>ew(t,e),deleteTable:()=>({state:t,dispatch:e})=>rw(t,e),mergeCells:()=>({state:t,dispatch:e})=>Jp(t,e),splitCell:()=>({state:t,dispatch:e})=>Xp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Zo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Zo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>nw(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Jp(t,e)?!0:Xp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>tw(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Zp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Zp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Yp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=et.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Mc,"Mod-Backspace":Mc,Delete:Mc,"Mod-Delete":Mc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ow({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],aw({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(re(t,"tableRole",e))}}});var dw=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ee(this.options.HTMLAttributes,t),0]}});var fw=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ee(this.options.HTMLAttributes,t),0]}});var pw=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ee(this.options.HTMLAttributes,t),0]}});var hw=ce.create({name:"text",group:"inline"});var mw=st.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var GP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,qP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,gw=st.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Vn({find:GP,type:this.type})]},addPasteRules(){return[xn({find:qP,type:this.type})]}});var gt="top",Dt="bottom",Mt="right",xt="left",Nc="auto",wi=[gt,Dt,Mt,xt],Kr="start",oo="end",bw="clippingParents",kc="viewport",jo="popper",yw="reference",eh=wi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+oo])},[]),Oc=[].concat(wi,[Nc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+oo])},[]),YP="beforeRead",JP="read",XP="afterRead",ZP="beforeMain",jP="main",QP="afterMain",eB="beforeWrite",tB="write",nB="afterWrite",Ew=[YP,JP,XP,ZP,jP,QP,eB,tB,nB];function Wt(t){return t?(t.nodeName||"").toLowerCase():null}function ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Gn(t){var e=ct(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Qo(t){if(typeof ShadowRoot>"u")return!1;var e=ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function rB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function iB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var aa={name:"applyStyles",enabled:!0,phase:"write",fn:rB,effect:iB,requires:["computeStyles"]};function Kt(t){return t.split("-")[0]}var sr=Math.max,so=Math.min,Vr=Math.round;function es(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function la(){return!/^((?!chrome|android).)*safari/i.test(es())}function qn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Gn(t)?ct(t):window,l=s.visualViewport,u=!la()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function ao(t){var e=qn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ca(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Qo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return ct(t).getComputedStyle(t)}function th(t){return["table","td","th"].indexOf(Wt(t))>=0}function Jt(t){return((Gn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Wt(t)==="html"?t:t.assignedSlot||t.parentNode||(Qo(t)?t.host:null)||Jt(t)}function vw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function oB(t){var e=/firefox/i.test(es()),n=/Trident/i.test(es());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Gr(t);for(Qo(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=ct(t),n=vw(t);n&&th(n)&&gn(n).position==="static";)n=vw(n);return n&&(Wt(n)==="html"||Wt(n)==="body"&&gn(n).position==="static")?e:n||oB(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,n){return sr(t,so(e,n))}function ww(t,e,n){var r=co(t,e,n);return r>n?n:r}function ua(){return{top:0,right:0,bottom:0,left:0}}function da(t){return Object.assign({},ua(),t)}function fa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var sB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,da(typeof e!="number"?e:fa(e,wi))};function aB(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Kt(n.placement),u=lo(l),d=[xt,Mt].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=sB(i.padding,n),m=ao(o),g=u==="y"?gt:xt,y=u==="y"?Dt:Mt,v=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],w=s[u]-n.rects.reference[u],S=ar(o),O=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,L=v/2-w/2,T=h[g],B=O-m[f]-h[y],R=O/2-m[f]/2+L,Y=co(T,R,B),ne=u;n.modifiersData[r]=(e={},e[ne]=Y,e.centerOffset=Y-R,e)}}function lB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ca(e.elements.popper,i)&&(e.elements.arrow=i))}var xw={name:"arrow",enabled:!0,phase:"main",fn:aB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yn(t){return t.split("-")[1]}var cB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function _w(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,g=m===void 0?0:m,y=s.y,v=y===void 0?0:y,w=typeof f=="function"?f({x:g,y:v}):{x:g,y:v};g=w.x,v=w.y;var S=s.hasOwnProperty("x"),O=s.hasOwnProperty("y"),L=xt,T=gt,B=window;if(d){var R=ar(n),Y="clientHeight",ne="clientWidth";if(R===ct(n)&&(R=Jt(n),gn(R).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ne="scrollWidth")),R=R,i===gt||(i===xt||i===Mt)&&o===oo){T=Dt;var q=h&&R===B&&B.visualViewport?B.visualViewport.height:R[Y];v-=q-r.height,v*=u?1:-1}if(i===xt||(i===gt||i===Dt)&&o===oo){L=Mt;var Q=h&&R===B&&B.visualViewport?B.visualViewport.width:R[ne];g-=Q-r.width,g*=u?1:-1}}var fe=Object.assign({position:l},d&&cB),we=f===!0?uB({x:g,y:v},ct(n)):{x:g,y:v};if(g=we.x,v=we.y,u){var me;return Object.assign({},fe,(me={},me[T]=O?"0":"",me[L]=S?"0":"",me.transform=(B.devicePixelRatio||1)<=1?"translate("+g+"px, "+v+"px)":"translate3d("+g+"px, "+v+"px, 0)",me))}return Object.assign({},fe,(e={},e[T]=O?v+"px":"",e[L]=S?g+"px":"",e.transform="",e))}function dB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Kt(e.placement),variation:Yn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_w(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,_w(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Sw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dB,data:{}};var Rc={passive:!0};function fB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=ct(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Rc)}),l&&u.addEventListener("resize",n.update,Rc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Rc)}),l&&u.removeEventListener("resize",n.update,Rc)}}var Tw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fB,data:{}};var pB={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(t){return t.replace(/left|right|bottom|top/g,function(e){return pB[e]})}var hB={start:"end",end:"start"};function Ic(t){return t.replace(/start|end/g,function(e){return hB[e]})}function uo(t){var e=ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fo(t){return qn(Jt(t)).left+uo(t).scrollLeft}function nh(t,e){var n=ct(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=la();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+fo(t),y:u}}function rh(t){var e,n=Jt(t),r=uo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+fo(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function po(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Dc(t){return["html","body","#document"].indexOf(Wt(t))>=0?t.ownerDocument.body:Lt(t)&&po(t)?t:Dc(Gr(t))}function xi(t,e){var n;e===void 0&&(e=[]);var r=Dc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],po(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(xi(Gr(s)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mB(t,e){var n=qn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Cw(t,e,n){return e===kc?ns(nh(t,n)):Gn(e)?mB(e,n):ns(rh(Jt(t)))}function gB(t){var e=xi(Gr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return Gn(r)?e.filter(function(i){return Gn(i)&&ca(i,r)&&Wt(i)!=="body"}):[]}function ih(t,e,n,r){var i=e==="clippingParents"?gB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=Cw(t,d,r);return u.top=sr(f.top,u.top),u.right=so(f.right,u.right),u.bottom=so(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},Cw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function pa(t){var e=t.reference,n=t.element,r=t.placement,i=r?Kt(r):null,o=r?Yn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case gt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case Mt:u={x:e.x+e.width,y:l};break;case xt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?lo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case oo:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?bw:l,d=n.rootBoundary,f=d===void 0?kc:d,h=n.elementContext,m=h===void 0?jo:h,g=n.altBoundary,y=g===void 0?!1:g,v=n.padding,w=v===void 0?0:v,S=da(typeof w!="number"?w:fa(w,wi)),O=m===jo?yw:jo,L=t.rects.popper,T=t.elements[y?O:m],B=ih(Gn(T)?T:T.contextElement||Jt(t.elements.popper),u,f,s),R=qn(t.elements.reference),Y=pa({reference:R,element:L,strategy:"absolute",placement:i}),ne=ns(Object.assign({},L,Y)),q=m===jo?ne:R,Q={top:B.top-q.top+S.top,bottom:q.bottom-B.bottom+S.bottom,left:B.left-q.left+S.left,right:q.right-B.right+S.right},fe=t.modifiersData.offset;if(m===jo&&fe){var we=fe[i];Object.keys(Q).forEach(function(me){var Ce=[Mt,Dt].indexOf(me)>=0?1:-1,ge=[gt,Dt].indexOf(me)>=0?"y":"x";Q[me]+=we[ge]*Ce})}return Q}function oh(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Oc:u,f=Yn(r),h=f?l?eh:eh.filter(function(y){return Yn(y)===f}):wi,m=h.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=h);var g=m.reduce(function(y,v){return y[v]=lr(t,{placement:v,boundary:i,rootBoundary:o,padding:s})[Kt(v)],y},{});return Object.keys(g).sort(function(y,v){return g[y]-g[v]})}function bB(t){if(Kt(t)===Nc)return[];var e=ts(t);return[Ic(t),e,Ic(e)]}function yB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,y=g===void 0?!0:g,v=n.allowedAutoPlacements,w=e.options.placement,S=Kt(w),O=S===w,L=u||(O||!y?[ts(w)]:bB(w)),T=[w].concat(L).reduce(function(je,Ne){return je.concat(Kt(Ne)===Nc?oh(e,{placement:Ne,boundary:f,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:v}):Ne)},[]),B=e.rects.reference,R=e.rects.popper,Y=new Map,ne=!0,q=T[0],Q=0;Q=0,ge=Ce?"width":"height",ye=lr(e,{placement:fe,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?Mt:xt:me?Dt:gt;B[ge]>R[ge]&&(A=ts(A));var I=ts(A),z=[];if(o&&z.push(ye[we]<=0),l&&z.push(ye[A]<=0,ye[I]<=0),z.every(function(je){return je})){q=fe,ne=!1;break}Y.set(fe,z)}if(ne)for(var j=y?3:1,ie=function(Ne){var Be=T.find(function(_t){var kt=Y.get(_t);if(kt)return kt.slice(0,Ne).every(function(Re){return Re})});if(Be)return q=Be,"break"},xe=j;xe>0;xe--){var Ae=ie(xe);if(Ae==="break")break}e.placement!==q&&(e.modifiersData[r]._skip=!0,e.placement=q,e.reset=!0)}}var Aw={name:"flip",enabled:!0,phase:"main",fn:yB,requiresIfExists:["offset"],data:{_skip:!1}};function Mw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Nw(t){return[gt,Mt,Dt,xt].some(function(e){return t[e]>=0})}function EB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=Mw(s,r),d=Mw(l,i,o),f=Nw(u),h=Nw(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:EB};function vB(t,e,n){var r=Kt(t),i=[xt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[xt,Mt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function wB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Oc.reduce(function(f,h){return f[h]=vB(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var Ow={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wB};function xB(t){var e=t.state,n=t.name;e.modifiersData[n]=pa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Rw={name:"popperOffsets",enabled:!0,phase:"read",fn:xB,data:{}};function sh(t){return t==="x"?"y":"x"}function _B(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,g=m===void 0?!0:m,y=n.tetherOffset,v=y===void 0?0:y,w=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),S=Kt(e.placement),O=Yn(e.placement),L=!O,T=lo(S),B=sh(T),R=e.modifiersData.popperOffsets,Y=e.rects.reference,ne=e.rects.popper,q=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,Q=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),fe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,we={x:0,y:0};if(R){if(o){var me,Ce=T==="y"?gt:xt,ge=T==="y"?Dt:Mt,ye=T==="y"?"height":"width",A=R[T],I=A+w[Ce],z=A-w[ge],j=g?-ne[ye]/2:0,ie=O===Kr?Y[ye]:ne[ye],xe=O===Kr?-ne[ye]:-Y[ye],Ae=e.elements.arrow,je=g&&Ae?ao(Ae):{width:0,height:0},Ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ua(),Be=Ne[Ce],_t=Ne[ge],kt=co(0,Y[ye],je[ye]),Re=L?Y[ye]/2-j-kt-Be-Q.mainAxis:ie-kt-Be-Q.mainAxis,St=L?-Y[ye]/2+j+kt+_t+Q.mainAxis:xe+kt+_t+Q.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),pt=Xt?T==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,an=(me=fe?.[T])!=null?me:0,Zt=A+Re-an-pt,Tt=A+St-an,Je=co(g?so(I,Zt):I,A,g?sr(z,Tt):z);R[T]=Je,we[T]=Je-A}if(l){var jn,Pt=T==="x"?gt:xt,V=T==="x"?Dt:Mt,yt=R[B],_e=B==="y"?"height":"width",pe=yt+w[Pt],ut=yt-w[V],dt=[gt,xt].indexOf(S)!==-1,Bt=(jn=fe?.[B])!=null?jn:0,Ot=dt?pe:yt-Y[_e]-ne[_e]-Bt+Q.altAxis,D=dt?yt+Y[_e]+ne[_e]-Bt-Q.altAxis:ut,H=g&&dt?ww(Ot,yt,D):co(g?Ot:pe,yt,g?D:ut);R[B]=H,we[B]=H-yt}e.modifiersData[r]=we}}var Iw={name:"preventOverflow",enabled:!0,phase:"main",fn:_B,requiresIfExists:["offset"]};function ah(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lh(t){return t===ct(t)||!Lt(t)?uo(t):ah(t)}function SB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ch(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&SB(e),o=Jt(e),s=qn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Wt(e)!=="body"||po(o))&&(l=lh(e)),Lt(e)?(u=qn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=fo(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function TB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function uh(t){var e=TB(t);return Ew.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function dh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function fh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Dw={placement:"bottom",modifiers:[],strategy:"absolute"};function Lw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Xw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Bw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function NB(t){return t.split(/\s+/).filter(Boolean)}function rs(t){return[].concat(t)}function Fw(t,e){t.indexOf(e)===-1&&t.push(e)}function kB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function OB(t){return t.split("-")[0]}function Pc(t){return[].slice.call(t)}function Hw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ha(){return document.createElement("div")}function Bc(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function RB(t){return vh(t,"NodeList")}function IB(t){return vh(t,"MouseEvent")}function DB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function LB(t){return Bc(t)?[t]:RB(t)?Pc(t):Array.isArray(t)?t:Pc(document.querySelectorAll(t))}function mh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $w(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function PB(t){var e,n=rs(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function BB(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=OB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,g=d==="right"?f.left.x:0,y=d==="left"?f.right.x:0,v=o.top-r+h>u,w=r-o.bottom-m>u,S=o.left-n+g>u,O=n-o.right-y>u;return v||w||S||O})}function gh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function zw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Uw=0;function FB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zw))}function Zw(){var t=performance.now();t-Uw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Zw)),Uw=t}function HB(){var t=document.activeElement;if(DB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $B(){document.addEventListener("touchstart",FB,ho),window.addEventListener("blur",HB)}var zB=typeof window<"u"&&typeof document<"u",UB=zB?!!window.msCrypto:!1;var WB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},KB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Jw,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},WB,KB),VB=Object.keys(cr),GB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function jw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function qB(t,e){var n=e?Object.keys(jw(Object.assign({},cr,{plugins:e}))):VB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Ww(t,e){var n=Object.assign({},e,{content:Xw(e.content,[t])},e.ignoreAttributes?{}:qB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var YB=function(){return"innerHTML"};function yh(t,e){t[YB()]=e}function Kw(t){var e=ha();return t===!0?e.className=qw:(e.className=Yw,Bc(t)?e.appendChild(t):yh(e,t)),e}function Vw(t,e){Bc(e.content)?(yh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yh(t,e.content):t.textContent=e.content)}function Eh(t){var e=t.firstElementChild,n=Pc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Gw)}),arrow:n.find(function(r){return r.classList.contains(qw)||r.classList.contains(Yw)}),backdrop:n.find(function(r){return r.classList.contains(MB)})}}function Qw(t){var e=ha(),n=ha();n.className=AB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ha();r.className=Gw,r.setAttribute("data-state","hidden"),Vw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Eh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(Kw(s.arrow))):u.appendChild(Kw(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}Qw.$$tippy=!0;var JB=1,Lc=[],bh=[];function XB(t,e){var n=Ww(t,Object.assign({},cr,jw(Hw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,g=[],y=Bw(Zt,n.interactiveDebounce),v,w=JB++,S=null,O=kB(n.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:w,reference:t,popper:ha(),popperInstance:S,props:n,state:L,plugins:O,clearDelayTimeouts:Ot,setProps:D,setContent:H,show:X,hide:se,hideWithInteractivity:Fe,enable:dt,disable:Bt,unmount:rt,destroy:wr};if(!n.render)return T;var B=n.render(T),R=B.popper,Y=B.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+T.id,T.popper=R,t._tippy=T,R._tippy=T;var ne=O.map(function(F){return F.fn(T)}),q=t.hasAttribute("aria-expanded");return Xt(),j(),A(),I("onCreate",[T]),n.showOnCreate&&pe(),R.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",y)}),T;function Q(){var F=T.props.touch;return Array.isArray(F)?F:[F,0]}function fe(){return Q()[0]==="hold"}function we(){var F;return!!((F=T.props.render)!=null&&F.$$tippy)}function me(){return v||t}function Ce(){var F=me().parentNode;return F?PB(F):document}function ge(){return Eh(R)}function ye(F){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:hh(T.props.delay,F?0:1,cr.delay)}function A(F){F===void 0&&(F=!1),R.style.pointerEvents=T.props.interactive&&!F?"":"none",R.style.zIndex=""+T.props.zIndex}function I(F,ae,Se){if(Se===void 0&&(Se=!0),ne.forEach(function(Ke){Ke[F]&&Ke[F].apply(Ke,ae)}),Se){var qe;(qe=T.props)[F].apply(qe,ae)}}function z(){var F=T.props.aria;if(F.content){var ae="aria-"+F.content,Se=R.id,qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){var Ft=Ke.getAttribute(ae);if(T.state.isVisible)Ke.setAttribute(ae,Ft?Ft+" "+Se:Se);else{var ln=Ft&&Ft.replace(Se,"").trim();ln?Ke.setAttribute(ae,ln):Ke.removeAttribute(ae)}})}}function j(){if(!(q||!T.props.aria.expanded)){var F=rs(T.props.triggerTarget||t);F.forEach(function(ae){T.props.interactive?ae.setAttribute("aria-expanded",T.state.isVisible&&ae===me()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function ie(){Ce().removeEventListener("mousemove",y),Lc=Lc.filter(function(F){return F!==y})}function xe(F){if(!(yr.isTouch&&(u||F.type==="mousedown"))){var ae=F.composedPath&&F.composedPath()[0]||F.target;if(!(T.props.interactive&&zw(R,ae))){if(rs(T.props.triggerTarget||t).some(function(Se){return zw(Se,ae)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[T,F]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function Ae(){u=!0}function je(){u=!1}function Ne(){var F=Ce();F.addEventListener("mousedown",xe,!0),F.addEventListener("touchend",xe,ho),F.addEventListener("touchstart",je,ho),F.addEventListener("touchmove",Ae,ho)}function Be(){var F=Ce();F.removeEventListener("mousedown",xe,!0),F.removeEventListener("touchend",xe,ho),F.removeEventListener("touchstart",je,ho),F.removeEventListener("touchmove",Ae,ho)}function _t(F,ae){Re(F,function(){!T.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&ae()})}function kt(F,ae){Re(F,ae)}function Re(F,ae){var Se=ge().box;function qe(Ke){Ke.target===Se&&(gh(Se,"remove",qe),ae())}if(F===0)return ae();gh(Se,"remove",h),gh(Se,"add",qe),h=qe}function St(F,ae,Se){Se===void 0&&(Se=!1);var qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){Ke.addEventListener(F,ae,Se),g.push({node:Ke,eventType:F,handler:ae,options:Se})})}function Xt(){fe()&&(St("touchstart",an,{passive:!0}),St("touchend",Tt,{passive:!0})),NB(T.props.trigger).forEach(function(F){if(F!=="manual")switch(St(F,an),F){case"mouseenter":St("mouseleave",Tt);break;case"focus":St(UB?"focusout":"blur",Je);break;case"focusin":St("focusout",Je);break}})}function pt(){g.forEach(function(F){var ae=F.node,Se=F.eventType,qe=F.handler,Ke=F.options;ae.removeEventListener(Se,qe,Ke)}),g=[]}function an(F){var ae,Se=!1;if(!(!T.state.isEnabled||jn(F)||l)){var qe=((ae=f)==null?void 0:ae.type)==="focus";f=F,v=F.currentTarget,j(),!T.state.isVisible&&IB(F)&&Lc.forEach(function(Ke){return Ke(F)}),F.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?Se=!0:pe(F),F.type==="click"&&(s=!Se),Se&&!qe&&ut(F)}}function Zt(F){var ae=F.target,Se=me().contains(ae)||R.contains(ae);if(!(F.type==="mousemove"&&Se)){var qe=_e().concat(R).map(function(Ke){var Ft,ln=Ke._tippy,Zr=(Ft=ln.popperInstance)==null?void 0:Ft.state;return Zr?{popperRect:Ke.getBoundingClientRect(),popperState:Zr,props:n}:null}).filter(Boolean);BB(qe,F)&&(ie(),ut(F))}}function Tt(F){var ae=jn(F)||T.props.trigger.indexOf("click")>=0&&s;if(!ae){if(T.props.interactive){T.hideWithInteractivity(F);return}ut(F)}}function Je(F){T.props.trigger.indexOf("focusin")<0&&F.target!==me()||T.props.interactive&&F.relatedTarget&&R.contains(F.relatedTarget)||ut(F)}function jn(F){return yr.isTouch?fe()!==F.type.indexOf("touch")>=0:!1}function Pt(){V();var F=T.props,ae=F.popperOptions,Se=F.placement,qe=F.offset,Ke=F.getReferenceClientRect,Ft=F.moveTransition,ln=we()?Eh(R).arrow:null,Zr=Ke?{getBoundingClientRect:Ke,contextElement:Ke.contextElement||me()}:t,Da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ni){var jr=Ni.state;if(we()){var zu=ge(),ys=zu.box;["placement","reference-hidden","escaped"].forEach(function(Qr){Qr==="placement"?ys.setAttribute("data-placement",jr.placement):jr.attributes.popper["data-popper-"+Qr]?ys.setAttribute("data-"+Qr,""):ys.removeAttribute("data-"+Qr)}),jr.attributes.popper={}}}},xr=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ft}},Da];we()&&ln&&xr.push({name:"arrow",options:{element:ln,padding:3}}),xr.push.apply(xr,ae?.modifiers||[]),T.popperInstance=ph(Zr,R,Object.assign({},ae,{placement:Se,onFirstUpdate:m,modifiers:xr}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function yt(){var F=T.props.appendTo,ae,Se=me();T.props.interactive&&F===Jw||F==="parent"?ae=Se.parentNode:ae=Xw(F,[Se]),ae.contains(R)||ae.appendChild(R),T.state.isMounted=!0,Pt()}function _e(){return Pc(R.querySelectorAll("[data-tippy-root]"))}function pe(F){T.clearDelayTimeouts(),F&&I("onTrigger",[T,F]),Ne();var ae=ye(!0),Se=Q(),qe=Se[0],Ke=Se[1];yr.isTouch&&qe==="hold"&&Ke&&(ae=Ke),ae?r=setTimeout(function(){T.show()},ae):T.show()}function ut(F){if(T.clearDelayTimeouts(),I("onUntrigger",[T,F]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(F.type)>=0&&s)){var ae=ye(!1);ae?i=setTimeout(function(){T.state.isVisible&&T.hide()},ae):o=requestAnimationFrame(function(){T.hide()})}}function dt(){T.state.isEnabled=!0}function Bt(){T.hide(),T.state.isEnabled=!1}function Ot(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function D(F){if(!T.state.isDestroyed){I("onBeforeUpdate",[T,F]),pt();var ae=T.props,Se=Ww(t,Object.assign({},ae,Hw(F),{ignoreAttributes:!0}));T.props=Se,Xt(),ae.interactiveDebounce!==Se.interactiveDebounce&&(ie(),y=Bw(Zt,Se.interactiveDebounce)),ae.triggerTarget&&!Se.triggerTarget?rs(ae.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):Se.triggerTarget&&t.removeAttribute("aria-expanded"),j(),A(),Y&&Y(ae,Se),T.popperInstance&&(Pt(),_e().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),I("onAfterUpdate",[T,F])}}function H(F){T.setProps({content:F})}function X(){var F=T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ke=hh(T.props.duration,0,cr.duration);if(!(F||ae||Se||qe)&&!me().hasAttribute("disabled")&&(I("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,we()&&(R.style.visibility="visible"),A(),Ne(),T.state.isMounted||(R.style.transition="none"),we()){var Ft=ge(),ln=Ft.box,Zr=Ft.content;mh([ln,Zr],0)}m=function(){var xr;if(!(!T.state.isVisible||d)){if(d=!0,R.offsetHeight,R.style.transition=T.props.moveTransition,we()&&T.props.animation){var bs=ge(),Ni=bs.box,jr=bs.content;mh([Ni,jr],Ke),$w([Ni,jr],"visible")}z(),j(),Fw(bh,T),(xr=T.popperInstance)==null||xr.forceUpdate(),I("onMount",[T]),T.props.animation&&we()&&kt(Ke,function(){T.state.isShown=!0,I("onShown",[T])})}},yt()}}function se(){var F=!T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=hh(T.props.duration,1,cr.duration);if(!(F||ae||Se)&&(I("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,we()&&(R.style.visibility="hidden"),ie(),Be(),A(!0),we()){var Ke=ge(),Ft=Ke.box,ln=Ke.content;T.props.animation&&(mh([Ft,ln],qe),$w([Ft,ln],"hidden"))}z(),j(),T.props.animation?we()&&_t(qe,T.unmount):T.unmount()}}function Fe(F){Ce().addEventListener("mousemove",y),Fw(Lc,y),y(F)}function rt(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),_e().forEach(function(F){F._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),bh=bh.filter(function(F){return F!==T}),T.state.isMounted=!1,I("onHidden",[T]))}function wr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,I("onDestroy",[T]))}}function ma(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);$B();var r=Object.assign({},e,{plugins:n}),i=LB(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&XB(d,r);return f&&u.push(f),u},[]);return Bc(t)?l[0]:l}ma.defaultProps=cr;ma.setDefaultProps=GB;ma.currentInput=yr;var JV=Object.assign({},aa,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ma.setDefaultProps({render:Qw});var is=ma;var wh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:d,to:f})=>{let{doc:h,selection:m}=u,{empty:g}=m,y=!h.textBetween(d,f).length&&dc(u.selection),v=this.element.contains(document.activeElement);return!(!(l.hasFocus()||v)||g||y||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{let d=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,u)},this.updateDelay))},this.updateHandler=(l,u,d,f)=>{var h,m,g;let{state:y,composing:v}=l,{selection:w}=y;if(v||!u&&!d)return;this.createTooltip();let{ranges:O}=w,L=Math.min(...O.map(R=>R.$from.pos)),T=Math.max(...O.map(R=>R.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,element:this.element,view:l,state:y,oldState:f,from:L,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((g=this.tippyOptions)===null||g===void 0?void 0:g.getReferenceClientRect)||(()=>{if(hc(y.selection)){let R=l.nodeDOM(L);if(R){let Y=R.dataset.nodeViewWrapper?R:R.querySelector("[data-node-view-wrapper]");if(Y&&(R=Y.firstChild),R)return R.getBoundingClientRect()}}return mc(l,L,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ZB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new wh({view:e,...t})}),ex=We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var xh=class{getTextContent(e){return kp(e,{textSerializers:uc(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:u}=l,{$anchor:d,empty:f}=u,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:u}=s,{from:d,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>mc(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},jB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new xh({view:e,...t})}),tx=We.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[jB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var _h=ce.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var Sh=ce.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var QB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",e2="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",as=(t,e)=>{for(let n in e)t[n]=e[n];return t},Oh="numeric",Rh="ascii",Ih="alpha",ya="asciinumeric",ba="alphanumeric",Dh="domain",lx="emoji",t2="scheme",n2="slashscheme",Th="whitespace";function r2(t,e){return t in e||(e[t]=[]),e[t]}function mo(t,e,n){e[Oh]&&(e[ya]=!0,e[ba]=!0),e[Rh]&&(e[ya]=!0,e[Ih]=!0),e[ya]&&(e[ba]=!0),e[Ih]&&(e[ba]=!0),e[ba]&&(e[Dh]=!0),e[lx]&&(e[Dh]=!0);for(let r in e){let i=r2(r,n);i.indexOf(t)<0&&i.push(t)}}function i2(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),bt=(t,e,n,r,i)=>t.tr(e,n,r,i),nx=(t,e,n,r,i)=>t.ts(e,n,r,i),J=(t,e,n,r,i)=>t.tt(e,n,r,i),Jr="WORD",Lh="UWORD",cx="ASCIINUMERICAL",ux="ALPHANUMERICAL",Sa="LOCALHOST",Ph="TLD",Bh="UTLD",zc="SCHEME",ss="SLASH_SCHEME",Hh="NUM",Fh="WS",$h="NL",Ea="OPENBRACE",va="CLOSEBRACE",Uc="OPENBRACKET",Wc="CLOSEBRACKET",Kc="OPENPAREN",Vc="CLOSEPAREN",Gc="OPENANGLEBRACKET",qc="CLOSEANGLEBRACKET",Yc="FULLWIDTHLEFTPAREN",Jc="FULLWIDTHRIGHTPAREN",Xc="LEFTCORNERBRACKET",Zc="RIGHTCORNERBRACKET",jc="LEFTWHITECORNERBRACKET",Qc="RIGHTWHITECORNERBRACKET",eu="FULLWIDTHLESSTHAN",tu="FULLWIDTHGREATERTHAN",nu="AMPERSAND",zh="APOSTROPHE",ru="ASTERISK",Si="AT",iu="BACKSLASH",ou="BACKTICK",su="CARET",Ti="COLON",Uh="COMMA",au="DOLLAR",Er="DOT",lu="EQUALS",Wh="EXCLAMATION",Xn="HYPHEN",wa="PERCENT",cu="PIPE",uu="PLUS",du="POUND",xa="QUERY",Kh="QUOTE",dx="FULLWIDTHMIDDLEDOT",Vh="SEMI",vr="SLASH",_a="TILDE",fu="UNDERSCORE",fx="EMOJI",pu="SYM",px=Object.freeze({__proto__:null,WORD:Jr,UWORD:Lh,ASCIINUMERICAL:cx,ALPHANUMERICAL:ux,LOCALHOST:Sa,TLD:Ph,UTLD:Bh,SCHEME:zc,SLASH_SCHEME:ss,NUM:Hh,WS:Fh,NL:$h,OPENBRACE:Ea,CLOSEBRACE:va,OPENBRACKET:Uc,CLOSEBRACKET:Wc,OPENPAREN:Kc,CLOSEPAREN:Vc,OPENANGLEBRACKET:Gc,CLOSEANGLEBRACKET:qc,FULLWIDTHLEFTPAREN:Yc,FULLWIDTHRIGHTPAREN:Jc,LEFTCORNERBRACKET:Xc,RIGHTCORNERBRACKET:Zc,LEFTWHITECORNERBRACKET:jc,RIGHTWHITECORNERBRACKET:Qc,FULLWIDTHLESSTHAN:eu,FULLWIDTHGREATERTHAN:tu,AMPERSAND:nu,APOSTROPHE:zh,ASTERISK:ru,AT:Si,BACKSLASH:iu,BACKTICK:ou,CARET:su,COLON:Ti,COMMA:Uh,DOLLAR:au,DOT:Er,EQUALS:lu,EXCLAMATION:Wh,HYPHEN:Xn,PERCENT:wa,PIPE:cu,PLUS:uu,POUND:du,QUERY:xa,QUOTE:Kh,FULLWIDTHMIDDLEDOT:dx,SEMI:Vh,SLASH:vr,TILDE:_a,UNDERSCORE:fu,EMOJI:fx,SYM:pu}),qr=/[a-z]/,ga=/\p{L}/u,Ch=/\p{Emoji}/u;var Yr=/\d/,Ah=/\s/;var rx="\r",Mh=` -`,o2="\uFE0F",s2="\u200D",Nh="\uFFFC",Fc=null,Hc=null;function a2(t=[]){let e={};_n.groups=e;let n=new _n;Fc==null&&(Fc=ix(QB)),Hc==null&&(Hc=ix(e2)),J(n,"'",zh),J(n,"{",Ea),J(n,"}",va),J(n,"[",Uc),J(n,"]",Wc),J(n,"(",Kc),J(n,")",Vc),J(n,"<",Gc),J(n,">",qc),J(n,"\uFF08",Yc),J(n,"\uFF09",Jc),J(n,"\u300C",Xc),J(n,"\u300D",Zc),J(n,"\u300E",jc),J(n,"\u300F",Qc),J(n,"\uFF1C",eu),J(n,"\uFF1E",tu),J(n,"&",nu),J(n,"*",ru),J(n,"@",Si),J(n,"`",ou),J(n,"^",su),J(n,":",Ti),J(n,",",Uh),J(n,"$",au),J(n,".",Er),J(n,"=",lu),J(n,"!",Wh),J(n,"-",Xn),J(n,"%",wa),J(n,"|",cu),J(n,"+",uu),J(n,"#",du),J(n,"?",xa),J(n,'"',Kh),J(n,"/",vr),J(n,";",Vh),J(n,"~",_a),J(n,"_",fu),J(n,"\\",iu),J(n,"\u30FB",dx);let r=bt(n,Yr,Hh,{[Oh]:!0});bt(r,Yr,r);let i=bt(r,qr,cx,{[ya]:!0}),o=bt(r,ga,ux,{[ba]:!0}),s=bt(n,qr,Jr,{[Rh]:!0});bt(s,Yr,i),bt(s,qr,s),bt(i,Yr,i),bt(i,qr,i);let l=bt(n,ga,Lh,{[Ih]:!0});bt(l,qr),bt(l,Yr,o),bt(l,ga,l),bt(o,Yr,o),bt(o,qr),bt(o,ga,o);let u=J(n,Mh,$h,{[Th]:!0}),d=J(n,rx,Fh,{[Th]:!0}),f=bt(n,Ah,Fh,{[Th]:!0});J(n,Nh,f),J(d,Mh,u),J(d,Nh,f),bt(d,Ah,f),J(f,rx),J(f,Mh),bt(f,Ah,f),J(f,Nh,f);let h=bt(n,Ch,fx,{[lx]:!0});J(h,"#"),bt(h,Ch,h),J(h,o2,h);let m=J(h,s2);J(m,"#"),bt(m,Ch,h);let g=[[qr,s],[Yr,i]],y=[[qr,null],[ga,l],[Yr,o]];for(let v=0;vv[0]>w[0]?1:-1);for(let v=0;v=0?O[Dh]=!0:qr.test(w)?Yr.test(w)?O[ya]=!0:O[Rh]=!0:O[Oh]=!0,nx(n,w,w,O)}return nx(n,"localhost",Sa,{ascii:!0}),n.jd=new _n(pu),{start:n,tokens:as({groups:e},px)}}function hx(t,e){let n=l2(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function l2(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function _i(t,e,n,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ta={defaultProtocol:"http",events:null,format:ox,formatHref:ox,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gh(t,e=null){let n=as({},Ta);t&&(n=as(n,t instanceof Gh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ta.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),u&&(s.target=u),d&&(s.rel=d),f&&as(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function hu(t,e){class n extends mx{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var sx=hu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ax=hu("text"),c2=hu("nl"),$c=hu("url",{isLink:!0,toHref(t=Ta.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Sa&&t[1].t===Ti}});var Jn=t=>new _n(t);function u2({groups:t}){let e=t.domain.concat([nu,ru,Si,iu,ou,su,au,lu,Xn,Hh,wa,cu,uu,du,vr,pu,_a,fu]),n=[Ti,Uh,Er,Wh,wa,xa,Kh,Vh,Gc,qc,Ea,va,Wc,Uc,Kc,Vc,Yc,Jc,Xc,Zc,jc,Qc,eu,tu],r=[nu,zh,ru,iu,ou,su,au,lu,Xn,Ea,va,wa,cu,uu,du,xa,vr,pu,_a,fu],i=Jn(),o=J(i,_a);Pe(o,r,o),Pe(o,t.domain,o);let s=Jn(),l=Jn(),u=Jn();Pe(i,t.domain,s),Pe(i,t.scheme,l),Pe(i,t.slashscheme,u),Pe(s,r,o),Pe(s,t.domain,s);let d=J(s,Si);J(o,Si,d),J(l,Si,d),J(u,Si,d);let f=J(o,Er);Pe(f,r,o),Pe(f,t.domain,o);let h=Jn();Pe(d,t.domain,h),Pe(h,t.domain,h);let m=J(h,Er);Pe(m,t.domain,h);let g=Jn(sx);Pe(m,t.tld,g),Pe(m,t.utld,g),J(d,Sa,g);let y=J(h,Xn);J(y,Xn,y),Pe(y,t.domain,h),Pe(g,t.domain,h),J(g,Er,m),J(g,Xn,y);let v=J(g,Ti);Pe(v,t.numeric,sx);let w=J(s,Xn),S=J(s,Er);J(w,Xn,w),Pe(w,t.domain,s),Pe(S,r,o),Pe(S,t.domain,s);let O=Jn($c);Pe(S,t.tld,O),Pe(S,t.utld,O),Pe(O,t.domain,s),Pe(O,r,o),J(O,Er,S),J(O,Xn,w),J(O,Si,d);let L=J(O,Ti),T=Jn($c);Pe(L,t.numeric,T);let B=Jn($c),R=Jn();Pe(B,e,B),Pe(B,n,R),Pe(R,e,B),Pe(R,n,R),J(O,vr,B),J(T,vr,B);let Y=J(l,Ti),ne=J(u,Ti),q=J(ne,vr),Q=J(q,vr);Pe(l,t.domain,s),J(l,Er,S),J(l,Xn,w),Pe(u,t.domain,s),J(u,Er,S),J(u,Xn,w),Pe(Y,t.domain,B),J(Y,vr,B),J(Y,xa,B),Pe(Q,t.domain,B),Pe(Q,e,B),J(Q,vr,B);let fe=[[Ea,va],[Uc,Wc],[Kc,Vc],[Gc,qc],[Yc,Jc],[Xc,Zc],[jc,Qc],[eu,tu]];for(let we=0;we=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(kh(ax,e,s)),s=[]),i-=m,f-=m;let g=h.t,y=n.slice(i-f,i);o.push(kh(g,e,y))}}return s.length>0&&o.push(kh(ax,e,s)),o}function kh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var f2=typeof console<"u"&&console&&console.warn||(()=>{}),p2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",at={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gx(){return _n.groups={},at.scanner=null,at.parser=null,at.tokenQueue=[],at.pluginQueue=[],at.customSchemes=[],at.initialized=!1,at}function qh(t,e=!1){if(at.initialized&&f2(`linkifyjs: already initialized - will not register custom scheme "${t}" ${p2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,textSerializers:r={}}=e||{};return kp(this.state.doc,{blockSeparator:n,textSerializers:{...uc(this.schema),...r}})}get isEmpty(){return oa(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new Sp(n,this)}get $doc(){return this.$pos(0)}};function Vn(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(pc(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(E=>E===t.type&&E!==g.mark.type)).filter(g=>g.to>d).length)return null;fn.from&&o.delete(n.from+u,d);let m=n.from+u+s.length;o.addMark(n.from+u,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function gc(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,u=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,u)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function sa(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Ei(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Bo(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,b=m||h.$to.parentOffset&&h.$from.marks();if(b){let E=b.filter(w=>g.includes(w.type.name));s.ensureMarks(E)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&rr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var ce=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new vp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],u=r[0],d=n.to;if(l){let f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(pc(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(w=>w===t.type&&w!==b.mark.type)).filter(b=>b.to>h).length)return null;mn.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function ov(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var CL=/^\s*>\s$/,sv=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ei({find:CL,type:this.type})]}});var AL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ML=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,av=st.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Vn({find:AL,type:this.type}),Vn({find:NL,type:this.type})]},addPasteRules(){return[xn({find:ML,type:this.type}),xn({find:kL,type:this.type})]}});var OL="listItem",lv="textStyle",cv=/^\s*([-+*])\s$/,uv=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OL,this.editor.getAttributes(lv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ei({find:cv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:cv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lv),editor:this.editor})),[t]}});var RL=/(^|[^`])`([^`]+)`(?!`)/,IL=/(^|[^`])`([^`]+)`(?!`)/g,dv=st.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Vn({find:RL,type:this.type})]},addPasteRules(){return[xn({find:IL,type:this.type})]}});var DL=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;let o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},fv=st.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&DL(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}});var pv=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var Rp=ce.create({name:"doc",topNode:!0,content:"block+"});function hv(t={}){return new Oe({view(e){return new Ip(e,t)}})}var Ip=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Il(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var mv=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hv(this.options)]}});var on=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Dp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!LL(e)||!PL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(t.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};on.prototype.visible=!1;on.findFrom=on.findGapCursorFrom;ue.jsonID("gapcursor",on);var Dp=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return on.valid(n)?new on(n):ue.near(n)}};function LL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function PL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function gv(){return new Oe({props:{decorations:$L,createSelectionBetween(t,e,n){return e.pos==n.pos&&on.valid(n)?new on(n):null},handleClick:FL,handleKeyDown:BL,handleDOMEvents:{beforeinput:HL}}})}var BL=ra({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=on.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new on(d))),!0):!1}}function FL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!on.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new on(r))),!0)}function HL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof on))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let s=r.length-1;s>=0;s--)i=K.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function $L(t){if(!(t.selection instanceof on))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[wt.widget(t.selection.head,e,{key:"gapcursor"})])}var bv=We.create({name:"gapCursor",addProseMirrorPlugins(){return[gv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var yv=ce.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ee(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){let h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Ev=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var yc=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Yt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new vv(e):Yt.empty};var vv=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=yc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=yc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Yt);Yt.empty=new vv([]);var zL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Yt),Lp=Yt;var UL=500,ro=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let g=h.step.map(i.slice(o)),b;g&&s.maybeStep(g).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(b,void 0,void 0,d.length+f.length))),o--,b&&i.appendMap(b,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,u=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;fKL&&(l=WL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Us;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let g=o.getMirror(--u);if(g==null)return;s=Math.min(s,g);let b=o.maps[g];if(m.step){let E=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(o.slice(u+1,g));w&&l++,r.push(new mr(b,E,w))}else r.push(new mr(b))},i);let d=[];for(let m=n;mUL&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(h))?i[g]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Lp.from(i.reverse()),o)}};ro.empty=new ro(Lp.empty,0);function WL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},KL=20;function VL(t,e,n,r){let i=n.getMeta(no),o;if(i)return i.historyState;n.getMeta(YL)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(no))return s.getMeta(no).redo?new gr(t.done.addTransform(n,void 0,r,Ec(e)),t.undone,wv(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,Ec(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GL(n,t.prevRanges)),d=s?Pp(t.prevRanges,n.mapping):wv(n.mapping.maps);return new gr(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Ec(e)),ro.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function wv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Pp(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=no.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=qL(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Fp=vc(!1,!0),Hp=vc(!0,!0),$z=vc(!1,!1),zz=vc(!0,!1);var Sv=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fp(t,e),redo:()=>({state:t,dispatch:e})=>Hp(t,e)}},addProseMirrorPlugins(){return[_v(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Tv=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var u;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(he.create(s.doc,d.pos)):s.setSelection(le.create(s.doc,d.pos));else{let h=(u=d.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(s.insert(f,h),s.setSelection(le.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var JL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,XL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ZL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cv=st.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Vn({find:JL,type:this.type}),Vn({find:ZL,type:this.type})]},addPasteRules(){return[xn({find:XL,type:this.type}),xn({find:jL,type:this.type})]}});var $p=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ee(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var QL="listItem",Av="textStyle",Mv=/^(\d+)\.\s$/,Nv=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",ee(this.options.HTMLAttributes,n),0]:["ol",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(QL,this.editor.getAttributes(Av)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ei({find:Mv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:Mv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Av)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var wc=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var kv=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Oe({key:new ze("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let u=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&oa(s);if((u||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=wt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),ot.create(t,i)}}})]}});var eP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ov=st.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Vn({find:eP,type:this.type})]},addPasteRules(){return[xn({find:tP,type:this.type})]}});var Rv=st.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Iv=st.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Up,Wp;if(typeof WeakMap<"u"){let t=new WeakMap;Up=e=>t.get(e),Wp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Up=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-D});break}let T=i+D*e;for(let B=0;Br&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function iP(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function sP(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ac(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Xo(e.$head)||aP(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function aP(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Kp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function lP(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Wv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function io(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Kv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=n.pos-o);u.unshift(n.pos-o);let d=u.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new $o(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Kp(r)&&Kp(i)&&qp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return le.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let u=i.top;u0||w>0){let S=b.attrs;if(E>0&&(S=io(S,0,E)),w>0&&(S=io(S,S.colspan-w,w)),g.lefti.bottom){let S={...b.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.top<=l.top?(s.top>0&&(e=u.resolve(o+i.map[s.left])),l.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.left<=l.left?(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),l.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ot.create(t.doc,e)}function fP({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function pP({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function hP(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=et.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=et.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=et.create(i,u+1,d)}}else r instanceof le&&fP(r)?o=le.create(i,r.from):r instanceof le&&pP(r)&&(o=le.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var mP=new ze("fix-tables");function Gv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=gP(t,i,o,n))};return e?e.doc!=t.doc&&Gv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function gP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);let b=[];for(let w=0;w0?-1:0;cP(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;yP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function wP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof et){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=sP(i.$from),!o)return!1;s=(r=Xo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,u=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let g=0;g{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function xP(t){return function(e,n){if(!or(e))return!1;if(n){let r=sn(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{let b=g+o.tableStart,E=s.doc.nodeAt(b);E&&s.setNodeMarkup(b,m,E.attrs)}),r(s)}return!0}}var CU=Zo("row",{useDeprecatedLogic:!0}),AU=Zo("column",{useDeprecatedLogic:!0}),nw=Zo("cell",{useDeprecatedLogic:!0});function _P(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function xc(t,e){let n=t.selection;if(!(n instanceof et))return!1;if(e){let r=t.tr,i=sn(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function SP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(K.empty),n[i]r&&(m=m.type.createChecked(io(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let g=1;gi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(K.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function AP(t,e,n,r,i,o,s){let l=t.doc.type.schema,u=sn(l),d,f;if(i>e.width)for(let h=0,m=0;he.height){let h=[];for(let b=0,E=(e.height-1)*e.width;b=e.width?!1:n.nodeAt(e.map[E+b]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,K.from(h)),g=[];for(let b=e.height;b{if(!i)return!1;let o=n.selection;if(o instanceof et)return Tc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=iw(i,t,e);if(s==null)return!1;if(t=="horiz")return Tc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=Wv(l,t,e),d;return u?d=ue.near(u,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),Tc(n,r,d)}}}function Sc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof et)s=o;else{let u=iw(i,t,e);if(u==null)return!1;s=new et(n.doc.resolve(u))}let l=Wv(s.$headCell,t,e);return l?Tc(n,r,new et(s.$anchorCell,l)):!1}}function NP(t,e){let n=t.state.doc,r=Xo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function kP(t,e,n){if(!or(t.state))return!1;let r=SP(n),i=t.state.selection;if(i instanceof et){r||(r={width:1,height:1,rows:[K.from(Vp(sn(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=CP(r,l.right-l.left,l.bottom-l.top),Fv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=Ac(t.state),s=o.start(-1);return Fv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function OP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Hv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof et)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Xo(t.state.selection.$anchor))!=null&&((n=zp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=zp(t,d),h=vi.getState(t.state)==null;if(!f||!qp(u,f))if(h)f=u;else return;let m=new et(u,f);if(h||!t.state.selection.eq(m)){let g=t.state.tr.setSelection(m);h&&g.setMeta(vi,u.pos),t.dispatch(g)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),vi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(vi,-1))}function l(u){let d=u,f=vi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Hv(t,d.target)!=r&&(h=zp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function iw(t,e,n){if(!(t.state.selection instanceof le))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function Hv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function zp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Xo(t.state.doc.resolve(n.pos)):null}var RP=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Gp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gp(t,e,n,r,i,o){var s;let l=0,u=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;hnew r(m,n,g)),new IP(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{let l=On.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{DP(s,l,t,i)},mouseleave:s=>{LP(s)},mousedown:(s,l)=>{PP(s,l,e,n)}},decorations:s=>{let l=On.getState(s);if(l&&l.activeHandle>-1)return zP(s,l.activeHandle)},nodeViews:{}}});return o}var IP=class Cc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(On);if(r&&r.setHandle!=null)return new Cc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Cc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Kp(e.doc.resolve(i))||(i=-1),new Cc(i,n.dragging)}return n}};function DP(t,e,n,r){let i=On.getState(t.state);if(i&&!i.dragging){let o=FP(e.target),s=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?s=$v(t,e,"left",n):u-e.clientX<=n&&(s=$v(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){let l=t.state.doc.resolve(s),u=l.node(-1),d=mt.get(u),f=l.start(-1);if(d.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==d.width-1)return}sw(t,s)}}}function LP(t){let e=On.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&sw(t,-1)}function PP(t,e,n,r){var i;let o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=On.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;let l=t.state.doc.nodeAt(s.activeHandle),u=BP(t,s.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(On,{setDragging:{startX:e.clientX,startWidth:u}}));function d(h){o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",f);let m=On.getState(t.state);m?.dragging&&(HP(t,m.activeHandle,zv(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(On,{setDragging:null})))}function f(h){if(!h.which)return d(h);let m=On.getState(t.state);if(m&&m.dragging){let g=zv(m.dragging,h,n);Uv(t,m.activeHandle,g,r)}}return Uv(t,s.activeHandle,u,r),o.addEventListener("mouseup",d),o.addEventListener("mousemove",f),e.preventDefault(),!0}function BP(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let d=0;d{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function KP(t,e,n,r,i){let o=WP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!VP(e))return!1;let n=0,r=Np(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},uw=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Qp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=UP(t,this.options.cellMinWidth);return["table",ee(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=KP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(le.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Yv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Jv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>jv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Qv(t,e),deleteRow:()=>({state:t,dispatch:e})=>ew(t,e),deleteTable:()=>({state:t,dispatch:e})=>rw(t,e),mergeCells:()=>({state:t,dispatch:e})=>Jp(t,e),splitCell:()=>({state:t,dispatch:e})=>Xp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Zo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Zo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>nw(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Jp(t,e)?!0:Xp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>tw(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Zp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Zp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Yp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=et.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Mc,"Mod-Backspace":Mc,Delete:Mc,"Mod-Delete":Mc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ow({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],aw({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(re(t,"tableRole",e))}}});var dw=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ee(this.options.HTMLAttributes,t),0]}});var fw=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ee(this.options.HTMLAttributes,t),0]}});var pw=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ee(this.options.HTMLAttributes,t),0]}});var hw=ce.create({name:"text",group:"inline"});var mw=st.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var GP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,qP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,gw=st.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Vn({find:GP,type:this.type})]},addPasteRules(){return[xn({find:qP,type:this.type})]}});var gt="top",Dt="bottom",Mt="right",xt="left",Nc="auto",wi=[gt,Dt,Mt,xt],Kr="start",oo="end",bw="clippingParents",kc="viewport",jo="popper",yw="reference",eh=wi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+oo])},[]),Oc=[].concat(wi,[Nc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+oo])},[]),YP="beforeRead",JP="read",XP="afterRead",ZP="beforeMain",jP="main",QP="afterMain",eB="beforeWrite",tB="write",nB="afterWrite",Ew=[YP,JP,XP,ZP,jP,QP,eB,tB,nB];function Wt(t){return t?(t.nodeName||"").toLowerCase():null}function ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Gn(t){var e=ct(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Qo(t){if(typeof ShadowRoot>"u")return!1;var e=ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function rB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function iB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var aa={name:"applyStyles",enabled:!0,phase:"write",fn:rB,effect:iB,requires:["computeStyles"]};function Kt(t){return t.split("-")[0]}var sr=Math.max,so=Math.min,Vr=Math.round;function es(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function la(){return!/^((?!chrome|android).)*safari/i.test(es())}function qn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Gn(t)?ct(t):window,l=s.visualViewport,u=!la()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function ao(t){var e=qn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ca(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Qo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return ct(t).getComputedStyle(t)}function th(t){return["table","td","th"].indexOf(Wt(t))>=0}function Jt(t){return((Gn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Wt(t)==="html"?t:t.assignedSlot||t.parentNode||(Qo(t)?t.host:null)||Jt(t)}function vw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function oB(t){var e=/firefox/i.test(es()),n=/Trident/i.test(es());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Gr(t);for(Qo(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=ct(t),n=vw(t);n&&th(n)&&gn(n).position==="static";)n=vw(n);return n&&(Wt(n)==="html"||Wt(n)==="body"&&gn(n).position==="static")?e:n||oB(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,n){return sr(t,so(e,n))}function ww(t,e,n){var r=co(t,e,n);return r>n?n:r}function ua(){return{top:0,right:0,bottom:0,left:0}}function da(t){return Object.assign({},ua(),t)}function fa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var sB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,da(typeof e!="number"?e:fa(e,wi))};function aB(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Kt(n.placement),u=lo(l),d=[xt,Mt].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=sB(i.padding,n),m=ao(o),g=u==="y"?gt:xt,b=u==="y"?Dt:Mt,E=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],w=s[u]-n.rects.reference[u],S=ar(o),N=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,D=E/2-w/2,T=h[g],B=N-m[f]-h[b],R=N/2-m[f]/2+D,Y=co(T,R,B),ne=u;n.modifiersData[r]=(e={},e[ne]=Y,e.centerOffset=Y-R,e)}}function lB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ca(e.elements.popper,i)&&(e.elements.arrow=i))}var xw={name:"arrow",enabled:!0,phase:"main",fn:aB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yn(t){return t.split("-")[1]}var cB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function _w(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,g=m===void 0?0:m,b=s.y,E=b===void 0?0:b,w=typeof f=="function"?f({x:g,y:E}):{x:g,y:E};g=w.x,E=w.y;var S=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),D=xt,T=gt,B=window;if(d){var R=ar(n),Y="clientHeight",ne="clientWidth";if(R===ct(n)&&(R=Jt(n),gn(R).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ne="scrollWidth")),R=R,i===gt||(i===xt||i===Mt)&&o===oo){T=Dt;var q=h&&R===B&&B.visualViewport?B.visualViewport.height:R[Y];E-=q-r.height,E*=u?1:-1}if(i===xt||(i===gt||i===Dt)&&o===oo){D=Mt;var Q=h&&R===B&&B.visualViewport?B.visualViewport.width:R[ne];g-=Q-r.width,g*=u?1:-1}}var fe=Object.assign({position:l},d&&cB),we=f===!0?uB({x:g,y:E},ct(n)):{x:g,y:E};if(g=we.x,E=we.y,u){var me;return Object.assign({},fe,(me={},me[T]=N?"0":"",me[D]=S?"0":"",me.transform=(B.devicePixelRatio||1)<=1?"translate("+g+"px, "+E+"px)":"translate3d("+g+"px, "+E+"px, 0)",me))}return Object.assign({},fe,(e={},e[T]=N?E+"px":"",e[D]=S?g+"px":"",e.transform="",e))}function dB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Kt(e.placement),variation:Yn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_w(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,_w(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Sw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dB,data:{}};var Rc={passive:!0};function fB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=ct(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Rc)}),l&&u.addEventListener("resize",n.update,Rc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Rc)}),l&&u.removeEventListener("resize",n.update,Rc)}}var Tw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fB,data:{}};var pB={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(t){return t.replace(/left|right|bottom|top/g,function(e){return pB[e]})}var hB={start:"end",end:"start"};function Ic(t){return t.replace(/start|end/g,function(e){return hB[e]})}function uo(t){var e=ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fo(t){return qn(Jt(t)).left+uo(t).scrollLeft}function nh(t,e){var n=ct(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=la();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+fo(t),y:u}}function rh(t){var e,n=Jt(t),r=uo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+fo(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function po(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Dc(t){return["html","body","#document"].indexOf(Wt(t))>=0?t.ownerDocument.body:Lt(t)&&po(t)?t:Dc(Gr(t))}function xi(t,e){var n;e===void 0&&(e=[]);var r=Dc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],po(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(xi(Gr(s)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mB(t,e){var n=qn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Cw(t,e,n){return e===kc?ns(nh(t,n)):Gn(e)?mB(e,n):ns(rh(Jt(t)))}function gB(t){var e=xi(Gr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return Gn(r)?e.filter(function(i){return Gn(i)&&ca(i,r)&&Wt(i)!=="body"}):[]}function ih(t,e,n,r){var i=e==="clippingParents"?gB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=Cw(t,d,r);return u.top=sr(f.top,u.top),u.right=so(f.right,u.right),u.bottom=so(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},Cw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function pa(t){var e=t.reference,n=t.element,r=t.placement,i=r?Kt(r):null,o=r?Yn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case gt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case Mt:u={x:e.x+e.width,y:l};break;case xt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?lo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case oo:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?bw:l,d=n.rootBoundary,f=d===void 0?kc:d,h=n.elementContext,m=h===void 0?jo:h,g=n.altBoundary,b=g===void 0?!1:g,E=n.padding,w=E===void 0?0:E,S=da(typeof w!="number"?w:fa(w,wi)),N=m===jo?yw:jo,D=t.rects.popper,T=t.elements[b?N:m],B=ih(Gn(T)?T:T.contextElement||Jt(t.elements.popper),u,f,s),R=qn(t.elements.reference),Y=pa({reference:R,element:D,strategy:"absolute",placement:i}),ne=ns(Object.assign({},D,Y)),q=m===jo?ne:R,Q={top:B.top-q.top+S.top,bottom:q.bottom-B.bottom+S.bottom,left:B.left-q.left+S.left,right:q.right-B.right+S.right},fe=t.modifiersData.offset;if(m===jo&&fe){var we=fe[i];Object.keys(Q).forEach(function(me){var Ce=[Mt,Dt].indexOf(me)>=0?1:-1,ge=[gt,Dt].indexOf(me)>=0?"y":"x";Q[me]+=we[ge]*Ce})}return Q}function oh(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Oc:u,f=Yn(r),h=f?l?eh:eh.filter(function(b){return Yn(b)===f}):wi,m=h.filter(function(b){return d.indexOf(b)>=0});m.length===0&&(m=h);var g=m.reduce(function(b,E){return b[E]=lr(t,{placement:E,boundary:i,rootBoundary:o,padding:s})[Kt(E)],b},{});return Object.keys(g).sort(function(b,E){return g[b]-g[E]})}function bB(t){if(Kt(t)===Nc)return[];var e=ts(t);return[Ic(t),e,Ic(e)]}function yB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,E=n.allowedAutoPlacements,w=e.options.placement,S=Kt(w),N=S===w,D=u||(N||!b?[ts(w)]:bB(w)),T=[w].concat(D).reduce(function(je,Ne){return je.concat(Kt(Ne)===Nc?oh(e,{placement:Ne,boundary:f,rootBoundary:h,padding:d,flipVariations:b,allowedAutoPlacements:E}):Ne)},[]),B=e.rects.reference,R=e.rects.popper,Y=new Map,ne=!0,q=T[0],Q=0;Q=0,ge=Ce?"width":"height",ye=lr(e,{placement:fe,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?Mt:xt:me?Dt:gt;B[ge]>R[ge]&&(A=ts(A));var I=ts(A),z=[];if(o&&z.push(ye[we]<=0),l&&z.push(ye[A]<=0,ye[I]<=0),z.every(function(je){return je})){q=fe,ne=!1;break}Y.set(fe,z)}if(ne)for(var j=b?3:1,ie=function(Ne){var Be=T.find(function(_t){var kt=Y.get(_t);if(kt)return kt.slice(0,Ne).every(function(Re){return Re})});if(Be)return q=Be,"break"},xe=j;xe>0;xe--){var Ae=ie(xe);if(Ae==="break")break}e.placement!==q&&(e.modifiersData[r]._skip=!0,e.placement=q,e.reset=!0)}}var Aw={name:"flip",enabled:!0,phase:"main",fn:yB,requiresIfExists:["offset"],data:{_skip:!1}};function Mw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Nw(t){return[gt,Mt,Dt,xt].some(function(e){return t[e]>=0})}function EB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=Mw(s,r),d=Mw(l,i,o),f=Nw(u),h=Nw(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:EB};function vB(t,e,n){var r=Kt(t),i=[xt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[xt,Mt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function wB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Oc.reduce(function(f,h){return f[h]=vB(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var Ow={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wB};function xB(t){var e=t.state,n=t.name;e.modifiersData[n]=pa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Rw={name:"popperOffsets",enabled:!0,phase:"read",fn:xB,data:{}};function sh(t){return t==="x"?"y":"x"}function _B(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,g=m===void 0?!0:m,b=n.tetherOffset,E=b===void 0?0:b,w=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),S=Kt(e.placement),N=Yn(e.placement),D=!N,T=lo(S),B=sh(T),R=e.modifiersData.popperOffsets,Y=e.rects.reference,ne=e.rects.popper,q=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,Q=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),fe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,we={x:0,y:0};if(R){if(o){var me,Ce=T==="y"?gt:xt,ge=T==="y"?Dt:Mt,ye=T==="y"?"height":"width",A=R[T],I=A+w[Ce],z=A-w[ge],j=g?-ne[ye]/2:0,ie=N===Kr?Y[ye]:ne[ye],xe=N===Kr?-ne[ye]:-Y[ye],Ae=e.elements.arrow,je=g&&Ae?ao(Ae):{width:0,height:0},Ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ua(),Be=Ne[Ce],_t=Ne[ge],kt=co(0,Y[ye],je[ye]),Re=D?Y[ye]/2-j-kt-Be-Q.mainAxis:ie-kt-Be-Q.mainAxis,St=D?-Y[ye]/2+j+kt+_t+Q.mainAxis:xe+kt+_t+Q.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),pt=Xt?T==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,an=(me=fe?.[T])!=null?me:0,Zt=A+Re-an-pt,Tt=A+St-an,Je=co(g?so(I,Zt):I,A,g?sr(z,Tt):z);R[T]=Je,we[T]=Je-A}if(l){var jn,Pt=T==="x"?gt:xt,V=T==="x"?Dt:Mt,yt=R[B],_e=B==="y"?"height":"width",pe=yt+w[Pt],ut=yt-w[V],dt=[gt,xt].indexOf(S)!==-1,Bt=(jn=fe?.[B])!=null?jn:0,Ot=dt?pe:yt-Y[_e]-ne[_e]-Bt+Q.altAxis,L=dt?yt+Y[_e]+ne[_e]-Bt-Q.altAxis:ut,H=g&&dt?ww(Ot,yt,L):co(g?Ot:pe,yt,g?L:ut);R[B]=H,we[B]=H-yt}e.modifiersData[r]=we}}var Iw={name:"preventOverflow",enabled:!0,phase:"main",fn:_B,requiresIfExists:["offset"]};function ah(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lh(t){return t===ct(t)||!Lt(t)?uo(t):ah(t)}function SB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ch(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&SB(e),o=Jt(e),s=qn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Wt(e)!=="body"||po(o))&&(l=lh(e)),Lt(e)?(u=qn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=fo(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function TB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function uh(t){var e=TB(t);return Ew.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function dh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function fh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Dw={placement:"bottom",modifiers:[],strategy:"absolute"};function Lw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Xw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Bw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function NB(t){return t.split(/\s+/).filter(Boolean)}function rs(t){return[].concat(t)}function Fw(t,e){t.indexOf(e)===-1&&t.push(e)}function kB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function OB(t){return t.split("-")[0]}function Pc(t){return[].slice.call(t)}function Hw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ha(){return document.createElement("div")}function Bc(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function RB(t){return vh(t,"NodeList")}function IB(t){return vh(t,"MouseEvent")}function DB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function LB(t){return Bc(t)?[t]:RB(t)?Pc(t):Array.isArray(t)?t:Pc(document.querySelectorAll(t))}function mh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $w(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function PB(t){var e,n=rs(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function BB(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=OB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,g=d==="right"?f.left.x:0,b=d==="left"?f.right.x:0,E=o.top-r+h>u,w=r-o.bottom-m>u,S=o.left-n+g>u,N=n-o.right-b>u;return E||w||S||N})}function gh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function zw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Uw=0;function FB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zw))}function Zw(){var t=performance.now();t-Uw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Zw)),Uw=t}function HB(){var t=document.activeElement;if(DB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $B(){document.addEventListener("touchstart",FB,ho),window.addEventListener("blur",HB)}var zB=typeof window<"u"&&typeof document<"u",UB=zB?!!window.msCrypto:!1;var WB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},KB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Jw,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},WB,KB),VB=Object.keys(cr),GB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function jw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function qB(t,e){var n=e?Object.keys(jw(Object.assign({},cr,{plugins:e}))):VB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Ww(t,e){var n=Object.assign({},e,{content:Xw(e.content,[t])},e.ignoreAttributes?{}:qB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var YB=function(){return"innerHTML"};function yh(t,e){t[YB()]=e}function Kw(t){var e=ha();return t===!0?e.className=qw:(e.className=Yw,Bc(t)?e.appendChild(t):yh(e,t)),e}function Vw(t,e){Bc(e.content)?(yh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yh(t,e.content):t.textContent=e.content)}function Eh(t){var e=t.firstElementChild,n=Pc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Gw)}),arrow:n.find(function(r){return r.classList.contains(qw)||r.classList.contains(Yw)}),backdrop:n.find(function(r){return r.classList.contains(MB)})}}function Qw(t){var e=ha(),n=ha();n.className=AB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ha();r.className=Gw,r.setAttribute("data-state","hidden"),Vw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Eh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(Kw(s.arrow))):u.appendChild(Kw(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}Qw.$$tippy=!0;var JB=1,Lc=[],bh=[];function XB(t,e){var n=Ww(t,Object.assign({},cr,jw(Hw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,g=[],b=Bw(Zt,n.interactiveDebounce),E,w=JB++,S=null,N=kB(n.plugins),D={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:w,reference:t,popper:ha(),popperInstance:S,props:n,state:D,plugins:N,clearDelayTimeouts:Ot,setProps:L,setContent:H,show:X,hide:se,hideWithInteractivity:Fe,enable:dt,disable:Bt,unmount:rt,destroy:wr};if(!n.render)return T;var B=n.render(T),R=B.popper,Y=B.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+T.id,T.popper=R,t._tippy=T,R._tippy=T;var ne=N.map(function(F){return F.fn(T)}),q=t.hasAttribute("aria-expanded");return Xt(),j(),A(),I("onCreate",[T]),n.showOnCreate&&pe(),R.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",b)}),T;function Q(){var F=T.props.touch;return Array.isArray(F)?F:[F,0]}function fe(){return Q()[0]==="hold"}function we(){var F;return!!((F=T.props.render)!=null&&F.$$tippy)}function me(){return E||t}function Ce(){var F=me().parentNode;return F?PB(F):document}function ge(){return Eh(R)}function ye(F){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:hh(T.props.delay,F?0:1,cr.delay)}function A(F){F===void 0&&(F=!1),R.style.pointerEvents=T.props.interactive&&!F?"":"none",R.style.zIndex=""+T.props.zIndex}function I(F,ae,Se){if(Se===void 0&&(Se=!0),ne.forEach(function(Ke){Ke[F]&&Ke[F].apply(Ke,ae)}),Se){var qe;(qe=T.props)[F].apply(qe,ae)}}function z(){var F=T.props.aria;if(F.content){var ae="aria-"+F.content,Se=R.id,qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){var Ft=Ke.getAttribute(ae);if(T.state.isVisible)Ke.setAttribute(ae,Ft?Ft+" "+Se:Se);else{var ln=Ft&&Ft.replace(Se,"").trim();ln?Ke.setAttribute(ae,ln):Ke.removeAttribute(ae)}})}}function j(){if(!(q||!T.props.aria.expanded)){var F=rs(T.props.triggerTarget||t);F.forEach(function(ae){T.props.interactive?ae.setAttribute("aria-expanded",T.state.isVisible&&ae===me()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function ie(){Ce().removeEventListener("mousemove",b),Lc=Lc.filter(function(F){return F!==b})}function xe(F){if(!(yr.isTouch&&(u||F.type==="mousedown"))){var ae=F.composedPath&&F.composedPath()[0]||F.target;if(!(T.props.interactive&&zw(R,ae))){if(rs(T.props.triggerTarget||t).some(function(Se){return zw(Se,ae)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[T,F]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function Ae(){u=!0}function je(){u=!1}function Ne(){var F=Ce();F.addEventListener("mousedown",xe,!0),F.addEventListener("touchend",xe,ho),F.addEventListener("touchstart",je,ho),F.addEventListener("touchmove",Ae,ho)}function Be(){var F=Ce();F.removeEventListener("mousedown",xe,!0),F.removeEventListener("touchend",xe,ho),F.removeEventListener("touchstart",je,ho),F.removeEventListener("touchmove",Ae,ho)}function _t(F,ae){Re(F,function(){!T.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&ae()})}function kt(F,ae){Re(F,ae)}function Re(F,ae){var Se=ge().box;function qe(Ke){Ke.target===Se&&(gh(Se,"remove",qe),ae())}if(F===0)return ae();gh(Se,"remove",h),gh(Se,"add",qe),h=qe}function St(F,ae,Se){Se===void 0&&(Se=!1);var qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){Ke.addEventListener(F,ae,Se),g.push({node:Ke,eventType:F,handler:ae,options:Se})})}function Xt(){fe()&&(St("touchstart",an,{passive:!0}),St("touchend",Tt,{passive:!0})),NB(T.props.trigger).forEach(function(F){if(F!=="manual")switch(St(F,an),F){case"mouseenter":St("mouseleave",Tt);break;case"focus":St(UB?"focusout":"blur",Je);break;case"focusin":St("focusout",Je);break}})}function pt(){g.forEach(function(F){var ae=F.node,Se=F.eventType,qe=F.handler,Ke=F.options;ae.removeEventListener(Se,qe,Ke)}),g=[]}function an(F){var ae,Se=!1;if(!(!T.state.isEnabled||jn(F)||l)){var qe=((ae=f)==null?void 0:ae.type)==="focus";f=F,E=F.currentTarget,j(),!T.state.isVisible&&IB(F)&&Lc.forEach(function(Ke){return Ke(F)}),F.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?Se=!0:pe(F),F.type==="click"&&(s=!Se),Se&&!qe&&ut(F)}}function Zt(F){var ae=F.target,Se=me().contains(ae)||R.contains(ae);if(!(F.type==="mousemove"&&Se)){var qe=_e().concat(R).map(function(Ke){var Ft,ln=Ke._tippy,Zr=(Ft=ln.popperInstance)==null?void 0:Ft.state;return Zr?{popperRect:Ke.getBoundingClientRect(),popperState:Zr,props:n}:null}).filter(Boolean);BB(qe,F)&&(ie(),ut(F))}}function Tt(F){var ae=jn(F)||T.props.trigger.indexOf("click")>=0&&s;if(!ae){if(T.props.interactive){T.hideWithInteractivity(F);return}ut(F)}}function Je(F){T.props.trigger.indexOf("focusin")<0&&F.target!==me()||T.props.interactive&&F.relatedTarget&&R.contains(F.relatedTarget)||ut(F)}function jn(F){return yr.isTouch?fe()!==F.type.indexOf("touch")>=0:!1}function Pt(){V();var F=T.props,ae=F.popperOptions,Se=F.placement,qe=F.offset,Ke=F.getReferenceClientRect,Ft=F.moveTransition,ln=we()?Eh(R).arrow:null,Zr=Ke?{getBoundingClientRect:Ke,contextElement:Ke.contextElement||me()}:t,Da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ni){var jr=Ni.state;if(we()){var zu=ge(),ys=zu.box;["placement","reference-hidden","escaped"].forEach(function(Qr){Qr==="placement"?ys.setAttribute("data-placement",jr.placement):jr.attributes.popper["data-popper-"+Qr]?ys.setAttribute("data-"+Qr,""):ys.removeAttribute("data-"+Qr)}),jr.attributes.popper={}}}},xr=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ft}},Da];we()&&ln&&xr.push({name:"arrow",options:{element:ln,padding:3}}),xr.push.apply(xr,ae?.modifiers||[]),T.popperInstance=ph(Zr,R,Object.assign({},ae,{placement:Se,onFirstUpdate:m,modifiers:xr}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function yt(){var F=T.props.appendTo,ae,Se=me();T.props.interactive&&F===Jw||F==="parent"?ae=Se.parentNode:ae=Xw(F,[Se]),ae.contains(R)||ae.appendChild(R),T.state.isMounted=!0,Pt()}function _e(){return Pc(R.querySelectorAll("[data-tippy-root]"))}function pe(F){T.clearDelayTimeouts(),F&&I("onTrigger",[T,F]),Ne();var ae=ye(!0),Se=Q(),qe=Se[0],Ke=Se[1];yr.isTouch&&qe==="hold"&&Ke&&(ae=Ke),ae?r=setTimeout(function(){T.show()},ae):T.show()}function ut(F){if(T.clearDelayTimeouts(),I("onUntrigger",[T,F]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(F.type)>=0&&s)){var ae=ye(!1);ae?i=setTimeout(function(){T.state.isVisible&&T.hide()},ae):o=requestAnimationFrame(function(){T.hide()})}}function dt(){T.state.isEnabled=!0}function Bt(){T.hide(),T.state.isEnabled=!1}function Ot(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function L(F){if(!T.state.isDestroyed){I("onBeforeUpdate",[T,F]),pt();var ae=T.props,Se=Ww(t,Object.assign({},ae,Hw(F),{ignoreAttributes:!0}));T.props=Se,Xt(),ae.interactiveDebounce!==Se.interactiveDebounce&&(ie(),b=Bw(Zt,Se.interactiveDebounce)),ae.triggerTarget&&!Se.triggerTarget?rs(ae.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):Se.triggerTarget&&t.removeAttribute("aria-expanded"),j(),A(),Y&&Y(ae,Se),T.popperInstance&&(Pt(),_e().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),I("onAfterUpdate",[T,F])}}function H(F){T.setProps({content:F})}function X(){var F=T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ke=hh(T.props.duration,0,cr.duration);if(!(F||ae||Se||qe)&&!me().hasAttribute("disabled")&&(I("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,we()&&(R.style.visibility="visible"),A(),Ne(),T.state.isMounted||(R.style.transition="none"),we()){var Ft=ge(),ln=Ft.box,Zr=Ft.content;mh([ln,Zr],0)}m=function(){var xr;if(!(!T.state.isVisible||d)){if(d=!0,R.offsetHeight,R.style.transition=T.props.moveTransition,we()&&T.props.animation){var bs=ge(),Ni=bs.box,jr=bs.content;mh([Ni,jr],Ke),$w([Ni,jr],"visible")}z(),j(),Fw(bh,T),(xr=T.popperInstance)==null||xr.forceUpdate(),I("onMount",[T]),T.props.animation&&we()&&kt(Ke,function(){T.state.isShown=!0,I("onShown",[T])})}},yt()}}function se(){var F=!T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=hh(T.props.duration,1,cr.duration);if(!(F||ae||Se)&&(I("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,we()&&(R.style.visibility="hidden"),ie(),Be(),A(!0),we()){var Ke=ge(),Ft=Ke.box,ln=Ke.content;T.props.animation&&(mh([Ft,ln],qe),$w([Ft,ln],"hidden"))}z(),j(),T.props.animation?we()&&_t(qe,T.unmount):T.unmount()}}function Fe(F){Ce().addEventListener("mousemove",b),Fw(Lc,b),b(F)}function rt(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),_e().forEach(function(F){F._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),bh=bh.filter(function(F){return F!==T}),T.state.isMounted=!1,I("onHidden",[T]))}function wr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,I("onDestroy",[T]))}}function ma(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);$B();var r=Object.assign({},e,{plugins:n}),i=LB(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&XB(d,r);return f&&u.push(f),u},[]);return Bc(t)?l[0]:l}ma.defaultProps=cr;ma.setDefaultProps=GB;ma.currentInput=yr;var JV=Object.assign({},aa,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ma.setDefaultProps({render:Qw});var is=ma;var wh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:d,to:f})=>{let{doc:h,selection:m}=u,{empty:g}=m,b=!h.textBetween(d,f).length&&dc(u.selection),E=this.element.contains(document.activeElement);return!(!(l.hasFocus()||E)||g||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{let d=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,u)},this.updateDelay))},this.updateHandler=(l,u,d,f)=>{var h,m,g;let{state:b,composing:E}=l,{selection:w}=b;if(E||!u&&!d)return;this.createTooltip();let{ranges:N}=w,D=Math.min(...N.map(R=>R.$from.pos)),T=Math.max(...N.map(R=>R.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,element:this.element,view:l,state:b,oldState:f,from:D,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((g=this.tippyOptions)===null||g===void 0?void 0:g.getReferenceClientRect)||(()=>{if(hc(b.selection)){let R=l.nodeDOM(D);if(R){let Y=R.dataset.nodeViewWrapper?R:R.querySelector("[data-node-view-wrapper]");if(Y&&(R=Y.firstChild),R)return R.getBoundingClientRect()}}return mc(l,D,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ZB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new wh({view:e,...t})}),ex=We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var xh=class{getTextContent(e){return kp(e,{textSerializers:uc(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:u}=l,{$anchor:d,empty:f}=u,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:u}=s,{from:d,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>mc(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},jB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new xh({view:e,...t})}),tx=We.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[jB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var _h=ce.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var Sh=ce.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var QB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",e2="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",as=(t,e)=>{for(let n in e)t[n]=e[n];return t},Oh="numeric",Rh="ascii",Ih="alpha",ya="asciinumeric",ba="alphanumeric",Dh="domain",lx="emoji",t2="scheme",n2="slashscheme",Th="whitespace";function r2(t,e){return t in e||(e[t]=[]),e[t]}function mo(t,e,n){e[Oh]&&(e[ya]=!0,e[ba]=!0),e[Rh]&&(e[ya]=!0,e[Ih]=!0),e[ya]&&(e[ba]=!0),e[Ih]&&(e[ba]=!0),e[ba]&&(e[Dh]=!0),e[lx]&&(e[Dh]=!0);for(let r in e){let i=r2(r,n);i.indexOf(t)<0&&i.push(t)}}function i2(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),bt=(t,e,n,r,i)=>t.tr(e,n,r,i),nx=(t,e,n,r,i)=>t.ts(e,n,r,i),J=(t,e,n,r,i)=>t.tt(e,n,r,i),Jr="WORD",Lh="UWORD",cx="ASCIINUMERICAL",ux="ALPHANUMERICAL",Sa="LOCALHOST",Ph="TLD",Bh="UTLD",zc="SCHEME",ss="SLASH_SCHEME",Hh="NUM",Fh="WS",$h="NL",Ea="OPENBRACE",va="CLOSEBRACE",Uc="OPENBRACKET",Wc="CLOSEBRACKET",Kc="OPENPAREN",Vc="CLOSEPAREN",Gc="OPENANGLEBRACKET",qc="CLOSEANGLEBRACKET",Yc="FULLWIDTHLEFTPAREN",Jc="FULLWIDTHRIGHTPAREN",Xc="LEFTCORNERBRACKET",Zc="RIGHTCORNERBRACKET",jc="LEFTWHITECORNERBRACKET",Qc="RIGHTWHITECORNERBRACKET",eu="FULLWIDTHLESSTHAN",tu="FULLWIDTHGREATERTHAN",nu="AMPERSAND",zh="APOSTROPHE",ru="ASTERISK",Si="AT",iu="BACKSLASH",ou="BACKTICK",su="CARET",Ti="COLON",Uh="COMMA",au="DOLLAR",Er="DOT",lu="EQUALS",Wh="EXCLAMATION",Xn="HYPHEN",wa="PERCENT",cu="PIPE",uu="PLUS",du="POUND",xa="QUERY",Kh="QUOTE",dx="FULLWIDTHMIDDLEDOT",Vh="SEMI",vr="SLASH",_a="TILDE",fu="UNDERSCORE",fx="EMOJI",pu="SYM",px=Object.freeze({__proto__:null,WORD:Jr,UWORD:Lh,ASCIINUMERICAL:cx,ALPHANUMERICAL:ux,LOCALHOST:Sa,TLD:Ph,UTLD:Bh,SCHEME:zc,SLASH_SCHEME:ss,NUM:Hh,WS:Fh,NL:$h,OPENBRACE:Ea,CLOSEBRACE:va,OPENBRACKET:Uc,CLOSEBRACKET:Wc,OPENPAREN:Kc,CLOSEPAREN:Vc,OPENANGLEBRACKET:Gc,CLOSEANGLEBRACKET:qc,FULLWIDTHLEFTPAREN:Yc,FULLWIDTHRIGHTPAREN:Jc,LEFTCORNERBRACKET:Xc,RIGHTCORNERBRACKET:Zc,LEFTWHITECORNERBRACKET:jc,RIGHTWHITECORNERBRACKET:Qc,FULLWIDTHLESSTHAN:eu,FULLWIDTHGREATERTHAN:tu,AMPERSAND:nu,APOSTROPHE:zh,ASTERISK:ru,AT:Si,BACKSLASH:iu,BACKTICK:ou,CARET:su,COLON:Ti,COMMA:Uh,DOLLAR:au,DOT:Er,EQUALS:lu,EXCLAMATION:Wh,HYPHEN:Xn,PERCENT:wa,PIPE:cu,PLUS:uu,POUND:du,QUERY:xa,QUOTE:Kh,FULLWIDTHMIDDLEDOT:dx,SEMI:Vh,SLASH:vr,TILDE:_a,UNDERSCORE:fu,EMOJI:fx,SYM:pu}),qr=/[a-z]/,ga=/\p{L}/u,Ch=/\p{Emoji}/u;var Yr=/\d/,Ah=/\s/;var rx="\r",Mh=` +`,o2="\uFE0F",s2="\u200D",Nh="\uFFFC",Fc=null,Hc=null;function a2(t=[]){let e={};_n.groups=e;let n=new _n;Fc==null&&(Fc=ix(QB)),Hc==null&&(Hc=ix(e2)),J(n,"'",zh),J(n,"{",Ea),J(n,"}",va),J(n,"[",Uc),J(n,"]",Wc),J(n,"(",Kc),J(n,")",Vc),J(n,"<",Gc),J(n,">",qc),J(n,"\uFF08",Yc),J(n,"\uFF09",Jc),J(n,"\u300C",Xc),J(n,"\u300D",Zc),J(n,"\u300E",jc),J(n,"\u300F",Qc),J(n,"\uFF1C",eu),J(n,"\uFF1E",tu),J(n,"&",nu),J(n,"*",ru),J(n,"@",Si),J(n,"`",ou),J(n,"^",su),J(n,":",Ti),J(n,",",Uh),J(n,"$",au),J(n,".",Er),J(n,"=",lu),J(n,"!",Wh),J(n,"-",Xn),J(n,"%",wa),J(n,"|",cu),J(n,"+",uu),J(n,"#",du),J(n,"?",xa),J(n,'"',Kh),J(n,"/",vr),J(n,";",Vh),J(n,"~",_a),J(n,"_",fu),J(n,"\\",iu),J(n,"\u30FB",dx);let r=bt(n,Yr,Hh,{[Oh]:!0});bt(r,Yr,r);let i=bt(r,qr,cx,{[ya]:!0}),o=bt(r,ga,ux,{[ba]:!0}),s=bt(n,qr,Jr,{[Rh]:!0});bt(s,Yr,i),bt(s,qr,s),bt(i,Yr,i),bt(i,qr,i);let l=bt(n,ga,Lh,{[Ih]:!0});bt(l,qr),bt(l,Yr,o),bt(l,ga,l),bt(o,Yr,o),bt(o,qr),bt(o,ga,o);let u=J(n,Mh,$h,{[Th]:!0}),d=J(n,rx,Fh,{[Th]:!0}),f=bt(n,Ah,Fh,{[Th]:!0});J(n,Nh,f),J(d,Mh,u),J(d,Nh,f),bt(d,Ah,f),J(f,rx),J(f,Mh),bt(f,Ah,f),J(f,Nh,f);let h=bt(n,Ch,fx,{[lx]:!0});J(h,"#"),bt(h,Ch,h),J(h,o2,h);let m=J(h,s2);J(m,"#"),bt(m,Ch,h);let g=[[qr,s],[Yr,i]],b=[[qr,null],[ga,l],[Yr,o]];for(let E=0;EE[0]>w[0]?1:-1);for(let E=0;E=0?N[Dh]=!0:qr.test(w)?Yr.test(w)?N[ya]=!0:N[Rh]=!0:N[Oh]=!0,nx(n,w,w,N)}return nx(n,"localhost",Sa,{ascii:!0}),n.jd=new _n(pu),{start:n,tokens:as({groups:e},px)}}function hx(t,e){let n=l2(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function l2(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function _i(t,e,n,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ta={defaultProtocol:"http",events:null,format:ox,formatHref:ox,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gh(t,e=null){let n=as({},Ta);t&&(n=as(n,t instanceof Gh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ta.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),u&&(s.target=u),d&&(s.rel=d),f&&as(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function hu(t,e){class n extends mx{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var sx=hu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ax=hu("text"),c2=hu("nl"),$c=hu("url",{isLink:!0,toHref(t=Ta.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Sa&&t[1].t===Ti}});var Jn=t=>new _n(t);function u2({groups:t}){let e=t.domain.concat([nu,ru,Si,iu,ou,su,au,lu,Xn,Hh,wa,cu,uu,du,vr,pu,_a,fu]),n=[Ti,Uh,Er,Wh,wa,xa,Kh,Vh,Gc,qc,Ea,va,Wc,Uc,Kc,Vc,Yc,Jc,Xc,Zc,jc,Qc,eu,tu],r=[nu,zh,ru,iu,ou,su,au,lu,Xn,Ea,va,wa,cu,uu,du,xa,vr,pu,_a,fu],i=Jn(),o=J(i,_a);Pe(o,r,o),Pe(o,t.domain,o);let s=Jn(),l=Jn(),u=Jn();Pe(i,t.domain,s),Pe(i,t.scheme,l),Pe(i,t.slashscheme,u),Pe(s,r,o),Pe(s,t.domain,s);let d=J(s,Si);J(o,Si,d),J(l,Si,d),J(u,Si,d);let f=J(o,Er);Pe(f,r,o),Pe(f,t.domain,o);let h=Jn();Pe(d,t.domain,h),Pe(h,t.domain,h);let m=J(h,Er);Pe(m,t.domain,h);let g=Jn(sx);Pe(m,t.tld,g),Pe(m,t.utld,g),J(d,Sa,g);let b=J(h,Xn);J(b,Xn,b),Pe(b,t.domain,h),Pe(g,t.domain,h),J(g,Er,m),J(g,Xn,b);let E=J(g,Ti);Pe(E,t.numeric,sx);let w=J(s,Xn),S=J(s,Er);J(w,Xn,w),Pe(w,t.domain,s),Pe(S,r,o),Pe(S,t.domain,s);let N=Jn($c);Pe(S,t.tld,N),Pe(S,t.utld,N),Pe(N,t.domain,s),Pe(N,r,o),J(N,Er,S),J(N,Xn,w),J(N,Si,d);let D=J(N,Ti),T=Jn($c);Pe(D,t.numeric,T);let B=Jn($c),R=Jn();Pe(B,e,B),Pe(B,n,R),Pe(R,e,B),Pe(R,n,R),J(N,vr,B),J(T,vr,B);let Y=J(l,Ti),ne=J(u,Ti),q=J(ne,vr),Q=J(q,vr);Pe(l,t.domain,s),J(l,Er,S),J(l,Xn,w),Pe(u,t.domain,s),J(u,Er,S),J(u,Xn,w),Pe(Y,t.domain,B),J(Y,vr,B),J(Y,xa,B),Pe(Q,t.domain,B),Pe(Q,e,B),J(Q,vr,B);let fe=[[Ea,va],[Uc,Wc],[Kc,Vc],[Gc,qc],[Yc,Jc],[Xc,Zc],[jc,Qc],[eu,tu]];for(let we=0;we=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(kh(ax,e,s)),s=[]),i-=m,f-=m;let g=h.t,b=n.slice(i-f,i);o.push(kh(g,e,b))}}return s.length>0&&o.push(kh(ax,e,s)),o}function kh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var f2=typeof console<"u"&&console&&console.warn||(()=>{}),p2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",at={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gx(){return _n.groups={},at.scanner=null,at.parser=null,at.tokenQueue=[],at.pluginQueue=[],at.customSchemes=[],at.initialized=!1,at}function qh(t,e=!1){if(at.initialized&&f2(`linkifyjs: already initialized - will not register custom scheme "${t}" ${p2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);at.customSchemes.push([t,e])}function h2(){at.scanner=a2(at.customSchemes);for(let t=0;t{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=nv(n.doc,[...e]);if(iv(l).forEach(({newRange:d})=>{let f=rv(r.doc,d,g=>g.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let g=m.split(" ").filter(S=>S!=="");if(g.length<=0)return!1;let y=g[g.length-1],v=h.pos+m.lastIndexOf(y);if(!y)return!1;let w=mu(y).map(S=>S.toObject(t.defaultProtocol));if(!m2(w))return!1;w.filter(S=>S.isLink).map(S=>({...S,from:v+S.start+1,to:v+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{pc(S.from,S.to,r.doc).some(O=>O.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function b2(t){return new Oe({key:new ze("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let u=Op(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:u.href,h=(o=d?.target)!==null&&o!==void 0?o:u.target;return d&&f?(window.open(f,h),!0):!1}}})}function y2(t){return new Oe({key:new ze("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let u=Yh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}var E2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function go(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(E2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var bx=st.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qh(t);return}qh(t.scheme,t.optionalSlashes)})},onDestroy(){gx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ee(this.options.HTMLAttributes,t),0]:["a",ee(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=Yh(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!go(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(g2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!go(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(b2({type:this.type})),this.options.linkOnPaste&&t.push(y2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var Jh=bx.extend({addOptions(){return{...this.parent?.(),openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{}}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var v2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yx=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[gc({find:v2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Xh=yx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}},srcset:{default:null},sizes:{default:null},media:{default:null,parseHTML:t=>t.getAttribute("data-media-id"),renderHTML:t=>t.media?{"data-media-id":t.media}:{}}}}});var w2=wc.extend({addAttributes(){return{class:{default:null}}}});var Zh=st.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Ex(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function vx(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function wx(t,e,n,r){let i=vx(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=wx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(re(t,"gridRole",e))}}});var Qh=ce.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var xx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),x2=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",em=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t,o=null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")&&(o=e.split("/").pop()),e.includes("/shorts/")&&(o=e.split("/shorts/").pop()),!o){let d=/v=([-\w]+)/gm.exec(e);d&&d[1]&&(o=d[1])}if(!o)return null;let s=`${x2(r)}${o}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(s+=`?${l.join("&")}`),s};var tm=ce.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!xx(t.src))return!1;let n=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var _x=t=>t.match(/(vimeo\.com)(.+)?$/),nm=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let u=/\.com\/([0-9]+)/gm.exec(e);if(!u||!u[1])return null;let d=`https://player.vimeo.com/video/${u[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var rm=ce.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!_x(t.src))return!1;let n=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var im=ce.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var om=ce.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",ee(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=ee(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,u])=>i.setAttribute(l,u)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let u=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(u.content))return!1;let f=((n=u.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=to(S=>S.type===this.type)(n);if(!i)return!1;let o=eo(i.node,S=>S.type===r.nodes.detailsSummary),s=eo(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],u=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},g=u.node.content.toJSON()||[],y=f.parent.type.contentMatch.defaultType,w=[y?.create(null,l.node.content).toJSON(),...g];return e().insertContentAt(m,w).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var sm=ce.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",ee(this.options.HTMLAttributes,t),0]}});var am=ce.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=to(fe=>fe.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:u}=s.node;if(!(u===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),g=u-1,y=s.node.child(g),v=m.posAtIndex(g,s.depth);if(!y.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let O=i.indexAfter(-3),L=Mp(S.contentMatchAt(O));if(!L||!S.canReplaceWith(O,O,L))return!1;let T=L.createAndFill();if(!T)return!1;let{tr:B}=e,R=i.after(-2);B.replaceWith(R,R,T);let Y=B.doc.resolve(R),ne=ue.near(Y,1);B.setSelection(ne);let q=v,Q=v+y.nodeSize;return B.delete(q,Q),B.scrollIntoView(),n.dispatch(B),!0}}}});var _2=/^```([a-z]+)?[\s\n]$/,S2=/^~~~([a-z]+)?[\s\n]$/,Sx=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ee(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` +3. "-" cannot repeat`);at.customSchemes.push([t,e])}function h2(){at.scanner=a2(at.customSchemes);for(let t=0;t{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=nv(n.doc,[...e]);if(iv(l).forEach(({newRange:d})=>{let f=rv(r.doc,d,g=>g.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let g=m.split(" ").filter(S=>S!=="");if(g.length<=0)return!1;let b=g[g.length-1],E=h.pos+m.lastIndexOf(b);if(!b)return!1;let w=mu(b).map(S=>S.toObject(t.defaultProtocol));if(!m2(w))return!1;w.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{pc(S.from,S.to,r.doc).some(N=>N.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function b2(t){return new Oe({key:new ze("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let u=Op(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:u.href,h=(o=d?.target)!==null&&o!==void 0?o:u.target;return d&&f?(window.open(f,h),!0):!1}}})}function y2(t){return new Oe({key:new ze("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let u=Yh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}var E2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function go(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(E2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var bx=st.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qh(t);return}qh(t.scheme,t.optionalSlashes)})},onDestroy(){gx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ee(this.options.HTMLAttributes,t),0]:["a",ee(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=Yh(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!go(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(g2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!go(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(b2({type:this.type})),this.options.linkOnPaste&&t.push(y2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var Jh=bx.extend({addOptions(){return{...this.parent?.(),openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{}}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var v2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yx=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[gc({find:v2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Xh=yx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}},srcset:{default:null},sizes:{default:null},media:{default:null,parseHTML:t=>t.getAttribute("data-media-id"),renderHTML:t=>t.media?{"data-media-id":t.media}:{}}}}});var w2=wc.extend({addAttributes(){return{class:{default:null}}}});var Zh=st.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Ex(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function vx(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function wx(t,e,n,r){let i=vx(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=wx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(re(t,"gridRole",e))}}});var Qh=ce.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var xx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),x2=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",em=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t,o=null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")&&(o=e.split("/").pop()),e.includes("/shorts/")&&(o=e.split("/shorts/").pop()),!o){let d=/v=([-\w]+)/gm.exec(e);d&&d[1]&&(o=d[1])}if(!o)return null;let s=`${x2(r)}${o}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(s+=`?${l.join("&")}`),s};var tm=ce.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!xx(t.src))return!1;let n=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var _x=t=>t.match(/(vimeo\.com)(.+)?$/),nm=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let u=/\.com\/([0-9]+)/gm.exec(e);if(!u||!u[1])return null;let d=`https://player.vimeo.com/video/${u[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var rm=ce.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!_x(t.src))return!1;let n=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var im=ce.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var om=ce.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",ee(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=ee(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,u])=>i.setAttribute(l,u)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let u=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(u.content))return!1;let f=((n=u.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=to(S=>S.type===this.type)(n);if(!i)return!1;let o=eo(i.node,S=>S.type===r.nodes.detailsSummary),s=eo(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],u=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},g=u.node.content.toJSON()||[],b=f.parent.type.contentMatch.defaultType,w=[b?.create(null,l.node.content).toJSON(),...g];return e().insertContentAt(m,w).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var sm=ce.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",ee(this.options.HTMLAttributes,t),0]}});var am=ce.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=to(fe=>fe.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:u}=s.node;if(!(u===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),g=u-1,b=s.node.child(g),E=m.posAtIndex(g,s.depth);if(!b.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let N=i.indexAfter(-3),D=Mp(S.contentMatchAt(N));if(!D||!S.canReplaceWith(N,N,D))return!1;let T=D.createAndFill();if(!T)return!1;let{tr:B}=e,R=i.after(-2);B.replaceWith(R,R,T);let Y=B.doc.resolve(R),ne=ue.near(Y,1);B.setSelection(ne);let q=E,Q=E+b.nodeSize;return B.delete(q,Q),B.scrollIntoView(),n.dispatch(B),!0}}}});var _2=/^```([a-z]+)?[\s\n]$/,S2=/^~~~([a-z]+)?[\s\n]$/,Sx=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ee(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(ue.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[sa({find:_2,type:this.type,getAttributes:t=>({language:t[1]})}),sa({find:S2,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Oe({key:new ze("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,` `));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function T2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ix(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ix(n)}),t}var bu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dx(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var C2="",Tx=t=>!!t.scope,A2=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},cm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Dx(e)}openNode(e){if(!Tx(e))return;let n=A2(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Tx(e)&&(this.buffer+=C2)}value(){return this.buffer}span(e){this.buffer+=``}},Cx=(t={})=>{let e={children:[]};return Object.assign(e,t),e},um=class t{constructor(){this.rootNode=Cx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=Cx({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},dm=class extends um{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new cm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ca(t){return t?typeof t=="string"?t:t.source:null}function Lx(t){return yo("(?=",t,")")}function M2(t){return yo("(?:",t,")*")}function N2(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>Ca(n)).join("")}function k2(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function pm(...t){return"("+(k2(t).capture?"":"?:")+t.map(r=>Ca(r)).join("|")+")"}function Px(t){return new RegExp(t.toString()+"|").exec("").length-1}function O2(t,e){let n=t&&t.exec(e);return n&&n.index===0}var R2=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function hm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ca(r),s="";for(;o.length>0;){let l=R2.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var I2=/\b\B/,Bx="[a-zA-Z]\\w*",mm="[a-zA-Z_]\\w*",Fx="\\b\\d+(\\.\\d+)?",Hx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$x="\\b(0b[01]+)",D2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L2=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ci({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Aa={begin:"\\\\[\\s\\S]",relevance:0},P2={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Aa]},B2={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Aa]},F2={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Eu=function(t,e,n={}){let r=Ci({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=pm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},H2=Eu("//","$"),$2=Eu("/\\*","\\*/"),z2=Eu("#","$"),U2={scope:"number",begin:Fx,relevance:0},W2={scope:"number",begin:Hx,relevance:0},K2={scope:"number",begin:$x,relevance:0},V2={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Aa,{begin:/\[/,end:/\]/,relevance:0,contains:[Aa]}]},G2={scope:"title",begin:Bx,relevance:0},q2={scope:"title",begin:mm,relevance:0},Y2={begin:"\\.\\s*"+mm,relevance:0},J2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},gu=Object.freeze({__proto__:null,APOS_STRING_MODE:P2,BACKSLASH_ESCAPE:Aa,BINARY_NUMBER_MODE:K2,BINARY_NUMBER_RE:$x,COMMENT:Eu,C_BLOCK_COMMENT_MODE:$2,C_LINE_COMMENT_MODE:H2,C_NUMBER_MODE:W2,C_NUMBER_RE:Hx,END_SAME_AS_BEGIN:J2,HASH_COMMENT_MODE:z2,IDENT_RE:Bx,MATCH_NOTHING_RE:I2,METHOD_GUARD:Y2,NUMBER_MODE:U2,NUMBER_RE:Fx,PHRASAL_WORDS_MODE:F2,QUOTE_STRING_MODE:B2,REGEXP_MODE:V2,RE_STARTERS_RE:D2,SHEBANG:L2,TITLE_MODE:G2,UNDERSCORE_IDENT_RE:mm,UNDERSCORE_TITLE_MODE:q2});function X2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Z2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function j2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=X2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Q2(t,e){Array.isArray(t.illegal)&&(t.illegal=pm(...t.illegal))}function eF(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function tF(t,e){t.relevance===void 0&&(t.relevance=1)}var nF=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=yo(n.beforeMatch,Lx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},rF=["of","and","for","in","not","or","if","then","parent","list","value"],iF="keyword";function zx(t,e,n=iF){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,zx(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,oF(u[0],u[1])]})}}function oF(t,e){return e?Number(e):sF(t)?0:1}function sF(t){return rF.includes(t.toLowerCase())}var Ax={},bo=t=>{console.error(t)},Mx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ls=(t,e)=>{Ax[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Ax[`${t}/${e}`]=!0)},yu=new Error;function Ux(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=Px(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function aF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),yu;Ux(t,t.begin,{key:"beginScope"}),t.begin=hm(t.begin,{joinWith:""})}}function lF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),yu;Ux(t,t.end,{key:"endScope"}),t.end=hm(t.end,{joinWith:""})}}function cF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function uF(t){cF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),aF(t),lF(t)}function dF(t){function e(s,l){return new RegExp(Ca(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=Px(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(hm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[Z2,eF,uF,nF].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[j2,Q2,tF].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=zx(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ca(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return fF(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ci(t.classNameAliases||{}),o(t)}function Wx(t){return t?t.endsWithParent||Wx(t.starts):!1}function fF(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ci(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Wx(t)?Ci(t,{starts:t.starts?Ci(t.starts):null}):Object.isFrozen(t)?Ci(t):t}var pF="11.10.0",fm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},lm=Dx,Nx=Ci,kx=Symbol("nomatch"),hF=7,Kx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:dm};function u(A){return l.noHighlightRe.test(A)}function d(A){let I=A.className+" ";I+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(I);if(z){let j=q(z[1]);return j||(Mx(o.replace("{}",z[1])),Mx("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return I.split(/\s+/).find(j=>u(j)||q(j))}function f(A,I,z){let j="",ie="";typeof I=="object"?(j=A,z=I.ignoreIllegals,ie=I.language):(ls("10.7.0","highlight(lang, code, ...args) has been deprecated."),ls("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(D,H){return D.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let D=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(D,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=hF&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];D=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(D),_e.addText(X)}function je(){if(pe==="")return;let D=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}D=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=D._top}else D=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=D.relevance),_e.__addSublanguage(D._emitter,D.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(D,H){D!==""&&(_e.startScope(H),_e.addText(D),_e.endScope())}function _t(D,H){let X=1,se=H.length-1;for(;X<=se;){if(!D._emit[X]){X++;continue}let Fe=Je.classNameAliases[D[X]]||D[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(D,H){return D.scope&&typeof D.scope=="string"&&_e.openNode(Je.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(Be(pe,Je.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),pe=""):D.beginScope._multi&&(_t(D.beginScope,H),pe="")),V=Object.create(D,{parent:{value:V}}),V}function Re(D,H,X){let se=O2(D.endRe,X);if(se){if(D["on:end"]){let Fe=new bu(D);D["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return Re(D.parent,H,X)}function St(D){return V.matcher.regexIndex===0?(pe+=D[0],1):(Ot=!0,0)}function Xt(D){let H=D[0],X=D.rule,se=new bu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(D,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,D),X.returnBegin?0:H.length}function pt(D){let H=D[0],X=I.substring(D.index),se=Re(V,D,X);if(!se)return kx;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,D)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,D),Fe.returnEnd?0:H.length}function an(){let D=[];for(let H=V;H!==Je;H=H.parent)H.scope&&D.unshift(H.scope);D.forEach(H=>_e.openNode(H))}let Zt={};function Tt(D,H){let X=H&&H[0];if(pe+=D,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==kx)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw bo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=dF(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let D=V.matcher.exec(I);if(!D)break;let H=I.substring(dt,D.index),X=Tt(H,D);dt=D.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:A,value:lm(I),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:dt,context:I.slice(dt-100,dt+100),mode:D.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:lm(I),illegal:!1,relevance:0,errorRaised:D,_emitter:_e,_top:V};throw D}}function m(A){let I={value:lm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function y(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function v(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new fm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,A.dataset.highlighted="yes",y(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=Nx(l,A)}let S=()=>{T(),ls("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){T(),ls("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function T(){if(document.readyState==="loading"){L=!0;return}document.querySelectorAll(l.cssSelector).forEach(v)}function B(){L&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(bo("Language definition for '{}' could not be registered.".replace("{}",A)),i)bo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return ls("10.7.0","highlightBlock will be removed entirely in v12.0"),ls("10.7.0","Please use highlightElement now."),v(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:v,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:O,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:Nx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=pF,t.regex={concat:yo,lookahead:Lx,either:pm,optional:N2,anyNumberOfTimes:M2};for(let A in gu)typeof gu[A]=="object"&&Ix(gu[A]);return Object.assign(t,gu),t},cs=Kx({});cs.newInstance=()=>Kx({});var mF=cs;cs.HighlightJS=cs;cs.default=cs;var gF=T2(mF);function Vx(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Vx(n.children,r):{text:n.value,classes:r}}).flat()}function Ox(t){return t.value||t.children||[]}function bF(t){return!!gF.getLanguage(t)}function Rx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(t,o=>o.type.name===e).forEach(o=>{var s;let l=o.pos+1,u=o.node.attrs.language||r,d=n.listLanguages(),f=u&&(d.includes(u)||bF(u)||!((s=n.registered)===null||s===void 0)&&s.call(n,u))?Ox(n.highlight(u,o.node.textContent)):Ox(n.highlightAuto(o.node.textContent));Vx(f).forEach(h=>{let m=l+h.text.length;if(h.classes.length){let g=wt.inline(l,m,{class:h.classes.join(" ")});i.push(g)}l=m})}),ot.create(t,i)}function yF(t){return typeof t=="function"}function EF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>yF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Oe({key:new ze("lowlight"),state:{init:(i,{doc:o})=>Rx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=eo(s.doc,m=>m.type.name===t),h=eo(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)))?Rx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Gx=Sx.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],EF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var gm=Gx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var bm=ce.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var ym=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function vu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function qx(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Yx(t,e,n,r,i,o,s){let l=qx(t),u=[];if(n==="asymmetric")u.push(vu(l.builderColumn,i,s)),u.push(vu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=Yx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(le.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(re(t,"gridBuilderRole",e))}}});var vm=ce.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var wm=We.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Oe({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var xm=ce.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",ee(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=` +https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=hF&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=O2(L.endRe,X);if(se){if(L["on:end"]){let Fe=new bu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new bu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=I.substring(L.index),se=Re(V,L,X);if(!se)return kx;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==kx)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw bo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=dF(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(I);if(!L)break;let H=I.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:lm(I),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:I.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:lm(I),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let I={value:lm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function b(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new fm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,A.dataset.highlighted="yes",b(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=Nx(l,A)}let S=()=>{T(),ls("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){T(),ls("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function B(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(bo("Language definition for '{}' could not be registered.".replace("{}",A)),i)bo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return ls("10.7.0","highlightBlock will be removed entirely in v12.0"),ls("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:N,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:Nx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=pF,t.regex={concat:yo,lookahead:Lx,either:pm,optional:N2,anyNumberOfTimes:M2};for(let A in gu)typeof gu[A]=="object"&&Ix(gu[A]);return Object.assign(t,gu),t},cs=Kx({});cs.newInstance=()=>Kx({});var mF=cs;cs.HighlightJS=cs;cs.default=cs;var gF=T2(mF);function Vx(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Vx(n.children,r):{text:n.value,classes:r}}).flat()}function Ox(t){return t.value||t.children||[]}function bF(t){return!!gF.getLanguage(t)}function Rx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(t,o=>o.type.name===e).forEach(o=>{var s;let l=o.pos+1,u=o.node.attrs.language||r,d=n.listLanguages(),f=u&&(d.includes(u)||bF(u)||!((s=n.registered)===null||s===void 0)&&s.call(n,u))?Ox(n.highlight(u,o.node.textContent)):Ox(n.highlightAuto(o.node.textContent));Vx(f).forEach(h=>{let m=l+h.text.length;if(h.classes.length){let g=wt.inline(l,m,{class:h.classes.join(" ")});i.push(g)}l=m})}),ot.create(t,i)}function yF(t){return typeof t=="function"}function EF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>yF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Oe({key:new ze("lowlight"),state:{init:(i,{doc:o})=>Rx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=eo(s.doc,m=>m.type.name===t),h=eo(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)))?Rx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Gx=Sx.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],EF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var gm=Gx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var bm=ce.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var ym=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function vu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function qx(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Yx(t,e,n,r,i,o,s){let l=qx(t),u=[];if(n==="asymmetric")u.push(vu(l.builderColumn,i,s)),u.push(vu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=Yx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(le.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(re(t,"gridBuilderRole",e))}}});var vm=ce.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var wm=We.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Oe({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var xm=ce.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",ee(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=`
- `,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),u=n();return l?(u.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),u.focus(l.end+1)):t.coordinates?(u.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(u.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function vF(t){var e;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=t,u=r&&!i,d=ov(n),f=new RegExp(`\\s${d}$`),h=s?"^":"",m=i?"":d,g=u?new RegExp(`${h}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${m}]*`,"gm"),y=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!y)return null;let v=l.pos-y.length,w=Array.from(y.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;let S=w.input.slice(Math.max(0,w.index-1),w.index),O=new RegExp(`^[${o?.join("")}\0]?$`).test(S);if(o!==null&&!O)return null;let L=v+w.index,T=L+w[0].length;return u&&f.test(y.slice(T-1,T+1))&&(w[0]+=" ",T+=1),L=l.pos?{range:{from:L,to:T},query:w[0].slice(n.length),text:w[0]}:null}var wF=new ze("suggestion");function Jx({pluginKey:t=wF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:u="suggestion",command:d=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=vF}){let y,v=h?.(),w=new Oe({key:t,view(){return{update:async(S,O)=>{var L,T,B,R,Y,ne,q;let Q=(L=this.key)===null||L===void 0?void 0:L.getState(O),fe=(T=this.key)===null||T===void 0?void 0:T.getState(S.state),we=Q.active&&fe.active&&Q.range.from!==fe.range.from,me=!Q.active&&fe.active,Ce=Q.active&&!fe.active,ge=!me&&!Ce&&Q.query!==fe.query,ye=me||we&&ge,A=ge||we,I=Ce||we&≥if(!ye&&!A&&!I)return;let z=I&&!ye?Q:fe,j=S.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);y={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:ie=>d({editor:e,range:z.range,props:ie}),decorationNode:j,clientRect:j?()=>{var ie;let{decorationId:xe}=(ie=this.key)===null||ie===void 0?void 0:ie.getState(e.state),Ae=S.dom.querySelector(`[data-decoration-id="${xe}"]`);return Ae?.getBoundingClientRect()||null}:null},ye&&((B=v?.onBeforeStart)===null||B===void 0||B.call(v,y)),A&&((R=v?.onBeforeUpdate)===null||R===void 0||R.call(v,y)),(A||ye)&&(y.items=await f({editor:e,query:z.query})),I&&((Y=v?.onExit)===null||Y===void 0||Y.call(v,y)),A&&((ne=v?.onUpdate)===null||ne===void 0||ne.call(v,y)),ye&&((q=v?.onStart)===null||q===void 0||q.call(v,y))},destroy:()=>{var S;y&&((S=v?.onExit)===null||S===void 0||S.call(v,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,O,L,T){let{isEditable:B}=e,{composing:R}=e.view,{selection:Y}=S,{empty:ne,from:q}=Y,Q={...O};if(Q.composing=R,B&&(ne||e.view.composing)){(qO.range.to)&&!R&&!O.composing&&(Q.active=!1);let fe=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:Y.$from}),we=`id_${Math.floor(Math.random()*4294967295)}`;fe&&m({editor:e,state:T,range:fe.range,isActive:O.active})?(Q.active=!0,Q.decorationId=O.decorationId?O.decorationId:we,Q.range=fe.range,Q.query=fe.query,Q.text=fe.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(S,O){var L;let{active:T,range:B}=w.getState(S.state);return T&&((L=v?.onKeyDown)===null||L===void 0?void 0:L.call(v,{view:S,event:O,range:B}))||!1},decorations(S){let{active:O,range:L,decorationId:T}=w.getState(S);return O?ot.create(S.doc,[wt.inline(L.from,L.to,{nodeName:l,class:u,"data-decoration-id":T})]):null}}});return w}var xF=new ze("mergeTag"),_m=ce.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",ee({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Jx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:xF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=` + `,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),u=n();return l?(u.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),u.focus(l.end+1)):t.coordinates?(u.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(u.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function vF(t){var e;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=t,u=r&&!i,d=ov(n),f=new RegExp(`\\s${d}$`),h=s?"^":"",m=i?"":d,g=u?new RegExp(`${h}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;let E=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;let S=w.input.slice(Math.max(0,w.index-1),w.index),N=new RegExp(`^[${o?.join("")}\0]?$`).test(S);if(o!==null&&!N)return null;let D=E+w.index,T=D+w[0].length;return u&&f.test(b.slice(T-1,T+1))&&(w[0]+=" ",T+=1),D=l.pos?{range:{from:D,to:T},query:w[0].slice(n.length),text:w[0]}:null}var wF=new ze("suggestion");function Jx({pluginKey:t=wF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:u="suggestion",command:d=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=vF}){let b,E=h?.(),w=new Oe({key:t,view(){return{update:async(S,N)=>{var D,T,B,R,Y,ne,q;let Q=(D=this.key)===null||D===void 0?void 0:D.getState(N),fe=(T=this.key)===null||T===void 0?void 0:T.getState(S.state),we=Q.active&&fe.active&&Q.range.from!==fe.range.from,me=!Q.active&&fe.active,Ce=Q.active&&!fe.active,ge=!me&&!Ce&&Q.query!==fe.query,ye=me||we&&ge,A=ge||we,I=Ce||we&≥if(!ye&&!A&&!I)return;let z=I&&!ye?Q:fe,j=S.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);b={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:ie=>d({editor:e,range:z.range,props:ie}),decorationNode:j,clientRect:j?()=>{var ie;let{decorationId:xe}=(ie=this.key)===null||ie===void 0?void 0:ie.getState(e.state),Ae=S.dom.querySelector(`[data-decoration-id="${xe}"]`);return Ae?.getBoundingClientRect()||null}:null},ye&&((B=E?.onBeforeStart)===null||B===void 0||B.call(E,b)),A&&((R=E?.onBeforeUpdate)===null||R===void 0||R.call(E,b)),(A||ye)&&(b.items=await f({editor:e,query:z.query})),I&&((Y=E?.onExit)===null||Y===void 0||Y.call(E,b)),A&&((ne=E?.onUpdate)===null||ne===void 0||ne.call(E,b)),ye&&((q=E?.onStart)===null||q===void 0||q.call(E,b))},destroy:()=>{var S;b&&((S=E?.onExit)===null||S===void 0||S.call(E,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,N,D,T){let{isEditable:B}=e,{composing:R}=e.view,{selection:Y}=S,{empty:ne,from:q}=Y,Q={...N};if(Q.composing=R,B&&(ne||e.view.composing)){(qN.range.to)&&!R&&!N.composing&&(Q.active=!1);let fe=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:Y.$from}),we=`id_${Math.floor(Math.random()*4294967295)}`;fe&&m({editor:e,state:T,range:fe.range,isActive:N.active})?(Q.active=!0,Q.decorationId=N.decorationId?N.decorationId:we,Q.range=fe.range,Q.query=fe.query,Q.text=fe.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(S,N){var D;let{active:T,range:B}=w.getState(S.state);return T&&((D=E?.onKeyDown)===null||D===void 0?void 0:D.call(E,{view:S,event:N,range:B}))||!1},decorations(S){let{active:N,range:D,decorationId:T}=w.getState(S);return N?ot.create(S.doc,[wt.inline(D.from,D.to,{nodeName:l,class:u,"data-decoration-id":T})]):null}}});return w}var xF=new ze("mergeTag"),_m=ce.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",ee({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Jx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:xF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=`
{n.command({id:i.detail.item})}),e=is("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var Sm=We.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var Tm=We.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var Cm=We.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var Am=We.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function _F(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:v,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xx(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=_F(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Zx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},u={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],y=["true","false"],v={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...w,...S,"set","shopt",...O,...L]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,v,s,l,u,n]}}function jx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},L={begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:g,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:w}}}function Qx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:v,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function e_(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=t.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[y,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[v,g,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let w={variants:[y,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",L={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[w,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},L]}}var SF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),TF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],AF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],MF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],NF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function t_(t){let e=t.regex,n=SF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AF.join("|")+")"},{begin:":(:)?("+MF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:CF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TF.join("|")+")\\b"}]}}function n_(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function r_(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"a_(t,e,n-1))}function l_(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+a_("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,s_,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s_,d]}}var c_="[A-Za-z$_][0-9A-Za-z$_]*",kF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],OF=["true","false","null","undefined","NaN","Infinity"],u_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],d_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IF=[].concat(f_,u_,d_);function p_(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:c_,keyword:kF,literal:OF,built_in:IF,"variable.language":RF},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},v={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},L=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,y,v,w,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let T=[].concat(O,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...u_,...d_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...f_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,y,v,w,O,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function h_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ds="[0-9](_*[0-9])*",_u=`\\.(${ds})`,Su="[0-9a-fA-F](_*[0-9a-fA-F])*",DF={className:"number",variants:[{begin:`(\\b(${ds})((${_u})|\\.)?|(${_u}))[eE][+-]?(${ds})[fFdD]?\\b`},{begin:`\\b(${ds})((${_u})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_u})[fFdD]?\\b`},{begin:`\\b(${ds})[fFdD]\\b`},{begin:`\\b0[xX]((${Su})\\.?|(${Su})?\\.(${Su}))[pP][+-]?(${ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Su})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function m_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=DF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},d]}}var LF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),PF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],g_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],b_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],FF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),HF=g_.concat(b_);function y_(t){let e=LF(t),n=HF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(L){return{className:"string",begin:"~?"+L+".*?"+L}},d=function(L,T,B){return{className:L,begin:T,relevance:B}},f={$pattern:/[a-z-]+/,keyword:r,attribute:BF.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},y={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+FF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},v={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+PF.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+g_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},O={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,v,w,O,y,S,g,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function E_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function v_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let g=[n,u];return[d,f,h,m].forEach(w=>{w.contains=w.contains.concat(g)}),g=g.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},i,r,u,s]}}function x_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function __(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},u=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,y,v="\\1")=>{let w=v==="\\1"?v:e.concat(v,y);return e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,v,r)},h=(g,y,v)=>e.concat(e.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,v,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function S_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,g={scope:"string",variants:[d,u,f,h]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],L={keyword:w,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(v),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:L,contains:[ne,o,Y,t.C_BLOCK_COMMENT_MODE,g,y,B]},Q={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(w).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(Q);let fe=[ne,Y,t.C_BLOCK_COMMENT_MODE,g,y,B],we={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...fe]},...fe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:L,contains:[we,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,Q,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},B,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:L,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,g,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,y]}}function T_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function C_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function A_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,y=`\\b|${r.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${y})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${m})[jJ](?=${y})`}]},w={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,v,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,v,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,v,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,w,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,S,h]}]}}function M_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function N_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function k_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},R=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=R,v.contains=R;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:R}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:R}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(R)}}function O_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:""},n]}}var $F=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),zF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],UF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],WF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],KF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],VF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function R_(t){let e=$F(t),n=KF,r=WF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+VF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:UF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function I_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function D_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,y=[...d,...u].filter(L=>!f.includes(L)),v={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},w={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function O(L,{exceptions:T,when:B}={}){let R=B;return T=T||[],L.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:R(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(y,{when:L=>L.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,v,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,w]}}function F_(t){return t?typeof t=="string"?t:t.source:null}function Tu(t){return nt("(?=",t,")")}function nt(...t){return t.map(n=>F_(n)).join("")}function GF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(GF(t).capture?"":"?:")+t.map(r=>F_(r)).join("|")+")"}var Om=t=>nt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),qF=["Protocol","Type"].map(Om),L_=["init","self"].map(Om),YF=["Any","Self"],Mm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],P_=["false","nil","true"],JF=["assignment","associativity","higherThan","left","lowerThan","none","right"],XF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],B_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],H_=Sn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),$_=Sn(H_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Nm=nt(H_,$_,"*"),z_=Sn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cu=Sn(z_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xr=nt(z_,Cu,"*"),km=nt(/[A-Z]/,Cu,"*"),ZF=["autoclosure",nt(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Xr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],jF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function U_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...qF,...L_)],className:{2:"keyword"}},o={match:nt(/\./,Sn(...Mm)),relevance:0},s=Mm.filter(Re=>typeof Re=="string").concat(["_|0"]),l=Mm.filter(Re=>typeof Re!="string").concat(YF).map(Om),u={variants:[{className:"keyword",match:Sn(...l,...L_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(XF),literal:P_},f=[i,o,u],h={match:nt(/\./,Sn(...B_)),relevance:0},m={className:"built_in",match:nt(/\b/,Sn(...B_),/(?=\()/)},g=[h,m],y={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:Nm},{match:`\\.(\\.|${$_})+`}]},w=[y,v],S="([0-9]_*)+",O="([0-9a-fA-F]_*)+",L={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(Re="")=>({className:"subst",variants:[{match:nt(/\\/,Re,/[0\\tnr"']/)},{match:nt(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),B=(Re="")=>({className:"subst",match:nt(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),R=(Re="")=>({className:"subst",label:"interpol",begin:nt(/\\/,Re,/\(/),end:/\)/}),Y=(Re="")=>({begin:nt(Re,/"""/),end:nt(/"""/,Re),contains:[T(Re),B(Re),R(Re)]}),ne=(Re="")=>({begin:nt(Re,/"/),end:nt(/"/,Re),contains:[T(Re),R(Re)]}),q={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ne(),ne("#"),ne("##"),ne("###")]},Q={match:nt(/`/,Xr,/`/)},fe={className:"variable",match:/\$\d+/},we={className:"variable",match:`\\$${Cu}+`},me=[Q,fe,we],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jF,contains:[...w,L,q]}]}},ge={className:"keyword",match:nt(/@/,Sn(...ZF))},ye={className:"meta",match:nt(/@/,Xr)},A=[Ce,ge,ye],I={match:Tu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cu,"+")},{className:"type",match:km,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Tu(km)),relevance:0}]},z={begin://,keywords:d,contains:[...r,...f,...A,y,I]};I.contains.push(z);let j={match:nt(Xr,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",j,...r,...f,...g,...w,L,q,...me,...A,I]},xe={begin://,contains:[...r,I]},Ae={begin:Sn(Tu(nt(Xr,/\s*:/)),Tu(nt(Xr,/\s+/,Xr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Xr}]},je={begin:/\(/,end:/\)/,keywords:d,contains:[Ae,...r,...f,...w,L,q,...A,I,ie],endsParent:!0,illegal:/["']/},Ne={match:[/func/,/\s+/,Sn(Q.match,Xr,Nm)],className:{1:"keyword",3:"title.function"},contains:[xe,je,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,je,e],illegal:/\[|%/},_t={match:[/operator/,/\s+/,Nm],className:{1:"keyword",3:"title"}},kt={begin:[/precedencegroup/,/\s+/,km],className:{1:"keyword",3:"title"},contains:[I],keywords:[...JF,...P_],end:/}/};for(let Re of q.variants){let St=Re.contains.find(pt=>pt.label==="interpol");St.keywords=d;let Xt=[...f,...g,...w,L,q,...me];St.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,Ne,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},_t,kt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...g,...w,L,q,...me,...A,I,ie]}}var Au="[A-Za-z$_][0-9A-Za-z$_]*",W_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],K_=["true","false","null","undefined","NaN","Infinity"],V_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],G_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],q_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Y_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J_=[].concat(q_,V_,G_);function QF(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:Au,keyword:W_,literal:K_,built_in:J_,"variable.language":Y_},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},y={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},v={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},L=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,y,v,w,{match:/\$\d+/},h];m.contains=L.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(L)});let T=[].concat(O,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...V_,...G_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...q_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,y,v,w,O,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function X_(t){let e=QF(t),n=Au,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],u={$pattern:Au,keyword:W_.concat(l),literal:K_,built_in:J_.concat(r),"variable.language":Y_},d={className:"meta",begin:"@"+n},f=(m,g,y)=>{let v=m.contains.findIndex(w=>w.label===g);if(v===-1)throw new Error("can not find mode to replace");m.contains.splice(v,1,y)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Z_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function j_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,u,d,l]}}function Q_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function eS(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,y,o],w=[...v];return w.pop(),w.push(s),m.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}var wS=ef(vS(),1);var Zn=wS.default;var _S=ef(xS(),1),ka=Object.assign(wo(Error),{eval:wo(EvalError),range:wo(RangeError),reference:wo(ReferenceError),syntax:wo(SyntaxError),type:wo(TypeError),uri:wo(URIError)});function wo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,_S.default)(n,...r);return new t(i)}}var WH={}.hasOwnProperty,SS="hljs-";function TS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw ka("Expected `string` for name, got `%s`",t);if(!Zn.getLanguage(t))throw ka("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw ka("Expected `string` for value, got `%s`",e);r==null&&(r=SS),Zn.configure({__emitter:zm,classPrefix:r});let i=Zn.highlight(e,{language:t,ignoreIllegals:!0});if(Zn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function KH(t,e={}){let n=e.subset||Zn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=SS),typeof t!="string")throw ka("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function VH(t,e){Zn.registerLanguage(t,e)}var GH=function(t,e){if(typeof t=="string")Zn.registerAliases(e,{languageName:t});else{let n;for(n in t)WH.call(t,n)&&Zn.registerAliases(t[n],{languageName:n})}};function qH(t){return!!Zn.getLanguage(t)}function YH(){return Zn.listLanguages()}var zm=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},De={highlight:TS,highlightAuto:KH,registerLanguage:VH,registered:qH,listLanguages:YH,registerAlias:GH};De.registerLanguage("arduino",Xx);De.registerLanguage("bash",Zx);De.registerLanguage("c",jx);De.registerLanguage("cpp",Qx);De.registerLanguage("csharp",e_);De.registerLanguage("css",t_);De.registerLanguage("diff",n_);De.registerLanguage("go",r_);De.registerLanguage("graphql",i_);De.registerLanguage("ini",o_);De.registerLanguage("java",l_);De.registerLanguage("javascript",p_);De.registerLanguage("json",h_);De.registerLanguage("kotlin",m_);De.registerLanguage("less",y_);De.registerLanguage("lua",E_);De.registerLanguage("makefile",v_);De.registerLanguage("markdown",w_);De.registerLanguage("objectivec",x_);De.registerLanguage("perl",__);De.registerLanguage("php",S_);De.registerLanguage("php-template",T_);De.registerLanguage("plaintext",C_);De.registerLanguage("python",A_);De.registerLanguage("python-repl",M_);De.registerLanguage("r",N_);De.registerLanguage("ruby",k_);De.registerLanguage("rust",O_);De.registerLanguage("scss",R_);De.registerLanguage("shell",I_);De.registerLanguage("sql",D_);De.registerLanguage("swift",U_);De.registerLanguage("typescript",X_);De.registerLanguage("vbnet",Z_);De.registerLanguage("wasm",j_);De.registerLanguage("xml",Q_);De.registerLanguage("yaml",eS);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var u6={grad:360/400,turn:360,rad:360/(Math.PI*2)},CS=t=>jH(Iu(t)),Iu=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Nt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Nt(parseInt(t.substring(6,8),16)/255,2):1});var AS=t=>ZH(XH(t)),JH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Nt(t),s:Nt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Nt(i/2),a:Nt(r,2)}};var Oa=t=>{let{h:e,s:n,l:r}=JH(t);return`hsl(${e}, ${n}%, ${r}%)`};var XH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),u=i%6;return{r:Nt([n,s,o,o,l,n][u]*255),g:Nt([l,n,n,s,o,o][u]*255),b:Nt([o,o,l,n,n,s][u]*255),a:Nt(r,2)}};var Ru=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},ZH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Ru(Nt(r*255)):"";return"#"+Ru(t)+Ru(e)+Ru(n)+i},jH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Nt(60*(s<0?s+6:s)),s:Nt(i?o/i*100:0),v:Nt(i/255*100),a:r}};var Um=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var MS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Um(Iu(t),Iu(e));var NS={},Du=t=>{let e=NS[t];return e||(e=document.createElement("template"),e.innerHTML=t,NS[t]=e),e},Ra=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var hs=!1,Wm=t=>"touches"in t,QH=t=>hs&&!Wm(t)?!1:(hs||(hs=Wm(t)),!0),kS=(t,e)=>{let n=Wm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ra(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},e$=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ra(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ms=class{constructor(e,n,r,i){let o=Du(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(hs?"touchmove":"mousemove",this),n(hs?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!QH(e)||!hs&&e.button!=0)return;this.el.focus(),kS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),kS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":e$(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Lu=class extends ms{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Oa({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Nt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Pu=class extends ms{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Oa(e)},{"background-color":Oa({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Nt(e.s)}%, Brightness ${Nt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var OS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var RS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var IS="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Bu=Symbol("same"),Km=Symbol("color"),DS=Symbol("hsva"),Vm=Symbol("update"),LS=Symbol("parts"),PS=Symbol("css"),BS=Symbol("sliders"),Fu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[PS](){return[OS,RS,IS]}get[BS](){return[Pu,Lu]}get color(){return this[Km]}set color(e){if(!this[Bu](e)){let n=this.colorModel.toHsva(e);this[Vm](n),this[Km]=e}}constructor(){super();let e=Du(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[LS]=this[BS].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Bu](i)||(this.color=i)}handleEvent(e){let n=this[DS],r={...n,...e.detail};this[Vm](r);let i;!Um(r,n)&&!this[Bu](i=this.colorModel.fromHsva(r))&&(this[Km]=i,Ra(this,"color-changed",{value:i}))}[Bu](e){return this.color&&this.colorModel.equal(e,this.color)}[Vm](e){this[DS]=e,this[LS].forEach(n=>n.update(e))}};var t$={defaultColor:"#000",toHsva:CS,fromHsva:({h:t,s:e,v:n})=>AS({h:t,s:e,v:n,a:1}),equal:MS,fromAttr:t=>t},Hu=class extends Fu{get colorModel(){return t$}};var $S=ef(FS(),1);customElements.define("tiptap-hex-color-picker",Hu);var n$={blockquote:[sv],bold:[av],"bullet-list":[uv],"checked-list":[_h],code:[dv],"code-block":[gm.configure({lowlight:De,HTMLAttributes:{class:"hljs"}})],color:[pv],details:[om,sm,am],grid:[jh,Qh],"grid-builder":[Em,vm],heading:[Ev.configure({levels:[1,2,3,4,5,6]})],highlight:[gw],hr:[Tv],hurdle:[bm],italic:[Cv],lead:[Sh],link:[Jh.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Xh.configure({inline:!0})],oembed:[tm,rm,im],"ordered-list":[Nv],small:[Zh],strike:[Ov],subscript:[Rv],superscript:[Iv],table:[uw.configure({resizable:!0}),fw,dw,pw],underline:[mw]},r$=window.TiptapEditorExtensions||{},HS={...n$,...r$},$u=document.getElementById("activeLocale");$u&&$u.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:$u.value}});$u.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function i$({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[],customDocument:u=null,nodePlaceholders:d=[],showOnlyCurrentPlaceholder:f=!0}){let h=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,getExtensions(){let m=this.tools.map(y=>typeof y=="string"?y:y.id),g=[u?Rp.extend({content:u}):Rp,hw,wc,mv,bv,yv,Sv,fv,wm,Sm,Tm,Cm,Am.configure({statePath:e}),xm];if((s||d)&&!r&&g.push(kv.configure({showOnlyCurrent:f,placeholder:({node:y})=>d?.[y.type.name]||s||""})),m.length){let y=Object.keys(HS),v=[],w=["paragraph"];g.push(ex.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"top",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:S,from:O,to:L})=>{if(Ur(S,"oembed")||Ur(S,"vimeo")||Ur(S,"youtube")||Ur(S,"video")||Ur(S,"tiptapBlock"))return!1;if(Ur(S,"link")||Ur(S,"table")||O!==L)return!0}})),this.floatingMenuTools.length&&(g.push(tx.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(S=>{m.includes(S)||m.push(S)})),m.forEach(S=>{y.includes(S)?HS[S].forEach(O=>{["ordered-list","bullet-list","checked-list"].includes(S)?(g.push(O),g.includes($p)||g.push($p)):g.push(O)}):["align-left","align-right","align-center","align-justify"].includes(S)&&(S==="align-left"&&v.push("start"),S==="align-center"&&v.push("center"),S==="align-right"&&v.push("end"),S==="align-justify"&&v.push("justify"),m.includes("heading")&&w.push("heading"),typeof g.find(L=>L.name==="textAlign")>"u"&&g.push(ym.configure({types:w,alignments:v})))})}return l?.length&&g.push(_m.configure({mergeTags:l})),g},init:function(){let m=this.$refs.element.querySelector(".tiptap");m&&(m.remove(),h=null),this.initEditor(this.state);let g=this.$el.parentElement.closest("[x-sortable]");g&&(window.Sortable.utils.on(g,"start",()=>{g.classList.add("sorting")}),window.Sortable.utils.on(g,"end",()=>{g.classList.remove("sorting")})),this.$watch("state",(y,v)=>{typeof y<"u"&&((0,$S.isEqual)(v,Alpine.raw(y))||this.updateEditorContent(y))})},initEditor(m){if(!this.$el.querySelector(".tiptap")){let g=this;h=new sc({element:g.$refs.element,extensions:g.getExtensions(),editable:!g.disabled,content:m,editorProps:{handlePaste(y,v,w){w.content.descendants(S=>{S.type.name==="tiptapBlock"&&(S.attrs.statePath=g.statePath,S.attrs.data=JSON.parse(S.attrs.data))})}},onUpdate({editor:y}){g.state=y.isEmpty?null:y.getJSON(),g.updatedAt=Date.now()},onSelectionUpdate(){g.updatedAt=Date.now()},onBlur(){g.updatedAt=Date.now()},onFocus(){g.updatedAt=Date.now()}})}},isActive(m,g={}){return h.isActive(m,g)},editor(){return h},blur(){let m=this.$el.querySelectorAll("[data-tippy-content]");m&&m.forEach(g=>g.destroy()),this.updatedAt=Date.now()},updateEditorContent(m){if(h.isEditable){let{from:g,to:y}=h.state.selection;h.commands.setContent(m,!0),h.chain().focus().setTextSelection({from:g,to:y}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(m){this.locale=m.detail.locale},insertContent(m){if(m.detail.statePath===this.statePath)switch(m.detail.type){case"media":this.insertMedia(m);return;case"video":this.insertVideo(m);return;case"link":this.insertLink(m);return;case"source":this.insertSource(m);return;case"grid":this.insertGridBuilder(m);return;default:return}},insertMedia(m){Array.isArray(m.detail.media)?m.detail.media.forEach(g=>{this.executeMediaInsert(g)}):this.executeMediaInsert(m.detail.media)},executeMediaInsert(m=null){if(!(!m||m?.url===null)&&m){let g=m?.url||m?.src,y=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],w=/.*\.([a-zA-Z]*)\??/.exec(g.toLowerCase());w!==null&&y.includes(w[1])?h.chain().focus().setImage({src:g,alt:m?.alt,title:m?.title,width:m?.width,height:m?.height,lazy:m?.lazy,srcset:m?.srcset,sizes:m?.sizes,media:m?.media}).run():h.chain().focus().extendMarkRange("link").setLink({href:g}).insertContent(m?.link_text).run()}},insertVideo(m){let g=m.detail.video;if(!g||g.url===null)return;let y={src:g.url,width:g.responsive?g.width*100:g.width,height:g.responsive?g.height*100:g.height,responsive:g.responsive??!0,"data-aspect-width":g.width,"data-aspect-height":g.height};g.url.includes("youtube")||g.url.includes("youtu.be")?h.chain().focus().setYoutubeVideo({...y,controls:g.youtube_options.includes("controls"),nocookie:g.youtube_options.includes("nocookie"),start:g.start_at??0}).run():g.url.includes("vimeo")?h.chain().focus().setVimeoVideo({...y,autoplay:g.vimeo_options.includes("autoplay"),loop:g.vimeo_options.includes("loop"),title:g.vimeo_options.includes("show_title"),byline:g.vimeo_options.includes("byline"),portrait:g.vimeo_options.includes("portrait")}).run():h.chain().focus().setVideo({...y,autoplay:g.native_options.includes("autoplay"),loop:g.native_options.includes("loop"),controls:g.native_options.includes("controls")}).run()},insertLink(m){let g=m.detail;if(!(g.href===null&&g.id===null)){if(g.href===""&&g.id===null){this.unsetLink();return}h.chain().focus().setTextSelection({from:g.coordinates[0].$from.pos,to:g.coordinates[0].$to.pos}).setLink({href:g.href,id:g.id??null,target:g.target??null,hreflang:g.hreflang??null,rel:g.rel??null,referrerpolicy:g.referrerpolicy??null,as_button:g.as_button??null,button_theme:g.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){h.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(m){this.updateEditorContent(m.detail.source)},insertGridBuilder(m){let g=m.detail.data,y="responsive",v=parseInt(g.asymmetric_left)??null,w=parseInt(g.asymmetric_right)??null;g.fixed&&(y="fixed"),g.asymmetric&&(y="asymmetric"),h.chain().focus().insertGridBuilder({cols:g.columns,type:y,stackAt:g.stack_at,asymmetricLeft:v,asymmetricRight:w}).run()},insertBlock(m){m.detail.statePath===this.statePath&&(h.commands.insertBlock({type:m.detail.type,statePath:m.detail.statePath,data:m.detail.data,preview:m.detail.preview,label:m.detail.label,coordinates:m.detail.coordinates}),h.isFocused||h.commands.focus())},insertMergeTag(m){h.commands.insertMergeTag({tag:m.detail.tag,coordinates:m.detail.coordinates}),h.isFocused||h.commands.focus()},openBlockSettings(m){m.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,m.detail)},updateBlock(m){m.detail.statePath===this.statePath&&(h.commands.updateBlock({type:m.detail.type,statePath:m.detail.statePath,data:m.detail.data,preview:m.detail.preview,label:m.detail.label,coordinates:m.detail.coordinates}),h.isFocused||h.commands.focus())},deleteBlock(){h.commands.removeBlock()}}}export{i$ as default}; + `;t=document.createElement("div"),t.innerHTML=r,t.addEventListener("merge-tags-select",i=>{n.command({id:i.detail.item})}),e=is("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var Sm=We.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var Tm=We.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var Cm=We.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var Am=We.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function _F(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xx(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=_F(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Zx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},u={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],b=["true","false"],E={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...w,...S,"set","shopt",...N,...D]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,E,s,l,u,n]}}function jx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},D={begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:g,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:w}}}function Qx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function e_(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},E=t.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[E,g,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let w={variants:[b,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},N=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+N+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[w,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}var SF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),TF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],AF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],MF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],NF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function t_(t){let e=t.regex,n=SF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AF.join("|")+")"},{begin:":(:)?("+MF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:CF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TF.join("|")+")\\b"}]}}function n_(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function r_(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"a_(t,e,n-1))}function l_(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+a_("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,s_,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s_,d]}}var c_="[A-Za-z$_][0-9A-Za-z$_]*",kF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],OF=["true","false","null","undefined","NaN","Infinity"],u_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],d_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IF=[].concat(f_,u_,d_);function p_(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:c_,keyword:kF,literal:OF,built_in:IF,"variable.language":RF},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(N,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...u_,...d_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...f_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,N,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function h_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ds="[0-9](_*[0-9])*",_u=`\\.(${ds})`,Su="[0-9a-fA-F](_*[0-9a-fA-F])*",DF={className:"number",variants:[{begin:`(\\b(${ds})((${_u})|\\.)?|(${_u}))[eE][+-]?(${ds})[fFdD]?\\b`},{begin:`\\b(${ds})((${_u})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_u})[fFdD]?\\b`},{begin:`\\b(${ds})[fFdD]\\b`},{begin:`\\b0[xX]((${Su})\\.?|(${Su})?\\.(${Su}))[pP][+-]?(${ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Su})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function m_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=DF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},d]}}var LF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),PF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],g_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],b_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],FF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),HF=g_.concat(b_);function y_(t){let e=LF(t),n=HF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(D){return{className:"string",begin:"~?"+D+".*?"+D}},d=function(D,T,B){return{className:D,begin:T,relevance:B}},f={$pattern:/[a-z-]+/,keyword:r,attribute:BF.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+FF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+PF.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+g_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},N={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,w,N,b,S,g,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function E_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function v_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let g=[n,u];return[d,f,h,m].forEach(w=>{w.contains=w.contains.concat(g)}),g=g.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},i,r,u,s]}}function x_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function __(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},u=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,b,E="\\1")=>{let w=E==="\\1"?E:e.concat(E,b);return e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,E,r)},h=(g,b,E)=>e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,E,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function S_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:w,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(E),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[ne,o,Y,t.C_BLOCK_COMMENT_MODE,g,b,B]},Q={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(w).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(Q);let fe=[ne,Y,t.C_BLOCK_COMMENT_MODE,g,b,B],we={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...fe]},...fe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:D,contains:[we,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,Q,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},B,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,b]}}function T_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function C_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function A_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},w={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,E,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,E,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,w,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,S,h]}]}}function M_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function N_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function k_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},R=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=R,E.contains=R;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:R}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:R}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(R)}}function O_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:""},n]}}var $F=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),zF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],UF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],WF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],KF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],VF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function R_(t){let e=$F(t),n=KF,r=WF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+VF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:UF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function I_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function D_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,b=[...d,...u].filter(D=>!f.includes(D)),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},w={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function N(D,{exceptions:T,when:B}={}){let R=B;return T=T||[],D.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:R(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(b,{when:D=>D.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:b.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,E,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,w]}}function F_(t){return t?typeof t=="string"?t:t.source:null}function Tu(t){return nt("(?=",t,")")}function nt(...t){return t.map(n=>F_(n)).join("")}function GF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(GF(t).capture?"":"?:")+t.map(r=>F_(r)).join("|")+")"}var Om=t=>nt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),qF=["Protocol","Type"].map(Om),L_=["init","self"].map(Om),YF=["Any","Self"],Mm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],P_=["false","nil","true"],JF=["assignment","associativity","higherThan","left","lowerThan","none","right"],XF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],B_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],H_=Sn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),$_=Sn(H_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Nm=nt(H_,$_,"*"),z_=Sn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cu=Sn(z_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xr=nt(z_,Cu,"*"),km=nt(/[A-Z]/,Cu,"*"),ZF=["autoclosure",nt(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Xr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],jF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function U_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...qF,...L_)],className:{2:"keyword"}},o={match:nt(/\./,Sn(...Mm)),relevance:0},s=Mm.filter(Re=>typeof Re=="string").concat(["_|0"]),l=Mm.filter(Re=>typeof Re!="string").concat(YF).map(Om),u={variants:[{className:"keyword",match:Sn(...l,...L_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(XF),literal:P_},f=[i,o,u],h={match:nt(/\./,Sn(...B_)),relevance:0},m={className:"built_in",match:nt(/\b/,Sn(...B_),/(?=\()/)},g=[h,m],b={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:Nm},{match:`\\.(\\.|${$_})+`}]},w=[b,E],S="([0-9]_*)+",N="([0-9a-fA-F]_*)+",D={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(Re="")=>({className:"subst",variants:[{match:nt(/\\/,Re,/[0\\tnr"']/)},{match:nt(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),B=(Re="")=>({className:"subst",match:nt(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),R=(Re="")=>({className:"subst",label:"interpol",begin:nt(/\\/,Re,/\(/),end:/\)/}),Y=(Re="")=>({begin:nt(Re,/"""/),end:nt(/"""/,Re),contains:[T(Re),B(Re),R(Re)]}),ne=(Re="")=>({begin:nt(Re,/"/),end:nt(/"/,Re),contains:[T(Re),R(Re)]}),q={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ne(),ne("#"),ne("##"),ne("###")]},Q={match:nt(/`/,Xr,/`/)},fe={className:"variable",match:/\$\d+/},we={className:"variable",match:`\\$${Cu}+`},me=[Q,fe,we],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jF,contains:[...w,D,q]}]}},ge={className:"keyword",match:nt(/@/,Sn(...ZF))},ye={className:"meta",match:nt(/@/,Xr)},A=[Ce,ge,ye],I={match:Tu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cu,"+")},{className:"type",match:km,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Tu(km)),relevance:0}]},z={begin://,keywords:d,contains:[...r,...f,...A,b,I]};I.contains.push(z);let j={match:nt(Xr,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",j,...r,...f,...g,...w,D,q,...me,...A,I]},xe={begin://,contains:[...r,I]},Ae={begin:Sn(Tu(nt(Xr,/\s*:/)),Tu(nt(Xr,/\s+/,Xr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Xr}]},je={begin:/\(/,end:/\)/,keywords:d,contains:[Ae,...r,...f,...w,D,q,...A,I,ie],endsParent:!0,illegal:/["']/},Ne={match:[/func/,/\s+/,Sn(Q.match,Xr,Nm)],className:{1:"keyword",3:"title.function"},contains:[xe,je,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,je,e],illegal:/\[|%/},_t={match:[/operator/,/\s+/,Nm],className:{1:"keyword",3:"title"}},kt={begin:[/precedencegroup/,/\s+/,km],className:{1:"keyword",3:"title"},contains:[I],keywords:[...JF,...P_],end:/}/};for(let Re of q.variants){let St=Re.contains.find(pt=>pt.label==="interpol");St.keywords=d;let Xt=[...f,...g,...w,D,q,...me];St.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,Ne,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},_t,kt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...g,...w,D,q,...me,...A,I,ie]}}var Au="[A-Za-z$_][0-9A-Za-z$_]*",W_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],K_=["true","false","null","undefined","NaN","Infinity"],V_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],G_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],q_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Y_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J_=[].concat(q_,V_,G_);function QF(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:Au,keyword:W_,literal:K_,built_in:J_,"variable.language":Y_},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(N,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...V_,...G_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...q_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,N,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function X_(t){let e=QF(t),n=Au,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],u={$pattern:Au,keyword:W_.concat(l),literal:K_,built_in:J_.concat(r),"variable.language":Y_},d={className:"meta",begin:"@"+n},f=(m,g,b)=>{let E=m.contains.findIndex(w=>w.label===g);if(E===-1)throw new Error("can not find mode to replace");m.contains.splice(E,1,b)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Z_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function j_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,u,d,l]}}function Q_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function eS(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,b,o],w=[...E];return w.pop(),w.push(s),m.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}var wS=ef(vS(),1);var Zn=wS.default;var _S=ef(xS(),1),ka=Object.assign(wo(Error),{eval:wo(EvalError),range:wo(RangeError),reference:wo(ReferenceError),syntax:wo(SyntaxError),type:wo(TypeError),uri:wo(URIError)});function wo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,_S.default)(n,...r);return new t(i)}}var WH={}.hasOwnProperty,SS="hljs-";function TS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw ka("Expected `string` for name, got `%s`",t);if(!Zn.getLanguage(t))throw ka("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw ka("Expected `string` for value, got `%s`",e);r==null&&(r=SS),Zn.configure({__emitter:zm,classPrefix:r});let i=Zn.highlight(e,{language:t,ignoreIllegals:!0});if(Zn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function KH(t,e={}){let n=e.subset||Zn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=SS),typeof t!="string")throw ka("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function VH(t,e){Zn.registerLanguage(t,e)}var GH=function(t,e){if(typeof t=="string")Zn.registerAliases(e,{languageName:t});else{let n;for(n in t)WH.call(t,n)&&Zn.registerAliases(t[n],{languageName:n})}};function qH(t){return!!Zn.getLanguage(t)}function YH(){return Zn.listLanguages()}var zm=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},De={highlight:TS,highlightAuto:KH,registerLanguage:VH,registered:qH,listLanguages:YH,registerAlias:GH};De.registerLanguage("arduino",Xx);De.registerLanguage("bash",Zx);De.registerLanguage("c",jx);De.registerLanguage("cpp",Qx);De.registerLanguage("csharp",e_);De.registerLanguage("css",t_);De.registerLanguage("diff",n_);De.registerLanguage("go",r_);De.registerLanguage("graphql",i_);De.registerLanguage("ini",o_);De.registerLanguage("java",l_);De.registerLanguage("javascript",p_);De.registerLanguage("json",h_);De.registerLanguage("kotlin",m_);De.registerLanguage("less",y_);De.registerLanguage("lua",E_);De.registerLanguage("makefile",v_);De.registerLanguage("markdown",w_);De.registerLanguage("objectivec",x_);De.registerLanguage("perl",__);De.registerLanguage("php",S_);De.registerLanguage("php-template",T_);De.registerLanguage("plaintext",C_);De.registerLanguage("python",A_);De.registerLanguage("python-repl",M_);De.registerLanguage("r",N_);De.registerLanguage("ruby",k_);De.registerLanguage("rust",O_);De.registerLanguage("scss",R_);De.registerLanguage("shell",I_);De.registerLanguage("sql",D_);De.registerLanguage("swift",U_);De.registerLanguage("typescript",X_);De.registerLanguage("vbnet",Z_);De.registerLanguage("wasm",j_);De.registerLanguage("xml",Q_);De.registerLanguage("yaml",eS);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var u6={grad:360/400,turn:360,rad:360/(Math.PI*2)},CS=t=>jH(Iu(t)),Iu=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Nt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Nt(parseInt(t.substring(6,8),16)/255,2):1});var AS=t=>ZH(XH(t)),JH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Nt(t),s:Nt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Nt(i/2),a:Nt(r,2)}};var Oa=t=>{let{h:e,s:n,l:r}=JH(t);return`hsl(${e}, ${n}%, ${r}%)`};var XH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),u=i%6;return{r:Nt([n,s,o,o,l,n][u]*255),g:Nt([l,n,n,s,o,o][u]*255),b:Nt([o,o,l,n,n,s][u]*255),a:Nt(r,2)}};var Ru=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},ZH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Ru(Nt(r*255)):"";return"#"+Ru(t)+Ru(e)+Ru(n)+i},jH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Nt(60*(s<0?s+6:s)),s:Nt(i?o/i*100:0),v:Nt(i/255*100),a:r}};var Um=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var MS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Um(Iu(t),Iu(e));var NS={},Du=t=>{let e=NS[t];return e||(e=document.createElement("template"),e.innerHTML=t,NS[t]=e),e},Ra=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var hs=!1,Wm=t=>"touches"in t,QH=t=>hs&&!Wm(t)?!1:(hs||(hs=Wm(t)),!0),kS=(t,e)=>{let n=Wm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ra(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},e$=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ra(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ms=class{constructor(e,n,r,i){let o=Du(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(hs?"touchmove":"mousemove",this),n(hs?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!QH(e)||!hs&&e.button!=0)return;this.el.focus(),kS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),kS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":e$(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Lu=class extends ms{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Oa({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Nt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Pu=class extends ms{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Oa(e)},{"background-color":Oa({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Nt(e.s)}%, Brightness ${Nt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var OS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var RS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var IS="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Bu=Symbol("same"),Km=Symbol("color"),DS=Symbol("hsva"),Vm=Symbol("update"),LS=Symbol("parts"),PS=Symbol("css"),BS=Symbol("sliders"),Fu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[PS](){return[OS,RS,IS]}get[BS](){return[Pu,Lu]}get color(){return this[Km]}set color(e){if(!this[Bu](e)){let n=this.colorModel.toHsva(e);this[Vm](n),this[Km]=e}}constructor(){super();let e=Du(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[LS]=this[BS].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Bu](i)||(this.color=i)}handleEvent(e){let n=this[DS],r={...n,...e.detail};this[Vm](r);let i;!Um(r,n)&&!this[Bu](i=this.colorModel.fromHsva(r))&&(this[Km]=i,Ra(this,"color-changed",{value:i}))}[Bu](e){return this.color&&this.colorModel.equal(e,this.color)}[Vm](e){this[DS]=e,this[LS].forEach(n=>n.update(e))}};var t$={defaultColor:"#000",toHsva:CS,fromHsva:({h:t,s:e,v:n})=>AS({h:t,s:e,v:n,a:1}),equal:MS,fromAttr:t=>t},Hu=class extends Fu{get colorModel(){return t$}};var $S=ef(FS(),1);customElements.define("tiptap-hex-color-picker",Hu);var n$={blockquote:[sv],bold:[av],"bullet-list":[uv],"checked-list":[_h],code:[dv],"code-block":[gm.configure({lowlight:De,HTMLAttributes:{class:"hljs"}})],color:[pv],details:[om,sm,am],grid:[jh,Qh],"grid-builder":[Em,vm],heading:[Ev.configure({levels:[1,2,3,4,5,6]})],highlight:[gw],hr:[Tv],hurdle:[bm],italic:[Cv],lead:[Sh],link:[Jh.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Xh.configure({inline:!0})],oembed:[tm,rm,im],"ordered-list":[Nv],small:[Zh],strike:[Ov],subscript:[Rv],superscript:[Iv],table:[uw.configure({resizable:!0}),fw,dw,pw],underline:[mw]},r$=window.TiptapEditorExtensions||{},HS={...n$,...r$},$u=document.getElementById("activeLocale");$u&&$u.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:$u.value}});$u.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function i$({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",floatingMenuTools:o=[],placeholder:s=null,mergeTags:l=[],customDocument:u=null,nodePlaceholders:d=[],showOnlyCurrentPlaceholder:f=!0,debounce:h=null}){let m=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,floatingMenuTools:o,getExtensions(){let g=this.tools.map(E=>typeof E=="string"?E:E.id),b=[u?Rp.extend({content:u}):Rp,hw,wc,mv,bv,yv,Sv,fv,wm,Sm,Tm,Cm,Am.configure({statePath:e}),xm];if((s||d)&&!r&&b.push(kv.configure({showOnlyCurrent:f,placeholder:({node:E})=>d?.[E.type.name]||s||""})),g.length){let E=Object.keys(HS),w=[],S=["paragraph"];b.push(ex.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"top",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:N,from:D,to:T})=>{if(Ur(N,"oembed")||Ur(N,"vimeo")||Ur(N,"youtube")||Ur(N,"video")||Ur(N,"tiptapBlock"))return!1;if(Ur(N,"link")||Ur(N,"table")||D!==T)return!0}})),this.floatingMenuTools.length&&(b.push(tx.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(N=>{g.includes(N)||g.push(N)})),g.forEach(N=>{E.includes(N)?HS[N].forEach(D=>{["ordered-list","bullet-list","checked-list"].includes(N)?(b.push(D),b.includes($p)||b.push($p)):b.push(D)}):["align-left","align-right","align-center","align-justify"].includes(N)&&(N==="align-left"&&w.push("start"),N==="align-center"&&w.push("center"),N==="align-right"&&w.push("end"),N==="align-justify"&&w.push("justify"),g.includes("heading")&&S.push("heading"),typeof b.find(T=>T.name==="textAlign")>"u"&&b.push(ym.configure({types:S,alignments:w})))})}return l?.length&&b.push(_m.configure({mergeTags:l})),b},init:function(){let g=this.$refs.element.querySelector(".tiptap");g&&(g.remove(),m=null),this.initEditor(this.state);let b=this.$el.parentElement.closest("[x-sortable]");b&&(window.Sortable.utils.on(b,"start",()=>{b.classList.add("sorting")}),window.Sortable.utils.on(b,"end",()=>{b.classList.remove("sorting")})),this.$watch("state",(E,w)=>{typeof E<"u"&&((0,$S.isEqual)(w,Alpine.raw(E))||this.updateEditorContent(E))})},initEditor(g){if(!this.$el.querySelector(".tiptap")){let b=this;m=new sc({element:b.$refs.element,extensions:b.getExtensions(),editable:!b.disabled,content:g,editorProps:{handlePaste(E,w,S){S.content.descendants(N=>{N.type.name==="tiptapBlock"&&(N.attrs.statePath=b.statePath,N.attrs.data=JSON.parse(N.attrs.data))})}},onUpdate({editor:E}){b.updatedAt=Date.now(),clearTimeout(b.timeOut),b.timeOut=setTimeout(function(){b.state=E.isEmpty?null:E.getJSON()},h??0)},onSelectionUpdate(){b.updatedAt=Date.now()},onBlur(){b.updatedAt=Date.now()},onFocus(){b.updatedAt=Date.now()}})}},isActive(g,b={}){return m.isActive(g,b)},editor(){return m},blur(){let g=this.$el.querySelectorAll("[data-tippy-content]");g&&g.forEach(b=>b.destroy()),this.updatedAt=Date.now()},updateEditorContent(g){if(m.isEditable){let{from:b,to:E}=m.state.selection;m.commands.setContent(g,!0),m.chain().focus().setTextSelection({from:b,to:E}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(g){this.locale=g.detail.locale},insertContent(g){if(g.detail.statePath===this.statePath)switch(g.detail.type){case"media":this.insertMedia(g);return;case"video":this.insertVideo(g);return;case"link":this.insertLink(g);return;case"source":this.insertSource(g);return;case"grid":this.insertGridBuilder(g);return;default:return}},insertMedia(g){Array.isArray(g.detail.media)?g.detail.media.forEach(b=>{this.executeMediaInsert(b)}):this.executeMediaInsert(g.detail.media)},executeMediaInsert(g=null){if(!(!g||g?.url===null)&&g){let b=g?.url||g?.src,E=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],S=/.*\.([a-zA-Z]*)\??/.exec(b.toLowerCase());S!==null&&E.includes(S[1])?m.chain().focus().setImage({src:b,alt:g?.alt,title:g?.title,width:g?.width,height:g?.height,lazy:g?.lazy,srcset:g?.srcset,sizes:g?.sizes,media:g?.media}).run():m.chain().focus().extendMarkRange("link").setLink({href:b}).insertContent(g?.link_text).run()}},insertVideo(g){let b=g.detail.video;if(!b||b.url===null)return;let E={src:b.url,width:b.responsive?b.width*100:b.width,height:b.responsive?b.height*100:b.height,responsive:b.responsive??!0,"data-aspect-width":b.width,"data-aspect-height":b.height};b.url.includes("youtube")||b.url.includes("youtu.be")?m.chain().focus().setYoutubeVideo({...E,controls:b.youtube_options.includes("controls"),nocookie:b.youtube_options.includes("nocookie"),start:b.start_at??0}).run():b.url.includes("vimeo")?m.chain().focus().setVimeoVideo({...E,autoplay:b.vimeo_options.includes("autoplay"),loop:b.vimeo_options.includes("loop"),title:b.vimeo_options.includes("show_title"),byline:b.vimeo_options.includes("byline"),portrait:b.vimeo_options.includes("portrait")}).run():m.chain().focus().setVideo({...E,autoplay:b.native_options.includes("autoplay"),loop:b.native_options.includes("loop"),controls:b.native_options.includes("controls")}).run()},insertLink(g){let b=g.detail;if(!(b.href===null&&b.id===null)){if(b.href===""&&b.id===null){this.unsetLink();return}m.chain().focus().setTextSelection({from:b.coordinates[0].$from.pos,to:b.coordinates[0].$to.pos}).setLink({href:b.href,id:b.id??null,target:b.target??null,hreflang:b.hreflang??null,rel:b.rel??null,referrerpolicy:b.referrerpolicy??null,as_button:b.as_button??null,button_theme:b.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){m.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(g){this.updateEditorContent(g.detail.source)},insertGridBuilder(g){let b=g.detail.data,E="responsive",w=parseInt(b.asymmetric_left)??null,S=parseInt(b.asymmetric_right)??null;b.fixed&&(E="fixed"),b.asymmetric&&(E="asymmetric"),m.chain().focus().insertGridBuilder({cols:b.columns,type:E,stackAt:b.stack_at,asymmetricLeft:w,asymmetricRight:S}).run()},insertBlock(g){g.detail.statePath===this.statePath&&(m.commands.insertBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus())},insertMergeTag(g){m.commands.insertMergeTag({tag:g.detail.tag,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus()},openBlockSettings(g){g.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,g.detail)},updateBlock(g){g.detail.statePath===this.statePath&&(m.commands.updateBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus())},deleteBlock(){m.commands.removeBlock()}}}export{i$ as default}; /*! Bundled license information: lodash/lodash.js: diff --git a/resources/js/plugin.js b/resources/js/plugin.js index aab1936..891cda2 100644 --- a/resources/js/plugin.js +++ b/resources/js/plugin.js @@ -162,6 +162,7 @@ export default function tiptap({ customDocument = null, nodePlaceholders = [], showOnlyCurrentPlaceholder = true, + debounce = null, }) { let editor = null; @@ -361,8 +362,11 @@ export default function tiptap({ } }, onUpdate({editor}) { - _this.state = editor.isEmpty ? null : editor.getJSON(); _this.updatedAt = Date.now(); + clearTimeout(_this.timeOut); + _this.timeOut = setTimeout(function(){ + _this.state = editor.isEmpty ? null : editor.getJSON(); + },debounce ?? 0); }, onSelectionUpdate() { _this.updatedAt = Date.now(); diff --git a/resources/views/tiptap-editor.blade.php b/resources/views/tiptap-editor.blade.php index 871ae58..896ff0a 100644 --- a/resources/views/tiptap-editor.blade.php +++ b/resources/views/tiptap-editor.blade.php @@ -48,7 +48,8 @@ class="relative z-0 tiptap-wrapper rounded-md bg-white dark:bg-gray-900 focus-wi mergeTags: @js($mergeTags), customDocument: @js($customDocument), nodePlaceholders: @js($nodePlaceholders), - showOnlyCurrentPlaceholder: @js($showOnlyCurrentPlaceholder) + showOnlyCurrentPlaceholder: @js($showOnlyCurrentPlaceholder), + debounce: @js($isLiveDebounced()) ? @js($getLiveDebounce()) : null, })" x-init="$nextTick(() => { init() })" x-on:click.away="blur()" From 410865b641b7e61bc897d1fa4647db0aff23a951 Mon Sep 17 00:00:00 2001 From: Thijs Kuilman Date: Wed, 22 Jan 2025 21:30:08 +0100 Subject: [PATCH 3/4] Replaced the ternary with $getLiveDebounce(), since that function can return null --- resources/views/tiptap-editor.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/tiptap-editor.blade.php b/resources/views/tiptap-editor.blade.php index 896ff0a..4095935 100644 --- a/resources/views/tiptap-editor.blade.php +++ b/resources/views/tiptap-editor.blade.php @@ -49,7 +49,7 @@ class="relative z-0 tiptap-wrapper rounded-md bg-white dark:bg-gray-900 focus-wi customDocument: @js($customDocument), nodePlaceholders: @js($nodePlaceholders), showOnlyCurrentPlaceholder: @js($showOnlyCurrentPlaceholder), - debounce: @js($isLiveDebounced()) ? @js($getLiveDebounce()) : null, + debounce: @js($getLiveDebounce()), })" x-init="$nextTick(() => { init() })" x-on:click.away="blur()" From 44ebb1cb0f23e88a4762c14d56741fc634e0f1df Mon Sep 17 00:00:00 2001 From: Thijs Kuilman Date: Sun, 2 Feb 2025 20:08:55 +0100 Subject: [PATCH 4/4] Build assets --- resources/dist/filament-tiptap-editor.js | 48 ++++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/resources/dist/filament-tiptap-editor.js b/resources/dist/filament-tiptap-editor.js index 999645e..8a83783 100644 --- a/resources/dist/filament-tiptap-editor.js +++ b/resources/dist/filament-tiptap-editor.js @@ -1,10 +1,10 @@ -var uO=Object.create;var yy=Object.defineProperty;var dO=Object.getOwnPropertyDescriptor;var fO=Object.getOwnPropertyNames;var pO=Object.getPrototypeOf,hO=Object.prototype.hasOwnProperty;var Qd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var mO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fO(e))!hO.call(t,i)&&i!==n&&yy(t,i,{get:()=>e[i],enumerable:!(r=dO(e,i))||r.enumerable});return t};var ef=(t,e,n)=>(n=t!=null?uO(pO(t)):{},mO(e||!t||!t.__esModule?yy(n,"default",{value:t,enumerable:!0}):n,t));var vS=Qd((mq,ES)=>{function aS(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&aS(n)}),t}var Nu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function lS(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ai(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var eH="",tS=t=>!!t.scope,tH=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Im=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=lS(e)}openNode(e){if(!tS(e))return;let n=tH(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){tS(e)&&(this.buffer+=eH)}value(){return this.buffer}span(e){this.buffer+=``}},nS=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Dm=class t{constructor(){this.rootNode=nS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=nS({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Lm=class extends Dm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Im(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ma(t){return t?typeof t=="string"?t:t.source:null}function cS(t){return vo("(?=",t,")")}function nH(t){return vo("(?:",t,")*")}function rH(t){return vo("(?:",t,")?")}function vo(...t){return t.map(n=>Ma(n)).join("")}function iH(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Bm(...t){return"("+(iH(t).capture?"":"?:")+t.map(r=>Ma(r)).join("|")+")"}function uS(t){return new RegExp(t.toString()+"|").exec("").length-1}function oH(t,e){let n=t&&t.exec(e);return n&&n.index===0}var sH=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ma(r),s="";for(;o.length>0;){let l=sH.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var aH=/\b\B/,dS="[a-zA-Z]\\w*",Hm="[a-zA-Z_]\\w*",fS="\\b\\d+(\\.\\d+)?",pS="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",hS="\\b(0b[01]+)",lH="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cH=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=vo(e,/.*\b/,t.binary,/\b.*/)),Ai({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Na={begin:"\\\\[\\s\\S]",relevance:0},uH={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Na]},dH={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Na]},fH={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ou=function(t,e,n={}){let r=Ai({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Bm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:vo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pH=Ou("//","$"),hH=Ou("/\\*","\\*/"),mH=Ou("#","$"),gH={scope:"number",begin:fS,relevance:0},bH={scope:"number",begin:pS,relevance:0},yH={scope:"number",begin:hS,relevance:0},EH={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Na,{begin:/\[/,end:/\]/,relevance:0,contains:[Na]}]}]},vH={scope:"title",begin:dS,relevance:0},wH={scope:"title",begin:Hm,relevance:0},xH={begin:"\\.\\s*"+Hm,relevance:0},_H=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Mu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:aH,IDENT_RE:dS,UNDERSCORE_IDENT_RE:Hm,NUMBER_RE:fS,C_NUMBER_RE:pS,BINARY_NUMBER_RE:hS,RE_STARTERS_RE:lH,SHEBANG:cH,BACKSLASH_ESCAPE:Na,APOS_STRING_MODE:uH,QUOTE_STRING_MODE:dH,PHRASAL_WORDS_MODE:fH,COMMENT:Ou,C_LINE_COMMENT_MODE:pH,C_BLOCK_COMMENT_MODE:hH,HASH_COMMENT_MODE:mH,NUMBER_MODE:gH,C_NUMBER_MODE:bH,BINARY_NUMBER_MODE:yH,REGEXP_MODE:EH,TITLE_MODE:vH,UNDERSCORE_TITLE_MODE:wH,METHOD_GUARD:xH,END_SAME_AS_BEGIN:_H});function SH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function TH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function CH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=SH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function AH(t,e){Array.isArray(t.illegal)&&(t.illegal=Bm(...t.illegal))}function MH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function NH(t,e){t.relevance===void 0&&(t.relevance=1)}var kH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=vo(n.beforeMatch,cS(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},OH=["of","and","for","in","not","or","if","then","parent","list","value"],RH="keyword";function mS(t,e,n=RH){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,mS(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,IH(u[0],u[1])]})}}function IH(t,e){return e?Number(e):DH(t)?0:1}function DH(t){return OH.includes(t.toLowerCase())}var rS={},Eo=t=>{console.error(t)},iS=(t,...e)=>{console.log(`WARN: ${t}`,...e)},fs=(t,e)=>{rS[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),rS[`${t}/${e}`]=!0)},ku=new Error;function gS(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=uS(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function LH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Eo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ku;if(typeof t.beginScope!="object"||t.beginScope===null)throw Eo("beginScope must be object"),ku;gS(t,t.begin,{key:"beginScope"}),t.begin=Fm(t.begin,{joinWith:""})}}function PH(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Eo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ku;if(typeof t.endScope!="object"||t.endScope===null)throw Eo("endScope must be object"),ku;gS(t,t.end,{key:"endScope"}),t.end=Fm(t.end,{joinWith:""})}}function BH(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function FH(t){BH(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),LH(t),PH(t)}function HH(t){function e(s,l){return new RegExp(Ma(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=uS(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Fm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[TH,MH,FH,kH].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[CH,AH,NH].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=mS(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ma(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return $H(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ai(t.classNameAliases||{}),o(t)}function bS(t){return t?t.endsWithParent||bS(t.starts):!1}function $H(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ai(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:bS(t)?Ai(t,{starts:t.starts?Ai(t.starts):null}):Object.isFrozen(t)?Ai(t):t}var zH="11.8.0",Pm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Rm=lS,oS=Ai,sS=Symbol("nomatch"),UH=7,yS=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lm};function u(A){return l.noHighlightRe.test(A)}function d(A){let I=A.className+" ";I+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(I);if(z){let j=q(z[1]);return j||(iS(o.replace("{}",z[1])),iS("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return I.split(/\s+/).find(j=>u(j)||q(j))}function f(A,I,z){let j="",ie="";typeof I=="object"?(j=A,z=I.ignoreIllegals,ie=I.language):(fs("10.7.0","highlight(lang, code, ...args) has been deprecated."),fs("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=UH&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=oH(L.endRe,X);if(se){if(L["on:end"]){let Fe=new Nu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new Nu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=I.substring(L.index),se=Re(V,L,X);if(!se)return sS;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==sS)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw Eo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=HH(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(I);if(!L)break;let H=I.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:Rm(I),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:I.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:Rm(I),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let I={value:Rm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function b(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Pm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,b(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=oS(l,A)}let S=()=>{T(),fs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){T(),fs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function B(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(Eo("Language definition for '{}' could not be registered.".replace("{}",A)),i)Eo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return fs("10.7.0","highlightBlock will be removed entirely in v12.0"),fs("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:N,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:oS,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=zH,t.regex={concat:vo,lookahead:cS,either:Bm,optional:rH,anyNumberOfTimes:nH};for(let A in Mu)typeof Mu[A]=="object"&&aS(Mu[A]);return Object.assign(t,Mu),t},ps=yS({});ps.newInstance=()=>yS({});ES.exports=ps;ps.HighlightJS=ps;ps.default=ps});var xS=Qd((bq,$m)=>{(function(){var t;typeof $m<"u"?t=$m.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,u=i.length,d="",f,h=!1,m,g,b=!1,E,w=function(){return s[o++]},S=function(){for(var N="";/\d/.test(i[l]);)N+=i[l++],f=i[l];return N.length>0?parseInt(N):null};l{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",d=1,f=2,h=4,m=1,g=2,b=1,E=2,w=4,S=8,N=16,D=32,T=64,B=128,R=256,Y=512,ne=30,q="...",Q=800,fe=16,we=1,me=2,Ce=3,ge=1/0,ye=9007199254740991,A=17976931348623157e292,I=NaN,z=4294967295,j=z-1,ie=z>>>1,xe=[["ary",B],["bind",b],["bindKey",E],["curry",S],["curryRight",N],["flip",Y],["partial",D],["partialRight",T],["rearg",R]],Ae="[object Arguments]",je="[object Array]",Ne="[object AsyncFunction]",Be="[object Boolean]",_t="[object Date]",kt="[object DOMException]",Re="[object Error]",St="[object Function]",Xt="[object GeneratorFunction]",pt="[object Map]",an="[object Number]",Zt="[object Null]",Tt="[object Object]",Je="[object Promise]",jn="[object Proxy]",Pt="[object RegExp]",V="[object Set]",yt="[object String]",_e="[object Symbol]",pe="[object Undefined]",ut="[object WeakMap]",dt="[object WeakSet]",Bt="[object ArrayBuffer]",Ot="[object DataView]",L="[object Float32Array]",H="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",Fe="[object Int32Array]",rt="[object Uint8Array]",wr="[object Uint8ClampedArray]",F="[object Uint16Array]",ae="[object Uint32Array]",Se=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ft=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,Zr=RegExp(Ft.source),Da=RegExp(ln.source),xr=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Ni=/<%=([\s\S]+?)%>/g,jr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zu=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qr=/[\\^$.*+?()[\]{}|]/g,zS=RegExp(Qr.source),Uu=/^\s+/,US=/\s/,WS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,KS=/\{\n\/\* \[wrapped with (.+)\] \*/,VS=/,? & /,GS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qS=/[()=,{}\[\]\/\s]/,YS=/\\(\\)?/g,JS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gm=/\w*$/,XS=/^[-+]0x[0-9a-f]+$/i,ZS=/^0b[01]+$/i,jS=/^\[object .+?Constructor\]$/,QS=/^0o[0-7]+$/i,eT=/^(?:0|[1-9]\d*)$/,tT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,La=/($^)/,nT=/['\n\r\u2028\u2029\\]/g,Pa="\\ud800-\\udfff",rT="\\u0300-\\u036f",iT="\\ufe20-\\ufe2f",oT="\\u20d0-\\u20ff",qm=rT+iT+oT,Ym="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",sT="\\xac\\xb1\\xd7\\xf7",aT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lT="\\u2000-\\u206f",cT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",Zm="\\ufe0e\\ufe0f",jm=sT+aT+lT+cT,Wu="['\u2019]",uT="["+Pa+"]",Qm="["+jm+"]",Ba="["+qm+"]",eg="\\d+",dT="["+Ym+"]",tg="["+Jm+"]",ng="[^"+Pa+jm+eg+Ym+Jm+Xm+"]",Ku="\\ud83c[\\udffb-\\udfff]",fT="(?:"+Ba+"|"+Ku+")",rg="[^"+Pa+"]",Vu="(?:\\ud83c[\\udde6-\\uddff]){2}",Gu="[\\ud800-\\udbff][\\udc00-\\udfff]",xo="["+Xm+"]",ig="\\u200d",og="(?:"+tg+"|"+ng+")",pT="(?:"+xo+"|"+ng+")",sg="(?:"+Wu+"(?:d|ll|m|re|s|t|ve))?",ag="(?:"+Wu+"(?:D|LL|M|RE|S|T|VE))?",lg=fT+"?",cg="["+Zm+"]?",hT="(?:"+ig+"(?:"+[rg,Vu,Gu].join("|")+")"+cg+lg+")*",mT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ug=cg+lg+hT,bT="(?:"+[dT,Vu,Gu].join("|")+")"+ug,yT="(?:"+[rg+Ba+"?",Ba,Vu,Gu,uT].join("|")+")",ET=RegExp(Wu,"g"),vT=RegExp(Ba,"g"),qu=RegExp(Ku+"(?="+Ku+")|"+yT+ug,"g"),wT=RegExp([xo+"?"+tg+"+"+sg+"(?="+[Qm,xo,"$"].join("|")+")",pT+"+"+ag+"(?="+[Qm,xo+og,"$"].join("|")+")",xo+"?"+og+"+"+sg,xo+"+"+ag,gT,mT,eg,bT].join("|"),"g"),xT=RegExp("["+ig+Pa+qm+Zm+"]"),_T=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ST=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],TT=-1,it={};it[L]=it[H]=it[X]=it[se]=it[Fe]=it[rt]=it[wr]=it[F]=it[ae]=!0,it[Ae]=it[je]=it[Bt]=it[Be]=it[Ot]=it[_t]=it[Re]=it[St]=it[pt]=it[an]=it[Tt]=it[Pt]=it[V]=it[yt]=it[ut]=!1;var tt={};tt[Ae]=tt[je]=tt[Bt]=tt[Ot]=tt[Be]=tt[_t]=tt[L]=tt[H]=tt[X]=tt[se]=tt[Fe]=tt[pt]=tt[an]=tt[Tt]=tt[Pt]=tt[V]=tt[yt]=tt[_e]=tt[rt]=tt[wr]=tt[F]=tt[ae]=!0,tt[Re]=tt[St]=tt[ut]=!1;var CT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},AT={"&":"&","<":"<",">":">",'"':""","'":"'"},MT={"&":"&","<":"<",">":">",""":'"',"'":"'"},NT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kT=parseFloat,OT=parseInt,dg=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ht=dg||RT||Function("return this")(),Yu=typeof gs=="object"&&gs&&!gs.nodeType&&gs,ki=Yu&&typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,fg=ki&&ki.exports===Yu,Ju=fg&&dg.process,Rn=function(){try{var k=ki&&ki.require&&ki.require("util").types;return k||Ju&&Ju.binding&&Ju.binding("util")}catch{}}(),pg=Rn&&Rn.isArrayBuffer,hg=Rn&&Rn.isDate,mg=Rn&&Rn.isMap,gg=Rn&&Rn.isRegExp,bg=Rn&&Rn.isSet,yg=Rn&&Rn.isTypedArray;function Tn(k,$,P){switch(P.length){case 0:return k.call($);case 1:return k.call($,P[0]);case 2:return k.call($,P[0],P[1]);case 3:return k.call($,P[0],P[1],P[2])}return k.apply($,P)}function IT(k,$,P,oe){for(var Me=-1,Ye=k==null?0:k.length;++Me-1}function Xu(k,$,P){for(var oe=-1,Me=k==null?0:k.length;++oe-1;);return P}function Cg(k,$){for(var P=k.length;P--&&_o($,k[P],0)>-1;);return P}function UT(k,$){for(var P=k.length,oe=0;P--;)k[P]===$&&++oe;return oe}var WT=ed(CT),KT=ed(AT);function VT(k){return"\\"+NT[k]}function GT(k,$){return k==null?t:k[$]}function So(k){return xT.test(k)}function qT(k){return _T.test(k)}function YT(k){for(var $,P=[];!($=k.next()).done;)P.push($.value);return P}function id(k){var $=-1,P=Array(k.size);return k.forEach(function(oe,Me){P[++$]=[Me,oe]}),P}function Ag(k,$){return function(P){return k($(P))}}function ni(k,$){for(var P=-1,oe=k.length,Me=0,Ye=[];++P-1}function L1(a,c){var p=this.__data__,y=tl(p,a);return y<0?(++this.size,p.push([a,c])):p[y][1]=c,this}_r.prototype.clear=O1,_r.prototype.delete=R1,_r.prototype.get=I1,_r.prototype.has=D1,_r.prototype.set=L1;function Sr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,y,v,_){var C,M=c&d,O=c&f,U=c&h;if(p&&(C=v?p(a,y,v,_):p(a)),C!==t)return C;if(!ft(a))return a;var W=ke(a);if(W){if(C=HC(a),!M)return bn(a,C)}else{var G=Qt(a),te=G==St||G==Xt;if(ci(a))return cb(a,M);if(G==Tt||G==Ae||te&&!v){if(C=O||te?{}:Mb(a),!M)return O?MC(a,Z1(C,a)):AC(a,Hg(C,a))}else{if(!tt[G])return v?a:{};C=$C(a,G,M)}}_||(_=new er);var de=_.get(a);if(de)return de;_.set(a,C),ry(a)?a.forEach(function(ve){C.add(Pn(ve,c,p,ve,a,_))}):ty(a)&&a.forEach(function(ve,$e){C.set($e,Pn(ve,c,p,$e,a,_))});var Ee=U?O?kd:Nd:O?En:$t,Le=W?t:Ee(a);return In(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ts(C,$e,Pn(ve,c,p,$e,a,_))}),C}function j1(a){var c=$t(a);return function(p){return $g(p,a,c)}}function $g(a,c,p){var y=p.length;if(a==null)return!y;for(a=Qe(a);y--;){var v=p[y],_=c[v],C=a[v];if(C===t&&!(v in a)||!_(C))return!1}return!0}function zg(a,c,p){if(typeof a!="function")throw new Dn(i);return Rs(function(){a.apply(t,p)},c)}function Cs(a,c,p,y){var v=-1,_=Fa,C=!0,M=a.length,O=[],U=c.length;if(!M)return O;p&&(c=lt(c,Cn(p))),y?(_=Xu,C=!1):c.length>=n&&(_=Es,C=!1,c=new Ii(c));e:for(;++vv?0:v+p),y=y===t||y>v?v:Ie(y),y<0&&(y+=v),y=p>y?0:oy(y);p0&&p(M)?c>1?Vt(M,c-1,p,y,v):ti(v,M):y||(v[v.length]=M)}return v}var dd=mb(),Kg=mb(!0);function ur(a,c){return a&&dd(a,c,$t)}function fd(a,c){return a&&Kg(a,c,$t)}function rl(a,c){return ei(c,function(p){return Nr(a[p])})}function Li(a,c){c=ai(c,a);for(var p=0,y=c.length;a!=null&&pc}function tC(a,c){return a!=null&&Ze.call(a,c)}function nC(a,c){return a!=null&&c in Qe(a)}function rC(a,c,p){return a>=jt(c,p)&&a=120&&W.length>=120)?new Ii(C&&W):t}W=a[0];var G=-1,te=M[0];e:for(;++G-1;)M!==a&&Ya.call(M,O,1),Ya.call(a,O,1);return a}function tb(a,c){for(var p=a?c.length:0,y=p-1;p--;){var v=c[p];if(p==y||v!==_){var _=v;Mr(v)?Ya.call(a,v,1):xd(a,v)}}return a}function Ed(a,c){return a+Za(Lg()*(c-a+1))}function gC(a,c,p,y){for(var v=-1,_=It(Xa((c-a)/(p||1)),0),C=P(_);_--;)C[y?_:++v]=a,a+=p;return C}function vd(a,c){var p="";if(!a||c<1||c>ye)return p;do c%2&&(p+=a),c=Za(c/2),c&&(a+=a);while(c);return p}function He(a,c){return Bd(Ob(a,c,vn),a+"")}function bC(a){return Fg(Do(a))}function yC(a,c){var p=Do(a);return hl(p,Di(c,0,p.length))}function Ns(a,c,p,y){if(!ft(a))return a;c=ai(c,a);for(var v=-1,_=c.length,C=_-1,M=a;M!=null&&++v<_;){var O=fr(c[v]),U=p;if(O==="__proto__"||O==="constructor"||O==="prototype")return a;if(v!=C){var W=M[O];U=y?y(W,O,M):t,U===t&&(U=ft(W)?W:Mr(c[v+1])?[]:{})}Ts(M,O,U),M=M[O]}return a}var nb=ja?function(a,c){return ja.set(a,c),a}:vn,EC=Ja?function(a,c){return Ja(a,"toString",{configurable:!0,enumerable:!1,value:qd(c),writable:!0})}:vn;function vC(a){return hl(Do(a))}function Bn(a,c,p){var y=-1,v=a.length;c<0&&(c=-c>v?0:v+c),p=p>v?v:p,p<0&&(p+=v),v=c>p?0:p-c>>>0,c>>>=0;for(var _=P(v);++y>>1,C=a[_];C!==null&&!Mn(C)&&(p?C<=c:C=n){var U=c?null:RC(a);if(U)return $a(U);C=!1,v=Es,O=new Ii}else O=c?[]:M;e:for(;++y<_;){var W=a[y],G=c?c(W):W;if(W=p||W!==0?W:0,C&&G===G){for(var te=O.length;te--;)if(O[te]===G)continue e;c&&O.push(G),M.push(W)}else v(O,G,p)||(O!==M&&O.push(G),M.push(W))}return M}function xd(a,c){return c=ai(c,a),a=Rb(a,c),a==null||delete a[fr(Fn(c))]}function ob(a,c,p,y){return Ns(a,c,p(Li(a,c)),y)}function sl(a,c,p,y){for(var v=a.length,_=y?v:-1;(y?_--:++_=y?a:Bn(a,c,p)}var lb=c1||function(a){return Ht.clearTimeout(a)};function cb(a,c){if(c)return a.slice();var p=a.length,y=kg?kg(p):new a.constructor(p);return a.copy(y),y}function Cd(a){var c=new a.constructor(a.byteLength);return new Ga(c).set(new Ga(a)),c}function _C(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function SC(a){var c=new a.constructor(a.source,Gm.exec(a));return c.lastIndex=a.lastIndex,c}function TC(a){return Ss?Qe(Ss.call(a)):{}}function ub(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function db(a,c){if(a!==c){var p=a!==t,y=a===null,v=a===a,_=Mn(a),C=c!==t,M=c===null,O=c===c,U=Mn(c);if(!M&&!U&&!_&&a>c||_&&C&&O&&!M&&!U||y&&C&&O||!p&&O||!v)return 1;if(!y&&!_&&!U&&a=M)return O;var U=p[y];return O*(U=="desc"?-1:1)}}return a.index-c.index}function fb(a,c,p,y){for(var v=-1,_=a.length,C=p.length,M=-1,O=c.length,U=It(_-C,0),W=P(O+U),G=!y;++M1?p[v-1]:t,C=v>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(v--,_):t,C&&un(p[0],p[1],C)&&(_=v<3?t:_,v=1),c=Qe(c);++y-1?v[_?c[C]:C]:t}}function yb(a){return Ar(function(c){var p=c.length,y=p,v=Ln.prototype.thru;for(a&&c.reverse();y--;){var _=c[y];if(typeof _!="function")throw new Dn(i);if(v&&!C&&fl(_)=="wrapper")var C=new Ln([],!0)}for(y=C?y:p;++y1&&Ve.reverse(),W&&O<$e&&(Ve.length=O),this&&this!==Ht&&this instanceof ve&&(Or=Le||ks(Or)),Or.apply(nr,Ve)}return ve}function Eb(a,c){return function(p,y){return iC(p,a,c(y),{})}}function cl(a,c){return function(p,y){var v;if(p===t&&y===t)return c;if(p!==t&&(v=p),y!==t){if(v===t)return y;typeof p=="string"||typeof y=="string"?(p=An(p),y=An(y)):(p=ib(p),y=ib(y)),v=a(p,y)}return v}}function Ad(a){return Ar(function(c){return c=lt(c,Cn(be())),He(function(p){var y=this;return a(c,function(v){return Tn(v,y,p)})})})}function ul(a,c){c=c===t?" ":An(c);var p=c.length;if(p<2)return p?vd(c,a):c;var y=vd(c,Xa(a/To(c)));return So(c)?li(Qn(y),0,a).join(""):y.slice(0,a)}function OC(a,c,p,y){var v=c&b,_=ks(a);function C(){for(var M=-1,O=arguments.length,U=-1,W=y.length,G=P(W+O),te=this&&this!==Ht&&this instanceof C?_:a;++UM))return!1;var U=_.get(a),W=_.get(c);if(U&&W)return U==c&&W==a;var G=-1,te=!0,de=p&g?new Ii:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[y],c=c.join(p>2?", ":" "),a.replace(WS,`{ +var uO=Object.create;var yy=Object.defineProperty;var dO=Object.getOwnPropertyDescriptor;var fO=Object.getOwnPropertyNames;var pO=Object.getPrototypeOf,hO=Object.prototype.hasOwnProperty;var Qd=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var mO=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fO(e))!hO.call(t,i)&&i!==n&&yy(t,i,{get:()=>e[i],enumerable:!(r=dO(e,i))||r.enumerable});return t};var ef=(t,e,n)=>(n=t!=null?uO(pO(t)):{},mO(e||!t||!t.__esModule?yy(n,"default",{value:t,enumerable:!0}):n,t));var vS=Qd((mq,ES)=>{function aS(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&aS(n)}),t}var Nu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function lS(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ai(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var eH="",tS=t=>!!t.scope,tH=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Im=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=lS(e)}openNode(e){if(!tS(e))return;let n=tH(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){tS(e)&&(this.buffer+=eH)}value(){return this.buffer}span(e){this.buffer+=``}},nS=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Dm=class t{constructor(){this.rootNode=nS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=nS({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},Lm=class extends Dm{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Im(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ma(t){return t?typeof t=="string"?t:t.source:null}function cS(t){return vo("(?=",t,")")}function nH(t){return vo("(?:",t,")*")}function rH(t){return vo("(?:",t,")?")}function vo(...t){return t.map(n=>Ma(n)).join("")}function iH(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Bm(...t){return"("+(iH(t).capture?"":"?:")+t.map(r=>Ma(r)).join("|")+")"}function uS(t){return new RegExp(t.toString()+"|").exec("").length-1}function oH(t,e){let n=t&&t.exec(e);return n&&n.index===0}var sH=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ma(r),s="";for(;o.length>0;){let l=sH.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var aH=/\b\B/,dS="[a-zA-Z]\\w*",Hm="[a-zA-Z_]\\w*",fS="\\b\\d+(\\.\\d+)?",pS="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",hS="\\b(0b[01]+)",lH="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",cH=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=vo(e,/.*\b/,t.binary,/\b.*/)),Ai({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Na={begin:"\\\\[\\s\\S]",relevance:0},uH={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Na]},dH={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Na]},fH={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ou=function(t,e,n={}){let r=Ai({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Bm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:vo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},pH=Ou("//","$"),hH=Ou("/\\*","\\*/"),mH=Ou("#","$"),gH={scope:"number",begin:fS,relevance:0},bH={scope:"number",begin:pS,relevance:0},yH={scope:"number",begin:hS,relevance:0},EH={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Na,{begin:/\[/,end:/\]/,relevance:0,contains:[Na]}]}]},vH={scope:"title",begin:dS,relevance:0},wH={scope:"title",begin:Hm,relevance:0},xH={begin:"\\.\\s*"+Hm,relevance:0},_H=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Mu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:aH,IDENT_RE:dS,UNDERSCORE_IDENT_RE:Hm,NUMBER_RE:fS,C_NUMBER_RE:pS,BINARY_NUMBER_RE:hS,RE_STARTERS_RE:lH,SHEBANG:cH,BACKSLASH_ESCAPE:Na,APOS_STRING_MODE:uH,QUOTE_STRING_MODE:dH,PHRASAL_WORDS_MODE:fH,COMMENT:Ou,C_LINE_COMMENT_MODE:pH,C_BLOCK_COMMENT_MODE:hH,HASH_COMMENT_MODE:mH,NUMBER_MODE:gH,C_NUMBER_MODE:bH,BINARY_NUMBER_MODE:yH,REGEXP_MODE:EH,TITLE_MODE:vH,UNDERSCORE_TITLE_MODE:wH,METHOD_GUARD:xH,END_SAME_AS_BEGIN:_H});function SH(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function TH(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function CH(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=SH,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function AH(t,e){Array.isArray(t.illegal)&&(t.illegal=Bm(...t.illegal))}function MH(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function NH(t,e){t.relevance===void 0&&(t.relevance=1)}var kH=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=vo(n.beforeMatch,cS(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},OH=["of","and","for","in","not","or","if","then","parent","list","value"],RH="keyword";function mS(t,e,n=RH){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,mS(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,IH(u[0],u[1])]})}}function IH(t,e){return e?Number(e):DH(t)?0:1}function DH(t){return OH.includes(t.toLowerCase())}var rS={},Eo=t=>{console.error(t)},iS=(t,...e)=>{console.log(`WARN: ${t}`,...e)},fs=(t,e)=>{rS[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),rS[`${t}/${e}`]=!0)},ku=new Error;function gS(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=uS(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function LH(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Eo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ku;if(typeof t.beginScope!="object"||t.beginScope===null)throw Eo("beginScope must be object"),ku;gS(t,t.begin,{key:"beginScope"}),t.begin=Fm(t.begin,{joinWith:""})}}function PH(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Eo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ku;if(typeof t.endScope!="object"||t.endScope===null)throw Eo("endScope must be object"),ku;gS(t,t.end,{key:"endScope"}),t.end=Fm(t.end,{joinWith:""})}}function BH(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function FH(t){BH(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),LH(t),PH(t)}function HH(t){function e(s,l){return new RegExp(Ma(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=uS(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Fm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[TH,MH,FH,kH].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[CH,AH,NH].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=mS(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ma(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return $H(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ai(t.classNameAliases||{}),o(t)}function bS(t){return t?t.endsWithParent||bS(t.starts):!1}function $H(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ai(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:bS(t)?Ai(t,{starts:t.starts?Ai(t.starts):null}):Object.isFrozen(t)?Ai(t):t}var zH="11.8.0",Pm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},Rm=lS,oS=Ai,sS=Symbol("nomatch"),UH=7,yS=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Lm};function u(A){return l.noHighlightRe.test(A)}function d(A){let D=A.className+" ";D+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(D);if(z){let j=q(z[1]);return j||(iS(o.replace("{}",z[1])),iS("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return D.split(/\s+/).find(j=>u(j)||q(j))}function f(A,D,z){let j="",ie="";typeof D=="object"?(j=A,z=D.ignoreIllegals,ie=D.language):(fs("10.7.0","highlight(lang, code, ...args) has been deprecated."),fs("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=D),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,D,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=UH&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=b(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=oH(L.endRe,X);if(se){if(L["on:end"]){let Fe=new Nu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new Nu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=D.substring(L.index),se=Re(V,L,X);if(!se)return sS;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=D.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==sS)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw Eo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=HH(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(D,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(D);if(!L)break;let H=D.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(D.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:Rm(D),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:D.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:Rm(D),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let D={value:Rm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return D._emitter.addText(A),D}function b(A,D){D=D||l.languages||Object.keys(e);let z=m(A),j=D.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function g(A,D,z){let j=D&&n[D]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let D=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new Pm("One of your code blocks includes unescaped HTML.",A.innerHTML);D=A;let j=D.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):b(j);A.innerHTML=ie.value,g(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=oS(l,A)}let S=()=>{T(),fs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){T(),fs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function T(){if(document.readyState==="loading"){k=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function P(){k&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",P,!1);function I(A,D){let z=null;try{z=D(t)}catch(j){if(Eo("Language definition for '{}' could not be registered.".replace("{}",A)),i)Eo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=D.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let D of Object.keys(n))n[D]===A&&delete n[D]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:D}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=D})}function fe(A){let D=q(A);return D&&!D.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=D=>{A["before:highlightBlock"](Object.assign({block:D.el},D))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=D=>{A["after:highlightBlock"](Object.assign({block:D.el},D))})}function me(A){we(A),r.push(A)}function Ce(A){let D=r.indexOf(A);D!==-1&&r.splice(D,1)}function ge(A,D){let z=A;r.forEach(function(j){j[z]&&j[z](D)})}function ye(A){return fs("10.7.0","highlightBlock will be removed entirely in v12.0"),fs("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:O,registerLanguage:I,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:oS,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=zH,t.regex={concat:vo,lookahead:cS,either:Bm,optional:rH,anyNumberOfTimes:nH};for(let A in Mu)typeof Mu[A]=="object"&&aS(Mu[A]);return Object.assign(t,Mu),t},ps=yS({});ps.newInstance=()=>yS({});ES.exports=ps;ps.HighlightJS=ps;ps.default=ps});var xS=Qd((bq,$m)=>{(function(){var t;typeof $m<"u"?t=$m.exports=r:t=function(){return this||(0,eval)("this")}(),t.format=r,t.vsprintf=n,typeof console<"u"&&typeof console.log=="function"&&(t.printf=e);function e(){console.log(r.apply(null,arguments))}function n(i,o){return r.apply(null,[i].concat(o))}function r(i){for(var o=1,s=[].slice.call(arguments),l=0,u=i.length,d="",f,h=!1,m,b,g=!1,E,w=function(){return s[o++]},S=function(){for(var O="";/\d/.test(i[l]);)O+=i[l++],f=i[l];return O.length>0?parseInt(O):null};l{(function(){var t,e="4.17.21",n=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",o="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",d=1,f=2,h=4,m=1,b=2,g=1,E=2,w=4,S=8,O=16,k=32,T=64,P=128,I=256,Y=512,ne=30,q="...",Q=800,fe=16,we=1,me=2,Ce=3,ge=1/0,ye=9007199254740991,A=17976931348623157e292,D=NaN,z=4294967295,j=z-1,ie=z>>>1,xe=[["ary",P],["bind",g],["bindKey",E],["curry",S],["curryRight",O],["flip",Y],["partial",k],["partialRight",T],["rearg",I]],Ae="[object Arguments]",je="[object Array]",Ne="[object AsyncFunction]",Be="[object Boolean]",_t="[object Date]",kt="[object DOMException]",Re="[object Error]",St="[object Function]",Xt="[object GeneratorFunction]",pt="[object Map]",an="[object Number]",Zt="[object Null]",Tt="[object Object]",Je="[object Promise]",jn="[object Proxy]",Pt="[object RegExp]",V="[object Set]",yt="[object String]",_e="[object Symbol]",pe="[object Undefined]",ut="[object WeakMap]",dt="[object WeakSet]",Bt="[object ArrayBuffer]",Ot="[object DataView]",L="[object Float32Array]",H="[object Float64Array]",X="[object Int8Array]",se="[object Int16Array]",Fe="[object Int32Array]",rt="[object Uint8Array]",wr="[object Uint8ClampedArray]",F="[object Uint16Array]",ae="[object Uint32Array]",Se=/\b__p \+= '';/g,qe=/\b(__p \+=) '' \+/g,Ke=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ft=/&(?:amp|lt|gt|quot|#39);/g,ln=/[&<>"']/g,Zr=RegExp(Ft.source),Da=RegExp(ln.source),xr=/<%-([\s\S]+?)%>/g,bs=/<%([\s\S]+?)%>/g,Ni=/<%=([\s\S]+?)%>/g,jr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zu=/^\w*$/,ys=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qr=/[\\^$.*+?()[\]{}|]/g,zS=RegExp(Qr.source),Uu=/^\s+/,US=/\s/,WS=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,KS=/\{\n\/\* \[wrapped with (.+)\] \*/,VS=/,? & /,GS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qS=/[()=,{}\[\]\/\s]/,YS=/\\(\\)?/g,JS=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Gm=/\w*$/,XS=/^[-+]0x[0-9a-f]+$/i,ZS=/^0b[01]+$/i,jS=/^\[object .+?Constructor\]$/,QS=/^0o[0-7]+$/i,eT=/^(?:0|[1-9]\d*)$/,tT=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,La=/($^)/,nT=/['\n\r\u2028\u2029\\]/g,Pa="\\ud800-\\udfff",rT="\\u0300-\\u036f",iT="\\ufe20-\\ufe2f",oT="\\u20d0-\\u20ff",qm=rT+iT+oT,Ym="\\u2700-\\u27bf",Jm="a-z\\xdf-\\xf6\\xf8-\\xff",sT="\\xac\\xb1\\xd7\\xf7",aT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lT="\\u2000-\\u206f",cT=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Xm="A-Z\\xc0-\\xd6\\xd8-\\xde",Zm="\\ufe0e\\ufe0f",jm=sT+aT+lT+cT,Wu="['\u2019]",uT="["+Pa+"]",Qm="["+jm+"]",Ba="["+qm+"]",eg="\\d+",dT="["+Ym+"]",tg="["+Jm+"]",ng="[^"+Pa+jm+eg+Ym+Jm+Xm+"]",Ku="\\ud83c[\\udffb-\\udfff]",fT="(?:"+Ba+"|"+Ku+")",rg="[^"+Pa+"]",Vu="(?:\\ud83c[\\udde6-\\uddff]){2}",Gu="[\\ud800-\\udbff][\\udc00-\\udfff]",xo="["+Xm+"]",ig="\\u200d",og="(?:"+tg+"|"+ng+")",pT="(?:"+xo+"|"+ng+")",sg="(?:"+Wu+"(?:d|ll|m|re|s|t|ve))?",ag="(?:"+Wu+"(?:D|LL|M|RE|S|T|VE))?",lg=fT+"?",cg="["+Zm+"]?",hT="(?:"+ig+"(?:"+[rg,Vu,Gu].join("|")+")"+cg+lg+")*",mT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ug=cg+lg+hT,bT="(?:"+[dT,Vu,Gu].join("|")+")"+ug,yT="(?:"+[rg+Ba+"?",Ba,Vu,Gu,uT].join("|")+")",ET=RegExp(Wu,"g"),vT=RegExp(Ba,"g"),qu=RegExp(Ku+"(?="+Ku+")|"+yT+ug,"g"),wT=RegExp([xo+"?"+tg+"+"+sg+"(?="+[Qm,xo,"$"].join("|")+")",pT+"+"+ag+"(?="+[Qm,xo+og,"$"].join("|")+")",xo+"?"+og+"+"+sg,xo+"+"+ag,gT,mT,eg,bT].join("|"),"g"),xT=RegExp("["+ig+Pa+qm+Zm+"]"),_T=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ST=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],TT=-1,it={};it[L]=it[H]=it[X]=it[se]=it[Fe]=it[rt]=it[wr]=it[F]=it[ae]=!0,it[Ae]=it[je]=it[Bt]=it[Be]=it[Ot]=it[_t]=it[Re]=it[St]=it[pt]=it[an]=it[Tt]=it[Pt]=it[V]=it[yt]=it[ut]=!1;var tt={};tt[Ae]=tt[je]=tt[Bt]=tt[Ot]=tt[Be]=tt[_t]=tt[L]=tt[H]=tt[X]=tt[se]=tt[Fe]=tt[pt]=tt[an]=tt[Tt]=tt[Pt]=tt[V]=tt[yt]=tt[_e]=tt[rt]=tt[wr]=tt[F]=tt[ae]=!0,tt[Re]=tt[St]=tt[ut]=!1;var CT={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},AT={"&":"&","<":"<",">":">",'"':""","'":"'"},MT={"&":"&","<":"<",">":">",""":'"',"'":"'"},NT={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kT=parseFloat,OT=parseInt,dg=typeof global=="object"&&global&&global.Object===Object&&global,RT=typeof self=="object"&&self&&self.Object===Object&&self,Ht=dg||RT||Function("return this")(),Yu=typeof gs=="object"&&gs&&!gs.nodeType&&gs,ki=Yu&&typeof Ia=="object"&&Ia&&!Ia.nodeType&&Ia,fg=ki&&ki.exports===Yu,Ju=fg&&dg.process,Rn=function(){try{var N=ki&&ki.require&&ki.require("util").types;return N||Ju&&Ju.binding&&Ju.binding("util")}catch{}}(),pg=Rn&&Rn.isArrayBuffer,hg=Rn&&Rn.isDate,mg=Rn&&Rn.isMap,gg=Rn&&Rn.isRegExp,bg=Rn&&Rn.isSet,yg=Rn&&Rn.isTypedArray;function Tn(N,$,B){switch(B.length){case 0:return N.call($);case 1:return N.call($,B[0]);case 2:return N.call($,B[0],B[1]);case 3:return N.call($,B[0],B[1],B[2])}return N.apply($,B)}function IT(N,$,B,oe){for(var Me=-1,Ye=N==null?0:N.length;++Me-1}function Xu(N,$,B){for(var oe=-1,Me=N==null?0:N.length;++oe-1;);return B}function Cg(N,$){for(var B=N.length;B--&&_o($,N[B],0)>-1;);return B}function UT(N,$){for(var B=N.length,oe=0;B--;)N[B]===$&&++oe;return oe}var WT=ed(CT),KT=ed(AT);function VT(N){return"\\"+NT[N]}function GT(N,$){return N==null?t:N[$]}function So(N){return xT.test(N)}function qT(N){return _T.test(N)}function YT(N){for(var $,B=[];!($=N.next()).done;)B.push($.value);return B}function id(N){var $=-1,B=Array(N.size);return N.forEach(function(oe,Me){B[++$]=[Me,oe]}),B}function Ag(N,$){return function(B){return N($(B))}}function ni(N,$){for(var B=-1,oe=N.length,Me=0,Ye=[];++B-1}function L1(a,c){var p=this.__data__,y=tl(p,a);return y<0?(++this.size,p.push([a,c])):p[y][1]=c,this}_r.prototype.clear=O1,_r.prototype.delete=R1,_r.prototype.get=I1,_r.prototype.has=D1,_r.prototype.set=L1;function Sr(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c=c?a:c)),a}function Pn(a,c,p,y,v,_){var C,M=c&d,R=c&f,U=c&h;if(p&&(C=v?p(a,y,v,_):p(a)),C!==t)return C;if(!ft(a))return a;var W=ke(a);if(W){if(C=HC(a),!M)return bn(a,C)}else{var G=Qt(a),te=G==St||G==Xt;if(ci(a))return cb(a,M);if(G==Tt||G==Ae||te&&!v){if(C=R||te?{}:Mb(a),!M)return R?MC(a,Z1(C,a)):AC(a,Hg(C,a))}else{if(!tt[G])return v?a:{};C=$C(a,G,M)}}_||(_=new er);var de=_.get(a);if(de)return de;_.set(a,C),ry(a)?a.forEach(function(ve){C.add(Pn(ve,c,p,ve,a,_))}):ty(a)&&a.forEach(function(ve,$e){C.set($e,Pn(ve,c,p,$e,a,_))});var Ee=U?R?kd:Nd:R?En:$t,Le=W?t:Ee(a);return In(Le||a,function(ve,$e){Le&&($e=ve,ve=a[$e]),Ts(C,$e,Pn(ve,c,p,$e,a,_))}),C}function j1(a){var c=$t(a);return function(p){return $g(p,a,c)}}function $g(a,c,p){var y=p.length;if(a==null)return!y;for(a=Qe(a);y--;){var v=p[y],_=c[v],C=a[v];if(C===t&&!(v in a)||!_(C))return!1}return!0}function zg(a,c,p){if(typeof a!="function")throw new Dn(i);return Rs(function(){a.apply(t,p)},c)}function Cs(a,c,p,y){var v=-1,_=Fa,C=!0,M=a.length,R=[],U=c.length;if(!M)return R;p&&(c=lt(c,Cn(p))),y?(_=Xu,C=!1):c.length>=n&&(_=Es,C=!1,c=new Ii(c));e:for(;++vv?0:v+p),y=y===t||y>v?v:Ie(y),y<0&&(y+=v),y=p>y?0:oy(y);p0&&p(M)?c>1?Vt(M,c-1,p,y,v):ti(v,M):y||(v[v.length]=M)}return v}var dd=mb(),Kg=mb(!0);function ur(a,c){return a&&dd(a,c,$t)}function fd(a,c){return a&&Kg(a,c,$t)}function rl(a,c){return ei(c,function(p){return Nr(a[p])})}function Li(a,c){c=ai(c,a);for(var p=0,y=c.length;a!=null&&pc}function tC(a,c){return a!=null&&Ze.call(a,c)}function nC(a,c){return a!=null&&c in Qe(a)}function rC(a,c,p){return a>=jt(c,p)&&a=120&&W.length>=120)?new Ii(C&&W):t}W=a[0];var G=-1,te=M[0];e:for(;++G-1;)M!==a&&Ya.call(M,R,1),Ya.call(a,R,1);return a}function tb(a,c){for(var p=a?c.length:0,y=p-1;p--;){var v=c[p];if(p==y||v!==_){var _=v;Mr(v)?Ya.call(a,v,1):xd(a,v)}}return a}function Ed(a,c){return a+Za(Lg()*(c-a+1))}function gC(a,c,p,y){for(var v=-1,_=It(Xa((c-a)/(p||1)),0),C=B(_);_--;)C[y?_:++v]=a,a+=p;return C}function vd(a,c){var p="";if(!a||c<1||c>ye)return p;do c%2&&(p+=a),c=Za(c/2),c&&(a+=a);while(c);return p}function He(a,c){return Bd(Ob(a,c,vn),a+"")}function bC(a){return Fg(Do(a))}function yC(a,c){var p=Do(a);return hl(p,Di(c,0,p.length))}function Ns(a,c,p,y){if(!ft(a))return a;c=ai(c,a);for(var v=-1,_=c.length,C=_-1,M=a;M!=null&&++v<_;){var R=fr(c[v]),U=p;if(R==="__proto__"||R==="constructor"||R==="prototype")return a;if(v!=C){var W=M[R];U=y?y(W,R,M):t,U===t&&(U=ft(W)?W:Mr(c[v+1])?[]:{})}Ts(M,R,U),M=M[R]}return a}var nb=ja?function(a,c){return ja.set(a,c),a}:vn,EC=Ja?function(a,c){return Ja(a,"toString",{configurable:!0,enumerable:!1,value:qd(c),writable:!0})}:vn;function vC(a){return hl(Do(a))}function Bn(a,c,p){var y=-1,v=a.length;c<0&&(c=-c>v?0:v+c),p=p>v?v:p,p<0&&(p+=v),v=c>p?0:p-c>>>0,c>>>=0;for(var _=B(v);++y>>1,C=a[_];C!==null&&!Mn(C)&&(p?C<=c:C=n){var U=c?null:RC(a);if(U)return $a(U);C=!1,v=Es,R=new Ii}else R=c?[]:M;e:for(;++y<_;){var W=a[y],G=c?c(W):W;if(W=p||W!==0?W:0,C&&G===G){for(var te=R.length;te--;)if(R[te]===G)continue e;c&&R.push(G),M.push(W)}else v(R,G,p)||(R!==M&&R.push(G),M.push(W))}return M}function xd(a,c){return c=ai(c,a),a=Rb(a,c),a==null||delete a[fr(Fn(c))]}function ob(a,c,p,y){return Ns(a,c,p(Li(a,c)),y)}function sl(a,c,p,y){for(var v=a.length,_=y?v:-1;(y?_--:++_=y?a:Bn(a,c,p)}var lb=c1||function(a){return Ht.clearTimeout(a)};function cb(a,c){if(c)return a.slice();var p=a.length,y=kg?kg(p):new a.constructor(p);return a.copy(y),y}function Cd(a){var c=new a.constructor(a.byteLength);return new Ga(c).set(new Ga(a)),c}function _C(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function SC(a){var c=new a.constructor(a.source,Gm.exec(a));return c.lastIndex=a.lastIndex,c}function TC(a){return Ss?Qe(Ss.call(a)):{}}function ub(a,c){var p=c?Cd(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function db(a,c){if(a!==c){var p=a!==t,y=a===null,v=a===a,_=Mn(a),C=c!==t,M=c===null,R=c===c,U=Mn(c);if(!M&&!U&&!_&&a>c||_&&C&&R&&!M&&!U||y&&C&&R||!p&&R||!v)return 1;if(!y&&!_&&!U&&a=M)return R;var U=p[y];return R*(U=="desc"?-1:1)}}return a.index-c.index}function fb(a,c,p,y){for(var v=-1,_=a.length,C=p.length,M=-1,R=c.length,U=It(_-C,0),W=B(R+U),G=!y;++M1?p[v-1]:t,C=v>2?p[2]:t;for(_=a.length>3&&typeof _=="function"?(v--,_):t,C&&un(p[0],p[1],C)&&(_=v<3?t:_,v=1),c=Qe(c);++y-1?v[_?c[C]:C]:t}}function yb(a){return Ar(function(c){var p=c.length,y=p,v=Ln.prototype.thru;for(a&&c.reverse();y--;){var _=c[y];if(typeof _!="function")throw new Dn(i);if(v&&!C&&fl(_)=="wrapper")var C=new Ln([],!0)}for(y=C?y:p;++y1&&Ve.reverse(),W&&R<$e&&(Ve.length=R),this&&this!==Ht&&this instanceof ve&&(Or=Le||ks(Or)),Or.apply(nr,Ve)}return ve}function Eb(a,c){return function(p,y){return iC(p,a,c(y),{})}}function cl(a,c){return function(p,y){var v;if(p===t&&y===t)return c;if(p!==t&&(v=p),y!==t){if(v===t)return y;typeof p=="string"||typeof y=="string"?(p=An(p),y=An(y)):(p=ib(p),y=ib(y)),v=a(p,y)}return v}}function Ad(a){return Ar(function(c){return c=lt(c,Cn(be())),He(function(p){var y=this;return a(c,function(v){return Tn(v,y,p)})})})}function ul(a,c){c=c===t?" ":An(c);var p=c.length;if(p<2)return p?vd(c,a):c;var y=vd(c,Xa(a/To(c)));return So(c)?li(Qn(y),0,a).join(""):y.slice(0,a)}function OC(a,c,p,y){var v=c&g,_=ks(a);function C(){for(var M=-1,R=arguments.length,U=-1,W=y.length,G=B(W+R),te=this&&this!==Ht&&this instanceof C?_:a;++UM))return!1;var U=_.get(a),W=_.get(c);if(U&&W)return U==c&&W==a;var G=-1,te=!0,de=p&b?new Ii:t;for(_.set(a,c),_.set(c,a);++G1?"& ":"")+c[y],c=c.join(p>2?", ":" "),a.replace(WS,`{ /* [wrapped with `+c+`] */ -`)}function UC(a){return ke(a)||Fi(a)||!!(Ig&&a&&a[Ig])}function Mr(a,c){var p=typeof a;return c=c??ye,!!c&&(p=="number"||p!="symbol"&&eT.test(a))&&a>-1&&a%1==0&&a0){if(++c>=Q)return arguments[0]}else c=0;return a.apply(t,arguments)}}function hl(a,c){var p=-1,y=a.length,v=y-1;for(c=c===t?y:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Wb(a,p)});function Kb(a){var c=x(a);return c.__chain__=!0,c}function QA(a,c){return c(a),a}function ml(a,c){return c(a)}var eM=Ar(function(a){var c=a.length,p=c?a[0]:0,y=this.__wrapped__,v=function(_){return ud(_,a)};return c>1||this.__actions__.length||!(y instanceof Ue)||!Mr(p)?this.thru(v):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:ml,args:[v],thisArg:t}),new Ln(y,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function tM(){return Kb(this)}function nM(){return new Ln(this.value(),this.__chain__)}function rM(){this.__values__===t&&(this.__values__=iy(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function iM(){return this}function oM(a){for(var c,p=this;p instanceof el;){var y=Bb(p);y.__index__=0,y.__values__=t,c?v.__wrapped__=y:c=y;var v=y;p=p.__wrapped__}return v.__wrapped__=a,c}function sM(){var a=this.__wrapped__;if(a instanceof Ue){var c=a;return this.__actions__.length&&(c=new Ue(this)),c=c.reverse(),c.__actions__.push({func:ml,args:[Fd],thisArg:t}),new Ln(c,this.__chain__)}return this.thru(Fd)}function aM(){return sb(this.__wrapped__,this.__actions__)}var lM=al(function(a,c,p){Ze.call(a,p)?++a[p]:Tr(a,p,1)});function cM(a,c,p){var y=ke(a)?Eg:Q1;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}function uM(a,c){var p=ke(a)?ei:Wg;return p(a,be(c,3))}var dM=bb(Fb),fM=bb(Hb);function pM(a,c){return Vt(gl(a,c),1)}function hM(a,c){return Vt(gl(a,c),ge)}function mM(a,c,p){return p=p===t?1:Ie(p),Vt(gl(a,c),p)}function Vb(a,c){var p=ke(a)?In:oi;return p(a,be(c,3))}function Gb(a,c){var p=ke(a)?DT:Ug;return p(a,be(c,3))}var gM=al(function(a,c,p){Ze.call(a,p)?a[p].push(c):Tr(a,p,[c])});function bM(a,c,p,y){a=yn(a)?a:Do(a),p=p&&!y?Ie(p):0;var v=a.length;return p<0&&(p=It(v+p,0)),wl(a)?p<=v&&a.indexOf(c,p)>-1:!!v&&_o(a,c,p)>-1}var yM=He(function(a,c,p){var y=-1,v=typeof c=="function",_=yn(a)?P(a.length):[];return oi(a,function(C){_[++y]=v?Tn(c,C,p):As(C,c,p)}),_}),EM=al(function(a,c,p){Tr(a,p,c)});function gl(a,c){var p=ke(a)?lt:Jg;return p(a,be(c,3))}function vM(a,c,p,y){return a==null?[]:(ke(c)||(c=c==null?[]:[c]),p=y?t:p,ke(p)||(p=p==null?[]:[p]),Qg(a,c,p))}var wM=al(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function xM(a,c,p){var y=ke(a)?Zu:_g,v=arguments.length<3;return y(a,be(c,4),p,v,oi)}function _M(a,c,p){var y=ke(a)?LT:_g,v=arguments.length<3;return y(a,be(c,4),p,v,Ug)}function SM(a,c){var p=ke(a)?ei:Wg;return p(a,El(be(c,3)))}function TM(a){var c=ke(a)?Fg:bC;return c(a)}function CM(a,c,p){(p?un(a,c,p):c===t)?c=1:c=Ie(c);var y=ke(a)?Y1:yC;return y(a,c)}function AM(a){var c=ke(a)?J1:vC;return c(a)}function MM(a){if(a==null)return 0;if(yn(a))return wl(a)?To(a):a.length;var c=Qt(a);return c==pt||c==V?a.size:gd(a).length}function NM(a,c,p){var y=ke(a)?ju:wC;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}var kM=He(function(a,c){if(a==null)return[];var p=c.length;return p>1&&un(a,c[0],c[1])?c=[]:p>2&&un(c[0],c[1],c[2])&&(c=[c[0]]),Qg(a,Vt(c,1),[])}),bl=u1||function(){return Ht.Date.now()};function OM(a,c){if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){if(--a<1)return c.apply(this,arguments)}}function qb(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,B,t,t,t,t,c)}function Yb(a,c){var p;if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var $d=He(function(a,c,p){var y=b;if(p.length){var v=ni(p,Ro($d));y|=D}return Cr(a,y,c,p,v)}),Jb=He(function(a,c,p){var y=b|E;if(p.length){var v=ni(p,Ro(Jb));y|=D}return Cr(c,y,a,p,v)});function Xb(a,c,p){c=p?t:c;var y=Cr(a,S,t,t,t,t,t,c);return y.placeholder=Xb.placeholder,y}function Zb(a,c,p){c=p?t:c;var y=Cr(a,N,t,t,t,t,t,c);return y.placeholder=Zb.placeholder,y}function jb(a,c,p){var y,v,_,C,M,O,U=0,W=!1,G=!1,te=!0;if(typeof a!="function")throw new Dn(i);c=Hn(c)||0,ft(p)&&(W=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,te="trailing"in p?!!p.trailing:te);function de(vt){var nr=y,Or=v;return y=v=t,U=vt,C=a.apply(Or,nr),C}function Ee(vt){return U=vt,M=Rs($e,c),W?de(vt):C}function Le(vt){var nr=vt-O,Or=vt-U,by=c-nr;return G?jt(by,_-Or):by}function ve(vt){var nr=vt-O,Or=vt-U;return O===t||nr>=c||nr<0||G&&Or>=_}function $e(){var vt=bl();if(ve(vt))return Ve(vt);M=Rs($e,Le(vt))}function Ve(vt){return M=t,te&&y?de(vt):(y=v=t,C)}function Nn(){M!==t&&lb(M),U=0,y=O=v=M=t}function dn(){return M===t?C:Ve(bl())}function kn(){var vt=bl(),nr=ve(vt);if(y=arguments,v=this,O=vt,nr){if(M===t)return Ee(O);if(G)return lb(M),M=Rs($e,c),de(O)}return M===t&&(M=Rs($e,c)),C}return kn.cancel=Nn,kn.flush=dn,kn}var RM=He(function(a,c){return zg(a,1,c)}),IM=He(function(a,c,p){return zg(a,Hn(c)||0,p)});function DM(a){return Cr(a,Y)}function yl(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Dn(i);var p=function(){var y=arguments,v=c?c.apply(this,y):y[0],_=p.cache;if(_.has(v))return _.get(v);var C=a.apply(this,y);return p.cache=_.set(v,C)||_,C};return p.cache=new(yl.Cache||Sr),p}yl.Cache=Sr;function El(a){if(typeof a!="function")throw new Dn(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function LM(a){return Yb(2,a)}var PM=xC(function(a,c){c=c.length==1&&ke(c[0])?lt(c[0],Cn(be())):lt(Vt(c,1),Cn(be()));var p=c.length;return He(function(y){for(var v=-1,_=jt(y.length,p);++v<_;)y[v]=c[v].call(this,y[v]);return Tn(a,this,y)})}),zd=He(function(a,c){var p=ni(c,Ro(zd));return Cr(a,D,t,c,p)}),Qb=He(function(a,c){var p=ni(c,Ro(Qb));return Cr(a,T,t,c,p)}),BM=Ar(function(a,c){return Cr(a,R,t,t,t,c)});function FM(a,c){if(typeof a!="function")throw new Dn(i);return c=c===t?c:Ie(c),He(a,c)}function HM(a,c){if(typeof a!="function")throw new Dn(i);return c=c==null?0:It(Ie(c),0),He(function(p){var y=p[c],v=li(p,0,c);return y&&ti(v,y),Tn(a,this,v)})}function $M(a,c,p){var y=!0,v=!0;if(typeof a!="function")throw new Dn(i);return ft(p)&&(y="leading"in p?!!p.leading:y,v="trailing"in p?!!p.trailing:v),jb(a,c,{leading:y,maxWait:c,trailing:v})}function zM(a){return qb(a,1)}function UM(a,c){return zd(Td(c),a)}function WM(){if(!arguments.length)return[];var a=arguments[0];return ke(a)?a:[a]}function KM(a){return Pn(a,h)}function VM(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function GM(a){return Pn(a,d|h)}function qM(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function YM(a,c){return c==null||$g(a,c,$t(c))}function tr(a,c){return a===c||a!==a&&c!==c}var JM=dl(pd),XM=dl(function(a,c){return a>=c}),Fi=Gg(function(){return arguments}())?Gg:function(a){return ht(a)&&Ze.call(a,"callee")&&!Rg.call(a,"callee")},ke=P.isArray,ZM=pg?Cn(pg):oC;function yn(a){return a!=null&&vl(a.length)&&!Nr(a)}function Et(a){return ht(a)&&yn(a)}function jM(a){return a===!0||a===!1||ht(a)&&cn(a)==Be}var ci=f1||jd,QM=hg?Cn(hg):sC;function eN(a){return ht(a)&&a.nodeType===1&&!Is(a)}function tN(a){if(a==null)return!0;if(yn(a)&&(ke(a)||typeof a=="string"||typeof a.splice=="function"||ci(a)||Io(a)||Fi(a)))return!a.length;var c=Qt(a);if(c==pt||c==V)return!a.size;if(Os(a))return!gd(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function nN(a,c){return Ms(a,c)}function rN(a,c,p){p=typeof p=="function"?p:t;var y=p?p(a,c):t;return y===t?Ms(a,c,t,p):!!y}function Ud(a){if(!ht(a))return!1;var c=cn(a);return c==Re||c==kt||typeof a.message=="string"&&typeof a.name=="string"&&!Is(a)}function iN(a){return typeof a=="number"&&Dg(a)}function Nr(a){if(!ft(a))return!1;var c=cn(a);return c==St||c==Xt||c==Ne||c==jn}function ey(a){return typeof a=="number"&&a==Ie(a)}function vl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ye}function ft(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function ht(a){return a!=null&&typeof a=="object"}var ty=mg?Cn(mg):lC;function oN(a,c){return a===c||md(a,c,Rd(c))}function sN(a,c,p){return p=typeof p=="function"?p:t,md(a,c,Rd(c),p)}function aN(a){return ny(a)&&a!=+a}function lN(a){if(VC(a))throw new Me(r);return qg(a)}function cN(a){return a===null}function uN(a){return a==null}function ny(a){return typeof a=="number"||ht(a)&&cn(a)==an}function Is(a){if(!ht(a)||cn(a)!=Tt)return!1;var c=qa(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wa.call(p)==s1}var Wd=gg?Cn(gg):cC;function dN(a){return ey(a)&&a>=-ye&&a<=ye}var ry=bg?Cn(bg):uC;function wl(a){return typeof a=="string"||!ke(a)&&ht(a)&&cn(a)==yt}function Mn(a){return typeof a=="symbol"||ht(a)&&cn(a)==_e}var Io=yg?Cn(yg):dC;function fN(a){return a===t}function pN(a){return ht(a)&&Qt(a)==ut}function hN(a){return ht(a)&&cn(a)==dt}var mN=dl(bd),gN=dl(function(a,c){return a<=c});function iy(a){if(!a)return[];if(yn(a))return wl(a)?Qn(a):bn(a);if(vs&&a[vs])return YT(a[vs]());var c=Qt(a),p=c==pt?id:c==V?$a:Do;return p(a)}function kr(a){if(!a)return a===0?a:0;if(a=Hn(a),a===ge||a===-ge){var c=a<0?-1:1;return c*A}return a===a?a:0}function Ie(a){var c=kr(a),p=c%1;return c===c?p?c-p:c:0}function oy(a){return a?Di(Ie(a),0,z):0}function Hn(a){if(typeof a=="number")return a;if(Mn(a))return I;if(ft(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ft(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=Sg(a);var p=ZS.test(a);return p||QS.test(a)?OT(a.slice(2),p?2:8):XS.test(a)?I:+a}function sy(a){return dr(a,En(a))}function bN(a){return a?Di(Ie(a),-ye,ye):a===0?a:0}function Xe(a){return a==null?"":An(a)}var yN=ko(function(a,c){if(Os(c)||yn(c)){dr(c,$t(c),a);return}for(var p in c)Ze.call(c,p)&&Ts(a,p,c[p])}),ay=ko(function(a,c){dr(c,En(c),a)}),xl=ko(function(a,c,p,y){dr(c,En(c),a,y)}),EN=ko(function(a,c,p,y){dr(c,$t(c),a,y)}),vN=Ar(ud);function wN(a,c){var p=No(a);return c==null?p:Hg(p,c)}var xN=He(function(a,c){a=Qe(a);var p=-1,y=c.length,v=y>2?c[2]:t;for(v&&un(c[0],c[1],v)&&(y=1);++p1),_}),dr(a,kd(a),p),y&&(p=Pn(p,d|f|h,IC));for(var v=c.length;v--;)xd(p,c[v]);return p});function $N(a,c){return cy(a,El(be(c)))}var zN=Ar(function(a,c){return a==null?{}:hC(a,c)});function cy(a,c){if(a==null)return{};var p=lt(kd(a),function(y){return[y]});return c=be(c),eb(a,p,function(y,v){return c(y,v[0])})}function UN(a,c,p){c=ai(c,a);var y=-1,v=c.length;for(v||(v=1,a=t);++yc){var y=a;a=c,c=y}if(p||a%1||c%1){var v=Lg();return jt(a+v*(c-a+kT("1e-"+((v+"").length-1))),c)}return Ed(a,c)}var QN=Oo(function(a,c,p){return c=c.toLowerCase(),a+(p?fy(c):c)});function fy(a){return Gd(Xe(a).toLowerCase())}function py(a){return a=Xe(a),a&&a.replace(tT,WT).replace(vT,"")}function ek(a,c,p){a=Xe(a),c=An(c);var y=a.length;p=p===t?y:Di(Ie(p),0,y);var v=p;return p-=c.length,p>=0&&a.slice(p,v)==c}function tk(a){return a=Xe(a),a&&Da.test(a)?a.replace(ln,KT):a}function nk(a){return a=Xe(a),a&&zS.test(a)?a.replace(Qr,"\\$&"):a}var rk=Oo(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),ik=Oo(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),ok=gb("toLowerCase");function sk(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;if(!c||y>=c)return a;var v=(c-y)/2;return ul(Za(v),p)+a+ul(Xa(v),p)}function ak(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;return c&&y>>0,p?(a=Xe(a),a&&(typeof c=="string"||c!=null&&!Wd(c))&&(c=An(c),!c&&So(a))?li(Qn(a),0,p):a.split(c,p)):[]}var hk=Oo(function(a,c,p){return a+(p?" ":"")+Gd(c)});function mk(a,c,p){return a=Xe(a),p=p==null?0:Di(Ie(p),0,a.length),c=An(c),a.slice(p,p+c.length)==c}function gk(a,c,p){var y=x.templateSettings;p&&un(a,c,p)&&(c=t),a=Xe(a),c=xl({},c,y,_b);var v=xl({},c.imports,y.imports,_b),_=$t(v),C=rd(v,_),M,O,U=0,W=c.interpolate||La,G="__p += '",te=od((c.escape||La).source+"|"+W.source+"|"+(W===Ni?JS:La).source+"|"+(c.evaluate||La).source+"|$","g"),de="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++TT+"]")+` +`)}function UC(a){return ke(a)||Fi(a)||!!(Ig&&a&&a[Ig])}function Mr(a,c){var p=typeof a;return c=c??ye,!!c&&(p=="number"||p!="symbol"&&eT.test(a))&&a>-1&&a%1==0&&a0){if(++c>=Q)return arguments[0]}else c=0;return a.apply(t,arguments)}}function hl(a,c){var p=-1,y=a.length,v=y-1;for(c=c===t?y:c;++p1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,Wb(a,p)});function Kb(a){var c=x(a);return c.__chain__=!0,c}function QA(a,c){return c(a),a}function ml(a,c){return c(a)}var eM=Ar(function(a){var c=a.length,p=c?a[0]:0,y=this.__wrapped__,v=function(_){return ud(_,a)};return c>1||this.__actions__.length||!(y instanceof Ue)||!Mr(p)?this.thru(v):(y=y.slice(p,+p+(c?1:0)),y.__actions__.push({func:ml,args:[v],thisArg:t}),new Ln(y,this.__chain__).thru(function(_){return c&&!_.length&&_.push(t),_}))});function tM(){return Kb(this)}function nM(){return new Ln(this.value(),this.__chain__)}function rM(){this.__values__===t&&(this.__values__=iy(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function iM(){return this}function oM(a){for(var c,p=this;p instanceof el;){var y=Bb(p);y.__index__=0,y.__values__=t,c?v.__wrapped__=y:c=y;var v=y;p=p.__wrapped__}return v.__wrapped__=a,c}function sM(){var a=this.__wrapped__;if(a instanceof Ue){var c=a;return this.__actions__.length&&(c=new Ue(this)),c=c.reverse(),c.__actions__.push({func:ml,args:[Fd],thisArg:t}),new Ln(c,this.__chain__)}return this.thru(Fd)}function aM(){return sb(this.__wrapped__,this.__actions__)}var lM=al(function(a,c,p){Ze.call(a,p)?++a[p]:Tr(a,p,1)});function cM(a,c,p){var y=ke(a)?Eg:Q1;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}function uM(a,c){var p=ke(a)?ei:Wg;return p(a,be(c,3))}var dM=bb(Fb),fM=bb(Hb);function pM(a,c){return Vt(gl(a,c),1)}function hM(a,c){return Vt(gl(a,c),ge)}function mM(a,c,p){return p=p===t?1:Ie(p),Vt(gl(a,c),p)}function Vb(a,c){var p=ke(a)?In:oi;return p(a,be(c,3))}function Gb(a,c){var p=ke(a)?DT:Ug;return p(a,be(c,3))}var gM=al(function(a,c,p){Ze.call(a,p)?a[p].push(c):Tr(a,p,[c])});function bM(a,c,p,y){a=yn(a)?a:Do(a),p=p&&!y?Ie(p):0;var v=a.length;return p<0&&(p=It(v+p,0)),wl(a)?p<=v&&a.indexOf(c,p)>-1:!!v&&_o(a,c,p)>-1}var yM=He(function(a,c,p){var y=-1,v=typeof c=="function",_=yn(a)?B(a.length):[];return oi(a,function(C){_[++y]=v?Tn(c,C,p):As(C,c,p)}),_}),EM=al(function(a,c,p){Tr(a,p,c)});function gl(a,c){var p=ke(a)?lt:Jg;return p(a,be(c,3))}function vM(a,c,p,y){return a==null?[]:(ke(c)||(c=c==null?[]:[c]),p=y?t:p,ke(p)||(p=p==null?[]:[p]),Qg(a,c,p))}var wM=al(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function xM(a,c,p){var y=ke(a)?Zu:_g,v=arguments.length<3;return y(a,be(c,4),p,v,oi)}function _M(a,c,p){var y=ke(a)?LT:_g,v=arguments.length<3;return y(a,be(c,4),p,v,Ug)}function SM(a,c){var p=ke(a)?ei:Wg;return p(a,El(be(c,3)))}function TM(a){var c=ke(a)?Fg:bC;return c(a)}function CM(a,c,p){(p?un(a,c,p):c===t)?c=1:c=Ie(c);var y=ke(a)?Y1:yC;return y(a,c)}function AM(a){var c=ke(a)?J1:vC;return c(a)}function MM(a){if(a==null)return 0;if(yn(a))return wl(a)?To(a):a.length;var c=Qt(a);return c==pt||c==V?a.size:gd(a).length}function NM(a,c,p){var y=ke(a)?ju:wC;return p&&un(a,c,p)&&(c=t),y(a,be(c,3))}var kM=He(function(a,c){if(a==null)return[];var p=c.length;return p>1&&un(a,c[0],c[1])?c=[]:p>2&&un(c[0],c[1],c[2])&&(c=[c[0]]),Qg(a,Vt(c,1),[])}),bl=u1||function(){return Ht.Date.now()};function OM(a,c){if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){if(--a<1)return c.apply(this,arguments)}}function qb(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Cr(a,P,t,t,t,t,c)}function Yb(a,c){var p;if(typeof c!="function")throw new Dn(i);return a=Ie(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var $d=He(function(a,c,p){var y=g;if(p.length){var v=ni(p,Ro($d));y|=k}return Cr(a,y,c,p,v)}),Jb=He(function(a,c,p){var y=g|E;if(p.length){var v=ni(p,Ro(Jb));y|=k}return Cr(c,y,a,p,v)});function Xb(a,c,p){c=p?t:c;var y=Cr(a,S,t,t,t,t,t,c);return y.placeholder=Xb.placeholder,y}function Zb(a,c,p){c=p?t:c;var y=Cr(a,O,t,t,t,t,t,c);return y.placeholder=Zb.placeholder,y}function jb(a,c,p){var y,v,_,C,M,R,U=0,W=!1,G=!1,te=!0;if(typeof a!="function")throw new Dn(i);c=Hn(c)||0,ft(p)&&(W=!!p.leading,G="maxWait"in p,_=G?It(Hn(p.maxWait)||0,c):_,te="trailing"in p?!!p.trailing:te);function de(vt){var nr=y,Or=v;return y=v=t,U=vt,C=a.apply(Or,nr),C}function Ee(vt){return U=vt,M=Rs($e,c),W?de(vt):C}function Le(vt){var nr=vt-R,Or=vt-U,by=c-nr;return G?jt(by,_-Or):by}function ve(vt){var nr=vt-R,Or=vt-U;return R===t||nr>=c||nr<0||G&&Or>=_}function $e(){var vt=bl();if(ve(vt))return Ve(vt);M=Rs($e,Le(vt))}function Ve(vt){return M=t,te&&y?de(vt):(y=v=t,C)}function Nn(){M!==t&&lb(M),U=0,y=R=v=M=t}function dn(){return M===t?C:Ve(bl())}function kn(){var vt=bl(),nr=ve(vt);if(y=arguments,v=this,R=vt,nr){if(M===t)return Ee(R);if(G)return lb(M),M=Rs($e,c),de(R)}return M===t&&(M=Rs($e,c)),C}return kn.cancel=Nn,kn.flush=dn,kn}var RM=He(function(a,c){return zg(a,1,c)}),IM=He(function(a,c,p){return zg(a,Hn(c)||0,p)});function DM(a){return Cr(a,Y)}function yl(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Dn(i);var p=function(){var y=arguments,v=c?c.apply(this,y):y[0],_=p.cache;if(_.has(v))return _.get(v);var C=a.apply(this,y);return p.cache=_.set(v,C)||_,C};return p.cache=new(yl.Cache||Sr),p}yl.Cache=Sr;function El(a){if(typeof a!="function")throw new Dn(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function LM(a){return Yb(2,a)}var PM=xC(function(a,c){c=c.length==1&&ke(c[0])?lt(c[0],Cn(be())):lt(Vt(c,1),Cn(be()));var p=c.length;return He(function(y){for(var v=-1,_=jt(y.length,p);++v<_;)y[v]=c[v].call(this,y[v]);return Tn(a,this,y)})}),zd=He(function(a,c){var p=ni(c,Ro(zd));return Cr(a,k,t,c,p)}),Qb=He(function(a,c){var p=ni(c,Ro(Qb));return Cr(a,T,t,c,p)}),BM=Ar(function(a,c){return Cr(a,I,t,t,t,c)});function FM(a,c){if(typeof a!="function")throw new Dn(i);return c=c===t?c:Ie(c),He(a,c)}function HM(a,c){if(typeof a!="function")throw new Dn(i);return c=c==null?0:It(Ie(c),0),He(function(p){var y=p[c],v=li(p,0,c);return y&&ti(v,y),Tn(a,this,v)})}function $M(a,c,p){var y=!0,v=!0;if(typeof a!="function")throw new Dn(i);return ft(p)&&(y="leading"in p?!!p.leading:y,v="trailing"in p?!!p.trailing:v),jb(a,c,{leading:y,maxWait:c,trailing:v})}function zM(a){return qb(a,1)}function UM(a,c){return zd(Td(c),a)}function WM(){if(!arguments.length)return[];var a=arguments[0];return ke(a)?a:[a]}function KM(a){return Pn(a,h)}function VM(a,c){return c=typeof c=="function"?c:t,Pn(a,h,c)}function GM(a){return Pn(a,d|h)}function qM(a,c){return c=typeof c=="function"?c:t,Pn(a,d|h,c)}function YM(a,c){return c==null||$g(a,c,$t(c))}function tr(a,c){return a===c||a!==a&&c!==c}var JM=dl(pd),XM=dl(function(a,c){return a>=c}),Fi=Gg(function(){return arguments}())?Gg:function(a){return ht(a)&&Ze.call(a,"callee")&&!Rg.call(a,"callee")},ke=B.isArray,ZM=pg?Cn(pg):oC;function yn(a){return a!=null&&vl(a.length)&&!Nr(a)}function Et(a){return ht(a)&&yn(a)}function jM(a){return a===!0||a===!1||ht(a)&&cn(a)==Be}var ci=f1||jd,QM=hg?Cn(hg):sC;function eN(a){return ht(a)&&a.nodeType===1&&!Is(a)}function tN(a){if(a==null)return!0;if(yn(a)&&(ke(a)||typeof a=="string"||typeof a.splice=="function"||ci(a)||Io(a)||Fi(a)))return!a.length;var c=Qt(a);if(c==pt||c==V)return!a.size;if(Os(a))return!gd(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function nN(a,c){return Ms(a,c)}function rN(a,c,p){p=typeof p=="function"?p:t;var y=p?p(a,c):t;return y===t?Ms(a,c,t,p):!!y}function Ud(a){if(!ht(a))return!1;var c=cn(a);return c==Re||c==kt||typeof a.message=="string"&&typeof a.name=="string"&&!Is(a)}function iN(a){return typeof a=="number"&&Dg(a)}function Nr(a){if(!ft(a))return!1;var c=cn(a);return c==St||c==Xt||c==Ne||c==jn}function ey(a){return typeof a=="number"&&a==Ie(a)}function vl(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ye}function ft(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function ht(a){return a!=null&&typeof a=="object"}var ty=mg?Cn(mg):lC;function oN(a,c){return a===c||md(a,c,Rd(c))}function sN(a,c,p){return p=typeof p=="function"?p:t,md(a,c,Rd(c),p)}function aN(a){return ny(a)&&a!=+a}function lN(a){if(VC(a))throw new Me(r);return qg(a)}function cN(a){return a===null}function uN(a){return a==null}function ny(a){return typeof a=="number"||ht(a)&&cn(a)==an}function Is(a){if(!ht(a)||cn(a)!=Tt)return!1;var c=qa(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Wa.call(p)==s1}var Wd=gg?Cn(gg):cC;function dN(a){return ey(a)&&a>=-ye&&a<=ye}var ry=bg?Cn(bg):uC;function wl(a){return typeof a=="string"||!ke(a)&&ht(a)&&cn(a)==yt}function Mn(a){return typeof a=="symbol"||ht(a)&&cn(a)==_e}var Io=yg?Cn(yg):dC;function fN(a){return a===t}function pN(a){return ht(a)&&Qt(a)==ut}function hN(a){return ht(a)&&cn(a)==dt}var mN=dl(bd),gN=dl(function(a,c){return a<=c});function iy(a){if(!a)return[];if(yn(a))return wl(a)?Qn(a):bn(a);if(vs&&a[vs])return YT(a[vs]());var c=Qt(a),p=c==pt?id:c==V?$a:Do;return p(a)}function kr(a){if(!a)return a===0?a:0;if(a=Hn(a),a===ge||a===-ge){var c=a<0?-1:1;return c*A}return a===a?a:0}function Ie(a){var c=kr(a),p=c%1;return c===c?p?c-p:c:0}function oy(a){return a?Di(Ie(a),0,z):0}function Hn(a){if(typeof a=="number")return a;if(Mn(a))return D;if(ft(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=ft(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=Sg(a);var p=ZS.test(a);return p||QS.test(a)?OT(a.slice(2),p?2:8):XS.test(a)?D:+a}function sy(a){return dr(a,En(a))}function bN(a){return a?Di(Ie(a),-ye,ye):a===0?a:0}function Xe(a){return a==null?"":An(a)}var yN=ko(function(a,c){if(Os(c)||yn(c)){dr(c,$t(c),a);return}for(var p in c)Ze.call(c,p)&&Ts(a,p,c[p])}),ay=ko(function(a,c){dr(c,En(c),a)}),xl=ko(function(a,c,p,y){dr(c,En(c),a,y)}),EN=ko(function(a,c,p,y){dr(c,$t(c),a,y)}),vN=Ar(ud);function wN(a,c){var p=No(a);return c==null?p:Hg(p,c)}var xN=He(function(a,c){a=Qe(a);var p=-1,y=c.length,v=y>2?c[2]:t;for(v&&un(c[0],c[1],v)&&(y=1);++p1),_}),dr(a,kd(a),p),y&&(p=Pn(p,d|f|h,IC));for(var v=c.length;v--;)xd(p,c[v]);return p});function $N(a,c){return cy(a,El(be(c)))}var zN=Ar(function(a,c){return a==null?{}:hC(a,c)});function cy(a,c){if(a==null)return{};var p=lt(kd(a),function(y){return[y]});return c=be(c),eb(a,p,function(y,v){return c(y,v[0])})}function UN(a,c,p){c=ai(c,a);var y=-1,v=c.length;for(v||(v=1,a=t);++yc){var y=a;a=c,c=y}if(p||a%1||c%1){var v=Lg();return jt(a+v*(c-a+kT("1e-"+((v+"").length-1))),c)}return Ed(a,c)}var QN=Oo(function(a,c,p){return c=c.toLowerCase(),a+(p?fy(c):c)});function fy(a){return Gd(Xe(a).toLowerCase())}function py(a){return a=Xe(a),a&&a.replace(tT,WT).replace(vT,"")}function ek(a,c,p){a=Xe(a),c=An(c);var y=a.length;p=p===t?y:Di(Ie(p),0,y);var v=p;return p-=c.length,p>=0&&a.slice(p,v)==c}function tk(a){return a=Xe(a),a&&Da.test(a)?a.replace(ln,KT):a}function nk(a){return a=Xe(a),a&&zS.test(a)?a.replace(Qr,"\\$&"):a}var rk=Oo(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),ik=Oo(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),ok=gb("toLowerCase");function sk(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;if(!c||y>=c)return a;var v=(c-y)/2;return ul(Za(v),p)+a+ul(Xa(v),p)}function ak(a,c,p){a=Xe(a),c=Ie(c);var y=c?To(a):0;return c&&y>>0,p?(a=Xe(a),a&&(typeof c=="string"||c!=null&&!Wd(c))&&(c=An(c),!c&&So(a))?li(Qn(a),0,p):a.split(c,p)):[]}var hk=Oo(function(a,c,p){return a+(p?" ":"")+Gd(c)});function mk(a,c,p){return a=Xe(a),p=p==null?0:Di(Ie(p),0,a.length),c=An(c),a.slice(p,p+c.length)==c}function gk(a,c,p){var y=x.templateSettings;p&&un(a,c,p)&&(c=t),a=Xe(a),c=xl({},c,y,_b);var v=xl({},c.imports,y.imports,_b),_=$t(v),C=rd(v,_),M,R,U=0,W=c.interpolate||La,G="__p += '",te=od((c.escape||La).source+"|"+W.source+"|"+(W===Ni?JS:La).source+"|"+(c.evaluate||La).source+"|$","g"),de="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++TT+"]")+` `;a.replace(te,function(ve,$e,Ve,Nn,dn,kn){return Ve||(Ve=Nn),G+=a.slice(U,kn).replace(nT,VT),$e&&(M=!0,G+=`' + __e(`+$e+`) + -'`),dn&&(O=!0,G+=`'; +'`),dn&&(R=!0,G+=`'; `+dn+`; __p += '`),Ve&&(G+=`' + ((__t = (`+Ve+`)) == null ? '' : __t) + @@ -12,25 +12,25 @@ __p += '`),Ve&&(G+=`' + `;var Ee=Ze.call(c,"variable")&&c.variable;if(!Ee)G=`with (obj) { `+G+` } -`;else if(qS.test(Ee))throw new Me(o);G=(O?G.replace(Se,""):G).replace(qe,"$1").replace(Ke,"$1;"),G="function("+(Ee||"obj")+`) { +`;else if(qS.test(Ee))throw new Me(o);G=(R?G.replace(Se,""):G).replace(qe,"$1").replace(Ke,"$1;"),G="function("+(Ee||"obj")+`) { `+(Ee?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(O?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(R?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+G+`return __p -}`;var Le=my(function(){return Ye(_,de+"return "+G).apply(t,C)});if(Le.source=G,Ud(Le))throw Le;return Le}function bk(a){return Xe(a).toLowerCase()}function yk(a){return Xe(a).toUpperCase()}function Ek(a,c,p){if(a=Xe(a),a&&(p||c===t))return Sg(a);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Qn(c),_=Tg(y,v),C=Cg(y,v)+1;return li(y,_,C).join("")}function vk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.slice(0,Mg(a)+1);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Cg(y,Qn(c))+1;return li(y,0,v).join("")}function wk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.replace(Uu,"");if(!a||!(c=An(c)))return a;var y=Qn(a),v=Tg(y,Qn(c));return li(y,v).join("")}function xk(a,c){var p=ne,y=q;if(ft(c)){var v="separator"in c?c.separator:v;p="length"in c?Ie(c.length):p,y="omission"in c?An(c.omission):y}a=Xe(a);var _=a.length;if(So(a)){var C=Qn(a);_=C.length}if(p>=_)return a;var M=p-To(y);if(M<1)return y;var O=C?li(C,0,M).join(""):a.slice(0,M);if(v===t)return O+y;if(C&&(M+=O.length-M),Wd(v)){if(a.slice(M).search(v)){var U,W=O;for(v.global||(v=od(v.source,Xe(Gm.exec(v))+"g")),v.lastIndex=0;U=v.exec(W);)var G=U.index;O=O.slice(0,G===t?M:G)}}else if(a.indexOf(An(v),M)!=M){var te=O.lastIndexOf(v);te>-1&&(O=O.slice(0,te))}return O+y}function _k(a){return a=Xe(a),a&&Zr.test(a)?a.replace(Ft,jT):a}var Sk=Oo(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Gd=gb("toUpperCase");function hy(a,c,p){return a=Xe(a),c=p?t:c,c===t?qT(a)?t1(a):FT(a):a.match(c)||[]}var my=He(function(a,c){try{return Tn(a,t,c)}catch(p){return Ud(p)?p:new Me(p)}}),Tk=Ar(function(a,c){return In(c,function(p){p=fr(p),Tr(a,p,$d(a[p],a))}),a});function Ck(a){var c=a==null?0:a.length,p=be();return a=c?lt(a,function(y){if(typeof y[1]!="function")throw new Dn(i);return[p(y[0]),y[1]]}):[],He(function(y){for(var v=-1;++vye)return[];var p=z,y=jt(a,z);c=be(c),a-=z;for(var v=nd(y,c);++p0||c<0)?new Ue(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Ie(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ue.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ue.prototype.toArray=function(){return this.take(z)},ur(Ue.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),v=x[y?"take"+(c=="last"?"Right":""):c],_=y||/^find/.test(c);v&&(x.prototype[c]=function(){var C=this.__wrapped__,M=y?[1]:arguments,O=C instanceof Ue,U=M[0],W=O||ke(C),G=function($e){var Ve=v.apply(x,ti([$e],M));return y&&te?Ve[0]:Ve};W&&p&&typeof U=="function"&&U.length!=1&&(O=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=_&&!te,Le=O&&!de;if(!_&&W){C=Le?C:new Ue(this);var ve=a.apply(C,M);return ve.__actions__.push({func:ml,args:[G],thisArg:t}),new Ln(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(G),Ee?y?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=za[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",y=/^(?:pop|shift)$/.test(a);x.prototype[a]=function(){var v=arguments;if(y&&!this.__chain__){var _=this.value();return c.apply(ke(_)?_:[],v)}return this[p](function(C){return c.apply(ke(C)?C:[],v)})}}),ur(Ue.prototype,function(a,c){var p=x[c];if(p){var y=p.name+"";Ze.call(Mo,y)||(Mo[y]=[]),Mo[y].push({name:c,func:p})}}),Mo[ll(t,E).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=_1,Ue.prototype.reverse=S1,Ue.prototype.value=T1,x.prototype.at=eM,x.prototype.chain=tM,x.prototype.commit=nM,x.prototype.next=rM,x.prototype.plant=oM,x.prototype.reverse=sM,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=aM,x.prototype.first=x.prototype.head,vs&&(x.prototype[vs]=iM),x},ri=n1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ht._=ri,define(function(){return ri})):ki?((ki.exports=ri)._=ri,Yu._=ri):Ht._=ri}).call(gs)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var tf=en;function My(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=My(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ny(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;de&&r(u,i+l,o||null,s)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?_l(r+1,s):_l(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Ge.none=[];var zi=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Oy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ky(this.content,e+this.openStart,n+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,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(K.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(K.empty,0,0);function ky(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ky(o.content,e-i-1,n-i-1)))}function Oy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Oy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function gO(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return Ry(t,e,n,0)}function Ry(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ds(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Hi(t.nodeAfter,r),o++));for(let l=o;li&&of(t,e,i+1),s=r.depth>i&&of(n,r,i+1),l=[];return Ds(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Iy(o,s),Hi($i(o,Dy(t,e,n,r,i+1)),l)):(o&&Hi($i(o,Cl(t,e,i+1)),l),Ds(e,n,i,l),s&&Hi($i(s,Cl(n,r,i+1)),l)),Ds(r,null,i,l),new K(l)}function Cl(t,e,n){let r=[];if(Ds(null,t,n,r),t.depth>n){let i=of(t,e,n+1);Hi($i(i,Cl(t,e,n+1)),r)}return Ds(e,null,n,r),new K(r)}function bO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Al=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new t(n,r,o)}static resolveCached(e,n){let r=Ey.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ly(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=K.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=K.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};$n.prototype.text=void 0;var af=class t extends $n{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ly(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ly(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Wi=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new lf(e,n);if(r.next==null)return t.empty;let i=Py(r);r.next&&r.err("Unexpected trailing text");let o=CO(TO(i));return AO(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +}`;var Le=my(function(){return Ye(_,de+"return "+G).apply(t,C)});if(Le.source=G,Ud(Le))throw Le;return Le}function bk(a){return Xe(a).toLowerCase()}function yk(a){return Xe(a).toUpperCase()}function Ek(a,c,p){if(a=Xe(a),a&&(p||c===t))return Sg(a);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Qn(c),_=Tg(y,v),C=Cg(y,v)+1;return li(y,_,C).join("")}function vk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.slice(0,Mg(a)+1);if(!a||!(c=An(c)))return a;var y=Qn(a),v=Cg(y,Qn(c))+1;return li(y,0,v).join("")}function wk(a,c,p){if(a=Xe(a),a&&(p||c===t))return a.replace(Uu,"");if(!a||!(c=An(c)))return a;var y=Qn(a),v=Tg(y,Qn(c));return li(y,v).join("")}function xk(a,c){var p=ne,y=q;if(ft(c)){var v="separator"in c?c.separator:v;p="length"in c?Ie(c.length):p,y="omission"in c?An(c.omission):y}a=Xe(a);var _=a.length;if(So(a)){var C=Qn(a);_=C.length}if(p>=_)return a;var M=p-To(y);if(M<1)return y;var R=C?li(C,0,M).join(""):a.slice(0,M);if(v===t)return R+y;if(C&&(M+=R.length-M),Wd(v)){if(a.slice(M).search(v)){var U,W=R;for(v.global||(v=od(v.source,Xe(Gm.exec(v))+"g")),v.lastIndex=0;U=v.exec(W);)var G=U.index;R=R.slice(0,G===t?M:G)}}else if(a.indexOf(An(v),M)!=M){var te=R.lastIndexOf(v);te>-1&&(R=R.slice(0,te))}return R+y}function _k(a){return a=Xe(a),a&&Zr.test(a)?a.replace(Ft,jT):a}var Sk=Oo(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),Gd=gb("toUpperCase");function hy(a,c,p){return a=Xe(a),c=p?t:c,c===t?qT(a)?t1(a):FT(a):a.match(c)||[]}var my=He(function(a,c){try{return Tn(a,t,c)}catch(p){return Ud(p)?p:new Me(p)}}),Tk=Ar(function(a,c){return In(c,function(p){p=fr(p),Tr(a,p,$d(a[p],a))}),a});function Ck(a){var c=a==null?0:a.length,p=be();return a=c?lt(a,function(y){if(typeof y[1]!="function")throw new Dn(i);return[p(y[0]),y[1]]}):[],He(function(y){for(var v=-1;++vye)return[];var p=z,y=jt(a,z);c=be(c),a-=z;for(var v=nd(y,c);++p0||c<0)?new Ue(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Ie(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},Ue.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},Ue.prototype.toArray=function(){return this.take(z)},ur(Ue.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),y=/^(?:head|last)$/.test(c),v=x[y?"take"+(c=="last"?"Right":""):c],_=y||/^find/.test(c);v&&(x.prototype[c]=function(){var C=this.__wrapped__,M=y?[1]:arguments,R=C instanceof Ue,U=M[0],W=R||ke(C),G=function($e){var Ve=v.apply(x,ti([$e],M));return y&&te?Ve[0]:Ve};W&&p&&typeof U=="function"&&U.length!=1&&(R=W=!1);var te=this.__chain__,de=!!this.__actions__.length,Ee=_&&!te,Le=R&&!de;if(!_&&W){C=Le?C:new Ue(this);var ve=a.apply(C,M);return ve.__actions__.push({func:ml,args:[G],thisArg:t}),new Ln(ve,te)}return Ee&&Le?a.apply(this,M):(ve=this.thru(G),Ee?y?ve.value()[0]:ve.value():ve)})}),In(["pop","push","shift","sort","splice","unshift"],function(a){var c=za[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",y=/^(?:pop|shift)$/.test(a);x.prototype[a]=function(){var v=arguments;if(y&&!this.__chain__){var _=this.value();return c.apply(ke(_)?_:[],v)}return this[p](function(C){return c.apply(ke(C)?C:[],v)})}}),ur(Ue.prototype,function(a,c){var p=x[c];if(p){var y=p.name+"";Ze.call(Mo,y)||(Mo[y]=[]),Mo[y].push({name:c,func:p})}}),Mo[ll(t,E).name]=[{name:"wrapper",func:t}],Ue.prototype.clone=_1,Ue.prototype.reverse=S1,Ue.prototype.value=T1,x.prototype.at=eM,x.prototype.chain=tM,x.prototype.commit=nM,x.prototype.next=rM,x.prototype.plant=oM,x.prototype.reverse=sM,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=aM,x.prototype.first=x.prototype.head,vs&&(x.prototype[vs]=iM),x},ri=n1();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ht._=ri,define(function(){return ri})):ki?((ki.exports=ri)._=ri,Yu._=ri):Ht._=ri}).call(gs)});function en(t){this.content=t}en.prototype={constructor:en,find:function(t){for(var e=0;e>1}};en.from=function(t){if(t instanceof en)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new en(e)};var tf=en;function My(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=My(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ny(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,f=Math.min(s.text.length,l.text.length);for(;de&&r(u,i+l,o||null,s)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,i+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new t(r,i)}cutByIndex(e,n){return e==n?t.empty:e==0&&n==this.content.length?this:new t(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}addToStart(e){return new t([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new t(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?_l(r+1,s):_l(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return t.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Ge.none=[];var zi=class extends Error{},Z=class t{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Oy(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}removeBetween(e,n){return new t(ky(this.content,e+this.openStart,n+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,n){if(!n)return t.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new t(K.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new t(e,r,i)}};Z.empty=new Z(K.empty,0,0);function ky(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ky(o.content,e-i-1,n-i-1)))}function Oy(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Oy(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function gO(t,e,n){if(n.openStart>t.depth)throw new zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zi("Inconsistent open depths");return Ry(t,e,n,0)}function Ry(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ds(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Hi(t.nodeAfter,r),o++));for(let l=o;li&&of(t,e,i+1),s=r.depth>i&&of(n,r,i+1),l=[];return Ds(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Iy(o,s),Hi($i(o,Dy(t,e,n,r,i+1)),l)):(o&&Hi($i(o,Cl(t,e,i+1)),l),Ds(e,n,i,l),s&&Hi($i(s,Cl(n,r,i+1)),l)),Ds(r,null,i,l),new K(l)}function Cl(t,e,n){let r=[];if(Ds(null,t,n,r),t.depth>n){let i=of(t,e,n+1);Hi($i(i,Cl(t,e,n+1)),r)}return Ds(e,null,n,r),new K(r)}function bO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var Al=class t{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ui(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),d=o-u;if(r.push(s,l,i+u),!d||(s=s.child(l),s.isText))break;o=d-1,i+=u+1}return new t(n,r,o)}static resolveCached(e,n){let r=Ey.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ly(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=K.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=K.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};$n.prototype.text=void 0;var af=class t extends $n{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ly(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ly(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var Wi=class t{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new lf(e,n);if(r.next==null)return t.empty;let i=Py(r);r.next&&r.err("Unexpected trailing text");let o=CO(TO(i));return AO(o,r),o}matchType(e){for(let n=0;nd.createAndFill()));for(let d=0;d=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}};Wi.empty=new Wi(!0);var lf=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 Py(t){let e=[];do e.push(vO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function vO(t){let e=[];do e.push(wO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function wO(t){let e=SO(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=xO(t,e);else break;return e}function vy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function xO(t,e){let n=vy(t),r=n;return t.eat(",")&&(t.next!="}"?r=vy(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _O(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function SO(t){if(t.eat("(")){let e=Py(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=_O(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function TO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,u){let d={term:u,to:l};return e[s].push(d),d}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,d)=>u.concat(o(d,l)),[]);if(s.type=="seq")for(let u=0;;u++){let d=o(s.exprs[u],l);if(u==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let d=0;d{t[s].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f{d||i.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[r.join(",")]=new Wi(r.indexOf(t.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Hy(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new $n(this,this.computeAttrs(e),K.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=K.from(n),this.checkContent(n),new $n(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=K.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(K.empty,!0);return o?new $n(this,e,n.append(o),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new t(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function MO(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var cf=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?MO(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},Ps=class t{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=zy(e,i.attrs),this.excluded=null;let o=Fy(this.attrs);this.instance=o?new Ge(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,Hy(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new t(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}},Bs=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=tf.from(e.nodes),n.marks=tf.from(e.marks||{}),this.nodes=Ml.compile(this.spec.nodes,this),this.marks=Ps.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Wi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?xy(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:xy(this,s.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,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ml){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new af(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return $n.fromJSON(this,e)}markFromJSON(e){return Ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function xy(t,e){let n=[];for(let r=0;r-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function NO(t){return t.tag!=null}function kO(t){return t.style!=null}var Rr=class t{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(NO(i))this.tags.push(i);else if(kO(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Nl(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Nl(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),Z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Sy(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Sy(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}},Uy={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},OO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wy={ol:!0,ul:!0},Fs=1,uf=2,Ls=4;function _y(t,e,n){return e!=null?(e?Fs:0)|(e==="full"?uf:0):t&&t.whitespace=="pre"?Fs|uf:n&~Ls}var Lo=class{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ge.none,this.match=o||(s&Ls?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(K.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Fs)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=K.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Uy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Nl=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=_y(null,n.preserveWhitespace,0)|(r?Ls:0);i?o=new Lo(i.type,i.attrs,Ge.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Lo(null,null,Ge.none,!0,null,s):o=new Lo(e.schema.topNodeType,null,Ge.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&uf?"full":this.localPreserveWS||(i.options&Fs)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Wy.hasOwnProperty(s)&&this.parser.normalizeLists&&RO(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:OO.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,f=this.needsBlock;if(Uy.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=u&&u.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),d&&this.sync(o),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(d.type):Ty(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Lo(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Fs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function RO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function IO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sy(t){let e={};for(let n in t)e[n]=t[n];return e}function Ty(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Sl(rf(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Sl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cy(e.marks)}};function Cy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function rf(t){return t.document||window.document}var Ay=new WeakMap;function DO(t){let e=Ay.get(t);return e===void 0&&Ay.set(t,e=LO(t)),e}function LO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):u.setAttribute(h,d[h])}}for(let h=f;hf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:b}=Sl(t,m,n,r);if(u.appendChild(g),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:u,contentDOM:l}}var Gy=65535,qy=Math.pow(2,16);function PO(t,e){return t+e*qy}function Ky(t){return t&Gy}function BO(t){return(t-(t&Gy))/qy}var Yy=1,Jy=2,kl=4,Xy=8,zs=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Xy)>0}get deletedBefore(){return(this.delInfo&(Yy|kl))>0}get deletedAfter(){return(this.delInfo&(Jy|kl))>0}get deletedAcross(){return(this.delInfo&kl)>0}},Dr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Ky(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,g=u+i+(m<0?0:f);if(r)return g;let b=e==(n<0?u:h)?null:PO(l/3,e-u),E=e==u?Jy:e==h?Yy:kl;return(n<0?e!=u:e!=h)&&(E|=Xy),new zs(g,E,b)}i+=f-d}return r?e+i:new zs(e+i,0,null)}touches(e,n){let r=0,i=Ky(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("addMark",Ws);var Ki=class t extends zt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(gf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,r)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("removeMark",Ki);var Ks=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};zt.jsonID("replaceAround",Ct);function hf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function FO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),g=Math.min(d+u.nodeSize,n),b=r.addToSet(h);for(let E=0;Et.step(u)),o.forEach(u=>t.step(u))}function HO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Ps){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;ft.step(new Ki(s.from,s.to,s.style)))}function bf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let u=0;u=0;u--)t.step(s[u])}function $O(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;b--)E||r.index(b)>0?(E=!0,f=K.from(r.node(b).copy(f)),h++):u--;let m=K.empty,g=0;for(let b=o,E=!1;b>n;b--)E||i.after(b+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ct(i,o,i,o,new Z(r,0,0),n.length,!0))}function VO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&GO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!b?d=!1:!g&&b&&(d=!0)}d===!1&&jy(t,s,l,o),bf(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new Ct(h,m,h+1,m-1,new Z(K.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&Zy(t,s,l,o),!1}})}function Zy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function jy(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function GO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function qO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ct(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(K.from(s),0,0),1,!0))}function zn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(g=g.replaceChild(0,b.type.create(b.attrs)));let E=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!E.type.validContent(g))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function YO(t,e,n=1,r){let i=t.doc.resolve(e),o=K.empty,s=K.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=K.from(i.node(l).copy(o));let f=r&&r[d];s=K.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new tn(e,e,new Z(o.append(s),n,n),!0))}function rr(t,e){let n=t.resolve(e),r=n.index();return Qy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JO(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Qy(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XO(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);jy(t,f.node(),f.before(),l)}s.inlineContent&&bf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new tn(d,u.map(e+n,-1),Z.empty,!0)),r===!0){let f=t.doc.resolve(d);Zy(t,f.node(),f.before(),t.steps.length)}return t}function ZO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Gs(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return e0(i,o,r)?new tn(e,n,r):new mf(i,o,r).fit()}function e0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var mf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new Z(o,s,l);return e>-1?new Ct(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ff(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(K.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Hs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Hs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let E=0;E1||u==0||E.content.size)&&(h=w,f.push(t0(E.mark(m.allowedMarks(E.marks)),d==1?u:0,d==l.childCount?g:-1)))}let b=d==l.childCount;b||(g=-1),this.placed=$s(this.placed,n,K.from(f)),this.frontier[n].match=h,b&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,w=l;E1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:d}=this.frontier[l],f=pf(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$s(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=$s(this.placed,this.depth,K.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=$s(this.placed,this.frontier.length,n))}};function Hs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hs(t.firstChild.content,e-1,n)))}function $s(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($s(t.lastChild.content,e-1,n)))}function ff(t,e){for(let n=0;n1&&(r=r.replaceChild(0,t0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),t.copy(r)}function pf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!jO(n,o.content,s)?l:null}function jO(t,e,n){for(let r=n;r0;m--,g--){let b=i.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==g&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,g=0;;g++){let b=m.firstChild;if(d.push(b),g==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let g=d[m],b=QO(g.type);if(b&&!g.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(b||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),b=d[g];if(b)for(let E=0;E=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let g=s[m];g<0||(e=i.before(g),n=o.after(g))}}function n0(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(K.empty,!0))}return t}function tR(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=ZO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(K.from(r),0,0))}function nR(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=r0(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function r0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Ol=class t extends zt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(i),0,n.isLeaf?0:1))}getMap(){return Dr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};zt.jsonID("attr",Ol);var Rl=class t extends zt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Gt.ok(r)}getMap(){return Dr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};zt.jsonID("docAttr",Rl);var Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";var ui=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Us}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(K.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return eR(this,e,n,r),this}replaceRangeWith(e,n,r){return tR(this,e,n,r),this}deleteRange(e,n){return nR(this,e,n),this}lift(e,n){return zO(this,e,n),this}join(e,n=1){return XO(this,e,n),this}wrap(e,n){return KO(this,e,n),this}setBlockType(e,n=e,r,i=null){return VO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return qO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ol(e,n,r)),this}setDocAttribute(e,n){return this.step(new Rl(e,n)),this}addNodeMark(e,n){return this.step(new Ks(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Vs(e,n)),this}split(e,n=1,r){return YO(this,e,n,r),this}addMark(e,n,r){return FO(this,e,n,r),this}removeMark(e,n,r){return HO(this,e,n,r),this}clearIncompatible(e,n,r){return bf(this,e,n,r),this}};var yf=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $o(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Ho(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ho(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fn(e.node(0))}static atStart(e){return Ho(e,e,0,0,1)||new fn(e)}static atEnd(e){return Ho(e,e,e.content.size,e.childCount,-1)||new fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yf)throw new RangeError("Duplicate use of selection JSON ID "+e);return yf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var $o=class{constructor(e,n){this.$from=e,this.$to=n}},i0=!1;function o0(t){!i0&&!t.parent.inlineContent&&(i0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var le=class t extends ue{constructor(e,n=e){o0(e),o0(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ll(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.create(t,n-(i<0?l.nodeSize:0))}else{let u=Ho(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function s0(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var a0=1,Dl=2,l0=4,wf=class extends ui{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Dl,this}ensureMarks(e){return Ge.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(this.updated&Dl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Dl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=l0,this}get scrolledIntoView(){return(this.updated&l0)>0}};function c0(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=c0(n.init,r),this.apply=c0(n.apply,r)}},iR=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],qs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iR.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Vi(r.key,r.spec.state,r))})}},Pl=class t{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new qs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=$n.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function u0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=u0(i,e,{})),n[r]=i}return n}var Oe=class{constructor(e){this.spec=e,this.props={},e.props&&u0(e.props,this,this.props),this.key=e.key?e.key.key:d0("plugin")}getState(e){return e[this.key]}},Ef=Object.create(null);function d0(t){return t in Ef?t+"$"+ ++Ef[t]:(Ef[t]=0,t+"$")}var ze=class{constructor(e="key"){this.key=d0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var qt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Af=null,Br=function(t,e,n){let r=Af||(Af=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},oR=function(){Af=null},ji=function(t,e,n,r){return n&&(f0(t,e,n,r,-1)||f0(t,e,n,r,1))},sR=/^(img|br|input|textarea|hr)$/i;function f0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Wn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ta(t)||sR.test(t.nodeName)||t.contentEditable=="false")return!1;e=qt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Wn(t):0}else return!1}}function Wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aR(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Wn(t)}else if(t.parentNode&&!ta(t))e=qt(t),t=t.parentNode;else return null}}function lR(t,e){for(;;){if(t.nodeType==3&&e2),Un=Vo||(pr?/Mac/.test(pr.platform):!1),fR=pr?/Win/.test(pr.platform):!1,Fr=/Android \d/.test(gi),na=!!p0&&"webkitFontSmoothing"in p0.documentElement.style,pR=na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function mR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function h0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Zs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?hR(o):mR(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,g=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-m,E=l.scrollTop-g;e={left:e.left-b,top:e.top-E,right:e.right-b,bottom:e.bottom-E}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function gR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:q0(t.dom)}}function q0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zs(r));return e}function bR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Y0(n,r==0?0:r-e)}function Y0(t,e){for(let n=0;n=l){s=Math.max(b.bottom,s),l=Math.min(b.top,l);let E=b.left>e.left?b.left-e.left:b.right=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!u&&b.left<=e.left&&b.right>=e.left&&(u=f,d={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?ER(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:J0(n,i)}function ER(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Vf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function xR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right-1?i:t.docView.posFromDOM(e,n,-1)}function X0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;na&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=xR(t,r,i,e))}l==null&&(l=wR(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function m0(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ys(di(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return xf(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,Wn(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ys(di(d,1),!1)}if(o==null&&i=0)}function Ys(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function j0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function TR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return j0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Z0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var CR=/[\u0590-\u08ac]/;function AR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!CR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:j0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:E}=t.domSelectionRange(),w=b&&!g.contains(b.nodeType==1?b:b.parentNode)||u==b&&d==E;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}var g0=null,b0=null,y0=!1;function MR(t,e,n){return g0==e&&b0==n?y0:(g0=e,b0=n,y0=n=="up"||n=="down"?TR(t,e,n):AR(t,e,n))}var Kn=0,E0=1,qi=2,hr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Kn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nqt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Hl){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Bl&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?qt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=qt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;fb&&sn){let b=l;l=u,u=b}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(g)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:E0,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:hr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:E0;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Kn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},Of=class extends Qi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Go=class t extends Qi{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ir.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Lf(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ir.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=tE(f,r,n),d?u=new Rf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Fl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,n,r){return this.dirty==Kn&&e.eq(this.node)&&$l(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new Df(this,s&&s.node,e);RR(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let g;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,g,e)||u.updateNextNode(d,f,h,e,m,i)||u.addNode(d,f,h,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==qi)&&(s&&this.protectLocalComposition(e,s),Q0(this.contentDOM,this.children,e),Vo&&IR(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=DR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;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 s=new Of(this,o,n,i);e.input.compositionNodes.push(s),this.children=Lf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Kn}updateOuterDeco(e){if($l(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=eE(this.dom,this.nodeDOM,If(this.outerDeco,this.node,n),If(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function v0(t,e,n,r,i){tE(r,e,t);let o=new mi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Fl=class t extends mi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=Kn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Kn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Hl=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Rf=class extends mi{constructor(e,n,r,i,o,s,l,u,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Q0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Go.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Go)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function OR(t,e){return t.type.side-e.type.side}function RR(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let b=o+m.nodeSize;if(m.isText){let w=b;s!w.inline):l.slice();r(m,E,e.forChild(o,m),g),o=b}}function IR(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function DR(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Lf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Gf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,d;if(Yl(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&he.isSelectable(h)&&i.parent&&!(h.isInline&&cR(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new he(s==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let g=0;g{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!nE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function PR(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,qt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&hi<=11&&(r.disabled=!0,r.disabled=!1)}function rE(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(T0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else T0(t)}function T0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function qf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function C0(t){return t.editable&&!t.hasFocus()?!1:iE(t)}function iE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function BR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Pf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function fi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function A0(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fi(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Pf(t.state,e);return i&&i instanceof he?fi(t,i):!1}else if(!(Un&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?he.isSelectable(o)?fi(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):na?fi(t,new le(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return fi(t,new le(e>0?r.$to:r.$from));{let i=Pf(t.state,e);return i?fi(t,i):!1}}}function zl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Xs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Uo(t,e){return e<0?FR(t):HR(t)}function FR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Xs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(oE(n))break;{let l=n.previousSibling;for(;l&&Xs(l,-1);)i=n.parentNode,o=qt(l),l=l.previousSibling;if(l)n=l,r=zl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Bf(t,n,r):i&&Bf(t,i,o)}function HR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=zl(n),o,s;for(;;)if(r{t.state==i&&Hr(t)},50)}function M0(t,e){let n=t.state.doc.resolve(e);if(!(rn||fR)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function N0(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Pf(t.state,e);if(s&&s instanceof he)return fi(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fn?ue.near(s,e):ue.findFrom(s,e);return l?fi(t,l):!1}return!1}function k0(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function O0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function UR(t){if(!pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;O0(t,r,"true"),setTimeout(()=>O0(t,r,"false"),20)}return!1}function WR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function KR(t,e){let n=e.keyCode,r=WR(e);if(n==8||Un&&n==72&&r=="c")return k0(t,-1)||Uo(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return k0(t,1)||Uo(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?M0(t,t.state.selection.from)=="ltr"?-1:1:-1;return A0(t,i,r)||Uo(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?M0(t,t.state.selection.from)=="ltr"?1:-1:1;return A0(t,i,r)||Uo(t,i)}else{if(n==38||Un&&n==80&&r=="c")return N0(t,-1,r)||Uo(t,-1);if(n==40||Un&&n==78&&r=="c")return UR(t)||N0(t,1,r)||Uo(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function sE(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=fE(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=dE[d.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let b=l.createElement(f[g]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(s,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(d.type):Ty(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Lo(e,n,u,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Fs)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let f=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function RO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function IO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Sy(t){let e={};for(let n in t)e[n]=t[n];return e}function Ty(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Sl(rf(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Sl(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Cy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Cy(e.marks)}};function Cy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function rf(t){return t.document||window.document}var Ay=new WeakMap;function DO(t){let e=Ay.get(t);return e===void 0&&Ay.set(t,e=LO(t)),e}function LO(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,u=n?t.createElementNS(n,i):t.createElement(i),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):u.setAttribute(h,d[h])}}for(let h=f;hf)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:b,contentDOM:g}=Sl(t,m,n,r);if(u.appendChild(b),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:u,contentDOM:l}}var Gy=65535,qy=Math.pow(2,16);function PO(t,e){return t+e*qy}function Ky(t){return t&Gy}function BO(t){return(t-(t&Gy))/qy}var Yy=1,Jy=2,kl=4,Xy=8,zs=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Xy)>0}get deletedBefore(){return(this.delInfo&(Yy|kl))>0}get deletedAfter(){return(this.delInfo&(Jy|kl))>0}get deletedAcross(){return(this.delInfo&kl)>0}},Dr=class t{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}recover(e){let n=0,r=Ky(e);if(!this.inverted)for(let i=0;ie)break;let d=this.ranges[l+o],f=this.ranges[l+s],h=u+d;if(e<=h){let m=d?e==u?-1:e==h?1:n:n,b=u+i+(m<0?0:f);if(r)return b;let g=e==(n<0?u:h)?null:PO(l/3,e-u),E=e==u?Jy:e==h?Yy:kl;return(n<0?e!=u:e!=h)&&(E|=Xy),new zs(b,E,g)}i+=f-d}return r?e+i:new zs(e+i,0,null)}touches(e,n){let r=0,i=Ky(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new t;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,o)}invert(){return new Ki(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("addMark",Ws);var Ki=class t extends zt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Z(gf(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Gt.fromReplace(e,this.from,this.to,r)}invert(){return new Ws(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)}merge(e){return e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new t(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))}};zt.jsonID("removeMark",Ki);var Ks=class t extends zt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,Z.fromJSON(e,n.slice),n.insert,!!n.structure)}};zt.jsonID("replaceAround",Ct);function hf(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function FO(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),b=Math.min(d+u.nodeSize,n),g=r.addToSet(h);for(let E=0;Et.step(u)),o.forEach(u=>t.step(u))}function HO(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Ps){let d=s.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let d=Math.min(l+s.nodeSize,n);for(let f=0;ft.step(new Ki(s.from,s.to,s.style)))}function bf(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let u=0;u=0;u--)t.step(s[u])}function $O(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;g--)E||r.index(g)>0?(E=!0,f=K.from(r.node(g).copy(f)),h++):u--;let m=K.empty,b=0;for(let g=o,E=!1;g>n;g--)E||i.after(g+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ct(i,o,i,o,new Z(r,0,0),n.length,!0))}function VO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let u=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,u)&&GO(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!g?d=!1:!b&&g&&(d=!0)}d===!1&&jy(t,s,l,o),bf(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let f=t.mapping.slice(o),h=f.map(l,1),m=f.map(l+s.nodeSize,1);return t.step(new Ct(h,m,h+1,m-1,new Z(K.from(r.create(u,null,s.marks)),0,0),1,!0)),d===!0&&Zy(t,s,l,o),!1}})}function Zy(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let u=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function jy(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function GO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function qO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ct(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Z(K.from(s),0,0),1,!0))}function zn(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,f=n-2;d>o;d--,f--){let h=i.node(d),m=i.index(d);if(h.type.spec.isolating)return!1;let b=h.content.cutByIndex(m,h.childCount),g=r&&r[f+1];g&&(b=b.replaceChild(0,g.type.create(g.attrs)));let E=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!E.type.validContent(b))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function YO(t,e,n=1,r){let i=t.doc.resolve(e),o=K.empty,s=K.empty;for(let l=i.depth,u=i.depth-n,d=n-1;l>u;l--,d--){o=K.from(i.node(l).copy(o));let f=r&&r[d];s=K.from(f?f.type.create(f.attrs,s):i.node(l).copy(s))}t.step(new tn(e,e,new Z(o.append(s),n,n),!0))}function rr(t,e){let n=t.resolve(e),r=n.index();return Qy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JO(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Qy(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function XO(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let f=s.whitespace=="pre",h=!!s.contentMatch.matchType(i);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);jy(t,f.node(),f.before(),l)}s.inlineContent&&bf(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new tn(d,u.map(e+n,-1),Z.empty,!0)),r===!0){let f=t.doc.resolve(d);Zy(t,f.node(),f.before(),t.steps.length)}return t}function ZO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),d=r.node(s),f=!1;if(o==1)f=d.canReplace(u,u,i);else{let h=d.contentMatchAt(u).findWrapping(i.firstChild.type);f=h&&d.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Gs(t,e,n=e,r=Z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return e0(i,o,r)?new tn(e,n,r):new mf(i,o,r).fit()}function e0(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var mf=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new Z(o,s,l);return e>-1?new Ct(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tn(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ff(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,h=null;if(n==1&&(s?d.matchType(s.type)||(h=d.fillBefore(K.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:h};if(n==2&&s&&(f=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ff(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new Z(Hs(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Z(Hs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let E=0;E1||u==0||E.content.size)&&(h=w,f.push(t0(E.mark(m.allowedMarks(E.marks)),d==1?u:0,d==l.childCount?b:-1)))}let g=d==l.childCount;g||(b=-1),this.placed=$s(this.placed,n,K.from(f)),this.frontier[n].match=h,g&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,w=l;E1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:d}=this.frontier[l],f=pf(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=$s(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=$s(this.placed,this.depth,K.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=$s(this.placed,this.frontier.length,n))}};function Hs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hs(t.firstChild.content,e-1,n)))}function $s(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy($s(t.lastChild.content,e-1,n)))}function ff(t,e){for(let n=0;n1&&(r=r.replaceChild(0,t0(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),t.copy(r)}function pf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!jO(n,o.content,s)?l:null}function jO(t,e,n){for(let r=n;r0;m--,b--){let g=i.node(m).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(m)>-1?l=m:i.before(m)==b&&s.splice(1,0,-m)}let u=s.indexOf(l),d=[],f=r.openStart;for(let m=r.content,b=0;;b++){let g=m.firstChild;if(d.push(g),b==r.openStart)break;m=g.content}for(let m=f-1;m>=0;m--){let b=d[m],g=QO(b.type);if(g&&!b.sameMarkup(i.node(Math.abs(l)-1)))f=m;else if(g||!b.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let b=(m+f+1)%(r.openStart+1),g=d[b];if(g)for(let E=0;E=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let b=s[m];b<0||(e=i.before(b),n=o.after(b))}}function n0(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(K.empty,!0))}return t}function tR(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=ZO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new Z(K.from(r),0,0))}function nR(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=r0(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function r0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var Ol=class t extends zt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Gt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Gt.fromReplace(e,this.pos,this.pos+1,new Z(K.from(i),0,n.isLeaf?0:1))}getMap(){return Dr.empty}invert(e){return new t(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new t(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new t(n.pos,n.attr,n.value)}};zt.jsonID("attr",Ol);var Rl=class t extends zt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Gt.ok(r)}getMap(){return Dr.empty}invert(e){return new t(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t(n.attr,n.value)}};zt.jsonID("docAttr",Rl);var Po=class extends Error{};Po=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Po.prototype=Object.create(Error.prototype);Po.prototype.constructor=Po;Po.prototype.name="TransformError";var ui=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Us}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Po(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=Z.empty){let i=Gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new Z(K.from(r),0,0))}delete(e,n){return this.replace(e,n,Z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return eR(this,e,n,r),this}replaceRangeWith(e,n,r){return tR(this,e,n,r),this}deleteRange(e,n){return nR(this,e,n),this}lift(e,n){return zO(this,e,n),this}join(e,n=1){return XO(this,e,n),this}wrap(e,n){return KO(this,e,n),this}setBlockType(e,n=e,r,i=null){return VO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return qO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Ol(e,n,r)),this}setDocAttribute(e,n){return this.step(new Rl(e,n)),this}addNodeMark(e,n){return this.step(new Ks(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Vs(e,n)),this}split(e,n=1,r){return YO(this,e,n,r),this}addMark(e,n,r){return FO(this,e,n,r),this}removeMark(e,n,r){return HO(this,e,n,r),this}clearIncompatible(e,n,r){return bf(this,e,n,r),this}};var yf=Object.create(null),ue=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $o(e.min(n),e.max(n))]}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 n=0;n=0;o--){let s=n<0?Ho(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ho(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new fn(e.node(0))}static atStart(e){return Ho(e,e,0,0,1)||new fn(e)}static atEnd(e){return Ho(e,e,e.content.size,e.childCount,-1)||new fn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yf)throw new RangeError("Duplicate use of selection JSON ID "+e);return yf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}};ue.prototype.visible=!0;var $o=class{constructor(e,n){this.$from=e,this.$to=n}},i0=!1;function o0(t){!i0&&!t.parent.inlineContent&&(i0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var le=class t extends ue{constructor(e,n=e){o0(e),o0(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ue.near(r);let i=e.resolve(n.map(this.anchor));return new t(i.parent.inlineContent?i:r,r)}replace(e,n=Z.empty){if(super.replace(e,n),n==Z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ll(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ue.findFrom(n,r,!0)||ue.findFrom(n,-r,!0);if(o)n=o.$head;else return ue.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ue.findFrom(e,-r,!0)||ue.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&he.isSelectable(l))return he.create(t,n-(i<0?l.nodeSize:0))}else{let u=Ho(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function s0(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var a0=1,Dl=2,l0=4,wf=class extends ui{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Dl,this}ensureMarks(e){return Ge.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(this.updated&Dl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Dl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ue.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=l0,this}get scrolledIntoView(){return(this.updated&l0)>0}};function c0(t,e){return!e||!t?t:t.bind(e)}var Vi=class{constructor(e,n,r){this.name=e,this.init=c0(n.init,r),this.apply=c0(n.apply,r)}},iR=[new Vi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Vi("selection",{init(t,e){return t.selection||ue.atStart(e.doc)},apply(t){return t.selection}}),new Vi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Vi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],qs=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=iR.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Vi(r.key,r.spec.state,r))})}},Pl=class t{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,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new qs(e.schema,e.plugins),o=new t(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=$n.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ue.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=d.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function u0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=u0(i,e,{})),n[r]=i}return n}var Oe=class{constructor(e){this.spec=e,this.props={},e.props&&u0(e.props,this,this.props),this.key=e.key?e.key.key:d0("plugin")}getState(e){return e[this.key]}},Ef=Object.create(null);function d0(t){return t in Ef?t+"$"+ ++Ef[t]:(Ef[t]=0,t+"$")}var ze=class{constructor(e="key"){this.key=d0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var qt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},Af=null,Br=function(t,e,n){let r=Af||(Af=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},oR=function(){Af=null},ji=function(t,e,n,r){return n&&(f0(t,e,n,r,-1)||f0(t,e,n,r,1))},sR=/^(img|br|input|textarea|hr)$/i;function f0(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Wn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ta(t)||sR.test(t.nodeName)||t.contentEditable=="false")return!1;e=qt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Wn(t):0}else return!1}}function Wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aR(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Wn(t)}else if(t.parentNode&&!ta(t))e=qt(t),t=t.parentNode;else return null}}function lR(t,e){for(;;){if(t.nodeType==3&&e2),Un=Vo||(pr?/Mac/.test(pr.platform):!1),fR=pr?/Win/.test(pr.platform):!1,Fr=/Android \d/.test(gi),na=!!p0&&"webkitFontSmoothing"in p0.documentElement.style,pR=na?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function hR(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pr(t,e){return typeof t=="number"?t:t[e]}function mR(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function h0(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Zs(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,d=u?hR(o):mR(l),f=0,h=0;if(e.topd.bottom-Pr(r,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+Pr(i,"top")-d.top:e.bottom-d.bottom+Pr(i,"bottom")),e.leftd.right-Pr(r,"right")&&(f=e.right-d.right+Pr(i,"right")),f||h)if(u)o.defaultView.scrollBy(f,h);else{let m=l.scrollLeft,b=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let g=l.scrollLeft-m,E=l.scrollTop-b;e={left:e.left-g,top:e.top-E,right:e.right-g,bottom:e.bottom-E}}if(u||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function gR(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:q0(t.dom)}}function q0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zs(r));return e}function bR({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Y0(n,r==0?0:r-e)}function Y0(t,e){for(let n=0;n=l){s=Math.max(g.bottom,s),l=Math.min(g.top,l);let E=g.left>e.left?g.left-e.left:g.right=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!u&&g.left<=e.left&&g.right>=e.left&&(u=f,d={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!n&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(o=h+1)}}return!n&&u&&(n=u,i=d,r=0),n&&n.nodeType==3?ER(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:J0(n,i)}function ER(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Vf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function vR(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function xR(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!s&&u.left>r.left||u.top>r.top?i=l.posBefore:(!s&&u.right-1?i:t.docView.posFromDOM(e,n,-1)}function X0(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let d;na&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=xR(t,r,i,e))}l==null&&(l=wR(t,s,e));let u=t.docView.nearestDesc(s,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function m0(t){return t.top=0&&i==r.nodeValue.length?(u--,f=1):n<0?u--:d++,Ys(di(Br(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return xf(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Wn(r))){let u=r.childNodes[i-1],d=u.nodeType==3?Br(u,Wn(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return Ys(di(d,1),!1)}if(o==null&&i=0)}function Ys(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function j0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function TR(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return j0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Z0(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Br(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;df.top+1&&(n=="up"?s.top-f.top>(f.bottom-s.top)*2:f.bottom-s.bottom>(s.bottom-f.top)*2))return!1}}return!0})}var CR=/[\u0590-\u08ac]/;function AR(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return l?!CR.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:j0(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:g,focusOffset:E}=t.domSelectionRange(),w=g&&!b.contains(g.nodeType==1?g:g.parentNode)||u==g&&d==E;try{l.collapse(f,h),u&&(u!=f||d!=h)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}var g0=null,b0=null,y0=!1;function MR(t,e,n){return g0==e&&b0==n?y0:(g0=e,b0=n,y0=n=="up"||n=="down"?TR(t,e,n):AR(t,e,n))}var Kn=0,E0=1,qi=2,hr=3,Qi=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Kn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nqt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof Hl){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Bl&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?qt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=s;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){i=qt(m.dom)+1;break}e-=m.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;fg&&sn){let g=l;l=u,u=g}let b=document.createRange();b.setEnd(u.node,u.offset),b.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(b)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?qi:E0,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=hr:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qi:hr}r=s}this.dirty=qi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qi:E0;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Kn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},Of=class extends Qi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Go=class t extends Qi{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ir.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&hr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=hr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Lf(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),f=d&&d.dom,h=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Ir.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=tE(f,r,n),d?u=new Rf(e,n,r,i,f,h||null,m,d,o,s+1):n.isText?new Fl(e,n,r,i,f,m,o):new t(e,n,r,i,f,h||null,m,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,n,r){return this.dirty==Kn&&e.eq(this.node)&&$l(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new Df(this,s&&s.node,e);RR(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ge.none:this.node.child(f).marks,r,e),u.placeWidget(d,e,i)},(d,f,h,m)=>{u.syncToMarks(d.marks,r,e);let b;u.findNodeMatch(d,f,h,m)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(d,f,h,b,e)||u.updateNextNode(d,f,h,e,m,i)||u.addNode(d,f,h,e,i),i+=d.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==qi)&&(s&&this.protectLocalComposition(e,s),Q0(this.contentDOM,this.children,e),Vo&&IR(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||rn+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=DR(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;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 s=new Of(this,o,n,i);e.input.compositionNodes.push(s),this.children=Lf(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==hr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Kn}updateOuterDeco(e){if($l(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=eE(this.dom,this.nodeDOM,If(this.outerDeco,this.node,n),If(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function v0(t,e,n,r,i){tE(r,e,t);let o=new mi(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Fl=class t extends mi{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==hr||this.dirty!=Kn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Kn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=hr)}get domAtom(){return!1}isText(e){return this.node.text==e}},Hl=class extends Qi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Rf=class extends mi{constructor(e,n,r,i,o,s,l,u,d,f){super(e,n,r,i,o,s,l,d,f),this.spec=u}update(e,n,r,i){if(this.dirty==hr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Q0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Go.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Go)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function OR(t,e){return t.type.side-e.type.side}function RR(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;do;)l.push(i[s++]);let g=o+m.nodeSize;if(m.isText){let w=g;s!w.inline):l.slice();r(m,E,e.forChild(o,m),b),o=g}}function IR(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function DR(t,e,n,r){for(let i=0,o=0;i=n){if(o>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Lf(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||f<=e?o.push(u):(dn&&o.push(u.slice(n-d,u.size,r)))}return o}function Gf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,d;if(Yl(n)){for(u=s;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&he.isSelectable(h)&&i.parent&&!(h.isInline&&cR(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;d=new he(s==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=s,m=s;for(let b=0;b{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!nE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function PR(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,qt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&wn&&hi<=11&&(r.disabled=!0,r.disabled=!1)}function rE(t,e){if(e instanceof he){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(T0(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else T0(t)}function T0(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function qf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,r)}function C0(t){return t.editable&&!t.hasFocus()?!1:iE(t)}function iE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function BR(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ji(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Pf(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ue.findFrom(o,e)}function fi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function A0(t,e,n){let r=t.state.selection;if(r instanceof le)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fi(t,new le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Pf(t.state,e);return i&&i instanceof he?fi(t,i):!1}else if(!(Un&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?he.isSelectable(o)?fi(t,new he(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):na?fi(t,new le(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof he&&r.node.isInline)return fi(t,new le(e>0?r.$to:r.$from));{let i=Pf(t.state,e);return i?fi(t,i):!1}}}function zl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Xs(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Uo(t,e){return e<0?FR(t):HR(t)}function FR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(ir&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Xs(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(oE(n))break;{let l=n.previousSibling;for(;l&&Xs(l,-1);)i=n.parentNode,o=qt(l),l=l.previousSibling;if(l)n=l,r=zl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Bf(t,n,r):i&&Bf(t,i,o)}function HR(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=zl(n),o,s;for(;;)if(r{t.state==i&&Hr(t)},50)}function M0(t,e){let n=t.state.doc.resolve(e);if(!(rn||fR)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function N0(t,e,n){let r=t.state.selection;if(r instanceof le&&!r.empty||n.indexOf("s")>-1||Un&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Pf(t.state,e);if(s&&s instanceof he)return fi(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fn?ue.near(s,e):ue.findFrom(s,e);return l?fi(t,l):!1}return!1}function k0(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function O0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function UR(t){if(!pn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;O0(t,r,"true"),setTimeout(()=>O0(t,r,"false"),20)}return!1}function WR(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function KR(t,e){let n=e.keyCode,r=WR(e);if(n==8||Un&&n==72&&r=="c")return k0(t,-1)||Uo(t,-1);if(n==46&&!e.shiftKey||Un&&n==68&&r=="c")return k0(t,1)||Uo(t,1);if(n==13||n==27)return!0;if(n==37||Un&&n==66&&r=="c"){let i=n==37?M0(t,t.state.selection.from)=="ltr"?-1:1:-1;return A0(t,i,r)||Uo(t,i)}else if(n==39||Un&&n==70&&r=="c"){let i=n==39?M0(t,t.state.selection.from)=="ltr"?1:-1:1;return A0(t,i,r)||Uo(t,i)}else{if(n==38||Un&&n==80&&r=="c")return N0(t,-1,r)||Uo(t,-1);if(n==40||Un&&n==78&&r=="c")return UR(t)||N0(t,1,r)||Uo(t,1);if(r==(Un?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function sE(t,e){t.someProp("transformCopied",b=>{e=b(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let s=t.someProp("clipboardSerializer")||Ir.fromSchema(t.state.schema),l=fE(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let d=u.firstChild,f,h=0;for(;d&&d.nodeType==1&&(f=dE[d.nodeName.toLowerCase()]);){for(let b=f.length-1;b>=0;b--){let g=l.createElement(f[b]);for(;u.firstChild;)g.appendChild(u.firstChild);u.appendChild(g),h++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:u,text:m,slice:e}}function aE(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let u=e&&(r||o||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,o||r,t)}),o)return e?new Z(K.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:g}=t.state,b=Ir.fromSchema(g);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let w=s.appendChild(document.createElement("p"));E&&w.appendChild(b.serializeNode(g.text(E,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=YR(n),na&&JR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Rr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!VR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=XR(R0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(GR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let g=l.content.firstChild;h{l=h(l,t)}),l}var VR=/^(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 GR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&cE(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=uE(s[s.length-1],o.length));let f=lE(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return K.from(s)}return t}function lE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,K.from(t));return t}function cE(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function R0(t,e,n){return en})),Sf.createHTML(t)):t}function YR(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=fE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dE[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=qR(t),i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=K.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},ZR={touchstart:!0,touchmove:!0},Hf=class{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function jR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eI(t,r)&&!Yf(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},ZR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),$f(t)}function pi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function QR(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $f(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Yf(t,r))})}function Yf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tI(t,e){!Yf(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fr&&rn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Vo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||KR(t,n)?n.preventDefault():pi(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(hE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Jl(t){return{left:t.clientX,top:t.clientY}}function nI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Jf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ko(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function rI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Ko(t,new he(n),"pointer"),!0):!1}function iI(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(he.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ko(t,he.create(t.state.doc,i),"pointer"),!0):!1}function oI(t,e,n,r,i){return Jf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?iI(t,n):rI(t,n))}function sI(t,e,n,r){return Jf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function aI(t,e,n,r){return Jf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||lI(t,n,r)}function lI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ko(t,le.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Ko(t,le.create(r,l+1,l+1+s.content.size),"pointer");else if(he.isSelectable(s))Ko(t,he.create(r,l),"pointer");else continue;return!0}}function Xf(t){return Ul(t)}var pE=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&nI(n,t.input.lastClick)&&!n[pE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Jl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zf(t,s,n,!!r)):(o=="doubleClick"?sI:aI)(t,s.pos,s.inside,n)?n.preventDefault():pi(t,"pointer"))};var zf=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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)),pi(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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?pi(this.view,"pointer"):oI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&this.mightDrag&&!this.mightDrag.node.isAtom||rn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ko(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pi(this.view,"pointer")}move(e){this.updateAllowDefault(e),pi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),Xf(t),pi(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),pi(t,"pointer")};hn.contextmenu=t=>Xf(t);function hE(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var cI=Fr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ul(t,!0),t.markCursor=null;else if(Ul(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}mE(t,cI)};mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mE(t,20))};function mE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ul(t),e))}function gE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function uI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aR(e.focusNode,e.focusOffset),r=lR(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function dI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ul(t,e=!1){if(!(Fr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gE(t),e||t.docView&&t.docView.dirty){let n=Gf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function fI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var js=wn&&hi<15||Vo&&pR<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=js?null:n.clipboardData,s=r.content(),{dom:l,text:u}=sE(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):fI(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qs(t,r.value,null,i,e):Qs(t,r.textContent,r.innerHTML,i,e)},50)}function Qs(t,e,n,r,i){let o=aE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=pI(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!Fr)return;let r=js?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qs(t,bE(r),r.getData("text/html"),i,n)?n.preventDefault():hI(t,n)};var Wl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},yE=Un?"altKey":"ctrlKey";hn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Jl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=he.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d,slice:f}=sE(t,l);(!n.dataTransfer.files.length||!rn||G0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",js||n.dataTransfer.setData("text/plain",d),t.dragging=new Wl(f,!n[yE],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Jl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=aE(t,bE(n.dataTransfer),js?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[yE]);if(t.someProp("handleDrop",b=>b(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Il(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:b}=r;b?b.replace(d):d.deleteSelection()}let f=d.mapping.map(u),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let g=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(g));else{let b=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((E,w,S,N)=>b=N),d.setSelection(qf(t,g,d.doc.resolve(b)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Hr(t)},20))};hn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,e)=>{if(rn&&Fr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in mn)hn[t]=mn[t];function ea(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Kl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ea(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=vE(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;in instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let w=E-b-(g-m);for(let S=0;SN+f-h)continue;let D=l[S]+f-h;g>=D?l[S+1]=m<=D?-2:-1:m>=f&&w&&(l[S]+=w,l[S+1]+=w)}h+=w}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),g=m-i,{index:b,offset:E}=r.content.findIndex(h),w=r.maybeChild(b);if(w&&E==h&&E+w.nodeSize==g){let S=l[d+2].mapInner(n,w,f+1,t[d]+o+1,s);S!=nn?(l[d]=h,l[d+1]=g,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=gI(l,t,e,n,i,o,s),f=Gl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=vE(t,l,u+n);if(d){o=!0;let f=Gl(d,l,n+u+1,r);f!=nn&&i.push(u,u+l.nodeSize,f)}});let s=EE(o?wE(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function Tf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nn&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),Vl.from(e)}var bI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yI=wn&&hi<=11,Wf=class{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}},Kf=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),yI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,bI)),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 n=0;nthis.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(C0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(wn&&hi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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 n=new Set,r;for(let o=e.focusNode;o;o=Zs(o))n.add(o);for(let o=e.anchorNode;o;o=Zs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&C0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;fh.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||wI(e,h)!=g)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),EI(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;fi;w--){let S=r.childNodes[w-1],N=S.pmViewDesc;if(S.nodeName=="BR"&&!N){o=w;break}if(!N||N.size)break}let h=t.state.doc,m=t.someProp("domParser")||Rr.fromSchema(t.state.schema),g=h.resolve(s),b=null,E=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:o,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:_I,context:g});if(d&&d[0].pos!=null){let w=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=w),b={anchor:w+s,head:S+s}}return{doc:E,sel:b,from:s,to:l}}function _I(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var SI=/^(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 TI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let q=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=Gf(t,q);if(Q&&!t.state.selection.eq(Q)){if(rn&&Fr&&t.input.lastKeyCode===13&&Date.now()-100we(t,Gi(13,"Enter"))))return;let fe=t.state.tr.setSelection(Q);q=="pointer"?fe.setMeta("pointer",!0):q=="key"&&fe.scrollIntoView(),o&&fe.setMeta("composition",o),t.dispatch(fe)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=xI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,g;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Fr)&&i.some(q=>q.nodeType==1&&!SI.test(q.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",q=>q(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof le&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let q=F0(t,t.state.doc,d.sel);if(q&&!q.eq(t.state.selection)){let Q=t.state.tr.setSelection(q);o&&Q.setMeta("composition",o),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?b.start=t.state.selection.from:b.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),wn&&hi<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>d.from&&d.doc.textBetween(b.start-d.from-1,b.start-d.from+1)==" \xA0"&&(b.start--,b.endA--,b.endB--);let E=d.doc.resolveNoCache(b.start-d.from),w=d.doc.resolveNoCache(b.endB-d.from),S=f.resolve(b.start),N=E.sameParent(w)&&E.parent.inlineContent&&S.end()>=b.endA,D;if((Vo&&t.input.lastIOSEnter>Date.now()-225&&(!N||i.some(q=>q.nodeName=="DIV"||q.nodeName=="P"))||!N&&E.posq(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&AI(f,b.start,b.endA,E,w)&&t.someProp("handleKeyDown",q=>q(t,Gi(8,"Backspace")))){Fr&&rn&&t.domObserver.suppressSelectionUpdates();return}rn&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),Fr&&!N&&E.start()!=w.start()&&w.parentOffset==0&&E.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==b.endA&&(b.endB-=2,w=d.doc.resolveNoCache(b.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(q){return q(t,Gi(13,"Enter"))})},20));let T=b.start,B=b.endA,R,Y,ne;if(N){if(E.pos==w.pos)wn&&hi<=11&&E.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),R=t.state.tr.delete(T,B),Y=f.resolve(b.start).marksAcross(f.resolve(b.endA));else if(b.endA==b.endB&&(ne=CI(E.parent.content.cut(E.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,b.endA-S.start()))))R=t.state.tr,ne.type=="add"?R.addMark(T,B,ne.mark):R.removeMark(T,B,ne.mark);else if(E.parent.child(E.index()).isText&&E.index()==w.index()-(w.textOffset?0:1)){let q=E.parent.textBetween(E.parentOffset,w.parentOffset);if(t.someProp("handleTextInput",Q=>Q(t,T,B,q)))return;R=t.state.tr.insertText(q,T,B)}}if(R||(R=t.state.tr.replace(T,B,d.doc.slice(b.start-d.from,b.endB-d.from))),d.sel){let q=F0(t,R.doc,d.sel);q&&!(rn&&t.composing&&q.empty&&(b.start!=b.endB||t.input.lastChromeDeletee.content.size?null:qf(t,e.resolve(n.anchor),e.resolve(n.head))}function CI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;fn||Cf(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function MI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var ql=class{constructor(e,n){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 Hf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(K0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=U0(this),z0(this),this.nodeViews=W0(this),this.docView=v0(this.state.doc,$0(this),Tf(this),this.dom,this),this.domObserver=new Kf(this,(r,i,o,s)=>TI(this,r,i,o,s)),this.domObserver.start(),jR(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$f(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(K0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(gE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=W0(this);kI(g,this.nodeViews)&&(this.nodeViews=g,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&$f(this),this.editable=U0(this),z0(this);let u=Tf(this),d=$0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&gR(this);if(s){this.domObserver.stop();let g=h&&(wn||rn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&NI(i.selection,e.selection);if(h){let b=rn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=uI(this)),(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=v0(e.doc,d,u,this.dom,this)),b&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BR(this))?Hr(this,g):(rE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&bR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&h0(this,n.getBoundingClientRect(),e)}else h0(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Wl(e.slice,e.move,i<0?void 0:he.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _R(this,e)}coordsAtPos(e,n=1){return Z0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return MR(this,n||this.state,e)}pasteHTML(e,n){return Qs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qs(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(QR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Tf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,oR())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tI(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?pn&&this.root.nodeType===11&&uR(this.dom.ownerDocument)==this.dom&&vI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function $0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[wt.node(0,t.state.doc.content.size,e)]}function z0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:wt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function U0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function NI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function W0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function kI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function K0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}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:"'"},Zl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OI=typeof navigator<"u"&&/Mac/.test(navigator.platform),RI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(At=0;At<10;At++)$r[48+At]=$r[96+At]=String(At);var At;for(At=1;At<=24;At++)$r[At+111]="F"+At;var At;for(At=65;At<=90;At++)$r[At]=String.fromCharCode(At+32),Zl[At]=String.fromCharCode(At);var At;for(Xl in $r)Zl.hasOwnProperty(Xl)||(Zl[Xl]=$r[Xl]);var Xl;function xE(t){var e=OI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||RI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Zl:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var II=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=$r[r.keyCode])&&o!=i){let l=e[jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var jl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function TE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ep=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);if(!i){let s=r.blockRange(),l=s&&Lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(DE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(qo(o,"end")||he.isSelectable(o)))for(let s=r.depth;;s--){let l=Gs(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},CE=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);return i?ME(t,i,e):!1},AE=(t,e,n)=>{let r=NE(t,n);if(!r)return!1;let i=op(r);return i?ME(t,i,e):!1};function ME(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Gs(t.doc,o,u,Z.empty);if(!d||d.from!=o||d instanceof tn&&d.slice.size>=u-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(le.create(f.doc,o)),n(f.scrollIntoView())}return!0}function qo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var tp=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=np(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function np(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=NE(t,n);if(!r)return!1;let i=op(r);if(!i)return!1;let o=i.nodeAfter;if(DE(t,i,e,1))return!0;if(r.parent.content.size==0&&(qo(o,"start")||he.isSelectable(o))){let s=Gs(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,i;if(r){if(n.node.isTextblock||!rr(t.doc,n.from))return!1;i=n.from}else if(i=Fo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OE=(t,e)=>{let n=t.selection,r;if(n instanceof he){if(n.node.isTextblock||!rr(t.doc,n.to))return!1;r=n.to}else if(r=Fo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},RE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},sp=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function ap(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ap(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},cp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ap(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function PI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,u=!1,d=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),d=r.start(g)==r.pos-(r.depth-g),l=ap(r.node(g-1).contentMatchAt(r.indexAfter(g-1)));let E=t&&t(i.parent,u,r);o.unshift(E||(u&&l?{type:l}:null)),s=g;break}else{if(g==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof le||e.selection instanceof fn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=zn(f.doc,h,o.length,o);if(m||(o[0]=l?{type:l}:null,m=zn(f.doc,h,o.length,o)),f.split(h,o.length,o),!u&&d&&r.node(s).type!=l){let g=f.mapping.map(r.before(s)),b=f.doc.resolve(g);l&&r.node(s-1).canReplaceWith(b.index(),b.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(s)),l)}return n&&n(f.scrollIntoView()),!0}}var BI=PI();var IE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(he.create(t.doc,i))),!0)},FI=(t,e)=>(e&&e(t.tr.setSelection(new fn(t.doc))),!0);function HI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function DE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&HI(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let g=e.pos+o.nodeSize,b=K.empty;for(let S=s.length-1;S>=0;S--)b=K.from(s[S].create(null,b));b=K.from(i.copy(b));let E=t.tr.step(new Ct(e.pos-1,g,e.pos,g,new Z(b,1,0),s.length,!0)),w=E.doc.resolve(g+2*s.length);w.nodeAfter&&w.nodeAfter.type==i.type&&rr(E.doc,w.pos)&&E.join(w.pos),n(E.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Lr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&qo(o,"start",!0)&&qo(i,"end")){let g=i,b=[];for(;b.push(g),!g.isTextblock;)g=g.lastChild;let E=o,w=1;for(;!E.isTextblock;E=E.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,E.content)){if(n){let S=K.empty;for(let D=b.length-1;D>=0;D--)S=K.from(b[D].copy(S));let N=t.tr.step(new Ct(e.pos-b.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new Z(S,b.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function LE(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var dp=LE(-1),fp=LE(1);function PE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Bo(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function pp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=s.resolve(e.start-2);o=new Ui(u,u,e.depth),e.endIndex=0;f--)o=K.from(n[f].type.create(n[f].attrs,o));t.step(new Ct(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?WI(e,n,t,o):KI(e,n,o):!0:!1}}function WI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);oE;b--)g-=i.child(b).nodeSize,r.delete(g-1,g+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(u?K.empty:K.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Ct(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?K.empty:K.from(i.copy(K.empty))).append(u?K.empty:K.from(i.copy(K.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function HE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=K.from(d?t.create():null),h=new Z(K.from(t.create(null,K.from(l.type.create(null,f)))),d?3:1,0),m=o.start,g=o.end;n(e.tr.step(new Ct(m-(d?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}function ac(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Yo=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{let h=u(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,d=e||o.tr,f=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,g])=>[m,(...E)=>{let w=this.buildProps(d,n),S=g(...E)(w);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ac({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...f)=>d(...f)(l)]))}};return l}},yp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){let r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}};function re(t,e,n){return t.config[e]===void 0&&t.parent?re(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?re(t.parent,e,n):null}):t.config[e]}function lc(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function qE(t){let e=[],{nodeExtensions:n,markExtensions:r}=lc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},u=re(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,g])=>{e.push({type:h,name:m,attribute:{...o,...g}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=re(s,"addAttributes",l);if(!u)return;let d=u();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function Ut(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ee(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){let l=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),l.forEach(f=>{let[h,m]=f.split(":").map(g=>g.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Ep(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ee(n,r),{})}function YE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return YE(t)?e?t.bind(e)(...n):t(...n):t}function VI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function $E(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):GI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function zE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&VI(n)?!1:n!=null))}function qI(t,e){var n;let r=qE(t),{nodeExtensions:i,markExtensions:o}=lc(t),s=(n=i.find(d=>re(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,N)=>{let D=re(N,"extendNodeSchema",h);return{...S,...D?D(d):{}}},{}),g=zE({...m,content:Te(re(d,"content",h)),marks:Te(re(d,"marks",h)),group:Te(re(d,"group",h)),inline:Te(re(d,"inline",h)),atom:Te(re(d,"atom",h)),selectable:Te(re(d,"selectable",h)),draggable:Te(re(d,"draggable",h)),code:Te(re(d,"code",h)),whitespace:Te(re(d,"whitespace",h)),linebreakReplacement:Te(re(d,"linebreakReplacement",h)),defining:Te(re(d,"defining",h)),isolating:Te(re(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var N;return[S.name,{default:(N=S?.attribute)===null||N===void 0?void 0:N.default}]}))}),b=Te(re(d,"parseHTML",h));b&&(g.parseDOM=b.map(S=>$E(S,f)));let E=re(d,"renderHTML",h);E&&(g.toDOM=S=>E({node:S,HTMLAttributes:Ep(S,f)}));let w=re(d,"renderText",h);return w&&(g.toText=w),[d.name,g]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(w=>w.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((w,S)=>{let N=re(S,"extendMarkSchema",h);return{...w,...N?N(d):{}}},{}),g=zE({...m,inclusive:Te(re(d,"inclusive",h)),excludes:Te(re(d,"excludes",h)),group:Te(re(d,"group",h)),spanning:Te(re(d,"spanning",h)),code:Te(re(d,"code",h)),attrs:Object.fromEntries(f.map(w=>{var S;return[w.name,{default:(S=w?.attribute)===null||S===void 0?void 0:S.default}]}))}),b=Te(re(d,"parseHTML",h));b&&(g.parseDOM=b.map(w=>$E(w,f)));let E=re(d,"renderHTML",h);return E&&(g.toDOM=w=>E({mark:w,HTMLAttributes:Ep(w,f)})),[d.name,g]}));return new Bs({topNode:s,nodes:l,marks:u})}function mp(t,e){return e.nodes[t]||e.marks[t]||null}function UE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tp(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}var YI=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,d;let f=((d=(u=i.type.spec).toText)===null||d===void 0?void 0:d.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function Cp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Jo=class{constructor(e){this.find=e.find,this.handler=e.handler}},JI=(t,e)=>{if(Cp(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ql(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;let d=u.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=YI(d)+o;return s.forEach(m=>{if(f)return;let g=JI(h,m.find);if(!g)return;let b=u.state.tr,E=ac({state:u.state,transaction:b}),w={from:r-(g[0].length-o.length),to:i},{commands:S,chain:N,can:D}=new Yo({editor:n,state:E});m.handler({state:E,range:w,match:g,commands:S,chain:N,can:D})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:i,text:o}),u.dispatch(b),f=!0)}),f}function XI(t){let{editor:e,rules:n}=t,r=new Oe({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Tp(K.from(f),s.schema);let{from:h}=u,m=h+f.length;Ql({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Ql({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Ql({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Ql({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZI(t){return Object.prototype.toString.call(t).slice(8,-1)}function ec(t){return ZI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function cc(t,e){let n={...t};return ec(t)&&ec(e)&&Object.keys(e).forEach(r=>{ec(e[r])&&ec(t[r])?n[r]=cc(t[r],e[r]):n[r]=e[r]}),n}var st=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let u=s.find(d=>d?.type.name===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}};function jI(t){return typeof t=="number"}var vp=class{constructor(e){this.find=e.find,this.handler=e.handler}},QI=(t,e,n)=>{if(Cp(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function eD(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Yo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(g,b)=>{if(!g.isTextblock||g.type.spec.code)return;let E=Math.max(r,b),w=Math.min(i,b+g.content.size),S=g.textBetween(E-b,w-b,void 0,"\uFFFC");QI(S,o.find,s).forEach(D=>{if(D.index===void 0)return;let T=E+D.index+1,B=T+D[0].length,R={from:n.tr.mapping.map(T),to:n.tr.mapping.map(B)},Y=o.handler({state:n,range:R,match:D,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(g=>g!==null)}var tc=null,tD=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function nD(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let u=({state:f,from:h,to:m,rule:g,pasteEvt:b})=>{let E=f.tr,w=ac({state:f,transaction:E});if(!(!eD({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:b,dropEvent:l})||!E.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(f=>new Oe({view(h){let m=b=>{var E;r=!((E=h.dom.parentElement)===null||E===void 0)&&E.contains(b.target)?h.dom.parentElement:null,r&&(tc=e)},g=()=>{tc&&(tc=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,l=m,!o){let g=tc;g&&setTimeout(()=>{let b=g.state.selection;b&&g.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(h,m)=>{var g;let b=(g=m.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return s=m,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,g)=>{let b=h[0],E=b.getMeta("uiEvent")==="paste"&&!i,w=b.getMeta("uiEvent")==="drop"&&!o,S=b.getMeta("applyPasteRules"),N=!!S;if(!E&&!w&&!N)return;if(N){let{text:B}=S;typeof B=="string"?B=B:B=Tp(K.from(B),g.schema);let{from:R}=S,Y=R+B.length,ne=tD(B);return u({rule:f,state:g,from:R,to:{b:Y},pasteEvt:ne})}let D=m.doc.content.findDiffStart(g.doc.content),T=m.doc.content.findDiffEnd(g.doc.content);if(!(!jI(D)||!T||D===T.b))return u({rule:f,state:g,from:D,to:T,pasteEvt:s})}}))}function rD(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var wp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=qI(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=rD(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=re(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=re(r,"priority")||100,s=re(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:mp(n.name,this.schema)},i=re(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:mp(s.name,this.schema)},u=[],d=re(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&re(s,"exitable",l)&&(f.ArrowRight=()=>st.handleExit({editor:e,mark:s})),d){let E=Object.fromEntries(Object.entries(d()).map(([w,S])=>[w,()=>S({editor:e})]));f={...f,...E}}let h=_E(f);u.push(h);let m=re(s,"addInputRules",l);UE(s,e.options.enableInputRules)&&m&&r.push(...m());let g=re(s,"addPasteRules",l);UE(s,e.options.enablePasteRules)&&g&&i.push(...g());let b=re(s,"addProseMirrorPlugins",l);if(b){let E=b();u.push(...E)}return u}).flat();return[XI({editor:e,rules:r}),...nD({editor:e,rules:i}),...o]}get attributes(){return qE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=lc(this.extensions);return Object.fromEntries(n.filter(r=>!!re(r,"addNodeView")).map(r=>{let i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ut(r.name,this.schema)},s=re(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h,m)=>{let g=Ep(u,i);return s()({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:g})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:mp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(re(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=re(e,"onBeforeCreate",r),o=re(e,"onCreate",r),s=re(e,"onUpdate",r),l=re(e,"onSelectionUpdate",r),u=re(e,"onTransaction",r),d=re(e,"onFocus",r),f=re(e,"onBlur",r),h=re(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},We=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function JE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` +`))),0,0):Z.empty;let h=t.someProp("clipboardTextParser",m=>m(e,i,r,t));if(h)l=h;else{let m=i.marks(),{schema:b}=t.state,g=Ir.fromSchema(b);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let w=s.appendChild(document.createElement("p"));E&&w.appendChild(g.serializeNode(b.text(E,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),s=YR(n),na&&JR(s);let d=s&&s.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=s.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;s=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Rr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||f),context:i,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!VR.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=XR(R0(l,+f[1],+f[2]),f[4]);else if(l=Z.maxOpen(GR(l.content,i),!0),l.openStart||l.openEnd){let h=0,m=0;for(let b=l.content.firstChild;h{l=h(l,t)}),l}var VR=/^(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 GR(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),d;if(!u)return s=null;if(d=s.length&&o.length&&cE(u,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=uE(s[s.length-1],o.length));let f=lE(l,u);s.push(f),i=i.matchType(f.type),o=u}}),s)return K.from(s)}return t}function lE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,K.from(t));return t}function cE(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function R0(t,e,n){return en})),Sf.createHTML(t)):t}function YR(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=fE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&dE[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=qR(t),i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=K.from(u.create(r[l+1],i)),o++,s++}return new Z(i,o,s)}var hn={},mn={},ZR={touchstart:!0,touchmove:!0},Hf=class{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.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function jR(t){for(let e in hn){let n=hn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{eI(t,r)&&!Yf(t,r)&&(t.editable||!(r.type in mn))&&n(t,r)},ZR[e]?{passive:!0}:void 0)}pn&&t.dom.addEventListener("input",()=>null),$f(t)}function pi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function QR(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function $f(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Yf(t,r))})}function Yf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function eI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function tI(t,e){!Yf(t,e)&&hn[e.type]&&(t.editable||!(e.type in mn))&&hn[e.type](t,e)}mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fr&&rn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Vo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||KR(t,n)?n.preventDefault():pi(t,"key")};mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};mn.keypress=(t,e)=>{let n=e;if(hE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Un&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof le)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Jl(t){return{left:t.clientX,top:t.clientY}}function nI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Jf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Ko(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function rI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(Ko(t,new he(n),"pointer"),!0):!1}function iI(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof he&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(he.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Ko(t,he.create(t.state.doc,i),"pointer"),!0):!1}function oI(t,e,n,r,i){return Jf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?iI(t,n):rI(t,n))}function sI(t,e,n,r){return Jf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function aI(t,e,n,r){return Jf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||lI(t,n,r)}function lI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ko(t,le.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Ko(t,le.create(r,l+1,l+1+s.content.size),"pointer");else if(he.isSelectable(s))Ko(t,he.create(r,l),"pointer");else continue;return!0}}function Xf(t){return Ul(t)}var pE=Un?"metaKey":"ctrlKey";hn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&nI(n,t.input.lastClick)&&!n[pE]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Jl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zf(t,s,n,!!r)):(o=="doubleClick"?sI:aI)(t,s.pos,s.inside,n)?n.preventDefault():pi(t,"pointer"))};var zf=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pE],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let f=e.state.doc.resolve(n.pos);o=f.parent,s=f.depth?f.before():0}let l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ir&&!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)),pi(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(()=>Hr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?pi(this.view,"pointer"):oI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pn&&this.mightDrag&&!this.mightDrag.node.isAtom||rn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ko(this.view,ue.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pi(this.view,"pointer")}move(e){this.updateAllowDefault(e),pi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};hn.touchstart=t=>{t.input.lastTouch=Date.now(),Xf(t),pi(t,"pointer")};hn.touchmove=t=>{t.input.lastTouch=Date.now(),pi(t,"pointer")};hn.contextmenu=t=>Xf(t);function hE(t,e){return t.composing?!0:pn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var cI=Fr?5e3:-1;mn.compositionstart=mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ul(t,!0),t.markCursor=null;else if(Ul(t,!e.selection.empty),ir&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}mE(t,cI)};mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mE(t,20))};function mE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ul(t),e))}function gE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=dI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function uI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=aR(e.focusNode,e.focusOffset),r=lR(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function dI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ul(t,e=!1){if(!(Fr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gE(t),e||t.docView&&t.docView.dirty){let n=Gf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function fI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}var js=wn&&hi<15||Vo&&pR<604;hn.copy=mn.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=js?null:n.clipboardData,s=r.content(),{dom:l,text:u}=sE(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):fI(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function hI(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qs(t,r.value,null,i,e):Qs(t,r.textContent,r.innerHTML,i,e)},50)}function Qs(t,e,n,r,i){let o=aE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||Z.empty)))return!0;if(!o)return!1;let s=pI(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mn.paste=(t,e)=>{let n=e;if(t.composing&&!Fr)return;let r=js?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Qs(t,bE(r),r.getData("text/html"),i,n)?n.preventDefault():hI(t,n)};var Wl=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}},yE=Un?"altKey":"ctrlKey";hn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Jl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)s=he.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(s=he.create(t.state.doc,h.posBefore))}}let l=(s||t.state.selection).content(),{dom:u,text:d,slice:f}=sE(t,l);(!n.dataTransfer.files.length||!rn||G0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",js||n.dataTransfer.setData("text/plain",d),t.dragging=new Wl(f,!n[yE],s)};hn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};mn.dragover=mn.dragenter=(t,e)=>e.preventDefault();mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Jl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",g=>{s=g(s,t)}):s=aE(t,bE(n.dataTransfer),js?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[yE]);if(t.someProp("handleDrop",g=>g(t,n,s||Z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Il(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let d=t.state.tr;if(l){let{node:g}=r;g?g.replace(d):d.deleteSelection()}let f=d.mapping.map(u),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,m=d.doc;if(h?d.replaceRangeWith(f,f,s.content.firstChild):d.replaceRange(f,f,s),d.doc.eq(m))return;let b=d.doc.resolve(f);if(h&&he.isSelectable(s.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new he(b));else{let g=d.mapping.map(u);d.mapping.maps[d.mapping.maps.length-1].forEach((E,w,S,O)=>g=O),d.setSelection(qf(t,b,d.doc.resolve(g)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))};hn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Hr(t)},20))};hn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};hn.beforeinput=(t,e)=>{if(rn&&Fr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gi(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in mn)hn[t]=mn[t];function ea(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}var Kl=class t{constructor(e,n){this.toDOM=e,this.spec=n||Xi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ea(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ji=class t{constructor(e,n){this.attrs=e,this.spec=n||Xi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Xi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let d=u+r,f;if(f=vE(n,l,d)){for(i||(i=this.children.slice());ol&&h.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Ji){let d=Math.max(o,u.from)-o,f=Math.min(s,u.to)-o;di.map(e,n,Xi));return t.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let i=0;in instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let w=E-g-(b-m);for(let S=0;SO+f-h)continue;let k=l[S]+f-h;b>=k?l[S+1]=m<=k?-2:-1:m>=f&&w&&(l[S]+=w,l[S+1]+=w)}h+=w}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d=r.content.size){u=!0;continue}let m=n.map(t[d+1]+o,-1),b=m-i,{index:g,offset:E}=r.content.findIndex(h),w=r.maybeChild(g);if(w&&E==h&&E+w.nodeSize==b){let S=l[d+2].mapInner(n,w,f+1,t[d]+o+1,s);S!=nn?(l[d]=h,l[d+1]=b,l[d+2]=S):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=gI(l,t,e,n,i,o,s),f=Gl(d,r,0,s);e=f.local;for(let h=0;hn&&s.to{let d=vE(t,l,u+n);if(d){o=!0;let f=Gl(d,l,n+u+1,r);f!=nn&&i.push(u,u+l.nodeSize,f)}});let s=EE(o?wE(t):t,-n).sort(Zi);for(let l=0;l0;)e++;t.splice(e,0,n)}function Tf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nn&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),Vl.from(e)}var bI={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yI=wn&&hi<=11,Wf=class{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}},Kf=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Wf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),yI&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,bI)),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 n=0;nthis.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(C0(this.view)){if(this.suppressingSelectionUpdates)return Hr(this.view);if(wn&&hi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ji(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 n=new Set,r;for(let o=e.focusNode;o;o=Zs(o))n.add(o);for(let o=e.anchorNode;o;o=Zs(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&C0(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let f=0;fh.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let b=m.parentNode;b&&b.nodeName=="LI"&&(!h||wI(e,h)!=b)&&m.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),EI(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Hr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;fi;w--){let S=r.childNodes[w-1],O=S.pmViewDesc;if(S.nodeName=="BR"&&!O){o=w;break}if(!O||O.size)break}let h=t.state.doc,m=t.someProp("domParser")||Rr.fromSchema(t.state.schema),b=h.resolve(s),g=null,E=m.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:i,to:o,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:_I,context:b});if(d&&d[0].pos!=null){let w=d[0].pos,S=d[1]&&d[1].pos;S==null&&(S=w),g={anchor:w+s,head:S+s}}return{doc:E,sel:g,from:s,to:l}}function _I(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(pn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||pn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}var SI=/^(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 TI(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let q=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,Q=Gf(t,q);if(Q&&!t.state.selection.eq(Q)){if(rn&&Fr&&t.input.lastKeyCode===13&&Date.now()-100we(t,Gi(13,"Enter"))))return;let fe=t.state.tr.setSelection(Q);q=="pointer"?fe.setMeta("pointer",!0):q=="key"&&fe.scrollIntoView(),o&&fe.setMeta("composition",o),t.dispatch(fe)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=xI(t,e,n),f=t.state.doc,h=f.slice(d.from,d.to),m,b;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Fr)&&i.some(q=>q.nodeType==1&&!SI.test(q.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",q=>q(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(r&&u instanceof le&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))g={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let q=F0(t,t.state.doc,d.sel);if(q&&!q.eq(t.state.selection)){let Q=t.state.tr.setSelection(q);o&&Q.setMeta("composition",o),t.dispatch(Q)}}return}t.state.selection.fromt.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?g.start=t.state.selection.from:g.endA=t.state.selection.to-2&&t.state.selection.to<=d.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),wn&&hi<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>d.from&&d.doc.textBetween(g.start-d.from-1,g.start-d.from+1)==" \xA0"&&(g.start--,g.endA--,g.endB--);let E=d.doc.resolveNoCache(g.start-d.from),w=d.doc.resolveNoCache(g.endB-d.from),S=f.resolve(g.start),O=E.sameParent(w)&&E.parent.inlineContent&&S.end()>=g.endA,k;if((Vo&&t.input.lastIOSEnter>Date.now()-225&&(!O||i.some(q=>q.nodeName=="DIV"||q.nodeName=="P"))||!O&&E.posq(t,Gi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&AI(f,g.start,g.endA,E,w)&&t.someProp("handleKeyDown",q=>q(t,Gi(8,"Backspace")))){Fr&&rn&&t.domObserver.suppressSelectionUpdates();return}rn&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),Fr&&!O&&E.start()!=w.start()&&w.parentOffset==0&&E.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==g.endA&&(g.endB-=2,w=d.doc.resolveNoCache(g.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(q){return q(t,Gi(13,"Enter"))})},20));let T=g.start,P=g.endA,I,Y,ne;if(O){if(E.pos==w.pos)wn&&hi<=11&&E.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Hr(t),20)),I=t.state.tr.delete(T,P),Y=f.resolve(g.start).marksAcross(f.resolve(g.endA));else if(g.endA==g.endB&&(ne=CI(E.parent.content.cut(E.parentOffset,w.parentOffset),S.parent.content.cut(S.parentOffset,g.endA-S.start()))))I=t.state.tr,ne.type=="add"?I.addMark(T,P,ne.mark):I.removeMark(T,P,ne.mark);else if(E.parent.child(E.index()).isText&&E.index()==w.index()-(w.textOffset?0:1)){let q=E.parent.textBetween(E.parentOffset,w.parentOffset);if(t.someProp("handleTextInput",Q=>Q(t,T,P,q)))return;I=t.state.tr.insertText(q,T,P)}}if(I||(I=t.state.tr.replace(T,P,d.doc.slice(g.start-d.from,g.endB-d.from))),d.sel){let q=F0(t,I.doc,d.sel);q&&!(rn&&t.composing&&q.empty&&(g.start!=g.endB||t.input.lastChromeDeletee.content.size?null:qf(t,e.resolve(n.anchor),e.resolve(n.head))}function CI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let f=0;ff.mark(l.addToSet(f.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;fn||Cf(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function MI(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,o&&o=l?o-r:0;o-=u,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}var ql=class{constructor(e,n){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 Hf,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(K0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=U0(this),z0(this),this.nodeViews=W0(this),this.docView=v0(this.state.doc,$0(this),Tf(this),this.dom,this),this.domObserver=new Kf(this,(r,i,o,s)=>TI(this,r,i,o,s)),this.domObserver.start(),jR(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&$f(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(K0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(gE(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let b=W0(this);kI(b,this.nodeViews)&&(this.nodeViews=b,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&$f(this),this.editable=U0(this),z0(this);let u=Tf(this),d=$0(this),f=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=o||!this.docView.matchesNode(e.doc,d,u);(h||!e.selection.eq(i.selection))&&(s=!0);let m=f=="preserve"&&s&&this.dom.style.overflowAnchor==null&&gR(this);if(s){this.domObserver.stop();let b=h&&(wn||rn)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&NI(i.selection,e.selection);if(h){let g=rn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=uI(this)),(o||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=v0(e.doc,d,u,this.dom,this)),g&&!this.trackWrites&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BR(this))?Hr(this,b):(rE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&bR(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof he){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&h0(this,n.getBoundingClientRect(),e)}else h0(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Wl(e.slice,e.move,i<0?void 0:he.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _R(this,e)}coordsAtPos(e,n=1){return Z0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return MR(this,n||this.state,e)}pasteHTML(e,n){return Qs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Qs(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(QR(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Tf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,oR())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return tI(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?pn&&this.root.nodeType===11&&uR(this.dom.ownerDocument)==this.dom&&vI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function $0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[wt.node(0,t.state.doc.content.size,e)]}function z0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:wt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function U0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function NI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function W0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function kI(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function K0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}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:"'"},Zl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},OI=typeof navigator<"u"&&/Mac/.test(navigator.platform),RI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(At=0;At<10;At++)$r[48+At]=$r[96+At]=String(At);var At;for(At=1;At<=24;At++)$r[At+111]="F"+At;var At;for(At=65;At<=90;At++)$r[At]=String.fromCharCode(At+32),Zl[At]=String.fromCharCode(At);var At;for(Xl in $r)Zl.hasOwnProperty(Xl)||(Zl[Xl]=$r[Xl]);var Xl;function xE(t){var e=OI&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||RI&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Zl:$r)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var II=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function DI(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=$r[r.keyCode])&&o!=i){let l=e[jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var jl=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function TE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var ep=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);if(!i){let s=r.blockRange(),l=s&&Lr(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(DE(t,i,e,-1))return!0;if(r.parent.content.size==0&&(qo(o,"end")||he.isSelectable(o)))for(let s=r.depth;;s--){let l=Gs(t.doc,r.before(s),r.after(s),Z.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},CE=(t,e,n)=>{let r=TE(t,n);if(!r)return!1;let i=np(r);return i?ME(t,i,e):!1},AE=(t,e,n)=>{let r=NE(t,n);if(!r)return!1;let i=op(r);return i?ME(t,i,e):!1};function ME(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let f=i.lastChild;if(!f)return!1;i=f}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=Gs(t.doc,o,u,Z.empty);if(!d||d.from!=o||d instanceof tn&&d.slice.size>=u-o)return!1;if(n){let f=t.tr.step(d);f.setSelection(le.create(f.doc,o)),n(f.scrollIntoView())}return!0}function qo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var tp=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=np(r)}let s=o&&o.nodeBefore;return!s||!he.isSelectable(s)?!1:(e&&e(t.tr.setSelection(he.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function np(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function NE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=NE(t,n);if(!r)return!1;let i=op(r);if(!i)return!1;let o=i.nodeAfter;if(DE(t,i,e,1))return!0;if(r.parent.content.size==0&&(qo(o,"start")||he.isSelectable(o))){let s=Gs(t.doc,r.before(),r.after(),Z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof he,i;if(r){if(n.node.isTextblock||!rr(t.doc,n.from))return!1;i=n.from}else if(i=Fo(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(he.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},OE=(t,e)=>{let n=t.selection,r;if(n instanceof he){if(n.node.isTextblock||!rr(t.doc,n.to))return!1;r=n.to}else if(r=Fo(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},RE=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Lr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},sp=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function ap(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ap(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ue.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},cp=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof fn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ap(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(zn(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Lr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function PI(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof he&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,u=!1,d=!1;for(let b=r.depth;;b--)if(r.node(b).isBlock){u=r.end(b)==r.pos+(r.depth-b),d=r.start(b)==r.pos-(r.depth-b),l=ap(r.node(b-1).contentMatchAt(r.indexAfter(b-1)));let E=t&&t(i.parent,u,r);o.unshift(E||(u&&l?{type:l}:null)),s=b;break}else{if(b==1)return!1;o.unshift(null)}let f=e.tr;(e.selection instanceof le||e.selection instanceof fn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=zn(f.doc,h,o.length,o);if(m||(o[0]=l?{type:l}:null,m=zn(f.doc,h,o.length,o)),f.split(h,o.length,o),!u&&d&&r.node(s).type!=l){let b=f.mapping.map(r.before(s)),g=f.doc.resolve(b);l&&r.node(s-1).canReplaceWith(g.index(),g.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(s)),l)}return n&&n(f.scrollIntoView()),!0}}var BI=PI();var IE=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(he.create(t.doc,i))),!0)},FI=(t,e)=>(e&&e(t.tr.setSelection(new fn(t.doc))),!0);function HI(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||rr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function DE(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,u=i.type.spec.isolating||o.type.spec.isolating;if(!u&&HI(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let b=e.pos+o.nodeSize,g=K.empty;for(let S=s.length-1;S>=0;S--)g=K.from(s[S].create(null,g));g=K.from(i.copy(g));let E=t.tr.step(new Ct(e.pos-1,b,e.pos,b,new Z(g,1,0),s.length,!0)),w=E.doc.resolve(b+2*s.length);w.nodeAfter&&w.nodeAfter.type==i.type&&rr(E.doc,w.pos)&&E.join(w.pos),n(E.scrollIntoView())}return!0}let f=o.type.spec.isolating||r>0&&u?null:ue.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Lr(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&qo(o,"start",!0)&&qo(i,"end")){let b=i,g=[];for(;g.push(b),!b.isTextblock;)b=b.lastChild;let E=o,w=1;for(;!E.isTextblock;E=E.firstChild)w++;if(b.canReplace(b.childCount,b.childCount,E.content)){if(n){let S=K.empty;for(let k=g.length-1;k>=0;k--)S=K.from(g[k].copy(S));let O=t.tr.step(new Ct(e.pos-g.length,e.pos+o.nodeSize,e.pos+w,e.pos+o.nodeSize-w,new Z(S,g.length,0),0,!0));n(O.scrollIntoView())}return!0}}return!1}function LE(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var dp=LE(-1),fp=LE(1);function PE(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Bo(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function pp(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let f=n.doc.resolve(d),h=f.index();i=f.parent.canReplaceWith(h,h+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=s.resolve(e.start-2);o=new Ui(u,u,e.depth),e.endIndex=0;f--)o=K.from(n[f].type.create(n[f].attrs,o));t.step(new Ct(e.start-(r?2:0),e.end,e.start,e.end,new Z(o,0,0),n.length,!0));let s=0;for(let f=0;fs.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?WI(e,n,t,o):KI(e,n,o):!0:!1}}function WI(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);oE;g--)b-=i.child(g).nodeSize,r.delete(b-1,b+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(l?0:1),f+1,s.content.append(u?K.empty:K.from(i))))return!1;let h=o.pos,m=h+s.nodeSize;return r.step(new Ct(h-(l?1:0),m+(u?1:0),h+1,m-1,new Z((l?K.empty:K.from(i.copy(K.empty))).append(u?K.empty:K.from(i.copy(K.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function HE(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=K.from(d?t.create():null),h=new Z(K.from(t.create(null,K.from(l.type.create(null,f)))),d?3:1,0),m=o.start,b=o.end;n(e.tr.step(new Ct(m-(d?3:1),b,m,b,h,1,!0)).scrollIntoView())}return!0}}function ac(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Yo=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{let h=u(...f)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,d=e||o.tr,f=()=>(!u&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,b])=>[m,(...E)=>{let w=this.buildProps(d,n),S=b(...E)(w);return l.push(S),h}])),run:f};return h}createCan(e){let{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,d])=>[u,(...f)=>d(...f)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){let{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:ac({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,d])=>[u,(...f)=>d(...f)(l)]))}};return l}},yp=class{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){let r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){let r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}once(e,n){let r=(...i)=>{this.off(e,r),n.apply(this,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}};function re(t,e,n){return t.config[e]===void 0&&t.parent?re(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?re(t.parent,e,n):null}):t.config[e]}function lc(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function qE(t){let e=[],{nodeExtensions:n,markExtensions:r}=lc(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},u=re(s,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,b])=>{e.push({type:h,name:m,attribute:{...o,...b}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},u=re(s,"addAttributes",l);if(!u)return;let d=u();Object.entries(d).forEach(([f,h])=>{let m={...o,...h};typeof m?.default=="function"&&(m.default=m.default()),m?.isRequired&&m?.default===void 0&&delete m.default,e.push({type:s.name,name:f,attribute:m})})}),e}function Ut(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ee(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],u=r[i]?r[i].split(" "):[],d=l.filter(f=>!u.includes(f));r[i]=[...u,...d].join(" ")}else if(i==="style"){let l=o?o.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[i]?r[i].split(";").map(f=>f.trim()).filter(Boolean):[],d=new Map;u.forEach(f=>{let[h,m]=f.split(":").map(b=>b.trim());d.set(h,m)}),l.forEach(f=>{let[h,m]=f.split(":").map(b=>b.trim());d.set(h,m)}),r[i]=Array.from(d.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[i]=o}),r},{})}function Ep(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ee(n,r),{})}function YE(t){return typeof t=="function"}function Te(t,e=void 0,...n){return YE(t)?e?t.bind(e)(...n):t(...n):t}function VI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function GI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function $E(t,e){return"style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(n):GI(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function zE(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&VI(n)?!1:n!=null))}function qI(t,e){var n;let r=qE(t),{nodeExtensions:i,markExtensions:o}=lc(t),s=(n=i.find(d=>re(d,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(d=>{let f=r.filter(S=>S.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,O)=>{let k=re(O,"extendNodeSchema",h);return{...S,...k?k(d):{}}},{}),b=zE({...m,content:Te(re(d,"content",h)),marks:Te(re(d,"marks",h)),group:Te(re(d,"group",h)),inline:Te(re(d,"inline",h)),atom:Te(re(d,"atom",h)),selectable:Te(re(d,"selectable",h)),draggable:Te(re(d,"draggable",h)),code:Te(re(d,"code",h)),whitespace:Te(re(d,"whitespace",h)),linebreakReplacement:Te(re(d,"linebreakReplacement",h)),defining:Te(re(d,"defining",h)),isolating:Te(re(d,"isolating",h)),attrs:Object.fromEntries(f.map(S=>{var O;return[S.name,{default:(O=S?.attribute)===null||O===void 0?void 0:O.default}]}))}),g=Te(re(d,"parseHTML",h));g&&(b.parseDOM=g.map(S=>$E(S,f)));let E=re(d,"renderHTML",h);E&&(b.toDOM=S=>E({node:S,HTMLAttributes:Ep(S,f)}));let w=re(d,"renderText",h);return w&&(b.toText=w),[d.name,b]})),u=Object.fromEntries(o.map(d=>{let f=r.filter(w=>w.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((w,S)=>{let O=re(S,"extendMarkSchema",h);return{...w,...O?O(d):{}}},{}),b=zE({...m,inclusive:Te(re(d,"inclusive",h)),excludes:Te(re(d,"excludes",h)),group:Te(re(d,"group",h)),spanning:Te(re(d,"spanning",h)),code:Te(re(d,"code",h)),attrs:Object.fromEntries(f.map(w=>{var S;return[w.name,{default:(S=w?.attribute)===null||S===void 0?void 0:S.default}]}))}),g=Te(re(d,"parseHTML",h));g&&(b.parseDOM=g.map(w=>$E(w,f)));let E=re(d,"renderHTML",h);return E&&(b.toDOM=w=>E({mark:w,HTMLAttributes:Ep(w,f)})),[d.name,b]}));return new Bs({topNode:s,nodes:l,marks:u})}function mp(t,e){return e.nodes[t]||e.marks[t]||null}function UE(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tp(t,e){let n=Ir.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}var YI=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,d;let f=((d=(u=i.type.spec).toText)===null||d===void 0?void 0:d.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-o))}),n};function Cp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var Jo=class{constructor(e){this.find=e.find,this.handler=e.handler}},JI=(t,e)=>{if(Cp(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ql(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;let d=u.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1,h=YI(d)+o;return s.forEach(m=>{if(f)return;let b=JI(h,m.find);if(!b)return;let g=u.state.tr,E=ac({state:u.state,transaction:g}),w={from:r-(b[0].length-o.length),to:i},{commands:S,chain:O,can:k}=new Yo({editor:n,state:E});m.handler({state:E,range:w,match:b,commands:S,chain:O,can:k})===null||!g.steps.length||(g.setMeta(l,{transform:g,from:r,to:i,text:o}),u.dispatch(g),f=!0)}),f}function XI(t){let{editor:e,rules:n}=t,r=new Oe({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let u=i.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Tp(K.from(f),s.schema);let{from:h}=u,m=h+f.length;Ql({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Ql({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Ql({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Ql({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function ZI(t){return Object.prototype.toString.call(t).slice(8,-1)}function ec(t){return ZI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function cc(t,e){let n={...t};return ec(t)&&ec(e)&&Object.keys(e).forEach(r=>{ec(e[r])&&ec(t[r])?n[r]=cc(t[r],e[r]):n[r]=e[r]}),n}var st=class t{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(d=>d?.type.name===n.name))return!1;let u=s.find(d=>d?.type.name===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}};function jI(t){return typeof t=="number"}var vp=class{constructor(e){this.find=e.find,this.handler=e.handler}},QI=(t,e,n)=>{if(Cp(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function eD(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Yo({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(b,g)=>{if(!b.isTextblock||b.type.spec.code)return;let E=Math.max(r,g),w=Math.min(i,g+b.content.size),S=b.textBetween(E-g,w-g,void 0,"\uFFFC");QI(S,o.find,s).forEach(k=>{if(k.index===void 0)return;let T=E+k.index+1,P=T+k[0].length,I={from:n.tr.mapping.map(T),to:n.tr.mapping.map(P)},Y=o.handler({state:n,range:I,match:k,commands:u,chain:d,can:f,pasteEvent:s,dropEvent:l});h.push(Y)})}),h.every(b=>b!==null)}var tc=null,tD=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function nD(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let u=({state:f,from:h,to:m,rule:b,pasteEvt:g})=>{let E=f.tr,w=ac({state:f,transaction:E});if(!(!eD({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:b,pasteEvent:g,dropEvent:l})||!E.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return n.map(f=>new Oe({view(h){let m=g=>{var E;r=!((E=h.dom.parentElement)===null||E===void 0)&&E.contains(g.target)?h.dom.parentElement:null,r&&(tc=e)},b=()=>{tc&&(tc=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(o=r===h.dom.parentElement,l=m,!o){let b=tc;b&&setTimeout(()=>{let g=b.state.selection;g&&b.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(h,m)=>{var b;let g=(b=m.clipboardData)===null||b===void 0?void 0:b.getData("text/html");return s=m,i=!!g?.includes("data-pm-slice"),!1}}},appendTransaction:(h,m,b)=>{let g=h[0],E=g.getMeta("uiEvent")==="paste"&&!i,w=g.getMeta("uiEvent")==="drop"&&!o,S=g.getMeta("applyPasteRules"),O=!!S;if(!E&&!w&&!O)return;if(O){let{text:P}=S;typeof P=="string"?P=P:P=Tp(K.from(P),b.schema);let{from:I}=S,Y=I+P.length,ne=tD(P);return u({rule:f,state:b,from:I,to:{b:Y},pasteEvt:ne})}let k=m.doc.content.findDiffStart(b.doc.content),T=m.doc.content.findDiffEnd(b.doc.content);if(!(!jI(k)||!T||k===T.b))return u({rule:f,state:b,from:k,to:T,pasteEvt:s})}}))}function rD(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}var wp=class t{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=t.resolve(e),this.schema=qI(this.extensions,n),this.setupExtensions()}static resolve(e){let n=t.sort(t.flatten(e)),r=rD(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{let r={name:n.name,options:n.options,storage:n.storage},i=re(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{let o=re(r,"priority")||100,s=re(i,"priority")||100;return o>s?-1:o{let r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:mp(n.name,this.schema)},i=re(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){let{editor:e}=this,n=t.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{let l={name:s.name,options:s.options,storage:s.storage,editor:e,type:mp(s.name,this.schema)},u=[],d=re(s,"addKeyboardShortcuts",l),f={};if(s.type==="mark"&&re(s,"exitable",l)&&(f.ArrowRight=()=>st.handleExit({editor:e,mark:s})),d){let E=Object.fromEntries(Object.entries(d()).map(([w,S])=>[w,()=>S({editor:e})]));f={...f,...E}}let h=_E(f);u.push(h);let m=re(s,"addInputRules",l);UE(s,e.options.enableInputRules)&&m&&r.push(...m());let b=re(s,"addPasteRules",l);UE(s,e.options.enablePasteRules)&&b&&i.push(...b());let g=re(s,"addProseMirrorPlugins",l);if(g){let E=g();u.push(...E)}return u}).flat();return[XI({editor:e,rules:r}),...nD({editor:e,rules:i}),...o]}get attributes(){return qE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:n}=lc(this.extensions);return Object.fromEntries(n.filter(r=>!!re(r,"addNodeView")).map(r=>{let i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ut(r.name,this.schema)},s=re(r,"addNodeView",o);if(!s)return[];let l=(u,d,f,h,m)=>{let b=Ep(u,i);return s()({node:u,view:d,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:b})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;let r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:mp(e.name,this.schema)};e.type==="mark"&&(!((n=Te(re(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);let i=re(e,"onBeforeCreate",r),o=re(e,"onCreate",r),s=re(e,"onUpdate",r),l=re(e,"onSelectionUpdate",r),u=re(e,"onTransaction",r),d=re(e,"onFocus",r),f=re(e,"onBlur",r),h=re(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}},We=class t{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function JE(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=o);let g=s?.[u.type.name];if(g)return f&&(l+=g({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function uc(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var iD=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Oe({key:new ze("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),u=uc(n);return JE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),oD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),sD=(t=!1)=>({commands:e})=>e.setContent("",t),aD=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),g=h.blockRange(m);if(!g)return;let b=Lr(g);if(l.type.isTextblock){let{defaultType:E}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,E)}(b||b===0)&&e.lift(g,b)})}),!0},lD=t=>e=>t(e),cD=()=>({state:t,dispatch:e})=>cp(t,e),uD=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},dD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},fD=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let u=o.before(s),d=o.after(s);e.delete(u,d).scrollIntoView()}return!0}return!1},pD=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},hD=()=>({state:t,dispatch:e})=>jl(t,e),mD=()=>({commands:t})=>t.keyboardShortcut("Enter"),gD=()=>({state:t,dispatch:e})=>lp(t,e);function ic(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function XE(t,e,n={}){return t.find(r=>r.type===e&&ic(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function WE(t,e,n={}){return!!XE(t,e,n)}function Ap(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!XE([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,u=s+1,d=l+i.node.nodeSize;for(;s>0&&WE([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;u({tr:n,state:r,dispatch:i})=>{let o=yi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=Ap(u,o,e);if(h&&h.from<=d&&h.to>=f){let m=le.create(s,h.from,h.to);n.setSelection(m)}}return!0},yD=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!dc(n.state.selection))return s(),!0;let l=ZE(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},vD=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),wD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jE(r)}return t};function nc(t){let e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jE(n)}function oc(t,e,n){if(t instanceof $n||t instanceof K)return t;n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return K.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),oc("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",u=new Bs({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Rr.fromSchema(u).parseSlice(nc(t),n.parseOptions):Rr.fromSchema(u).parse(nc(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Rr.fromSchema(e);return n.slice?o.parseSlice(nc(t),n.parseOptions).content:o.parse(nc(t),n.parseOptions)}return oc("",e,n)}function xD(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var _D=t=>!("type"in t),SD=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=oc(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(b){return o.emit("contentError",{editor:o,error:b,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((_D(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),u===d&&h){let{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,d+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof K){let b="";e.forEach(E=>{E.text&&(b+=E.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,d)}else g=l,r.replaceWith(u,d,g);n.updateSelection&&xD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},TD=()=>({state:t,dispatch:e})=>kE(t,e),CD=()=>({state:t,dispatch:e})=>OE(t,e),AD=()=>({state:t,dispatch:e})=>ep(t,e),MD=()=>({state:t,dispatch:e})=>rp(t,e),ND=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},OD=()=>({state:t,dispatch:e})=>CE(t,e),RD=()=>({state:t,dispatch:e})=>AE(t,e);function QE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ev(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ID(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=ID(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function ia(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let g=Math.max(r,m),b=Math.min(i,m+h.nodeSize);l.push({node:h,from:g,to:b})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ic(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var LD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?RE(n,r):!1},PD=()=>({state:t,dispatch:e})=>up(t,e),BD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return FE(r)(e,n)},FD=()=>({state:t,dispatch:e})=>sp(t,e);function fc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var HD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,KE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(KE(h.attrs,e)))})})}),!0):!1},$D=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),zD=()=>({tr:t,dispatch:e})=>{if(e){let n=new fn(t.doc);t.setSelection(n)}return!0},UD=()=>({state:t,dispatch:e})=>tp(t,e),WD=()=>({state:t,dispatch:e})=>ip(t,e),KD=()=>({state:t,dispatch:e})=>IE(t,e),VD=()=>({state:t,dispatch:e})=>fp(t,e),GD=()=>({state:t,dispatch:e})=>dp(t,e);function xp(t,e,n={},r={}){return oc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var qD=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var u,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=xp(t,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function tv(t,e){let n=yi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});let l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function nv(t,e){let n=new ui(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Mp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function rv(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Np(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function to(t){return e=>Np(e.$from,t)}function kp(t,e){let n={from:0,to:t.content.size};return JE(t,n,e)}function YD(t,e){let n=Ut(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Op(t,e){let n=fc(typeof e=="string"?e:e.name,t.schema);return n==="node"?YD(t,e):n==="mark"?tv(t,e):{}}function JD(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function XD(t){let e=JD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function iv(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{let{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),XD(r)}function pc(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=Ap(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function rc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function _p(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?yi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>ic(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let g=h.pos,b=m.pos;t.doc.nodesBetween(g,b,(E,w)=>{if(!E.isText&&!E.marks.length)return;let S=Math.max(g,w),N=Math.min(b,w+E.nodeSize),D=N-S;s+=D,l.push(...E.marks.map(T=>({mark:T,from:S,to:N})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>ic(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function Ur(t,e,n={}){if(!e)return ia(t,null,n)||_p(t,null,n);let r=fc(e,t.schema);return r==="node"?ia(t,e,n):r==="mark"?_p(t,e,n):!1}function VE(t,e){let{nodeExtensions:n}=lc(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(re(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function oa(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(oa(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function hc(t){return t instanceof he}function mc(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),g=m-h,b=f-d,S={top:d,bottom:f,left:h,right:m,width:g,height:b,x:h,y:d};return{...S,toJSON:()=>S}}function ZD(t,e,n){var r;let{selection:i}=e,o=null;if(dc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let g=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(E=>E.type.excludes(n));d=g&&b}return!d}),d})}var jD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=yi(t,r.schema);if(i)if(s){let d=tv(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{let b=Math.max(g,f),E=Math.min(g+m.nodeSize,h);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(b,E,u.create({...S.attrs,...e}))}):n.addMark(b,E,u.create(e))})});return ZD(r,n,u)},QD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),eL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>pp(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>pp(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},nL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,l=le.atEnd(r).to,u=zr(i,s,l),d=zr(o,s,l),f=le.create(r,u,d);e.setSelection(f)}return!0},rL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return HE(r)(e,n)};function GE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var iL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:u}=o,d=i.extensionManager.attributes,f=rc(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&GE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:Mp(l.node(-1).contentMatchAt(l.indexAfter(-1))),g=h&&m?[{type:m,attrs:f}]:void 0,b=zn(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(b&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let E=e.mapping.map(l.before()),w=e.doc.resolve(E);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&GE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},oL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=Ut(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;let h=u.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=K.empty,N=u.index(-1)?1:u.index(-2)?2:3;for(let ne=u.depth-N;ne>=u.depth-3;ne-=1)S=K.from(u.node(ne).copy(S));let D=u.indexAfter(-1){if(Y>-1)return!1;ne.isTextblock&&ne.content.size===0&&(Y=q+1)}),Y>-1&&n.setSelection(le.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let g=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,b={...rc(m,h.type.name,h.attrs),...e},E={...rc(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);let w=g?[{type:l,attrs:b},{type:g,attrs:E}]:[{type:l,attrs:b}];if(!zn(n.doc,u.pos,2))return!1;if(i){let{selection:S,storedMarks:N}=r,{splittableMarks:D}=o.extensionManager,T=N||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!T||!i)return!0;let B=T.filter(R=>D.includes(R.type.name));n.ensureMarks(B)}return!0},gp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,n.pos)&&t.join(n.pos),!0},bp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,r)&&t.join(r),!0},sL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,g=Ut(t,s.schema),b=Ut(e,s.schema),{selection:E,storedMarks:w}=s,{$from:S,$to:N}=E,D=S.blockRange(N),T=w||E.$to.parentOffset&&E.$from.marks();if(!D)return!1;let B=to(R=>VE(R.type.name,h))(E);if(D.depth>=1&&B&&D.depth-B.depth<=1){if(B.node.type===g)return d.liftListItem(b);if(VE(B.node.type.name,h)&&g.validContent(B.node.content)&&l)return u().command(()=>(o.setNodeMarkup(B.pos,g),!0)).command(()=>gp(o,g)).command(()=>bp(o,g)).run()}return!n||!T||!l?u().command(()=>f().wrapInList(g,r)?!0:d.clearNodes()).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run():u().command(()=>{let R=f().wrapInList(g,r),Y=T.filter(ne=>m.includes(ne.type.name));return o.ensureMarks(Y),R?!0:d.clearNodes()}).wrapInList(g,r).command(()=>gp(o,g)).command(()=>bp(o,g)).run()},aL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=yi(t,r.schema);return _p(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lL=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema),l=ia(r,o,n),u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(s,u):i.setNode(o,{...u,...n})},cL=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?r.lift(i):r.wrapIn(i,e)},uL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},dL=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},fL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=yi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:g}=l,b=(o=d.marks().find(w=>w.type===u))===null||o===void 0?void 0:o.attrs,E=Ap(d,u,b);E&&(m=E.from,g=E.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},pL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{let d=u.$from.pos,f=u.$to.pos,h,m,g,b;n.selection.empty?r.doc.nodesBetween(d,f,(E,w)=>{o&&o===E.type&&(g=Math.max(w,d),b=Math.min(w+E.nodeSize,f),h=w,m=E)}):r.doc.nodesBetween(d,f,(E,w)=>{w=d&&w<=f&&(o&&o===E.type&&n.setNodeMarkup(w,void 0,{...E.attrs,...e}),s&&E.marks.length&&E.marks.forEach(S=>{if(s===S.type){let N=Math.max(w,d),D=Math.min(w+E.nodeSize,f);n.addMark(N,D,s.create({...S.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(E=>{s===E.type&&n.addMark(g,b,s.create({...E.attrs,...e}))}))}),!0):!1},hL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return PE(i,e)(n,r)},mL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return BE(i,e)(n,r)},gL=Object.freeze({__proto__:null,blur:oD,clearContent:sD,clearNodes:aD,command:lD,createParagraphNear:cD,cut:uD,deleteCurrentNode:dD,deleteNode:fD,deleteRange:pD,deleteSelection:hD,enter:mD,exitCode:gD,extendMarkRange:bD,first:yD,focus:ED,forEach:vD,insertContent:wD,insertContentAt:SD,joinBackward:AD,joinDown:CD,joinForward:MD,joinItemBackward:ND,joinItemForward:kD,joinTextblockBackward:OD,joinTextblockForward:RD,joinUp:TD,keyboardShortcut:DD,lift:LD,liftEmptyBlock:PD,liftListItem:BD,newlineInCode:FD,resetAttributes:HD,scrollIntoView:$D,selectAll:zD,selectNodeBackward:UD,selectNodeForward:WD,selectParentNode:KD,selectTextblockEnd:VD,selectTextblockStart:GD,setContent:qD,setMark:jD,setMeta:QD,setNode:eL,setNodeSelection:tL,setTextSelection:nL,sinkListItem:rL,splitBlock:iL,splitListItem:oL,toggleList:sL,toggleMark:aL,toggleNode:lL,toggleWrap:cL,undoInputRule:uL,unsetAllMarks:dL,unsetMark:fL,updateAttributes:pL,wrapIn:hL,wrapInList:mL}),bL=We.create({name:"commands",addCommands(){return{...gL}}}),yL=We.create({name:"drop",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),EL=We.create({name:"editable",addProseMirrorPlugins(){return[new Oe({key:new ze("editable"),props:{editable:()=>this.editor.options.editable}})]}}),vL=We.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Oe({key:new ze("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wL=We.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,E=b.parent.type.spec.isolating,w=h.pos-h.parentOffset,S=E&&b.parent.childCount===1?w===h.pos:ue.atStart(d).from===m;return!f||!g.type.isTextblock||g.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return QE()||ev()?o:i},addProseMirrorPlugins(){return[new Oe({key:new ze("clearDocument"),appendTransaction:(t,e,n)=>{let r=t.some(E=>E.docChanged)&&!e.doc.eq(n.doc),i=t.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,u=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===u&&l===d)||!oa(n.doc))return;let m=n.tr,g=ac({state:n,transaction:m}),{commands:b}=new Yo({editor:this.editor,state:g});if(b.clearNodes(),!!m.steps.length)return m}})]}}),xL=We.create({name:"paste",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_L=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Oe({key:new ze("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Sp=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let u=new t(l,this.editor,i,i?n:null);i&&(u.actualDepth=this.depth+1),e.push(new t(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},SL=`.ProseMirror { +`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,i,(u,d,f,h)=>{var m;u.isBlock&&d>r&&(l+=o);let b=s?.[u.type.name];if(b)return f&&(l+=b({node:u,pos:d,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u?.text)===null||m===void 0?void 0:m.slice(Math.max(r,d)-d,i-d))}),l}function uc(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}var iD=We.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Oe({key:new ze("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(f=>f.$from.pos)),l=Math.max(...o.map(f=>f.$to.pos)),u=uc(n);return JE(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),oD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),sD=(t=!1)=>({commands:e})=>e.setContent("",t),aD=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;let{doc:d,mapping:f}=e,h=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),b=h.blockRange(m);if(!b)return;let g=Lr(b);if(l.type.isTextblock){let{defaultType:E}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(b.start,E)}(g||g===0)&&e.lift(b,g)})}),!0},lD=t=>e=>t(e),cD=()=>({state:t,dispatch:e})=>cp(t,e),uD=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new le(r.doc.resolve(s-1))),!0},dD=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},fD=t=>({tr:e,state:n,dispatch:r})=>{let i=Ut(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let u=o.before(s),d=o.after(s);e.delete(u,d).scrollIntoView()}return!0}return!1},pD=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},hD=()=>({state:t,dispatch:e})=>jl(t,e),mD=()=>({commands:t})=>t.keyboardShortcut("Enter"),gD=()=>({state:t,dispatch:e})=>lp(t,e);function ic(t,e,n={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Cp(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function XE(t,e,n={}){return t.find(r=>r.type===e&&ic(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function WE(t,e,n={}){return!!XE(t,e,n)}function Ap(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!XE([...i.node.marks],e,n)))return;let s=i.index,l=t.start()+i.offset,u=s+1,d=l+i.node.nodeSize;for(;s>0&&WE([...t.parent.child(s-1).marks],e,n);)s-=1,l-=t.parent.child(s).nodeSize;for(;u({tr:n,state:r,dispatch:i})=>{let o=yi(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:d,to:f}=l;if(i){let h=Ap(u,o,e);if(h&&h.from<=d&&h.to>=f){let m=le.create(s,h.from,h.to);n.setSelection(m)}}return!0},yD=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!dc(n.state.selection))return s(),!0;let l=ZE(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},vD=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),wD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),jE=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&jE(r)}return t};function nc(t){let e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return jE(n)}function oc(t,e,n){if(t instanceof $n||t instanceof K)return t;n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return K.fromArray(t.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),oc("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="",u=new Bs({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Rr.fromSchema(u).parseSlice(nc(t),n.parseOptions):Rr.fromSchema(u).parse(nc(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Rr.fromSchema(e);return n.slice?o.parseSlice(nc(t),n.parseOptions).content:o.parse(nc(t),n.parseOptions)}return oc("",e,n)}function xD(t,e,n){let r=t.steps.length-1;if(r{s===0&&(s=f)}),t.setSelection(ue.near(t.doc.resolve(s),n))}var _D=t=>!("type"in t),SD=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=oc(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(g){return o.emit("contentError",{editor:o,error:g,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:d}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((_D(l)?l:[l]).forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),u===d&&h){let{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let b;if(f){if(Array.isArray(e))b=e.map(g=>g.text||"").join("");else if(e instanceof K){let g="";e.forEach(E=>{E.text&&(g+=E.text)}),b=g}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,u,d)}else b=l,r.replaceWith(u,d,b);n.updateSelection&&xD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:b})}return!0},TD=()=>({state:t,dispatch:e})=>kE(t,e),CD=()=>({state:t,dispatch:e})=>OE(t,e),AD=()=>({state:t,dispatch:e})=>ep(t,e),MD=()=>({state:t,dispatch:e})=>rp(t,e),ND=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},kD=()=>({state:t,dispatch:e,tr:n})=>{try{let r=Fo(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},OD=()=>({state:t,dispatch:e})=>CE(t,e),RD=()=>({state:t,dispatch:e})=>AE(t,e);function QE(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ev(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function ID(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{let o=ID(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u?.steps.forEach(d=>{let f=d.map(r.mapping);f&&i&&r.maybeStep(f)}),!0};function ia(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?Ut(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(h,m)=>{if(h.isText)return;let b=Math.max(r,m),g=Math.min(i,m+h.nodeSize);l.push({node:h,from:b,to:g})});let u=i-r,d=l.filter(h=>s?s.name===h.node.type.name:!0).filter(h=>ic(h.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=u}var LD=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?RE(n,r):!1},PD=()=>({state:t,dispatch:e})=>up(t,e),BD=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return FE(r)(e,n)},FD=()=>({state:t,dispatch:e})=>sp(t,e);function fc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KE(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var HD=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,f)=>{o&&o===d.type&&n.setNodeMarkup(f,void 0,KE(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(h=>{s===h.type&&n.addMark(f,f+d.nodeSize,s.create(KE(h.attrs,e)))})})}),!0):!1},$D=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),zD=()=>({tr:t,dispatch:e})=>{if(e){let n=new fn(t.doc);t.setSelection(n)}return!0},UD=()=>({state:t,dispatch:e})=>tp(t,e),WD=()=>({state:t,dispatch:e})=>ip(t,e),KD=()=>({state:t,dispatch:e})=>IE(t,e),VD=()=>({state:t,dispatch:e})=>fp(t,e),GD=()=>({state:t,dispatch:e})=>dp(t,e);function xp(t,e,n={},r={}){return oc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var qD=(t,e=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var u,d;let{doc:f}=o;if(n.preserveWhitespace!=="full"){let h=xp(t,i.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck});return s&&o.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return s&&o.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(d=r.errorOnInvalidContent)!==null&&d!==void 0?d:i.options.enableContentCheck})};function tv(t,e){let n=yi(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});let l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function nv(t,e){let n=new ui(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Mp(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function rv(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function Np(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function to(t){return e=>Np(e.$from,t)}function kp(t,e){let n={from:0,to:t.content.size};return JE(t,n,e)}function YD(t,e){let n=Ut(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Op(t,e){let n=fc(typeof e=="string"?e:e.name,t.schema);return n==="node"?YD(t,e):n==="mark"?tv(t,e):{}}function JD(t,e=JSON.stringify){let n={};return t.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function XD(t){let e=JD(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function iv(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{let{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{let d=e.slice(o).map(l,-1),f=e.slice(o).map(u),h=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:d,to:f}})})}),XD(r)}function pc(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(i=>{let o=n.resolve(t),s=Ap(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function rc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function _p(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?yi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>ic(h.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:h,$to:m})=>{let b=h.pos,g=m.pos;t.doc.nodesBetween(b,g,(E,w)=>{if(!E.isText&&!E.marks.length)return;let S=Math.max(b,w),O=Math.min(g,w+E.nodeSize),k=O-S;s+=k,l.push(...E.marks.map(T=>({mark:T,from:S,to:O})))})}),s===0)return!1;let u=l.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>ic(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+d:u)>=s}function Ur(t,e,n={}){if(!e)return ia(t,null,n)||_p(t,null,n);let r=fc(e,t.schema);return r==="node"?ia(t,e,n):r==="mark"?_p(t,e,n):!1}function VE(t,e){let{nodeExtensions:n}=lc(e),r=n.find(s=>s.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Te(re(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function oa(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(o=>{i!==!1&&(oa(o,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function hc(t){return t instanceof he}function mc(t,e,n){let i=t.state.doc.content.size,o=zr(e,0,i),s=zr(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),d=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),b=m-h,g=f-d,S={top:d,bottom:f,left:h,right:m,width:b,height:g,x:h,y:d};return{...S,toJSON:()=>S}}function ZD(t,e,n){var r;let{selection:i}=e,o=null;if(dc(i)&&(o=i.$cursor),o){let l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(d)return!1;if(f.isInline){let b=!m||m.type.allowsMarkType(n),g=!!n.isInSet(f.marks)||!f.marks.some(E=>E.type.excludes(n));d=b&&g}return!d}),d})}var jD=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,u=yi(t,r.schema);if(i)if(s){let d=tv(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{let f=d.$from.pos,h=d.$to.pos;r.doc.nodesBetween(f,h,(m,b)=>{let g=Math.max(b,f),E=Math.min(b+m.nodeSize,h);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(g,E,u.create({...S.attrs,...e}))}):n.addMark(g,E,u.create(e))})});return ZD(r,n,u)},QD=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),eL=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=Ut(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>pp(o,{...s,...e})(n)?!0:l.clearNodes()).command(({state:l})=>pp(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=zr(t,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},nL=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=le.atStart(r).from,l=le.atEnd(r).to,u=zr(i,s,l),d=zr(o,s,l),f=le.create(r,u,d);e.setSelection(f)}return!0},rL=t=>({state:e,dispatch:n})=>{let r=Ut(t,e.schema);return HE(r)(e,n)};function GE(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var iL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:u}=o,d=i.extensionManager.attributes,f=rc(d,l.node().type.name,l.node().attrs);if(o instanceof he&&o.node.isBlock)return!l.parentOffset||!zn(s,l.pos)?!1:(r&&(t&&GE(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:Mp(l.node(-1).contentMatchAt(l.indexAfter(-1))),b=h&&m?[{type:m,attrs:f}]:void 0,g=zn(e.doc,e.mapping.map(l.pos),1,b);if(!b&&!g&&zn(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(g=!0,b=m?[{type:m,attrs:f}]:void 0),r){if(g&&(o instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,b),m&&!h&&!l.parentOffset&&l.parent.type!==m)){let E=e.mapping.map(l.before()),w=e.doc.resolve(E);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&GE(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return g},oL=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let l=Ut(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;let h=u.node(-1);if(h.type!==l)return!1;let m=o.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let S=K.empty,O=u.index(-1)?1:u.index(-2)?2:3;for(let ne=u.depth-O;ne>=u.depth-3;ne-=1)S=K.from(u.node(ne).copy(S));let k=u.indexAfter(-1){if(Y>-1)return!1;ne.isTextblock&&ne.content.size===0&&(Y=q+1)}),Y>-1&&n.setSelection(le.near(n.doc.resolve(Y))),n.scrollIntoView()}return!0}let b=d.pos===u.end()?h.contentMatchAt(0).defaultType:null,g={...rc(m,h.type.name,h.attrs),...e},E={...rc(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);let w=b?[{type:l,attrs:g},{type:b,attrs:E}]:[{type:l,attrs:g}];if(!zn(n.doc,u.pos,2))return!1;if(i){let{selection:S,storedMarks:O}=r,{splittableMarks:k}=o.extensionManager,T=O||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!T||!i)return!0;let P=T.filter(I=>k.includes(I.type.name));n.ensureMarks(P)}return!0},gp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,n.pos)&&t.join(n.pos),!0},bp=(t,e)=>{let n=to(s=>s.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&rr(t.doc,r)&&t.join(r),!0},sL=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:d,can:f})=>{let{extensions:h,splittableMarks:m}=i.extensionManager,b=Ut(t,s.schema),g=Ut(e,s.schema),{selection:E,storedMarks:w}=s,{$from:S,$to:O}=E,k=S.blockRange(O),T=w||E.$to.parentOffset&&E.$from.marks();if(!k)return!1;let P=to(I=>VE(I.type.name,h))(E);if(k.depth>=1&&P&&k.depth-P.depth<=1){if(P.node.type===b)return d.liftListItem(g);if(VE(P.node.type.name,h)&&b.validContent(P.node.content)&&l)return u().command(()=>(o.setNodeMarkup(P.pos,b),!0)).command(()=>gp(o,b)).command(()=>bp(o,b)).run()}return!n||!T||!l?u().command(()=>f().wrapInList(b,r)?!0:d.clearNodes()).wrapInList(b,r).command(()=>gp(o,b)).command(()=>bp(o,b)).run():u().command(()=>{let I=f().wrapInList(b,r),Y=T.filter(ne=>m.includes(ne.type.name));return o.ensureMarks(Y),I?!0:d.clearNodes()}).wrapInList(b,r).command(()=>gp(o,b)).command(()=>bp(o,b)).run()},aL=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=yi(t,r.schema);return _p(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},lL=(t,e,n={})=>({state:r,commands:i})=>{let o=Ut(t,r.schema),s=Ut(e,r.schema),l=ia(r,o,n),u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?i.setNode(s,u):i.setNode(o,{...u,...n})},cL=(t,e={})=>({state:n,commands:r})=>{let i=Ut(t,n.schema);return ia(n,i,e)?r.lift(i):r.wrapIn(i,e)},uL=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){let u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},dL=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},fL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=yi(t,r.schema),{$from:d,empty:f,ranges:h}=l;if(!i)return!0;if(f&&s){let{from:m,to:b}=l,g=(o=d.marks().find(w=>w.type===u))===null||o===void 0?void 0:o.attrs,E=Ap(d,u,g);E&&(m=E.from,b=E.to),n.removeMark(m,b,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},pL=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=fc(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Ut(t,r.schema)),l==="mark"&&(s=yi(t,r.schema)),i&&n.selection.ranges.forEach(u=>{let d=u.$from.pos,f=u.$to.pos,h,m,b,g;n.selection.empty?r.doc.nodesBetween(d,f,(E,w)=>{o&&o===E.type&&(b=Math.max(w,d),g=Math.min(w+E.nodeSize,f),h=w,m=E)}):r.doc.nodesBetween(d,f,(E,w)=>{w=d&&w<=f&&(o&&o===E.type&&n.setNodeMarkup(w,void 0,{...E.attrs,...e}),s&&E.marks.length&&E.marks.forEach(S=>{if(s===S.type){let O=Math.max(w,d),k=Math.min(w+E.nodeSize,f);n.addMark(O,k,s.create({...S.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(E=>{s===E.type&&n.addMark(b,g,s.create({...E.attrs,...e}))}))}),!0):!1},hL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return PE(i,e)(n,r)},mL=(t,e={})=>({state:n,dispatch:r})=>{let i=Ut(t,n.schema);return BE(i,e)(n,r)},gL=Object.freeze({__proto__:null,blur:oD,clearContent:sD,clearNodes:aD,command:lD,createParagraphNear:cD,cut:uD,deleteCurrentNode:dD,deleteNode:fD,deleteRange:pD,deleteSelection:hD,enter:mD,exitCode:gD,extendMarkRange:bD,first:yD,focus:ED,forEach:vD,insertContent:wD,insertContentAt:SD,joinBackward:AD,joinDown:CD,joinForward:MD,joinItemBackward:ND,joinItemForward:kD,joinTextblockBackward:OD,joinTextblockForward:RD,joinUp:TD,keyboardShortcut:DD,lift:LD,liftEmptyBlock:PD,liftListItem:BD,newlineInCode:FD,resetAttributes:HD,scrollIntoView:$D,selectAll:zD,selectNodeBackward:UD,selectNodeForward:WD,selectParentNode:KD,selectTextblockEnd:VD,selectTextblockStart:GD,setContent:qD,setMark:jD,setMeta:QD,setNode:eL,setNodeSelection:tL,setTextSelection:nL,sinkListItem:rL,splitBlock:iL,splitListItem:oL,toggleList:sL,toggleMark:aL,toggleNode:lL,toggleWrap:cL,undoInputRule:uL,unsetAllMarks:dL,unsetMark:fL,updateAttributes:pL,wrapIn:hL,wrapInList:mL}),bL=We.create({name:"commands",addCommands(){return{...gL}}}),yL=We.create({name:"drop",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),EL=We.create({name:"editable",addProseMirrorPlugins(){return[new Oe({key:new ze("editable"),props:{editable:()=>this.editor.options.editable}})]}}),vL=We.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new Oe({key:new ze("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wL=We.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:u,doc:d}=l,{empty:f,$anchor:h}=u,{pos:m,parent:b}=h,g=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,E=g.parent.type.spec.isolating,w=h.pos-h.parentOffset,S=E&&g.parent.childCount===1?w===h.pos:ue.atStart(d).from===m;return!f||!b.type.isTextblock||b.textContent.length||!S||S&&h.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return QE()||ev()?o:i},addProseMirrorPlugins(){return[new Oe({key:new ze("clearDocument"),appendTransaction:(t,e,n)=>{let r=t.some(E=>E.docChanged)&&!e.doc.eq(n.doc),i=t.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,u=ue.atStart(e.doc).from,d=ue.atEnd(e.doc).to;if(o||!(s===u&&l===d)||!oa(n.doc))return;let m=n.tr,b=ac({state:n,transaction:m}),{commands:g}=new Yo({editor:this.editor,state:b});if(g.clearNodes(),!!m.steps.length)return m}})]}}),xL=We.create({name:"paste",addProseMirrorPlugins(){return[new Oe({key:new ze("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_L=We.create({name:"tabindex",addProseMirrorPlugins(){return[new Oe({key:new ze("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Sp=class t{get name(){return this.node.type.name}constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new t(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new t(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new t(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let u=new t(l,this.editor,i,i?n:null);i&&(u.actualDepth=this.depth+1),e.push(new t(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(u=>n[u]===s.node.attrs[u])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},SL=`.ProseMirror { position: relative; } @@ -106,16 +106,16 @@ img.ProseMirror-separator { opacity: 0 }`;function TL(t,e,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var sc=class extends yp{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=TL(SL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){let r=YE(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;let n=this.state.plugins,r=n;if([].concat(e).forEach(o=>{let s=typeof o=="string"?`${o}$`:o.key;r=n.filter(l=>!l.key.startsWith(s))}),n.length===r.length)return;let i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,n;let i=[...this.options.enableCoreExtensions?[EL,iD.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),bL,vL,wL,_L,yL,xL].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new wp(i,this)}createCommandManager(){this.commandManager=new Yo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=xp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let r=ZE(n,this.options.autofocus);this.view=new ql(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Pl.create({doc:n,selection:r||void 0})});let i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();let o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}let n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Op(this.state,e)}isActive(e,n){let r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return Ur(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Tp(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:n=` -`,textSerializers:r={}}=e||{};return kp(this.state.doc,{blockSeparator:n,textSerializers:{...uc(this.schema),...r}})}get isEmpty(){return oa(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new Sp(n,this)}get $doc(){return this.$pos(0)}};function Vn(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(pc(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(E=>E===t.type&&E!==g.mark.type)).filter(g=>g.to>d).length)return null;fn.from&&o.delete(n.from+u,d);let m=n.from+u+s.length;o.addMark(n.from+u,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function gc(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,u=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,u)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function sa(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Ei(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Bo(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:g}=t.editor.extensionManager,b=m||h.$to.parentOffset&&h.$from.marks();if(b){let E=b.filter(w=>g.includes(w.type.name));s.ensureMarks(E)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&rr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var ce=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new vp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],u=r[0],d=n.to;if(l){let f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(pc(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(w=>w===t.type&&w!==b.mark.type)).filter(b=>b.to>h).length)return null;mn.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function ov(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var CL=/^\s*>\s$/,sv=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ei({find:CL,type:this.type})]}});var AL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ML=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,av=st.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Vn({find:AL,type:this.type}),Vn({find:NL,type:this.type})]},addPasteRules(){return[xn({find:ML,type:this.type}),xn({find:kL,type:this.type})]}});var OL="listItem",lv="textStyle",cv=/^\s*([-+*])\s$/,uv=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OL,this.editor.getAttributes(lv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ei({find:cv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:cv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lv),editor:this.editor})),[t]}});var RL=/(^|[^`])`([^`]+)`(?!`)/,IL=/(^|[^`])`([^`]+)`(?!`)/g,dv=st.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Vn({find:RL,type:this.type})]},addPasteRules(){return[xn({find:IL,type:this.type})]}});var DL=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;let o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},fv=st.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&DL(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}});var pv=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var Rp=ce.create({name:"doc",topNode:!0,content:"block+"});function hv(t={}){return new Oe({view(e){return new Ip(e,t)}})}var Ip=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Il(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var mv=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hv(this.options)]}});var on=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Dp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!LL(e)||!PL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(t.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};on.prototype.visible=!1;on.findFrom=on.findGapCursorFrom;ue.jsonID("gapcursor",on);var Dp=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return on.valid(n)?new on(n):ue.near(n)}};function LL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function PL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function gv(){return new Oe({props:{decorations:$L,createSelectionBetween(t,e,n){return e.pos==n.pos&&on.valid(n)?new on(n):null},handleClick:FL,handleKeyDown:BL,handleDOMEvents:{beforeinput:HL}}})}var BL=ra({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=on.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new on(d))),!0):!1}}function FL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!on.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new on(r))),!0)}function HL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof on))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let s=r.length-1;s>=0;s--)i=K.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function $L(t){if(!(t.selection instanceof on))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[wt.widget(t.selection.head,e,{key:"gapcursor"})])}var bv=We.create({name:"gapCursor",addProseMirrorPlugins(){return[gv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var yv=ce.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ee(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){let h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Ev=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var yc=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Yt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new vv(e):Yt.empty};var vv=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=yc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=yc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Yt);Yt.empty=new vv([]);var zL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Yt),Lp=Yt;var UL=500,ro=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let g=h.step.map(i.slice(o)),b;g&&s.maybeStep(g).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(b,void 0,void 0,d.length+f.length))),o--,b&&i.appendMap(b,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,u=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;fKL&&(l=WL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Us;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let g=o.getMirror(--u);if(g==null)return;s=Math.min(s,g);let b=o.maps[g];if(m.step){let E=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(o.slice(u+1,g));w&&l++,r.push(new mr(b,E,w))}else r.push(new mr(b))},i);let d=[];for(let m=n;mUL&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),u,f),m,g=i.length-1;(m=i.length&&i[g].merge(h))?i[g]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Lp.from(i.reverse()),o)}};ro.empty=new ro(Lp.empty,0);function WL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},KL=20;function VL(t,e,n,r){let i=n.getMeta(no),o;if(i)return i.historyState;n.getMeta(YL)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(no))return s.getMeta(no).redo?new gr(t.done.addTransform(n,void 0,r,Ec(e)),t.undone,wv(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,Ec(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GL(n,t.prevRanges)),d=s?Pp(t.prevRanges,n.mapping):wv(n.mapping.maps);return new gr(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Ec(e)),ro.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function wv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Pp(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=no.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=qL(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Fp=vc(!1,!0),Hp=vc(!0,!0),$z=vc(!1,!1),zz=vc(!0,!1);var Sv=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fp(t,e),redo:()=>({state:t,dispatch:e})=>Hp(t,e)}},addProseMirrorPlugins(){return[_v(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Tv=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var u;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(he.create(s.doc,d.pos)):s.setSelection(le.create(s.doc,d.pos));else{let h=(u=d.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(s.insert(f,h),s.setSelection(le.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var JL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,XL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ZL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cv=st.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Vn({find:JL,type:this.type}),Vn({find:ZL,type:this.type})]},addPasteRules(){return[xn({find:XL,type:this.type}),xn({find:jL,type:this.type})]}});var $p=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ee(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var QL="listItem",Av="textStyle",Mv=/^(\d+)\.\s$/,Nv=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",ee(this.options.HTMLAttributes,n),0]:["ol",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(QL,this.editor.getAttributes(Av)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ei({find:Mv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:Mv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Av)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var wc=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var kv=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Oe({key:new ze("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let u=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&oa(s);if((u||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=wt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),ot.create(t,i)}}})]}});var eP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ov=st.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Vn({find:eP,type:this.type})]},addPasteRules(){return[xn({find:tP,type:this.type})]}});var Rv=st.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Iv=st.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Up,Wp;if(typeof WeakMap<"u"){let t=new WeakMap;Up=e=>t.get(e),Wp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Up=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-D});break}let T=i+D*e;for(let B=0;Br&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function iP(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function sP(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ac(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Xo(e.$head)||aP(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function aP(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Kp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function lP(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Wv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function io(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Kv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=n.pos-o);u.unshift(n.pos-o);let d=u.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new $o(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Kp(r)&&Kp(i)&&qp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return le.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let u=i.top;u0||w>0){let S=b.attrs;if(E>0&&(S=io(S,0,E)),w>0&&(S=io(S,S.colspan-w,w)),g.lefti.bottom){let S={...b.attrs,rowspan:Math.min(g.bottom,i.bottom)-Math.max(g.top,i.top)};g.top0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.top<=l.top?(s.top>0&&(e=u.resolve(o+i.map[s.left])),l.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.left<=l.left?(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),l.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ot.create(t.doc,e)}function fP({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function pP({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function hP(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=et.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=et.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=et.create(i,u+1,d)}}else r instanceof le&&fP(r)?o=le.create(i,r.from):r instanceof le&&pP(r)&&(o=le.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var mP=new ze("fix-tables");function Gv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=gP(t,i,o,n))};return e?e.doc!=t.doc&&Gv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function gP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);let b=[];for(let w=0;w0?-1:0;cP(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;yP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function wP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof et){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=sP(i.$from),!o)return!1;s=(r=Xo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,u=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let g=0;g{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function xP(t){return function(e,n){if(!or(e))return!1;if(n){let r=sn(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{let b=g+o.tableStart,E=s.doc.nodeAt(b);E&&s.setNodeMarkup(b,m,E.attrs)}),r(s)}return!0}}var CU=Zo("row",{useDeprecatedLogic:!0}),AU=Zo("column",{useDeprecatedLogic:!0}),nw=Zo("cell",{useDeprecatedLogic:!0});function _P(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function xc(t,e){let n=t.selection;if(!(n instanceof et))return!1;if(e){let r=t.tr,i=sn(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function SP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(K.empty),n[i]r&&(m=m.type.createChecked(io(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let g=1;gi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(K.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function AP(t,e,n,r,i,o,s){let l=t.doc.type.schema,u=sn(l),d,f;if(i>e.width)for(let h=0,m=0;he.height){let h=[];for(let b=0,E=(e.height-1)*e.width;b=e.width?!1:n.nodeAt(e.map[E+b]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,K.from(h)),g=[];for(let b=e.height;b{if(!i)return!1;let o=n.selection;if(o instanceof et)return Tc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=iw(i,t,e);if(s==null)return!1;if(t=="horiz")return Tc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=Wv(l,t,e),d;return u?d=ue.near(u,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),Tc(n,r,d)}}}function Sc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof et)s=o;else{let u=iw(i,t,e);if(u==null)return!1;s=new et(n.doc.resolve(u))}let l=Wv(s.$headCell,t,e);return l?Tc(n,r,new et(s.$anchorCell,l)):!1}}function NP(t,e){let n=t.state.doc,r=Xo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function kP(t,e,n){if(!or(t.state))return!1;let r=SP(n),i=t.state.selection;if(i instanceof et){r||(r={width:1,height:1,rows:[K.from(Vp(sn(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=CP(r,l.right-l.left,l.bottom-l.top),Fv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=Ac(t.state),s=o.start(-1);return Fv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function OP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Hv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof et)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Xo(t.state.selection.$anchor))!=null&&((n=zp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=zp(t,d),h=vi.getState(t.state)==null;if(!f||!qp(u,f))if(h)f=u;else return;let m=new et(u,f);if(h||!t.state.selection.eq(m)){let g=t.state.tr.setSelection(m);h&&g.setMeta(vi,u.pos),t.dispatch(g)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),vi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(vi,-1))}function l(u){let d=u,f=vi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Hv(t,d.target)!=r&&(h=zp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function iw(t,e,n){if(!(t.state.selection instanceof le))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function Hv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function zp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Xo(t.state.doc.resolve(n.pos)):null}var RP=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Gp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gp(t,e,n,r,i,o){var s;let l=0,u=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;hnew r(m,n,g)),new IP(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{let l=On.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{DP(s,l,t,i)},mouseleave:s=>{LP(s)},mousedown:(s,l)=>{PP(s,l,e,n)}},decorations:s=>{let l=On.getState(s);if(l&&l.activeHandle>-1)return zP(s,l.activeHandle)},nodeViews:{}}});return o}var IP=class Cc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(On);if(r&&r.setHandle!=null)return new Cc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Cc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Kp(e.doc.resolve(i))||(i=-1),new Cc(i,n.dragging)}return n}};function DP(t,e,n,r){let i=On.getState(t.state);if(i&&!i.dragging){let o=FP(e.target),s=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?s=$v(t,e,"left",n):u-e.clientX<=n&&(s=$v(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){let l=t.state.doc.resolve(s),u=l.node(-1),d=mt.get(u),f=l.start(-1);if(d.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==d.width-1)return}sw(t,s)}}}function LP(t){let e=On.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&sw(t,-1)}function PP(t,e,n,r){var i;let o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=On.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;let l=t.state.doc.nodeAt(s.activeHandle),u=BP(t,s.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(On,{setDragging:{startX:e.clientX,startWidth:u}}));function d(h){o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",f);let m=On.getState(t.state);m?.dragging&&(HP(t,m.activeHandle,zv(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(On,{setDragging:null})))}function f(h){if(!h.which)return d(h);let m=On.getState(t.state);if(m&&m.dragging){let g=zv(m.dragging,h,n);Uv(t,m.activeHandle,g,r)}}return Uv(t,s.activeHandle,u,r),o.addEventListener("mouseup",d),o.addEventListener("mousemove",f),e.preventDefault(),!0}function BP(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let d=0;d{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function KP(t,e,n,r,i){let o=WP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!VP(e))return!1;let n=0,r=Np(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},uw=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Qp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=UP(t,this.options.cellMinWidth);return["table",ee(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=KP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(le.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Yv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Jv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>jv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Qv(t,e),deleteRow:()=>({state:t,dispatch:e})=>ew(t,e),deleteTable:()=>({state:t,dispatch:e})=>rw(t,e),mergeCells:()=>({state:t,dispatch:e})=>Jp(t,e),splitCell:()=>({state:t,dispatch:e})=>Xp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Zo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Zo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>nw(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Jp(t,e)?!0:Xp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>tw(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Zp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Zp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Yp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=et.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Mc,"Mod-Backspace":Mc,Delete:Mc,"Mod-Delete":Mc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ow({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],aw({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(re(t,"tableRole",e))}}});var dw=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ee(this.options.HTMLAttributes,t),0]}});var fw=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ee(this.options.HTMLAttributes,t),0]}});var pw=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ee(this.options.HTMLAttributes,t),0]}});var hw=ce.create({name:"text",group:"inline"});var mw=st.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var GP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,qP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,gw=st.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Vn({find:GP,type:this.type})]},addPasteRules(){return[xn({find:qP,type:this.type})]}});var gt="top",Dt="bottom",Mt="right",xt="left",Nc="auto",wi=[gt,Dt,Mt,xt],Kr="start",oo="end",bw="clippingParents",kc="viewport",jo="popper",yw="reference",eh=wi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+oo])},[]),Oc=[].concat(wi,[Nc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+oo])},[]),YP="beforeRead",JP="read",XP="afterRead",ZP="beforeMain",jP="main",QP="afterMain",eB="beforeWrite",tB="write",nB="afterWrite",Ew=[YP,JP,XP,ZP,jP,QP,eB,tB,nB];function Wt(t){return t?(t.nodeName||"").toLowerCase():null}function ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Gn(t){var e=ct(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Qo(t){if(typeof ShadowRoot>"u")return!1;var e=ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function rB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function iB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var aa={name:"applyStyles",enabled:!0,phase:"write",fn:rB,effect:iB,requires:["computeStyles"]};function Kt(t){return t.split("-")[0]}var sr=Math.max,so=Math.min,Vr=Math.round;function es(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function la(){return!/^((?!chrome|android).)*safari/i.test(es())}function qn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Gn(t)?ct(t):window,l=s.visualViewport,u=!la()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function ao(t){var e=qn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ca(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Qo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return ct(t).getComputedStyle(t)}function th(t){return["table","td","th"].indexOf(Wt(t))>=0}function Jt(t){return((Gn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Wt(t)==="html"?t:t.assignedSlot||t.parentNode||(Qo(t)?t.host:null)||Jt(t)}function vw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function oB(t){var e=/firefox/i.test(es()),n=/Trident/i.test(es());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Gr(t);for(Qo(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=ct(t),n=vw(t);n&&th(n)&&gn(n).position==="static";)n=vw(n);return n&&(Wt(n)==="html"||Wt(n)==="body"&&gn(n).position==="static")?e:n||oB(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,n){return sr(t,so(e,n))}function ww(t,e,n){var r=co(t,e,n);return r>n?n:r}function ua(){return{top:0,right:0,bottom:0,left:0}}function da(t){return Object.assign({},ua(),t)}function fa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var sB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,da(typeof e!="number"?e:fa(e,wi))};function aB(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Kt(n.placement),u=lo(l),d=[xt,Mt].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=sB(i.padding,n),m=ao(o),g=u==="y"?gt:xt,b=u==="y"?Dt:Mt,E=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],w=s[u]-n.rects.reference[u],S=ar(o),N=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,D=E/2-w/2,T=h[g],B=N-m[f]-h[b],R=N/2-m[f]/2+D,Y=co(T,R,B),ne=u;n.modifiersData[r]=(e={},e[ne]=Y,e.centerOffset=Y-R,e)}}function lB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ca(e.elements.popper,i)&&(e.elements.arrow=i))}var xw={name:"arrow",enabled:!0,phase:"main",fn:aB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yn(t){return t.split("-")[1]}var cB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function _w(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,g=m===void 0?0:m,b=s.y,E=b===void 0?0:b,w=typeof f=="function"?f({x:g,y:E}):{x:g,y:E};g=w.x,E=w.y;var S=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),D=xt,T=gt,B=window;if(d){var R=ar(n),Y="clientHeight",ne="clientWidth";if(R===ct(n)&&(R=Jt(n),gn(R).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ne="scrollWidth")),R=R,i===gt||(i===xt||i===Mt)&&o===oo){T=Dt;var q=h&&R===B&&B.visualViewport?B.visualViewport.height:R[Y];E-=q-r.height,E*=u?1:-1}if(i===xt||(i===gt||i===Dt)&&o===oo){D=Mt;var Q=h&&R===B&&B.visualViewport?B.visualViewport.width:R[ne];g-=Q-r.width,g*=u?1:-1}}var fe=Object.assign({position:l},d&&cB),we=f===!0?uB({x:g,y:E},ct(n)):{x:g,y:E};if(g=we.x,E=we.y,u){var me;return Object.assign({},fe,(me={},me[T]=N?"0":"",me[D]=S?"0":"",me.transform=(B.devicePixelRatio||1)<=1?"translate("+g+"px, "+E+"px)":"translate3d("+g+"px, "+E+"px, 0)",me))}return Object.assign({},fe,(e={},e[T]=N?E+"px":"",e[D]=S?g+"px":"",e.transform="",e))}function dB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Kt(e.placement),variation:Yn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_w(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,_w(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Sw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dB,data:{}};var Rc={passive:!0};function fB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=ct(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Rc)}),l&&u.addEventListener("resize",n.update,Rc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Rc)}),l&&u.removeEventListener("resize",n.update,Rc)}}var Tw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fB,data:{}};var pB={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(t){return t.replace(/left|right|bottom|top/g,function(e){return pB[e]})}var hB={start:"end",end:"start"};function Ic(t){return t.replace(/start|end/g,function(e){return hB[e]})}function uo(t){var e=ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fo(t){return qn(Jt(t)).left+uo(t).scrollLeft}function nh(t,e){var n=ct(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=la();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+fo(t),y:u}}function rh(t){var e,n=Jt(t),r=uo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+fo(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function po(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Dc(t){return["html","body","#document"].indexOf(Wt(t))>=0?t.ownerDocument.body:Lt(t)&&po(t)?t:Dc(Gr(t))}function xi(t,e){var n;e===void 0&&(e=[]);var r=Dc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],po(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(xi(Gr(s)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mB(t,e){var n=qn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Cw(t,e,n){return e===kc?ns(nh(t,n)):Gn(e)?mB(e,n):ns(rh(Jt(t)))}function gB(t){var e=xi(Gr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return Gn(r)?e.filter(function(i){return Gn(i)&&ca(i,r)&&Wt(i)!=="body"}):[]}function ih(t,e,n,r){var i=e==="clippingParents"?gB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=Cw(t,d,r);return u.top=sr(f.top,u.top),u.right=so(f.right,u.right),u.bottom=so(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},Cw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function pa(t){var e=t.reference,n=t.element,r=t.placement,i=r?Kt(r):null,o=r?Yn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case gt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case Mt:u={x:e.x+e.width,y:l};break;case xt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?lo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case oo:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?bw:l,d=n.rootBoundary,f=d===void 0?kc:d,h=n.elementContext,m=h===void 0?jo:h,g=n.altBoundary,b=g===void 0?!1:g,E=n.padding,w=E===void 0?0:E,S=da(typeof w!="number"?w:fa(w,wi)),N=m===jo?yw:jo,D=t.rects.popper,T=t.elements[b?N:m],B=ih(Gn(T)?T:T.contextElement||Jt(t.elements.popper),u,f,s),R=qn(t.elements.reference),Y=pa({reference:R,element:D,strategy:"absolute",placement:i}),ne=ns(Object.assign({},D,Y)),q=m===jo?ne:R,Q={top:B.top-q.top+S.top,bottom:q.bottom-B.bottom+S.bottom,left:B.left-q.left+S.left,right:q.right-B.right+S.right},fe=t.modifiersData.offset;if(m===jo&&fe){var we=fe[i];Object.keys(Q).forEach(function(me){var Ce=[Mt,Dt].indexOf(me)>=0?1:-1,ge=[gt,Dt].indexOf(me)>=0?"y":"x";Q[me]+=we[ge]*Ce})}return Q}function oh(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Oc:u,f=Yn(r),h=f?l?eh:eh.filter(function(b){return Yn(b)===f}):wi,m=h.filter(function(b){return d.indexOf(b)>=0});m.length===0&&(m=h);var g=m.reduce(function(b,E){return b[E]=lr(t,{placement:E,boundary:i,rootBoundary:o,padding:s})[Kt(E)],b},{});return Object.keys(g).sort(function(b,E){return g[b]-g[E]})}function bB(t){if(Kt(t)===Nc)return[];var e=ts(t);return[Ic(t),e,Ic(e)]}function yB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,g=n.flipVariations,b=g===void 0?!0:g,E=n.allowedAutoPlacements,w=e.options.placement,S=Kt(w),N=S===w,D=u||(N||!b?[ts(w)]:bB(w)),T=[w].concat(D).reduce(function(je,Ne){return je.concat(Kt(Ne)===Nc?oh(e,{placement:Ne,boundary:f,rootBoundary:h,padding:d,flipVariations:b,allowedAutoPlacements:E}):Ne)},[]),B=e.rects.reference,R=e.rects.popper,Y=new Map,ne=!0,q=T[0],Q=0;Q=0,ge=Ce?"width":"height",ye=lr(e,{placement:fe,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?Mt:xt:me?Dt:gt;B[ge]>R[ge]&&(A=ts(A));var I=ts(A),z=[];if(o&&z.push(ye[we]<=0),l&&z.push(ye[A]<=0,ye[I]<=0),z.every(function(je){return je})){q=fe,ne=!1;break}Y.set(fe,z)}if(ne)for(var j=b?3:1,ie=function(Ne){var Be=T.find(function(_t){var kt=Y.get(_t);if(kt)return kt.slice(0,Ne).every(function(Re){return Re})});if(Be)return q=Be,"break"},xe=j;xe>0;xe--){var Ae=ie(xe);if(Ae==="break")break}e.placement!==q&&(e.modifiersData[r]._skip=!0,e.placement=q,e.reset=!0)}}var Aw={name:"flip",enabled:!0,phase:"main",fn:yB,requiresIfExists:["offset"],data:{_skip:!1}};function Mw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Nw(t){return[gt,Mt,Dt,xt].some(function(e){return t[e]>=0})}function EB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=Mw(s,r),d=Mw(l,i,o),f=Nw(u),h=Nw(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:EB};function vB(t,e,n){var r=Kt(t),i=[xt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[xt,Mt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function wB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Oc.reduce(function(f,h){return f[h]=vB(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var Ow={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wB};function xB(t){var e=t.state,n=t.name;e.modifiersData[n]=pa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Rw={name:"popperOffsets",enabled:!0,phase:"read",fn:xB,data:{}};function sh(t){return t==="x"?"y":"x"}function _B(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,g=m===void 0?!0:m,b=n.tetherOffset,E=b===void 0?0:b,w=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),S=Kt(e.placement),N=Yn(e.placement),D=!N,T=lo(S),B=sh(T),R=e.modifiersData.popperOffsets,Y=e.rects.reference,ne=e.rects.popper,q=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,Q=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),fe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,we={x:0,y:0};if(R){if(o){var me,Ce=T==="y"?gt:xt,ge=T==="y"?Dt:Mt,ye=T==="y"?"height":"width",A=R[T],I=A+w[Ce],z=A-w[ge],j=g?-ne[ye]/2:0,ie=N===Kr?Y[ye]:ne[ye],xe=N===Kr?-ne[ye]:-Y[ye],Ae=e.elements.arrow,je=g&&Ae?ao(Ae):{width:0,height:0},Ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ua(),Be=Ne[Ce],_t=Ne[ge],kt=co(0,Y[ye],je[ye]),Re=D?Y[ye]/2-j-kt-Be-Q.mainAxis:ie-kt-Be-Q.mainAxis,St=D?-Y[ye]/2+j+kt+_t+Q.mainAxis:xe+kt+_t+Q.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),pt=Xt?T==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,an=(me=fe?.[T])!=null?me:0,Zt=A+Re-an-pt,Tt=A+St-an,Je=co(g?so(I,Zt):I,A,g?sr(z,Tt):z);R[T]=Je,we[T]=Je-A}if(l){var jn,Pt=T==="x"?gt:xt,V=T==="x"?Dt:Mt,yt=R[B],_e=B==="y"?"height":"width",pe=yt+w[Pt],ut=yt-w[V],dt=[gt,xt].indexOf(S)!==-1,Bt=(jn=fe?.[B])!=null?jn:0,Ot=dt?pe:yt-Y[_e]-ne[_e]-Bt+Q.altAxis,L=dt?yt+Y[_e]+ne[_e]-Bt-Q.altAxis:ut,H=g&&dt?ww(Ot,yt,L):co(g?Ot:pe,yt,g?L:ut);R[B]=H,we[B]=H-yt}e.modifiersData[r]=we}}var Iw={name:"preventOverflow",enabled:!0,phase:"main",fn:_B,requiresIfExists:["offset"]};function ah(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lh(t){return t===ct(t)||!Lt(t)?uo(t):ah(t)}function SB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ch(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&SB(e),o=Jt(e),s=qn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Wt(e)!=="body"||po(o))&&(l=lh(e)),Lt(e)?(u=qn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=fo(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function TB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function uh(t){var e=TB(t);return Ew.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function dh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function fh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Dw={placement:"bottom",modifiers:[],strategy:"absolute"};function Lw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Xw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Bw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function NB(t){return t.split(/\s+/).filter(Boolean)}function rs(t){return[].concat(t)}function Fw(t,e){t.indexOf(e)===-1&&t.push(e)}function kB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function OB(t){return t.split("-")[0]}function Pc(t){return[].slice.call(t)}function Hw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ha(){return document.createElement("div")}function Bc(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function RB(t){return vh(t,"NodeList")}function IB(t){return vh(t,"MouseEvent")}function DB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function LB(t){return Bc(t)?[t]:RB(t)?Pc(t):Array.isArray(t)?t:Pc(document.querySelectorAll(t))}function mh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $w(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function PB(t){var e,n=rs(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function BB(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=OB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,g=d==="right"?f.left.x:0,b=d==="left"?f.right.x:0,E=o.top-r+h>u,w=r-o.bottom-m>u,S=o.left-n+g>u,N=n-o.right-b>u;return E||w||S||N})}function gh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function zw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Uw=0;function FB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zw))}function Zw(){var t=performance.now();t-Uw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Zw)),Uw=t}function HB(){var t=document.activeElement;if(DB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $B(){document.addEventListener("touchstart",FB,ho),window.addEventListener("blur",HB)}var zB=typeof window<"u"&&typeof document<"u",UB=zB?!!window.msCrypto:!1;var WB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},KB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Jw,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},WB,KB),VB=Object.keys(cr),GB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function jw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function qB(t,e){var n=e?Object.keys(jw(Object.assign({},cr,{plugins:e}))):VB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Ww(t,e){var n=Object.assign({},e,{content:Xw(e.content,[t])},e.ignoreAttributes?{}:qB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var YB=function(){return"innerHTML"};function yh(t,e){t[YB()]=e}function Kw(t){var e=ha();return t===!0?e.className=qw:(e.className=Yw,Bc(t)?e.appendChild(t):yh(e,t)),e}function Vw(t,e){Bc(e.content)?(yh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yh(t,e.content):t.textContent=e.content)}function Eh(t){var e=t.firstElementChild,n=Pc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Gw)}),arrow:n.find(function(r){return r.classList.contains(qw)||r.classList.contains(Yw)}),backdrop:n.find(function(r){return r.classList.contains(MB)})}}function Qw(t){var e=ha(),n=ha();n.className=AB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ha();r.className=Gw,r.setAttribute("data-state","hidden"),Vw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Eh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(Kw(s.arrow))):u.appendChild(Kw(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}Qw.$$tippy=!0;var JB=1,Lc=[],bh=[];function XB(t,e){var n=Ww(t,Object.assign({},cr,jw(Hw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,g=[],b=Bw(Zt,n.interactiveDebounce),E,w=JB++,S=null,N=kB(n.plugins),D={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:w,reference:t,popper:ha(),popperInstance:S,props:n,state:D,plugins:N,clearDelayTimeouts:Ot,setProps:L,setContent:H,show:X,hide:se,hideWithInteractivity:Fe,enable:dt,disable:Bt,unmount:rt,destroy:wr};if(!n.render)return T;var B=n.render(T),R=B.popper,Y=B.onUpdate;R.setAttribute("data-tippy-root",""),R.id="tippy-"+T.id,T.popper=R,t._tippy=T,R._tippy=T;var ne=N.map(function(F){return F.fn(T)}),q=t.hasAttribute("aria-expanded");return Xt(),j(),A(),I("onCreate",[T]),n.showOnCreate&&pe(),R.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),R.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",b)}),T;function Q(){var F=T.props.touch;return Array.isArray(F)?F:[F,0]}function fe(){return Q()[0]==="hold"}function we(){var F;return!!((F=T.props.render)!=null&&F.$$tippy)}function me(){return E||t}function Ce(){var F=me().parentNode;return F?PB(F):document}function ge(){return Eh(R)}function ye(F){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:hh(T.props.delay,F?0:1,cr.delay)}function A(F){F===void 0&&(F=!1),R.style.pointerEvents=T.props.interactive&&!F?"":"none",R.style.zIndex=""+T.props.zIndex}function I(F,ae,Se){if(Se===void 0&&(Se=!0),ne.forEach(function(Ke){Ke[F]&&Ke[F].apply(Ke,ae)}),Se){var qe;(qe=T.props)[F].apply(qe,ae)}}function z(){var F=T.props.aria;if(F.content){var ae="aria-"+F.content,Se=R.id,qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){var Ft=Ke.getAttribute(ae);if(T.state.isVisible)Ke.setAttribute(ae,Ft?Ft+" "+Se:Se);else{var ln=Ft&&Ft.replace(Se,"").trim();ln?Ke.setAttribute(ae,ln):Ke.removeAttribute(ae)}})}}function j(){if(!(q||!T.props.aria.expanded)){var F=rs(T.props.triggerTarget||t);F.forEach(function(ae){T.props.interactive?ae.setAttribute("aria-expanded",T.state.isVisible&&ae===me()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function ie(){Ce().removeEventListener("mousemove",b),Lc=Lc.filter(function(F){return F!==b})}function xe(F){if(!(yr.isTouch&&(u||F.type==="mousedown"))){var ae=F.composedPath&&F.composedPath()[0]||F.target;if(!(T.props.interactive&&zw(R,ae))){if(rs(T.props.triggerTarget||t).some(function(Se){return zw(Se,ae)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[T,F]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function Ae(){u=!0}function je(){u=!1}function Ne(){var F=Ce();F.addEventListener("mousedown",xe,!0),F.addEventListener("touchend",xe,ho),F.addEventListener("touchstart",je,ho),F.addEventListener("touchmove",Ae,ho)}function Be(){var F=Ce();F.removeEventListener("mousedown",xe,!0),F.removeEventListener("touchend",xe,ho),F.removeEventListener("touchstart",je,ho),F.removeEventListener("touchmove",Ae,ho)}function _t(F,ae){Re(F,function(){!T.state.isVisible&&R.parentNode&&R.parentNode.contains(R)&&ae()})}function kt(F,ae){Re(F,ae)}function Re(F,ae){var Se=ge().box;function qe(Ke){Ke.target===Se&&(gh(Se,"remove",qe),ae())}if(F===0)return ae();gh(Se,"remove",h),gh(Se,"add",qe),h=qe}function St(F,ae,Se){Se===void 0&&(Se=!1);var qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){Ke.addEventListener(F,ae,Se),g.push({node:Ke,eventType:F,handler:ae,options:Se})})}function Xt(){fe()&&(St("touchstart",an,{passive:!0}),St("touchend",Tt,{passive:!0})),NB(T.props.trigger).forEach(function(F){if(F!=="manual")switch(St(F,an),F){case"mouseenter":St("mouseleave",Tt);break;case"focus":St(UB?"focusout":"blur",Je);break;case"focusin":St("focusout",Je);break}})}function pt(){g.forEach(function(F){var ae=F.node,Se=F.eventType,qe=F.handler,Ke=F.options;ae.removeEventListener(Se,qe,Ke)}),g=[]}function an(F){var ae,Se=!1;if(!(!T.state.isEnabled||jn(F)||l)){var qe=((ae=f)==null?void 0:ae.type)==="focus";f=F,E=F.currentTarget,j(),!T.state.isVisible&&IB(F)&&Lc.forEach(function(Ke){return Ke(F)}),F.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?Se=!0:pe(F),F.type==="click"&&(s=!Se),Se&&!qe&&ut(F)}}function Zt(F){var ae=F.target,Se=me().contains(ae)||R.contains(ae);if(!(F.type==="mousemove"&&Se)){var qe=_e().concat(R).map(function(Ke){var Ft,ln=Ke._tippy,Zr=(Ft=ln.popperInstance)==null?void 0:Ft.state;return Zr?{popperRect:Ke.getBoundingClientRect(),popperState:Zr,props:n}:null}).filter(Boolean);BB(qe,F)&&(ie(),ut(F))}}function Tt(F){var ae=jn(F)||T.props.trigger.indexOf("click")>=0&&s;if(!ae){if(T.props.interactive){T.hideWithInteractivity(F);return}ut(F)}}function Je(F){T.props.trigger.indexOf("focusin")<0&&F.target!==me()||T.props.interactive&&F.relatedTarget&&R.contains(F.relatedTarget)||ut(F)}function jn(F){return yr.isTouch?fe()!==F.type.indexOf("touch")>=0:!1}function Pt(){V();var F=T.props,ae=F.popperOptions,Se=F.placement,qe=F.offset,Ke=F.getReferenceClientRect,Ft=F.moveTransition,ln=we()?Eh(R).arrow:null,Zr=Ke?{getBoundingClientRect:Ke,contextElement:Ke.contextElement||me()}:t,Da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ni){var jr=Ni.state;if(we()){var zu=ge(),ys=zu.box;["placement","reference-hidden","escaped"].forEach(function(Qr){Qr==="placement"?ys.setAttribute("data-placement",jr.placement):jr.attributes.popper["data-popper-"+Qr]?ys.setAttribute("data-"+Qr,""):ys.removeAttribute("data-"+Qr)}),jr.attributes.popper={}}}},xr=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ft}},Da];we()&&ln&&xr.push({name:"arrow",options:{element:ln,padding:3}}),xr.push.apply(xr,ae?.modifiers||[]),T.popperInstance=ph(Zr,R,Object.assign({},ae,{placement:Se,onFirstUpdate:m,modifiers:xr}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function yt(){var F=T.props.appendTo,ae,Se=me();T.props.interactive&&F===Jw||F==="parent"?ae=Se.parentNode:ae=Xw(F,[Se]),ae.contains(R)||ae.appendChild(R),T.state.isMounted=!0,Pt()}function _e(){return Pc(R.querySelectorAll("[data-tippy-root]"))}function pe(F){T.clearDelayTimeouts(),F&&I("onTrigger",[T,F]),Ne();var ae=ye(!0),Se=Q(),qe=Se[0],Ke=Se[1];yr.isTouch&&qe==="hold"&&Ke&&(ae=Ke),ae?r=setTimeout(function(){T.show()},ae):T.show()}function ut(F){if(T.clearDelayTimeouts(),I("onUntrigger",[T,F]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(F.type)>=0&&s)){var ae=ye(!1);ae?i=setTimeout(function(){T.state.isVisible&&T.hide()},ae):o=requestAnimationFrame(function(){T.hide()})}}function dt(){T.state.isEnabled=!0}function Bt(){T.hide(),T.state.isEnabled=!1}function Ot(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function L(F){if(!T.state.isDestroyed){I("onBeforeUpdate",[T,F]),pt();var ae=T.props,Se=Ww(t,Object.assign({},ae,Hw(F),{ignoreAttributes:!0}));T.props=Se,Xt(),ae.interactiveDebounce!==Se.interactiveDebounce&&(ie(),b=Bw(Zt,Se.interactiveDebounce)),ae.triggerTarget&&!Se.triggerTarget?rs(ae.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):Se.triggerTarget&&t.removeAttribute("aria-expanded"),j(),A(),Y&&Y(ae,Se),T.popperInstance&&(Pt(),_e().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),I("onAfterUpdate",[T,F])}}function H(F){T.setProps({content:F})}function X(){var F=T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ke=hh(T.props.duration,0,cr.duration);if(!(F||ae||Se||qe)&&!me().hasAttribute("disabled")&&(I("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,we()&&(R.style.visibility="visible"),A(),Ne(),T.state.isMounted||(R.style.transition="none"),we()){var Ft=ge(),ln=Ft.box,Zr=Ft.content;mh([ln,Zr],0)}m=function(){var xr;if(!(!T.state.isVisible||d)){if(d=!0,R.offsetHeight,R.style.transition=T.props.moveTransition,we()&&T.props.animation){var bs=ge(),Ni=bs.box,jr=bs.content;mh([Ni,jr],Ke),$w([Ni,jr],"visible")}z(),j(),Fw(bh,T),(xr=T.popperInstance)==null||xr.forceUpdate(),I("onMount",[T]),T.props.animation&&we()&&kt(Ke,function(){T.state.isShown=!0,I("onShown",[T])})}},yt()}}function se(){var F=!T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=hh(T.props.duration,1,cr.duration);if(!(F||ae||Se)&&(I("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,we()&&(R.style.visibility="hidden"),ie(),Be(),A(!0),we()){var Ke=ge(),Ft=Ke.box,ln=Ke.content;T.props.animation&&(mh([Ft,ln],qe),$w([Ft,ln],"hidden"))}z(),j(),T.props.animation?we()&&_t(qe,T.unmount):T.unmount()}}function Fe(F){Ce().addEventListener("mousemove",b),Fw(Lc,b),b(F)}function rt(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),_e().forEach(function(F){F._tippy.unmount()}),R.parentNode&&R.parentNode.removeChild(R),bh=bh.filter(function(F){return F!==T}),T.state.isMounted=!1,I("onHidden",[T]))}function wr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,I("onDestroy",[T]))}}function ma(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);$B();var r=Object.assign({},e,{plugins:n}),i=LB(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&XB(d,r);return f&&u.push(f),u},[]);return Bc(t)?l[0]:l}ma.defaultProps=cr;ma.setDefaultProps=GB;ma.currentInput=yr;var JV=Object.assign({},aa,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ma.setDefaultProps({render:Qw});var is=ma;var wh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:d,to:f})=>{let{doc:h,selection:m}=u,{empty:g}=m,b=!h.textBetween(d,f).length&&dc(u.selection),E=this.element.contains(document.activeElement);return!(!(l.hasFocus()||E)||g||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{let d=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,u)},this.updateDelay))},this.updateHandler=(l,u,d,f)=>{var h,m,g;let{state:b,composing:E}=l,{selection:w}=b;if(E||!u&&!d)return;this.createTooltip();let{ranges:N}=w,D=Math.min(...N.map(R=>R.$from.pos)),T=Math.max(...N.map(R=>R.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,element:this.element,view:l,state:b,oldState:f,from:D,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((g=this.tippyOptions)===null||g===void 0?void 0:g.getReferenceClientRect)||(()=>{if(hc(b.selection)){let R=l.nodeDOM(D);if(R){let Y=R.dataset.nodeViewWrapper?R:R.querySelector("[data-node-view-wrapper]");if(Y&&(R=Y.firstChild),R)return R.getBoundingClientRect()}}return mc(l,D,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ZB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new wh({view:e,...t})}),ex=We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var xh=class{getTextContent(e){return kp(e,{textSerializers:uc(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:u}=l,{$anchor:d,empty:f}=u,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:u}=s,{from:d,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>mc(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},jB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new xh({view:e,...t})}),tx=We.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[jB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var _h=ce.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var Sh=ce.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var QB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",e2="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",as=(t,e)=>{for(let n in e)t[n]=e[n];return t},Oh="numeric",Rh="ascii",Ih="alpha",ya="asciinumeric",ba="alphanumeric",Dh="domain",lx="emoji",t2="scheme",n2="slashscheme",Th="whitespace";function r2(t,e){return t in e||(e[t]=[]),e[t]}function mo(t,e,n){e[Oh]&&(e[ya]=!0,e[ba]=!0),e[Rh]&&(e[ya]=!0,e[Ih]=!0),e[ya]&&(e[ba]=!0),e[Ih]&&(e[ba]=!0),e[ba]&&(e[Dh]=!0),e[lx]&&(e[Dh]=!0);for(let r in e){let i=r2(r,n);i.indexOf(t)<0&&i.push(t)}}function i2(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),bt=(t,e,n,r,i)=>t.tr(e,n,r,i),nx=(t,e,n,r,i)=>t.ts(e,n,r,i),J=(t,e,n,r,i)=>t.tt(e,n,r,i),Jr="WORD",Lh="UWORD",cx="ASCIINUMERICAL",ux="ALPHANUMERICAL",Sa="LOCALHOST",Ph="TLD",Bh="UTLD",zc="SCHEME",ss="SLASH_SCHEME",Hh="NUM",Fh="WS",$h="NL",Ea="OPENBRACE",va="CLOSEBRACE",Uc="OPENBRACKET",Wc="CLOSEBRACKET",Kc="OPENPAREN",Vc="CLOSEPAREN",Gc="OPENANGLEBRACKET",qc="CLOSEANGLEBRACKET",Yc="FULLWIDTHLEFTPAREN",Jc="FULLWIDTHRIGHTPAREN",Xc="LEFTCORNERBRACKET",Zc="RIGHTCORNERBRACKET",jc="LEFTWHITECORNERBRACKET",Qc="RIGHTWHITECORNERBRACKET",eu="FULLWIDTHLESSTHAN",tu="FULLWIDTHGREATERTHAN",nu="AMPERSAND",zh="APOSTROPHE",ru="ASTERISK",Si="AT",iu="BACKSLASH",ou="BACKTICK",su="CARET",Ti="COLON",Uh="COMMA",au="DOLLAR",Er="DOT",lu="EQUALS",Wh="EXCLAMATION",Xn="HYPHEN",wa="PERCENT",cu="PIPE",uu="PLUS",du="POUND",xa="QUERY",Kh="QUOTE",dx="FULLWIDTHMIDDLEDOT",Vh="SEMI",vr="SLASH",_a="TILDE",fu="UNDERSCORE",fx="EMOJI",pu="SYM",px=Object.freeze({__proto__:null,WORD:Jr,UWORD:Lh,ASCIINUMERICAL:cx,ALPHANUMERICAL:ux,LOCALHOST:Sa,TLD:Ph,UTLD:Bh,SCHEME:zc,SLASH_SCHEME:ss,NUM:Hh,WS:Fh,NL:$h,OPENBRACE:Ea,CLOSEBRACE:va,OPENBRACKET:Uc,CLOSEBRACKET:Wc,OPENPAREN:Kc,CLOSEPAREN:Vc,OPENANGLEBRACKET:Gc,CLOSEANGLEBRACKET:qc,FULLWIDTHLEFTPAREN:Yc,FULLWIDTHRIGHTPAREN:Jc,LEFTCORNERBRACKET:Xc,RIGHTCORNERBRACKET:Zc,LEFTWHITECORNERBRACKET:jc,RIGHTWHITECORNERBRACKET:Qc,FULLWIDTHLESSTHAN:eu,FULLWIDTHGREATERTHAN:tu,AMPERSAND:nu,APOSTROPHE:zh,ASTERISK:ru,AT:Si,BACKSLASH:iu,BACKTICK:ou,CARET:su,COLON:Ti,COMMA:Uh,DOLLAR:au,DOT:Er,EQUALS:lu,EXCLAMATION:Wh,HYPHEN:Xn,PERCENT:wa,PIPE:cu,PLUS:uu,POUND:du,QUERY:xa,QUOTE:Kh,FULLWIDTHMIDDLEDOT:dx,SEMI:Vh,SLASH:vr,TILDE:_a,UNDERSCORE:fu,EMOJI:fx,SYM:pu}),qr=/[a-z]/,ga=/\p{L}/u,Ch=/\p{Emoji}/u;var Yr=/\d/,Ah=/\s/;var rx="\r",Mh=` -`,o2="\uFE0F",s2="\u200D",Nh="\uFFFC",Fc=null,Hc=null;function a2(t=[]){let e={};_n.groups=e;let n=new _n;Fc==null&&(Fc=ix(QB)),Hc==null&&(Hc=ix(e2)),J(n,"'",zh),J(n,"{",Ea),J(n,"}",va),J(n,"[",Uc),J(n,"]",Wc),J(n,"(",Kc),J(n,")",Vc),J(n,"<",Gc),J(n,">",qc),J(n,"\uFF08",Yc),J(n,"\uFF09",Jc),J(n,"\u300C",Xc),J(n,"\u300D",Zc),J(n,"\u300E",jc),J(n,"\u300F",Qc),J(n,"\uFF1C",eu),J(n,"\uFF1E",tu),J(n,"&",nu),J(n,"*",ru),J(n,"@",Si),J(n,"`",ou),J(n,"^",su),J(n,":",Ti),J(n,",",Uh),J(n,"$",au),J(n,".",Er),J(n,"=",lu),J(n,"!",Wh),J(n,"-",Xn),J(n,"%",wa),J(n,"|",cu),J(n,"+",uu),J(n,"#",du),J(n,"?",xa),J(n,'"',Kh),J(n,"/",vr),J(n,";",Vh),J(n,"~",_a),J(n,"_",fu),J(n,"\\",iu),J(n,"\u30FB",dx);let r=bt(n,Yr,Hh,{[Oh]:!0});bt(r,Yr,r);let i=bt(r,qr,cx,{[ya]:!0}),o=bt(r,ga,ux,{[ba]:!0}),s=bt(n,qr,Jr,{[Rh]:!0});bt(s,Yr,i),bt(s,qr,s),bt(i,Yr,i),bt(i,qr,i);let l=bt(n,ga,Lh,{[Ih]:!0});bt(l,qr),bt(l,Yr,o),bt(l,ga,l),bt(o,Yr,o),bt(o,qr),bt(o,ga,o);let u=J(n,Mh,$h,{[Th]:!0}),d=J(n,rx,Fh,{[Th]:!0}),f=bt(n,Ah,Fh,{[Th]:!0});J(n,Nh,f),J(d,Mh,u),J(d,Nh,f),bt(d,Ah,f),J(f,rx),J(f,Mh),bt(f,Ah,f),J(f,Nh,f);let h=bt(n,Ch,fx,{[lx]:!0});J(h,"#"),bt(h,Ch,h),J(h,o2,h);let m=J(h,s2);J(m,"#"),bt(m,Ch,h);let g=[[qr,s],[Yr,i]],b=[[qr,null],[ga,l],[Yr,o]];for(let E=0;EE[0]>w[0]?1:-1);for(let E=0;E=0?N[Dh]=!0:qr.test(w)?Yr.test(w)?N[ya]=!0:N[Rh]=!0:N[Oh]=!0,nx(n,w,w,N)}return nx(n,"localhost",Sa,{ascii:!0}),n.jd=new _n(pu),{start:n,tokens:as({groups:e},px)}}function hx(t,e){let n=l2(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function l2(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function _i(t,e,n,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ta={defaultProtocol:"http",events:null,format:ox,formatHref:ox,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gh(t,e=null){let n=as({},Ta);t&&(n=as(n,t instanceof Gh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ta.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),u&&(s.target=u),d&&(s.rel=d),f&&as(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function hu(t,e){class n extends mx{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var sx=hu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ax=hu("text"),c2=hu("nl"),$c=hu("url",{isLink:!0,toHref(t=Ta.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Sa&&t[1].t===Ti}});var Jn=t=>new _n(t);function u2({groups:t}){let e=t.domain.concat([nu,ru,Si,iu,ou,su,au,lu,Xn,Hh,wa,cu,uu,du,vr,pu,_a,fu]),n=[Ti,Uh,Er,Wh,wa,xa,Kh,Vh,Gc,qc,Ea,va,Wc,Uc,Kc,Vc,Yc,Jc,Xc,Zc,jc,Qc,eu,tu],r=[nu,zh,ru,iu,ou,su,au,lu,Xn,Ea,va,wa,cu,uu,du,xa,vr,pu,_a,fu],i=Jn(),o=J(i,_a);Pe(o,r,o),Pe(o,t.domain,o);let s=Jn(),l=Jn(),u=Jn();Pe(i,t.domain,s),Pe(i,t.scheme,l),Pe(i,t.slashscheme,u),Pe(s,r,o),Pe(s,t.domain,s);let d=J(s,Si);J(o,Si,d),J(l,Si,d),J(u,Si,d);let f=J(o,Er);Pe(f,r,o),Pe(f,t.domain,o);let h=Jn();Pe(d,t.domain,h),Pe(h,t.domain,h);let m=J(h,Er);Pe(m,t.domain,h);let g=Jn(sx);Pe(m,t.tld,g),Pe(m,t.utld,g),J(d,Sa,g);let b=J(h,Xn);J(b,Xn,b),Pe(b,t.domain,h),Pe(g,t.domain,h),J(g,Er,m),J(g,Xn,b);let E=J(g,Ti);Pe(E,t.numeric,sx);let w=J(s,Xn),S=J(s,Er);J(w,Xn,w),Pe(w,t.domain,s),Pe(S,r,o),Pe(S,t.domain,s);let N=Jn($c);Pe(S,t.tld,N),Pe(S,t.utld,N),Pe(N,t.domain,s),Pe(N,r,o),J(N,Er,S),J(N,Xn,w),J(N,Si,d);let D=J(N,Ti),T=Jn($c);Pe(D,t.numeric,T);let B=Jn($c),R=Jn();Pe(B,e,B),Pe(B,n,R),Pe(R,e,B),Pe(R,n,R),J(N,vr,B),J(T,vr,B);let Y=J(l,Ti),ne=J(u,Ti),q=J(ne,vr),Q=J(q,vr);Pe(l,t.domain,s),J(l,Er,S),J(l,Xn,w),Pe(u,t.domain,s),J(u,Er,S),J(u,Xn,w),Pe(Y,t.domain,B),J(Y,vr,B),J(Y,xa,B),Pe(Q,t.domain,B),Pe(Q,e,B),J(Q,vr,B);let fe=[[Ea,va],[Uc,Wc],[Kc,Vc],[Gc,qc],[Yc,Jc],[Xc,Zc],[jc,Qc],[eu,tu]];for(let we=0;we=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(kh(ax,e,s)),s=[]),i-=m,f-=m;let g=h.t,b=n.slice(i-f,i);o.push(kh(g,e,b))}}return s.length>0&&o.push(kh(ax,e,s)),o}function kh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var f2=typeof console<"u"&&console&&console.warn||(()=>{}),p2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",at={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gx(){return _n.groups={},at.scanner=null,at.parser=null,at.tokenQueue=[],at.pluginQueue=[],at.customSchemes=[],at.initialized=!1,at}function qh(t,e=!1){if(at.initialized&&f2(`linkifyjs: already initialized - will not register custom scheme "${t}" ${p2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,textSerializers:r={}}=e||{};return kp(this.state.doc,{blockSeparator:n,textSerializers:{...uc(this.schema),...r}})}get isEmpty(){return oa(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){let n=this.state.doc.resolve(e);return new Sp(n,this)}get $doc(){return this.$pos(0)}};function Vn(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let u=l.search(/\S/),d=n.from+l.indexOf(s),f=d+s.length;if(pc(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(E=>E===t.type&&E!==b.mark.type)).filter(b=>b.to>d).length)return null;fn.from&&o.delete(n.from+u,d);let m=n.from+u+s.length;o.addMark(n.from+u,m,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function gc(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Te(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,l=n.to,u=t.type.create(i);if(r[1]){let d=r[0].lastIndexOf(r[1]),f=s+d;f>l?f=l:l=f+r[1].length;let h=r[0][r[0].length-1];o.insertText(h,s+r[0].length-1),o.replaceWith(f,l,u)}else if(r[0]){let d=t.type.isInline?s:s-1;o.insert(d,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function sa(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Te(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function Ei(t){return new Jo({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Te(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),d=u&&Bo(u,t.type,o);if(!d)return null;if(s.wrap(u,d),t.keepMarks&&t.editor){let{selection:h,storedMarks:m}=e,{splittableMarks:b}=t.editor.extensionManager,g=m||h.$to.parentOffset&&h.$from.marks();if(g){let E=g.filter(w=>b.includes(w.type.name));s.ensureMarks(E)}}if(t.keepAttributes){let h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,o).run()}let f=s.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&rr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&s.join(n.from-1)}})}var ce=class t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Te(re(this,"addOptions",{name:this.name}))),this.storage=Te(re(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new t(e)}configure(e={}){let n=this.extend({...this.config,addOptions:()=>cc(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){let n=new t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Te(re(n,"addOptions",{name:n.name})),n.storage=Te(re(n,"addStorage",{name:n.name,options:n.options})),n}};function xn(t){return new vp({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Te(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],u=r[0],d=n.to;if(l){let f=u.search(/\S/),h=n.from+u.indexOf(l),m=h+l.length;if(pc(n.from,n.to,e.doc).filter(g=>g.mark.type.excluded.find(w=>w===t.type&&w!==g.mark.type)).filter(g=>g.to>h).length)return null;mn.from&&s.delete(n.from+f,h),d=n.from+f+l.length,s.addMark(n.from+f,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function ov(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var CL=/^\s*>\s$/,sv=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ei({find:CL,type:this.type})]}});var AL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ML=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,NL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,av=st.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Vn({find:AL,type:this.type}),Vn({find:NL,type:this.type})]},addPasteRules(){return[xn({find:ML,type:this.type}),xn({find:kL,type:this.type})]}});var OL="listItem",lv="textStyle",cv=/^\s*([-+*])\s$/,uv=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OL,this.editor.getAttributes(lv)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ei({find:cv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:cv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lv),editor:this.editor})),[t]}});var RL=/(^|[^`])`([^`]+)`(?!`)/,IL=/(^|[^`])`([^`]+)`(?!`)/g,dv=st.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Vn({find:RL,type:this.type})]},addPasteRules(){return[xn({find:IL,type:this.type})]}});var DL=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;let o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},fv=st.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&DL(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}});var pv=We.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});var Rp=ce.create({name:"doc",topNode:!0,content:"block+"});function hv(t={}){return new Oe({view(e){return new Ip(e,t)}})}var Ip=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let d=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(d){let f=d.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Il(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}};var mv=We.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hv(this.options)]}});var on=class t extends ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return t.valid(r)?new t(r):ue.near(r)}content(){return Z.empty}eq(e){return e instanceof t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))}getBookmark(){return new Dp(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!LL(e)||!PL(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&t.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(t.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(t.valid(l))return l}return null}}};on.prototype.visible=!1;on.findFrom=on.findGapCursorFrom;ue.jsonID("gapcursor",on);var Dp=class t{constructor(e){this.pos=e}map(e){return new t(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return on.valid(n)?new on(n):ue.near(n)}};function LL(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function PL(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function gv(){return new Oe({props:{decorations:$L,createSelectionBetween(t,e,n){return e.pos==n.pos&&on.valid(n)?new on(n):null},handleClick:FL,handleKeyDown:BL,handleDOMEvents:{beforeinput:HL}}})}var BL=ra({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof le){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=on.findGapCursorFrom(l,e,u);return d?(i&&i(r.tr.setSelection(new on(d))),!0):!1}}function FL(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!on.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&he.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new on(r))),!0)}function HL(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof on))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let s=r.length-1;s>=0;s--)i=K.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new Z(i,0,0));return o.setSelection(le.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function $L(t){if(!(t.selection instanceof on))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[wt.widget(t.selection.head,e,{key:"gapcursor"})])}var bv=We.create({name:"gapCursor",addProseMirrorPlugins(){return[gv()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Te(re(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var yv=ce.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",ee(this.options.HTMLAttributes,t)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&s){let h=u.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Ev=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var yc=200,Yt=function(){};Yt.prototype.append=function(e){return e.length?(e=Yt.from(e),!this.length&&e||e.length=n?Yt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Yt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Yt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Yt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Yt.from=function(e){return e instanceof Yt?e:e&&e.length?new vv(e):Yt.empty};var vv=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=yc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=yc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Yt);Yt.empty=new vv([]);var zL=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Yt),Lp=Yt;var UL=500,ro=class t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,d=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){i||(i=this.remapping(r,m+1),o=i.maps.length),o--,f.push(h);return}if(i){f.push(new mr(h.map));let b=h.step.map(i.slice(o)),g;b&&s.maybeStep(b).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],d.push(new mr(g,void 0,void 0,d.length+f.length))),o--,g&&i.appendMap(g,o)}else s.maybeStep(h.step);if(h.selection)return l=i?h.selection.map(i.slice(o)):h.selection,u=new t(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let f=0;fKL&&(l=WL(l,d),s-=d),new t(l.append(o),s)}remapping(e,n){let r=new Us;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new t(this.items.append(e.map(n=>new mr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},i);let u=n;this.items.forEach(m=>{let b=o.getMirror(--u);if(b==null)return;s=Math.min(s,b);let g=o.maps[b];if(m.step){let E=e.steps[b].invert(e.docs[b]),w=m.selection&&m.selection.map(o.slice(u+1,b));w&&l++,r.push(new mr(g,E,w))}else r.push(new mr(g))},i);let d=[];for(let m=n;mUL&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=s.selection&&s.selection.map(n.slice(r));f&&o++;let h=new mr(d.invert(),u,f),m,b=i.length-1;(m=i.length&&i[b].merge(h))?i[b]=m:i.push(h)}}else s.map&&r--},this.items.length,0),new t(Lp.from(i.reverse()),o)}};ro.empty=new ro(Lp.empty,0);function WL(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var mr=class t{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}},gr=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},KL=20;function VL(t,e,n,r){let i=n.getMeta(no),o;if(i)return i.historyState;n.getMeta(YL)&&(t=new gr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(no))return s.getMeta(no).redo?new gr(t.done.addTransform(n,void 0,r,Ec(e)),t.undone,wv(n.mapping.maps),t.prevTime,t.prevComposition):new gr(t.done,t.undone.addTransform(n,void 0,r,Ec(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!GL(n,t.prevRanges)),d=s?Pp(t.prevRanges,n.mapping):wv(n.mapping.maps);return new gr(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Ec(e)),ro.empty,d,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new gr(t.done.rebased(n,o),t.undone.rebased(n,o),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new gr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function GL(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function wv(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Pp(t,e){if(!t)return null;let n=[];for(let r=0;r{let i=no.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=qL(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}var Fp=vc(!1,!0),Hp=vc(!0,!0),$z=vc(!1,!1),zz=vc(!0,!1);var Sv=We.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Fp(t,e),redo:()=>({state:t,dispatch:e})=>Hp(t,e)}},addProseMirrorPlugins(){return[_v(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var Tv=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{selection:n}=e,{$from:r,$to:i}=n,o=t();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hc(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var u;if(l){let{$to:d}=s.selection,f=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?s.setSelection(le.create(s.doc,d.pos+1)):d.nodeAfter.isBlock?s.setSelection(he.create(s.doc,d.pos)):s.setSelection(le.create(s.doc,d.pos));else{let h=(u=d.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(s.insert(f,h),s.setSelection(le.create(s.doc,f+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var JL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,XL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,ZL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Cv=st.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Vn({find:JL,type:this.type}),Vn({find:ZL,type:this.type})]},addPasteRules(){return[xn({find:XL,type:this.type}),xn({find:jL,type:this.type})]}});var $p=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",ee(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});var QL="listItem",Av="textStyle",Mv=/^(\d+)\.\s$/,Nv=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",ee(this.options.HTMLAttributes,n),0]:["ol",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(QL,this.editor.getAttributes(Av)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ei({find:Mv,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ei({find:Mv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Av)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});var wc=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var kv=We.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Oe({key:new ze("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,l)=>{let u=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&oa(s);if((u||!this.options.showOnlyCurrent)&&d){let f=[this.options.emptyNodeClass];o&&f.push(this.options.emptyEditorClass);let h=wt.node(l,l+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:u}):this.options.placeholder});i.push(h)}return this.options.includeChildren}),ot.create(t,i)}}})]}});var eP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,tP=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ov=st.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Vn({find:eP,type:this.type})]},addPasteRules(){return[xn({find:tP,type:this.type})]}});var Rv=st.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}});var Iv=st.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});var Up,Wp;if(typeof WeakMap<"u"){let t=new WeakMap;Up=e=>t.get(e),Wp=(e,n)=>(t.set(e,n),n)}else{let t=[],n=0;Up=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var mt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:f,n:S-k});break}let T=i+k*e;for(let P=0;Pr&&(o+=d.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function iP(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function sP(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function or(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ac(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Xo(e.$head)||aP(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function aP(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Kp(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function lP(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qp(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Wv(t,e,n){let r=t.node(-1),i=mt.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function io(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Kv(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=n.pos-o);u.unshift(n.pos-o);let d=u.map(f=>{let h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o+f+1;return new $o(l.resolve(m),l.resolve(m+h.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Kp(r)&&Kp(i)&&qp(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Wr.rowSelection(r,i):o&&this.isColSelection()?Wr.colSelection(r,i):new Wr(r,i)}return le.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=mt.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let u=i.top;u0||w>0){let S=g.attrs;if(E>0&&(S=io(S,0,E)),w>0&&(S=io(S,S.colspan-w,w)),b.lefti.bottom){let S={...g.attrs,rowspan:Math.min(b.bottom,i.bottom)-Math.max(b.top,i.top)};b.top0)return!1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.top<=l.top?(s.top>0&&(e=u.resolve(o+i.map[s.left])),l.bottom0&&(n=u.resolve(o+i.map[l.left])),s.bottom0)return!1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Wr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=mt.get(r),o=e.start(-1),s=i.findCell(e.pos-o),l=i.findCell(n.pos-o),u=e.node(0);return s.left<=l.left?(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),l.right0&&(n=u.resolve(o+i.map[l.top*i.width])),s.right{e.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ot.create(t.doc,e)}function fP({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function pP({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function hP(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof he&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=et.create(i,r.from);else if(s=="row"){let l=i.resolve(r.from+1);o=et.rowSelection(l,l)}else if(!n){let l=mt.get(r.node),u=r.from+1,d=u+l.map[l.width*l.height-1];o=et.create(i,u+1,d)}}else r instanceof le&&fP(r)?o=le.create(i,r.from):r instanceof le&&pP(r)&&(o=le.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var mP=new ze("fix-tables");function Gv(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=gP(t,i,o,n))};return e?e.doc!=t.doc&&Gv(e.doc,t.doc,0,r):t.doc.descendants(r),n}function gP(t,e,n,r){let i=mt.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let u=0;u0){let b="cell";f.firstChild&&(b=f.firstChild.type.spec.tableRole);let g=[];for(let w=0;w0?-1:0;cP(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;yP(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let d=0,f=e.width*i;d0&&i0&&h==e.map[f-e.width]){let m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),d+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function wP(t){return(e,n)=>{var r;let i=e.selection,o,s;if(i instanceof et){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=sP(i.$from),!o)return!1;s=(r=Xo(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs,u=[],d=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});let f=br(e),h=e.tr;for(let b=0;b{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function xP(t){return function(e,n){if(!or(e))return!1;if(n){let r=sn(e.schema),i=br(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{let g=b+o.tableStart,E=s.doc.nodeAt(g);E&&s.setNodeMarkup(g,m,E.attrs)}),r(s)}return!0}}var CU=Zo("row",{useDeprecatedLogic:!0}),AU=Zo("column",{useDeprecatedLogic:!0}),nw=Zo("cell",{useDeprecatedLogic:!0});function _P(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function xc(t,e){let n=t.selection;if(!(n instanceof et))return!1;if(e){let r=t.tr,i=sn(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Z(i,0,0))}),r.docChanged&&e(r)}return!0}function SP(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){let{rowspan:l,colspan:u}=o.child(s).attrs;for(let d=i;d=e.length&&e.push(K.empty),n[i]r&&(m=m.type.createChecked(io(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),d.push(m),f+=m.attrs.colspan;for(let b=1;bi&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,i-h.attrs.rowspan)},h.content)),u.push(h)}o.push(K.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function AP(t,e,n,r,i,o,s){let l=t.doc.type.schema,u=sn(l),d,f;if(i>e.width)for(let h=0,m=0;he.height){let h=[];for(let g=0,E=(e.height-1)*e.width;g=e.width?!1:n.nodeAt(e.map[E+g]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):d||(d=u.cell.createAndFill()))}let m=u.row.create(null,K.from(h)),b=[];for(let g=e.height;g{if(!i)return!1;let o=n.selection;if(o instanceof et)return Tc(n,r,ue.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;let s=iw(i,t,e);if(s==null)return!1;if(t=="horiz")return Tc(n,r,ue.near(n.doc.resolve(o.head+e),e));{let l=n.doc.resolve(s),u=Wv(l,t,e),d;return u?d=ue.near(u,1):e<0?d=ue.near(n.doc.resolve(l.before(-1)),-1):d=ue.near(n.doc.resolve(l.after(-1)),1),Tc(n,r,d)}}}function Sc(t,e){return(n,r,i)=>{if(!i)return!1;let o=n.selection,s;if(o instanceof et)s=o;else{let u=iw(i,t,e);if(u==null)return!1;s=new et(n.doc.resolve(u))}let l=Wv(s.$headCell,t,e);return l?Tc(n,r,new et(s.$anchorCell,l)):!1}}function NP(t,e){let n=t.state.doc,r=Xo(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new et(r))),!0):!1}function kP(t,e,n){if(!or(t.state))return!1;let r=SP(n),i=t.state.selection;if(i instanceof et){r||(r={width:1,height:1,rows:[K.from(Vp(sn(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=mt.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=CP(r,l.right-l.left,l.bottom-l.top),Fv(t.state,t.dispatch,s,l,r),!0}else if(r){let o=Ac(t.state),s=o.start(-1);return Fv(t.state,t.dispatch,s,mt.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function OP(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Hv(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof et)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Xo(t.state.selection.$anchor))!=null&&((n=zp(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,d){let f=zp(t,d),h=vi.getState(t.state)==null;if(!f||!qp(u,f))if(h)f=u;else return;let m=new et(u,f);if(h||!t.state.selection.eq(m)){let b=t.state.tr.setSelection(m);h&&b.setMeta(vi,u.pos),t.dispatch(b)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),vi.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(vi,-1))}function l(u){let d=u,f=vi.getState(t.state),h;if(f!=null)h=t.state.doc.resolve(f);else if(Hv(t,d.target)!=r&&(h=zp(t,e),!h))return s();h&&o(h,d)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function iw(t,e,n){if(!(t.state.selection instanceof le))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function Hv(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function zp(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Xo(t.state.doc.resolve(n.pos)):null}var RP=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gp(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Gp(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gp(t,e,n,r,i,o){var s;let l=0,u=!0,d=e.firstChild,f=t.firstChild;if(f){for(let h=0,m=0;hnew r(m,n,b)),new IP(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{let l=On.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{DP(s,l,t,i)},mouseleave:s=>{LP(s)},mousedown:(s,l)=>{PP(s,l,e,n)}},decorations:s=>{let l=On.getState(s);if(l&&l.activeHandle>-1)return zP(s,l.activeHandle)},nodeViews:{}}});return o}var IP=class Cc{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){let n=this,r=e.getMeta(On);if(r&&r.setHandle!=null)return new Cc(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Cc(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Kp(e.doc.resolve(i))||(i=-1),new Cc(i,n.dragging)}return n}};function DP(t,e,n,r){let i=On.getState(t.state);if(i&&!i.dragging){let o=FP(e.target),s=-1;if(o){let{left:l,right:u}=o.getBoundingClientRect();e.clientX-l<=n?s=$v(t,e,"left",n):u-e.clientX<=n&&(s=$v(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){let l=t.state.doc.resolve(s),u=l.node(-1),d=mt.get(u),f=l.start(-1);if(d.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==d.width-1)return}sw(t,s)}}}function LP(t){let e=On.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&sw(t,-1)}function PP(t,e,n,r){var i;let o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=On.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;let l=t.state.doc.nodeAt(s.activeHandle),u=BP(t,s.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(On,{setDragging:{startX:e.clientX,startWidth:u}}));function d(h){o.removeEventListener("mouseup",d),o.removeEventListener("mousemove",f);let m=On.getState(t.state);m?.dragging&&(HP(t,m.activeHandle,zv(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(On,{setDragging:null})))}function f(h){if(!h.which)return d(h);let m=On.getState(t.state);if(m&&m.dragging){let b=zv(m.dragging,h,n);Uv(t,m.activeHandle,b,r)}}return Uv(t,s.activeHandle,u,r),o.addEventListener("mouseup",d),o.addEventListener("mousemove",f),e.preventDefault(),!0}function BP(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let d=0;d{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function KP(t,e,n,r,i){let o=WP(t),s=[],l=[];for(let d=0;d{let{selection:e}=t.state;if(!VP(e))return!1;let n=0,r=Np(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},uw=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Qp,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=UP(t,this.options.cellMinWidth);return["table",ee(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=KP(o.schema,t,e,n);if(i){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(le.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>Yv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Jv(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Xv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>jv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Qv(t,e),deleteRow:()=>({state:t,dispatch:e})=>ew(t,e),deleteTable:()=>({state:t,dispatch:e})=>rw(t,e),mergeCells:()=>({state:t,dispatch:e})=>Jp(t,e),splitCell:()=>({state:t,dispatch:e})=>Xp(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Zo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Zo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>nw(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Jp(t,e)?!0:Xp(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>tw(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Zp(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Zp(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Yp(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=et.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Mc,"Mod-Backspace":Mc,Delete:Mc,"Mod-Delete":Mc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ow({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],aw({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:Te(re(t,"tableRole",e))}}});var dw=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",ee(this.options.HTMLAttributes,t),0]}});var fw=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",ee(this.options.HTMLAttributes,t),0]}});var pw=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",ee(this.options.HTMLAttributes,t),0]}});var hw=ce.create({name:"text",group:"inline"});var mw=st.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});var GP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,qP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,gw=st.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Vn({find:GP,type:this.type})]},addPasteRules(){return[xn({find:qP,type:this.type})]}});var gt="top",Dt="bottom",Mt="right",xt="left",Nc="auto",wi=[gt,Dt,Mt,xt],Kr="start",oo="end",bw="clippingParents",kc="viewport",jo="popper",yw="reference",eh=wi.reduce(function(t,e){return t.concat([e+"-"+Kr,e+"-"+oo])},[]),Oc=[].concat(wi,[Nc]).reduce(function(t,e){return t.concat([e,e+"-"+Kr,e+"-"+oo])},[]),YP="beforeRead",JP="read",XP="afterRead",ZP="beforeMain",jP="main",QP="afterMain",eB="beforeWrite",tB="write",nB="afterWrite",Ew=[YP,JP,XP,ZP,jP,QP,eB,tB,nB];function Wt(t){return t?(t.nodeName||"").toLowerCase():null}function ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Gn(t){var e=ct(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Qo(t){if(typeof ShadowRoot>"u")return!1;var e=ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function rB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!Wt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function iB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!Wt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var aa={name:"applyStyles",enabled:!0,phase:"write",fn:rB,effect:iB,requires:["computeStyles"]};function Kt(t){return t.split("-")[0]}var sr=Math.max,so=Math.min,Vr=Math.round;function es(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function la(){return!/^((?!chrome|android).)*safari/i.test(es())}function qn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Vr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Vr(r.height)/t.offsetHeight||1);var s=Gn(t)?ct(t):window,l=s.visualViewport,u=!la()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function ao(t){var e=qn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ca(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Qo(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return ct(t).getComputedStyle(t)}function th(t){return["table","td","th"].indexOf(Wt(t))>=0}function Jt(t){return((Gn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gr(t){return Wt(t)==="html"?t:t.assignedSlot||t.parentNode||(Qo(t)?t.host:null)||Jt(t)}function vw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function oB(t){var e=/firefox/i.test(es()),n=/Trident/i.test(es());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Gr(t);for(Qo(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf(Wt(i))<0;){var o=gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=ct(t),n=vw(t);n&&th(n)&&gn(n).position==="static";)n=vw(n);return n&&(Wt(n)==="html"||Wt(n)==="body"&&gn(n).position==="static")?e:n||oB(t)||e}function lo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function co(t,e,n){return sr(t,so(e,n))}function ww(t,e,n){var r=co(t,e,n);return r>n?n:r}function ua(){return{top:0,right:0,bottom:0,left:0}}function da(t){return Object.assign({},ua(),t)}function fa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var sB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,da(typeof e!="number"?e:fa(e,wi))};function aB(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Kt(n.placement),u=lo(l),d=[xt,Mt].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=sB(i.padding,n),m=ao(o),b=u==="y"?gt:xt,g=u==="y"?Dt:Mt,E=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],w=s[u]-n.rects.reference[u],S=ar(o),O=S?u==="y"?S.clientHeight||0:S.clientWidth||0:0,k=E/2-w/2,T=h[b],P=O-m[f]-h[g],I=O/2-m[f]/2+k,Y=co(T,I,P),ne=u;n.modifiersData[r]=(e={},e[ne]=Y,e.centerOffset=Y-I,e)}}function lB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ca(e.elements.popper,i)&&(e.elements.arrow=i))}var xw={name:"arrow",enabled:!0,phase:"main",fn:aB,effect:lB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yn(t){return t.split("-")[1]}var cB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Vr(n*i)/i||0,y:Vr(r*i)/i||0}}function _w(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,b=m===void 0?0:m,g=s.y,E=g===void 0?0:g,w=typeof f=="function"?f({x:b,y:E}):{x:b,y:E};b=w.x,E=w.y;var S=s.hasOwnProperty("x"),O=s.hasOwnProperty("y"),k=xt,T=gt,P=window;if(d){var I=ar(n),Y="clientHeight",ne="clientWidth";if(I===ct(n)&&(I=Jt(n),gn(I).position!=="static"&&l==="absolute"&&(Y="scrollHeight",ne="scrollWidth")),I=I,i===gt||(i===xt||i===Mt)&&o===oo){T=Dt;var q=h&&I===P&&P.visualViewport?P.visualViewport.height:I[Y];E-=q-r.height,E*=u?1:-1}if(i===xt||(i===gt||i===Dt)&&o===oo){k=Mt;var Q=h&&I===P&&P.visualViewport?P.visualViewport.width:I[ne];b-=Q-r.width,b*=u?1:-1}}var fe=Object.assign({position:l},d&&cB),we=f===!0?uB({x:b,y:E},ct(n)):{x:b,y:E};if(b=we.x,E=we.y,u){var me;return Object.assign({},fe,(me={},me[T]=O?"0":"",me[k]=S?"0":"",me.transform=(P.devicePixelRatio||1)<=1?"translate("+b+"px, "+E+"px)":"translate3d("+b+"px, "+E+"px, 0)",me))}return Object.assign({},fe,(e={},e[T]=O?E+"px":"",e[k]=S?b+"px":"",e.transform="",e))}function dB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Kt(e.placement),variation:Yn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_w(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,_w(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Sw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:dB,data:{}};var Rc={passive:!0};function fB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=ct(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,Rc)}),l&&u.addEventListener("resize",n.update,Rc),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,Rc)}),l&&u.removeEventListener("resize",n.update,Rc)}}var Tw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:fB,data:{}};var pB={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(t){return t.replace(/left|right|bottom|top/g,function(e){return pB[e]})}var hB={start:"end",end:"start"};function Ic(t){return t.replace(/start|end/g,function(e){return hB[e]})}function uo(t){var e=ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function fo(t){return qn(Jt(t)).left+uo(t).scrollLeft}function nh(t,e){var n=ct(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=la();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+fo(t),y:u}}function rh(t){var e,n=Jt(t),r=uo(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+fo(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function po(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Dc(t){return["html","body","#document"].indexOf(Wt(t))>=0?t.ownerDocument.body:Lt(t)&&po(t)?t:Dc(Gr(t))}function xi(t,e){var n;e===void 0&&(e=[]);var r=Dc(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=ct(r),s=i?[o].concat(o.visualViewport||[],po(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(xi(Gr(s)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mB(t,e){var n=qn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Cw(t,e,n){return e===kc?ns(nh(t,n)):Gn(e)?mB(e,n):ns(rh(Jt(t)))}function gB(t){var e=xi(Gr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return Gn(r)?e.filter(function(i){return Gn(i)&&ca(i,r)&&Wt(i)!=="body"}):[]}function ih(t,e,n,r){var i=e==="clippingParents"?gB(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=Cw(t,d,r);return u.top=sr(f.top,u.top),u.right=so(f.right,u.right),u.bottom=so(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},Cw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function pa(t){var e=t.reference,n=t.element,r=t.placement,i=r?Kt(r):null,o=r?Yn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case gt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case Mt:u={x:e.x+e.width,y:l};break;case xt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?lo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Kr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case oo:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?bw:l,d=n.rootBoundary,f=d===void 0?kc:d,h=n.elementContext,m=h===void 0?jo:h,b=n.altBoundary,g=b===void 0?!1:b,E=n.padding,w=E===void 0?0:E,S=da(typeof w!="number"?w:fa(w,wi)),O=m===jo?yw:jo,k=t.rects.popper,T=t.elements[g?O:m],P=ih(Gn(T)?T:T.contextElement||Jt(t.elements.popper),u,f,s),I=qn(t.elements.reference),Y=pa({reference:I,element:k,strategy:"absolute",placement:i}),ne=ns(Object.assign({},k,Y)),q=m===jo?ne:I,Q={top:P.top-q.top+S.top,bottom:q.bottom-P.bottom+S.bottom,left:P.left-q.left+S.left,right:q.right-P.right+S.right},fe=t.modifiersData.offset;if(m===jo&&fe){var we=fe[i];Object.keys(Q).forEach(function(me){var Ce=[Mt,Dt].indexOf(me)>=0?1:-1,ge=[gt,Dt].indexOf(me)>=0?"y":"x";Q[me]+=we[ge]*Ce})}return Q}function oh(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?Oc:u,f=Yn(r),h=f?l?eh:eh.filter(function(g){return Yn(g)===f}):wi,m=h.filter(function(g){return d.indexOf(g)>=0});m.length===0&&(m=h);var b=m.reduce(function(g,E){return g[E]=lr(t,{placement:E,boundary:i,rootBoundary:o,padding:s})[Kt(E)],g},{});return Object.keys(b).sort(function(g,E){return b[g]-b[E]})}function bB(t){if(Kt(t)===Nc)return[];var e=ts(t);return[Ic(t),e,Ic(e)]}function yB(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,b=n.flipVariations,g=b===void 0?!0:b,E=n.allowedAutoPlacements,w=e.options.placement,S=Kt(w),O=S===w,k=u||(O||!g?[ts(w)]:bB(w)),T=[w].concat(k).reduce(function(je,Ne){return je.concat(Kt(Ne)===Nc?oh(e,{placement:Ne,boundary:f,rootBoundary:h,padding:d,flipVariations:g,allowedAutoPlacements:E}):Ne)},[]),P=e.rects.reference,I=e.rects.popper,Y=new Map,ne=!0,q=T[0],Q=0;Q=0,ge=Ce?"width":"height",ye=lr(e,{placement:fe,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),A=Ce?me?Mt:xt:me?Dt:gt;P[ge]>I[ge]&&(A=ts(A));var D=ts(A),z=[];if(o&&z.push(ye[we]<=0),l&&z.push(ye[A]<=0,ye[D]<=0),z.every(function(je){return je})){q=fe,ne=!1;break}Y.set(fe,z)}if(ne)for(var j=g?3:1,ie=function(Ne){var Be=T.find(function(_t){var kt=Y.get(_t);if(kt)return kt.slice(0,Ne).every(function(Re){return Re})});if(Be)return q=Be,"break"},xe=j;xe>0;xe--){var Ae=ie(xe);if(Ae==="break")break}e.placement!==q&&(e.modifiersData[r]._skip=!0,e.placement=q,e.reset=!0)}}var Aw={name:"flip",enabled:!0,phase:"main",fn:yB,requiresIfExists:["offset"],data:{_skip:!1}};function Mw(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Nw(t){return[gt,Mt,Dt,xt].some(function(e){return t[e]>=0})}function EB(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=Mw(s,r),d=Mw(l,i,o),f=Nw(u),h=Nw(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:EB};function vB(t,e,n){var r=Kt(t),i=[xt,gt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[xt,Mt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function wB(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Oc.reduce(function(f,h){return f[h]=vB(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var Ow={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:wB};function xB(t){var e=t.state,n=t.name;e.modifiersData[n]=pa({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Rw={name:"popperOffsets",enabled:!0,phase:"read",fn:xB,data:{}};function sh(t){return t==="x"?"y":"x"}function _B(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,b=m===void 0?!0:m,g=n.tetherOffset,E=g===void 0?0:g,w=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),S=Kt(e.placement),O=Yn(e.placement),k=!O,T=lo(S),P=sh(T),I=e.modifiersData.popperOffsets,Y=e.rects.reference,ne=e.rects.popper,q=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,Q=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),fe=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,we={x:0,y:0};if(I){if(o){var me,Ce=T==="y"?gt:xt,ge=T==="y"?Dt:Mt,ye=T==="y"?"height":"width",A=I[T],D=A+w[Ce],z=A-w[ge],j=b?-ne[ye]/2:0,ie=O===Kr?Y[ye]:ne[ye],xe=O===Kr?-ne[ye]:-Y[ye],Ae=e.elements.arrow,je=b&&Ae?ao(Ae):{width:0,height:0},Ne=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ua(),Be=Ne[Ce],_t=Ne[ge],kt=co(0,Y[ye],je[ye]),Re=k?Y[ye]/2-j-kt-Be-Q.mainAxis:ie-kt-Be-Q.mainAxis,St=k?-Y[ye]/2+j+kt+_t+Q.mainAxis:xe+kt+_t+Q.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),pt=Xt?T==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,an=(me=fe?.[T])!=null?me:0,Zt=A+Re-an-pt,Tt=A+St-an,Je=co(b?so(D,Zt):D,A,b?sr(z,Tt):z);I[T]=Je,we[T]=Je-A}if(l){var jn,Pt=T==="x"?gt:xt,V=T==="x"?Dt:Mt,yt=I[P],_e=P==="y"?"height":"width",pe=yt+w[Pt],ut=yt-w[V],dt=[gt,xt].indexOf(S)!==-1,Bt=(jn=fe?.[P])!=null?jn:0,Ot=dt?pe:yt-Y[_e]-ne[_e]-Bt+Q.altAxis,L=dt?yt+Y[_e]+ne[_e]-Bt-Q.altAxis:ut,H=b&&dt?ww(Ot,yt,L):co(b?Ot:pe,yt,b?L:ut);I[P]=H,we[P]=H-yt}e.modifiersData[r]=we}}var Iw={name:"preventOverflow",enabled:!0,phase:"main",fn:_B,requiresIfExists:["offset"]};function ah(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function lh(t){return t===ct(t)||!Lt(t)?uo(t):ah(t)}function SB(t){var e=t.getBoundingClientRect(),n=Vr(e.width)/t.offsetWidth||1,r=Vr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function ch(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&SB(e),o=Jt(e),s=qn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Wt(e)!=="body"||po(o))&&(l=lh(e)),Lt(e)?(u=qn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=fo(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function TB(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function uh(t){var e=TB(t);return Ew.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function dh(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function fh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Dw={placement:"bottom",modifiers:[],strategy:"absolute"};function Lw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function Xw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Bw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function NB(t){return t.split(/\s+/).filter(Boolean)}function rs(t){return[].concat(t)}function Fw(t,e){t.indexOf(e)===-1&&t.push(e)}function kB(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function OB(t){return t.split("-")[0]}function Pc(t){return[].slice.call(t)}function Hw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ha(){return document.createElement("div")}function Bc(t){return["Element","Fragment"].some(function(e){return vh(t,e)})}function RB(t){return vh(t,"NodeList")}function IB(t){return vh(t,"MouseEvent")}function DB(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function LB(t){return Bc(t)?[t]:RB(t)?Pc(t):Array.isArray(t)?t:Pc(document.querySelectorAll(t))}function mh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $w(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function PB(t){var e,n=rs(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function BB(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=OB(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,b=d==="right"?f.left.x:0,g=d==="left"?f.right.x:0,E=o.top-r+h>u,w=r-o.bottom-m>u,S=o.left-n+b>u,O=n-o.right-g>u;return E||w||S||O})}function gh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function zw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var yr={isTouch:!1},Uw=0;function FB(){yr.isTouch||(yr.isTouch=!0,window.performance&&document.addEventListener("mousemove",Zw))}function Zw(){var t=performance.now();t-Uw<20&&(yr.isTouch=!1,document.removeEventListener("mousemove",Zw)),Uw=t}function HB(){var t=document.activeElement;if(DB(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function $B(){document.addEventListener("touchstart",FB,ho),window.addEventListener("blur",HB)}var zB=typeof window<"u"&&typeof document<"u",UB=zB?!!window.msCrypto:!1;var WB={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},KB={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:Jw,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},WB,KB),VB=Object.keys(cr),GB=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function jw(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function qB(t,e){var n=e?Object.keys(jw(Object.assign({},cr,{plugins:e}))):VB,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Ww(t,e){var n=Object.assign({},e,{content:Xw(e.content,[t])},e.ignoreAttributes?{}:qB(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var YB=function(){return"innerHTML"};function yh(t,e){t[YB()]=e}function Kw(t){var e=ha();return t===!0?e.className=qw:(e.className=Yw,Bc(t)?e.appendChild(t):yh(e,t)),e}function Vw(t,e){Bc(e.content)?(yh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yh(t,e.content):t.textContent=e.content)}function Eh(t){var e=t.firstElementChild,n=Pc(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Gw)}),arrow:n.find(function(r){return r.classList.contains(qw)||r.classList.contains(Yw)}),backdrop:n.find(function(r){return r.classList.contains(MB)})}}function Qw(t){var e=ha(),n=ha();n.className=AB,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ha();r.className=Gw,r.setAttribute("data-state","hidden"),Vw(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Eh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Vw(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(Kw(s.arrow))):u.appendChild(Kw(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}Qw.$$tippy=!0;var JB=1,Lc=[],bh=[];function XB(t,e){var n=Ww(t,Object.assign({},cr,jw(Hw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,b=[],g=Bw(Zt,n.interactiveDebounce),E,w=JB++,S=null,O=kB(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},T={id:w,reference:t,popper:ha(),popperInstance:S,props:n,state:k,plugins:O,clearDelayTimeouts:Ot,setProps:L,setContent:H,show:X,hide:se,hideWithInteractivity:Fe,enable:dt,disable:Bt,unmount:rt,destroy:wr};if(!n.render)return T;var P=n.render(T),I=P.popper,Y=P.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+T.id,T.popper=I,t._tippy=T,I._tippy=T;var ne=O.map(function(F){return F.fn(T)}),q=t.hasAttribute("aria-expanded");return Xt(),j(),A(),D("onCreate",[T]),n.showOnCreate&&pe(),I.addEventListener("mouseenter",function(){T.props.interactive&&T.state.isVisible&&T.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){T.props.interactive&&T.props.trigger.indexOf("mouseenter")>=0&&Ce().addEventListener("mousemove",g)}),T;function Q(){var F=T.props.touch;return Array.isArray(F)?F:[F,0]}function fe(){return Q()[0]==="hold"}function we(){var F;return!!((F=T.props.render)!=null&&F.$$tippy)}function me(){return E||t}function Ce(){var F=me().parentNode;return F?PB(F):document}function ge(){return Eh(I)}function ye(F){return T.state.isMounted&&!T.state.isVisible||yr.isTouch||f&&f.type==="focus"?0:hh(T.props.delay,F?0:1,cr.delay)}function A(F){F===void 0&&(F=!1),I.style.pointerEvents=T.props.interactive&&!F?"":"none",I.style.zIndex=""+T.props.zIndex}function D(F,ae,Se){if(Se===void 0&&(Se=!0),ne.forEach(function(Ke){Ke[F]&&Ke[F].apply(Ke,ae)}),Se){var qe;(qe=T.props)[F].apply(qe,ae)}}function z(){var F=T.props.aria;if(F.content){var ae="aria-"+F.content,Se=I.id,qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){var Ft=Ke.getAttribute(ae);if(T.state.isVisible)Ke.setAttribute(ae,Ft?Ft+" "+Se:Se);else{var ln=Ft&&Ft.replace(Se,"").trim();ln?Ke.setAttribute(ae,ln):Ke.removeAttribute(ae)}})}}function j(){if(!(q||!T.props.aria.expanded)){var F=rs(T.props.triggerTarget||t);F.forEach(function(ae){T.props.interactive?ae.setAttribute("aria-expanded",T.state.isVisible&&ae===me()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function ie(){Ce().removeEventListener("mousemove",g),Lc=Lc.filter(function(F){return F!==g})}function xe(F){if(!(yr.isTouch&&(u||F.type==="mousedown"))){var ae=F.composedPath&&F.composedPath()[0]||F.target;if(!(T.props.interactive&&zw(I,ae))){if(rs(T.props.triggerTarget||t).some(function(Se){return zw(Se,ae)})){if(yr.isTouch||T.state.isVisible&&T.props.trigger.indexOf("click")>=0)return}else D("onClickOutside",[T,F]);T.props.hideOnClick===!0&&(T.clearDelayTimeouts(),T.hide(),l=!0,setTimeout(function(){l=!1}),T.state.isMounted||Be())}}}function Ae(){u=!0}function je(){u=!1}function Ne(){var F=Ce();F.addEventListener("mousedown",xe,!0),F.addEventListener("touchend",xe,ho),F.addEventListener("touchstart",je,ho),F.addEventListener("touchmove",Ae,ho)}function Be(){var F=Ce();F.removeEventListener("mousedown",xe,!0),F.removeEventListener("touchend",xe,ho),F.removeEventListener("touchstart",je,ho),F.removeEventListener("touchmove",Ae,ho)}function _t(F,ae){Re(F,function(){!T.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&ae()})}function kt(F,ae){Re(F,ae)}function Re(F,ae){var Se=ge().box;function qe(Ke){Ke.target===Se&&(gh(Se,"remove",qe),ae())}if(F===0)return ae();gh(Se,"remove",h),gh(Se,"add",qe),h=qe}function St(F,ae,Se){Se===void 0&&(Se=!1);var qe=rs(T.props.triggerTarget||t);qe.forEach(function(Ke){Ke.addEventListener(F,ae,Se),b.push({node:Ke,eventType:F,handler:ae,options:Se})})}function Xt(){fe()&&(St("touchstart",an,{passive:!0}),St("touchend",Tt,{passive:!0})),NB(T.props.trigger).forEach(function(F){if(F!=="manual")switch(St(F,an),F){case"mouseenter":St("mouseleave",Tt);break;case"focus":St(UB?"focusout":"blur",Je);break;case"focusin":St("focusout",Je);break}})}function pt(){b.forEach(function(F){var ae=F.node,Se=F.eventType,qe=F.handler,Ke=F.options;ae.removeEventListener(Se,qe,Ke)}),b=[]}function an(F){var ae,Se=!1;if(!(!T.state.isEnabled||jn(F)||l)){var qe=((ae=f)==null?void 0:ae.type)==="focus";f=F,E=F.currentTarget,j(),!T.state.isVisible&&IB(F)&&Lc.forEach(function(Ke){return Ke(F)}),F.type==="click"&&(T.props.trigger.indexOf("mouseenter")<0||s)&&T.props.hideOnClick!==!1&&T.state.isVisible?Se=!0:pe(F),F.type==="click"&&(s=!Se),Se&&!qe&&ut(F)}}function Zt(F){var ae=F.target,Se=me().contains(ae)||I.contains(ae);if(!(F.type==="mousemove"&&Se)){var qe=_e().concat(I).map(function(Ke){var Ft,ln=Ke._tippy,Zr=(Ft=ln.popperInstance)==null?void 0:Ft.state;return Zr?{popperRect:Ke.getBoundingClientRect(),popperState:Zr,props:n}:null}).filter(Boolean);BB(qe,F)&&(ie(),ut(F))}}function Tt(F){var ae=jn(F)||T.props.trigger.indexOf("click")>=0&&s;if(!ae){if(T.props.interactive){T.hideWithInteractivity(F);return}ut(F)}}function Je(F){T.props.trigger.indexOf("focusin")<0&&F.target!==me()||T.props.interactive&&F.relatedTarget&&I.contains(F.relatedTarget)||ut(F)}function jn(F){return yr.isTouch?fe()!==F.type.indexOf("touch")>=0:!1}function Pt(){V();var F=T.props,ae=F.popperOptions,Se=F.placement,qe=F.offset,Ke=F.getReferenceClientRect,Ft=F.moveTransition,ln=we()?Eh(I).arrow:null,Zr=Ke?{getBoundingClientRect:Ke,contextElement:Ke.contextElement||me()}:t,Da={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ni){var jr=Ni.state;if(we()){var zu=ge(),ys=zu.box;["placement","reference-hidden","escaped"].forEach(function(Qr){Qr==="placement"?ys.setAttribute("data-placement",jr.placement):jr.attributes.popper["data-popper-"+Qr]?ys.setAttribute("data-"+Qr,""):ys.removeAttribute("data-"+Qr)}),jr.attributes.popper={}}}},xr=[{name:"offset",options:{offset:qe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ft}},Da];we()&&ln&&xr.push({name:"arrow",options:{element:ln,padding:3}}),xr.push.apply(xr,ae?.modifiers||[]),T.popperInstance=ph(Zr,I,Object.assign({},ae,{placement:Se,onFirstUpdate:m,modifiers:xr}))}function V(){T.popperInstance&&(T.popperInstance.destroy(),T.popperInstance=null)}function yt(){var F=T.props.appendTo,ae,Se=me();T.props.interactive&&F===Jw||F==="parent"?ae=Se.parentNode:ae=Xw(F,[Se]),ae.contains(I)||ae.appendChild(I),T.state.isMounted=!0,Pt()}function _e(){return Pc(I.querySelectorAll("[data-tippy-root]"))}function pe(F){T.clearDelayTimeouts(),F&&D("onTrigger",[T,F]),Ne();var ae=ye(!0),Se=Q(),qe=Se[0],Ke=Se[1];yr.isTouch&&qe==="hold"&&Ke&&(ae=Ke),ae?r=setTimeout(function(){T.show()},ae):T.show()}function ut(F){if(T.clearDelayTimeouts(),D("onUntrigger",[T,F]),!T.state.isVisible){Be();return}if(!(T.props.trigger.indexOf("mouseenter")>=0&&T.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(F.type)>=0&&s)){var ae=ye(!1);ae?i=setTimeout(function(){T.state.isVisible&&T.hide()},ae):o=requestAnimationFrame(function(){T.hide()})}}function dt(){T.state.isEnabled=!0}function Bt(){T.hide(),T.state.isEnabled=!1}function Ot(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function L(F){if(!T.state.isDestroyed){D("onBeforeUpdate",[T,F]),pt();var ae=T.props,Se=Ww(t,Object.assign({},ae,Hw(F),{ignoreAttributes:!0}));T.props=Se,Xt(),ae.interactiveDebounce!==Se.interactiveDebounce&&(ie(),g=Bw(Zt,Se.interactiveDebounce)),ae.triggerTarget&&!Se.triggerTarget?rs(ae.triggerTarget).forEach(function(qe){qe.removeAttribute("aria-expanded")}):Se.triggerTarget&&t.removeAttribute("aria-expanded"),j(),A(),Y&&Y(ae,Se),T.popperInstance&&(Pt(),_e().forEach(function(qe){requestAnimationFrame(qe._tippy.popperInstance.forceUpdate)})),D("onAfterUpdate",[T,F])}}function H(F){T.setProps({content:F})}function X(){var F=T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=yr.isTouch&&!T.props.touch,Ke=hh(T.props.duration,0,cr.duration);if(!(F||ae||Se||qe)&&!me().hasAttribute("disabled")&&(D("onShow",[T],!1),T.props.onShow(T)!==!1)){if(T.state.isVisible=!0,we()&&(I.style.visibility="visible"),A(),Ne(),T.state.isMounted||(I.style.transition="none"),we()){var Ft=ge(),ln=Ft.box,Zr=Ft.content;mh([ln,Zr],0)}m=function(){var xr;if(!(!T.state.isVisible||d)){if(d=!0,I.offsetHeight,I.style.transition=T.props.moveTransition,we()&&T.props.animation){var bs=ge(),Ni=bs.box,jr=bs.content;mh([Ni,jr],Ke),$w([Ni,jr],"visible")}z(),j(),Fw(bh,T),(xr=T.popperInstance)==null||xr.forceUpdate(),D("onMount",[T]),T.props.animation&&we()&&kt(Ke,function(){T.state.isShown=!0,D("onShown",[T])})}},yt()}}function se(){var F=!T.state.isVisible,ae=T.state.isDestroyed,Se=!T.state.isEnabled,qe=hh(T.props.duration,1,cr.duration);if(!(F||ae||Se)&&(D("onHide",[T],!1),T.props.onHide(T)!==!1)){if(T.state.isVisible=!1,T.state.isShown=!1,d=!1,s=!1,we()&&(I.style.visibility="hidden"),ie(),Be(),A(!0),we()){var Ke=ge(),Ft=Ke.box,ln=Ke.content;T.props.animation&&(mh([Ft,ln],qe),$w([Ft,ln],"hidden"))}z(),j(),T.props.animation?we()&&_t(qe,T.unmount):T.unmount()}}function Fe(F){Ce().addEventListener("mousemove",g),Fw(Lc,g),g(F)}function rt(){T.state.isVisible&&T.hide(),T.state.isMounted&&(V(),_e().forEach(function(F){F._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),bh=bh.filter(function(F){return F!==T}),T.state.isMounted=!1,D("onHidden",[T]))}function wr(){T.state.isDestroyed||(T.clearDelayTimeouts(),T.unmount(),pt(),delete t._tippy,T.state.isDestroyed=!0,D("onDestroy",[T]))}}function ma(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);$B();var r=Object.assign({},e,{plugins:n}),i=LB(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&XB(d,r);return f&&u.push(f),u},[]);return Bc(t)?l[0]:l}ma.defaultProps=cr;ma.setDefaultProps=GB;ma.currentInput=yr;var JV=Object.assign({},aa,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ma.setDefaultProps({render:Qw});var is=ma;var wh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:u,from:d,to:f})=>{let{doc:h,selection:m}=u,{empty:b}=m,g=!h.textBetween(d,f).length&&dc(u.selection),E=this.element.contains(document.activeElement);return!(!(l.hasFocus()||E)||b||g||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var u;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((u=this.element.parentNode)===null||u===void 0)&&u.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,u)=>{let d=!u?.selection.eq(l.state.selection),f=!u?.doc.eq(l.state.doc);!d&&!f||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,d,f,u)},this.updateDelay))},this.updateHandler=(l,u,d,f)=>{var h,m,b;let{state:g,composing:E}=l,{selection:w}=g;if(E||!u&&!d)return;this.createTooltip();let{ranges:O}=w,k=Math.min(...O.map(I=>I.$from.pos)),T=Math.max(...O.map(I=>I.$to.pos));if(!((h=this.shouldShow)===null||h===void 0?void 0:h.call(this,{editor:this.editor,element:this.element,view:l,state:g,oldState:f,from:k,to:T}))){this.hide();return}(m=this.tippy)===null||m===void 0||m.setProps({getReferenceClientRect:((b=this.tippyOptions)===null||b===void 0?void 0:b.getReferenceClientRect)||(()=>{if(hc(g.selection)){let I=l.nodeDOM(k);if(I){let Y=I.dataset.nodeViewWrapper?I:I.querySelector("[data-node-view-wrapper]");if(Y&&(I=Y.firstChild),I)return I.getBoundingClientRect()}}return mc(l,k,T)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},ZB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new wh({view:e,...t})}),ex=We.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[ZB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var xh=class{getTextContent(e){return kp(e,{textSerializers:uc(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:l})=>{let{selection:u}=l,{$anchor:d,empty:f}=u,h=d.depth===1,m=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent&&d.parent.childCount===0&&!this.getTextContent(d.parent);return!(!s.hasFocus()||!f||!h||!m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var l;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=is(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;let{state:s}=e,{doc:l,selection:u}=s,{from:d,to:f}=u;if(n&&n.doc.eq(l)&&n.selection.eq(u))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>mc(e,d,f))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},jB=t=>new Oe({key:typeof t.pluginKey=="string"?new ze(t.pluginKey):t.pluginKey,view:e=>new xh({view:e,...t})}),tx=We.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[jB({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});var _h=ce.create({name:"checkedList",priority:50,addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{class:"checked-list"}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul",getAttrs:t=>t.classList.contains("checked-list"),priority:1e3}]},renderHTML({HTMLAttributes:t}){return["ul",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleCheckedList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}}});var Sh=ce.create({name:"lead",group:"block",content:"block+",addOptions(){return{HTMLAttributes:{class:"lead"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("lead")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleLead:()=>({commands:t})=>t.toggleWrap(this.name)}}});var QB="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",e2="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",as=(t,e)=>{for(let n in e)t[n]=e[n];return t},Oh="numeric",Rh="ascii",Ih="alpha",ya="asciinumeric",ba="alphanumeric",Dh="domain",lx="emoji",t2="scheme",n2="slashscheme",Th="whitespace";function r2(t,e){return t in e||(e[t]=[]),e[t]}function mo(t,e,n){e[Oh]&&(e[ya]=!0,e[ba]=!0),e[Rh]&&(e[ya]=!0,e[Ih]=!0),e[ya]&&(e[ba]=!0),e[Ih]&&(e[ba]=!0),e[ba]&&(e[Dh]=!0),e[lx]&&(e[Dh]=!0);for(let r in e){let i=r2(r,n);i.indexOf(t)<0&&i.push(t)}}function i2(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function _n(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}_n.groups={};_n.prototype={accepts(){return!!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),bt=(t,e,n,r,i)=>t.tr(e,n,r,i),nx=(t,e,n,r,i)=>t.ts(e,n,r,i),J=(t,e,n,r,i)=>t.tt(e,n,r,i),Jr="WORD",Lh="UWORD",cx="ASCIINUMERICAL",ux="ALPHANUMERICAL",Sa="LOCALHOST",Ph="TLD",Bh="UTLD",zc="SCHEME",ss="SLASH_SCHEME",Hh="NUM",Fh="WS",$h="NL",Ea="OPENBRACE",va="CLOSEBRACE",Uc="OPENBRACKET",Wc="CLOSEBRACKET",Kc="OPENPAREN",Vc="CLOSEPAREN",Gc="OPENANGLEBRACKET",qc="CLOSEANGLEBRACKET",Yc="FULLWIDTHLEFTPAREN",Jc="FULLWIDTHRIGHTPAREN",Xc="LEFTCORNERBRACKET",Zc="RIGHTCORNERBRACKET",jc="LEFTWHITECORNERBRACKET",Qc="RIGHTWHITECORNERBRACKET",eu="FULLWIDTHLESSTHAN",tu="FULLWIDTHGREATERTHAN",nu="AMPERSAND",zh="APOSTROPHE",ru="ASTERISK",Si="AT",iu="BACKSLASH",ou="BACKTICK",su="CARET",Ti="COLON",Uh="COMMA",au="DOLLAR",Er="DOT",lu="EQUALS",Wh="EXCLAMATION",Xn="HYPHEN",wa="PERCENT",cu="PIPE",uu="PLUS",du="POUND",xa="QUERY",Kh="QUOTE",dx="FULLWIDTHMIDDLEDOT",Vh="SEMI",vr="SLASH",_a="TILDE",fu="UNDERSCORE",fx="EMOJI",pu="SYM",px=Object.freeze({__proto__:null,WORD:Jr,UWORD:Lh,ASCIINUMERICAL:cx,ALPHANUMERICAL:ux,LOCALHOST:Sa,TLD:Ph,UTLD:Bh,SCHEME:zc,SLASH_SCHEME:ss,NUM:Hh,WS:Fh,NL:$h,OPENBRACE:Ea,CLOSEBRACE:va,OPENBRACKET:Uc,CLOSEBRACKET:Wc,OPENPAREN:Kc,CLOSEPAREN:Vc,OPENANGLEBRACKET:Gc,CLOSEANGLEBRACKET:qc,FULLWIDTHLEFTPAREN:Yc,FULLWIDTHRIGHTPAREN:Jc,LEFTCORNERBRACKET:Xc,RIGHTCORNERBRACKET:Zc,LEFTWHITECORNERBRACKET:jc,RIGHTWHITECORNERBRACKET:Qc,FULLWIDTHLESSTHAN:eu,FULLWIDTHGREATERTHAN:tu,AMPERSAND:nu,APOSTROPHE:zh,ASTERISK:ru,AT:Si,BACKSLASH:iu,BACKTICK:ou,CARET:su,COLON:Ti,COMMA:Uh,DOLLAR:au,DOT:Er,EQUALS:lu,EXCLAMATION:Wh,HYPHEN:Xn,PERCENT:wa,PIPE:cu,PLUS:uu,POUND:du,QUERY:xa,QUOTE:Kh,FULLWIDTHMIDDLEDOT:dx,SEMI:Vh,SLASH:vr,TILDE:_a,UNDERSCORE:fu,EMOJI:fx,SYM:pu}),qr=/[a-z]/,ga=/\p{L}/u,Ch=/\p{Emoji}/u;var Yr=/\d/,Ah=/\s/;var rx="\r",Mh=` +`,o2="\uFE0F",s2="\u200D",Nh="\uFFFC",Fc=null,Hc=null;function a2(t=[]){let e={};_n.groups=e;let n=new _n;Fc==null&&(Fc=ix(QB)),Hc==null&&(Hc=ix(e2)),J(n,"'",zh),J(n,"{",Ea),J(n,"}",va),J(n,"[",Uc),J(n,"]",Wc),J(n,"(",Kc),J(n,")",Vc),J(n,"<",Gc),J(n,">",qc),J(n,"\uFF08",Yc),J(n,"\uFF09",Jc),J(n,"\u300C",Xc),J(n,"\u300D",Zc),J(n,"\u300E",jc),J(n,"\u300F",Qc),J(n,"\uFF1C",eu),J(n,"\uFF1E",tu),J(n,"&",nu),J(n,"*",ru),J(n,"@",Si),J(n,"`",ou),J(n,"^",su),J(n,":",Ti),J(n,",",Uh),J(n,"$",au),J(n,".",Er),J(n,"=",lu),J(n,"!",Wh),J(n,"-",Xn),J(n,"%",wa),J(n,"|",cu),J(n,"+",uu),J(n,"#",du),J(n,"?",xa),J(n,'"',Kh),J(n,"/",vr),J(n,";",Vh),J(n,"~",_a),J(n,"_",fu),J(n,"\\",iu),J(n,"\u30FB",dx);let r=bt(n,Yr,Hh,{[Oh]:!0});bt(r,Yr,r);let i=bt(r,qr,cx,{[ya]:!0}),o=bt(r,ga,ux,{[ba]:!0}),s=bt(n,qr,Jr,{[Rh]:!0});bt(s,Yr,i),bt(s,qr,s),bt(i,Yr,i),bt(i,qr,i);let l=bt(n,ga,Lh,{[Ih]:!0});bt(l,qr),bt(l,Yr,o),bt(l,ga,l),bt(o,Yr,o),bt(o,qr),bt(o,ga,o);let u=J(n,Mh,$h,{[Th]:!0}),d=J(n,rx,Fh,{[Th]:!0}),f=bt(n,Ah,Fh,{[Th]:!0});J(n,Nh,f),J(d,Mh,u),J(d,Nh,f),bt(d,Ah,f),J(f,rx),J(f,Mh),bt(f,Ah,f),J(f,Nh,f);let h=bt(n,Ch,fx,{[lx]:!0});J(h,"#"),bt(h,Ch,h),J(h,o2,h);let m=J(h,s2);J(m,"#"),bt(m,Ch,h);let b=[[qr,s],[Yr,i]],g=[[qr,null],[ga,l],[Yr,o]];for(let E=0;EE[0]>w[0]?1:-1);for(let E=0;E=0?O[Dh]=!0:qr.test(w)?Yr.test(w)?O[ya]=!0:O[Rh]=!0:O[Oh]=!0,nx(n,w,w,O)}return nx(n,"localhost",Sa,{ascii:!0}),n.jd=new _n(pu),{start:n,tokens:as({groups:e},px)}}function hx(t,e){let n=l2(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s=0&&(h+=n[s].length,m++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=m,d-=h,i.push({t:f.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function l2(t){let e=[],n=t.length,r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function _i(t,e,n,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(t[r]),r++}return e}var Ta={defaultProtocol:"http",events:null,format:ox,formatHref:ox,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Gh(t,e=null){let n=as({},Ta);t&&(n=as(n,t instanceof Gh?t.o:t));let r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ta.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),u&&(s.target=u),d&&(s.rel=d),f&&as(s,f),{tagName:i,attributes:s,content:o,eventListeners:h}}};function hu(t,e){class n extends mx{constructor(i,o){super(i,o),this.t=t}}for(let r in e)n.prototype[r]=e[r];return n.t=t,n}var sx=hu("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ax=hu("text"),c2=hu("nl"),$c=hu("url",{isLink:!0,toHref(t=Ta.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Sa&&t[1].t===Ti}});var Jn=t=>new _n(t);function u2({groups:t}){let e=t.domain.concat([nu,ru,Si,iu,ou,su,au,lu,Xn,Hh,wa,cu,uu,du,vr,pu,_a,fu]),n=[Ti,Uh,Er,Wh,wa,xa,Kh,Vh,Gc,qc,Ea,va,Wc,Uc,Kc,Vc,Yc,Jc,Xc,Zc,jc,Qc,eu,tu],r=[nu,zh,ru,iu,ou,su,au,lu,Xn,Ea,va,wa,cu,uu,du,xa,vr,pu,_a,fu],i=Jn(),o=J(i,_a);Pe(o,r,o),Pe(o,t.domain,o);let s=Jn(),l=Jn(),u=Jn();Pe(i,t.domain,s),Pe(i,t.scheme,l),Pe(i,t.slashscheme,u),Pe(s,r,o),Pe(s,t.domain,s);let d=J(s,Si);J(o,Si,d),J(l,Si,d),J(u,Si,d);let f=J(o,Er);Pe(f,r,o),Pe(f,t.domain,o);let h=Jn();Pe(d,t.domain,h),Pe(h,t.domain,h);let m=J(h,Er);Pe(m,t.domain,h);let b=Jn(sx);Pe(m,t.tld,b),Pe(m,t.utld,b),J(d,Sa,b);let g=J(h,Xn);J(g,Xn,g),Pe(g,t.domain,h),Pe(b,t.domain,h),J(b,Er,m),J(b,Xn,g);let E=J(b,Ti);Pe(E,t.numeric,sx);let w=J(s,Xn),S=J(s,Er);J(w,Xn,w),Pe(w,t.domain,s),Pe(S,r,o),Pe(S,t.domain,s);let O=Jn($c);Pe(S,t.tld,O),Pe(S,t.utld,O),Pe(O,t.domain,s),Pe(O,r,o),J(O,Er,S),J(O,Xn,w),J(O,Si,d);let k=J(O,Ti),T=Jn($c);Pe(k,t.numeric,T);let P=Jn($c),I=Jn();Pe(P,e,P),Pe(P,n,I),Pe(I,e,P),Pe(I,n,I),J(O,vr,P),J(T,vr,P);let Y=J(l,Ti),ne=J(u,Ti),q=J(ne,vr),Q=J(q,vr);Pe(l,t.domain,s),J(l,Er,S),J(l,Xn,w),Pe(u,t.domain,s),J(u,Er,S),J(u,Xn,w),Pe(Y,t.domain,P),J(Y,vr,P),J(Y,xa,P),Pe(Q,t.domain,P),Pe(Q,e,P),J(Q,vr,P);let fe=[[Ea,va],[Uc,Wc],[Kc,Vc],[Gc,qc],[Yc,Jc],[Xc,Zc],[jc,Qc],[eu,tu]];for(let we=0;we=0&&m++,i++,f++;if(m<0)i-=f,i0&&(o.push(kh(ax,e,s)),s=[]),i-=m,f-=m;let b=h.t,g=n.slice(i-f,i);o.push(kh(b,e,g))}}return s.length>0&&o.push(kh(ax,e,s)),o}function kh(t,e,n){let r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}var f2=typeof console<"u"&&console&&console.warn||(()=>{}),p2="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",at={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function gx(){return _n.groups={},at.scanner=null,at.parser=null,at.tokenQueue=[],at.pluginQueue=[],at.customSchemes=[],at.initialized=!1,at}function qh(t,e=!1){if(at.initialized&&f2(`linkifyjs: already initialized - will not register custom scheme "${t}" ${p2}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);at.customSchemes.push([t,e])}function h2(){at.scanner=a2(at.customSchemes);for(let t=0;t{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=nv(n.doc,[...e]);if(iv(l).forEach(({newRange:d})=>{let f=rv(r.doc,d,g=>g.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let g=m.split(" ").filter(S=>S!=="");if(g.length<=0)return!1;let b=g[g.length-1],E=h.pos+m.lastIndexOf(b);if(!b)return!1;let w=mu(b).map(S=>S.toObject(t.defaultProtocol));if(!m2(w))return!1;w.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{pc(S.from,S.to,r.doc).some(N=>N.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function b2(t){return new Oe({key:new ze("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let u=Op(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:u.href,h=(o=d?.target)!==null&&o!==void 0?o:u.target;return d&&f?(window.open(f,h),!0):!1}}})}function y2(t){return new Oe({key:new ze("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let u=Yh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}var E2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function go(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(E2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var bx=st.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qh(t);return}qh(t.scheme,t.optionalSlashes)})},onDestroy(){gx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ee(this.options.HTMLAttributes,t),0]:["a",ee(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=Yh(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!go(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(g2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!go(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(b2({type:this.type})),this.options.linkOnPaste&&t.push(y2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var Jh=bx.extend({addOptions(){return{...this.parent?.(),openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{}}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var v2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yx=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[gc({find:v2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Xh=yx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}},srcset:{default:null},sizes:{default:null},media:{default:null,parseHTML:t=>t.getAttribute("data-media-id"),renderHTML:t=>t.media?{"data-media-id":t.media}:{}}}}});var w2=wc.extend({addAttributes(){return{class:{default:null}}}});var Zh=st.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Ex(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function vx(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function wx(t,e,n,r){let i=vx(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=wx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(re(t,"gridRole",e))}}});var Qh=ce.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var xx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),x2=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",em=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t,o=null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")&&(o=e.split("/").pop()),e.includes("/shorts/")&&(o=e.split("/shorts/").pop()),!o){let d=/v=([-\w]+)/gm.exec(e);d&&d[1]&&(o=d[1])}if(!o)return null;let s=`${x2(r)}${o}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(s+=`?${l.join("&")}`),s};var tm=ce.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!xx(t.src))return!1;let n=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var _x=t=>t.match(/(vimeo\.com)(.+)?$/),nm=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let u=/\.com\/([0-9]+)/gm.exec(e);if(!u||!u[1])return null;let d=`https://player.vimeo.com/video/${u[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var rm=ce.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!_x(t.src))return!1;let n=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var im=ce.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var om=ce.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",ee(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=ee(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,u])=>i.setAttribute(l,u)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let u=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(u.content))return!1;let f=((n=u.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=to(S=>S.type===this.type)(n);if(!i)return!1;let o=eo(i.node,S=>S.type===r.nodes.detailsSummary),s=eo(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],u=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},g=u.node.content.toJSON()||[],b=f.parent.type.contentMatch.defaultType,w=[b?.create(null,l.node.content).toJSON(),...g];return e().insertContentAt(m,w).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var sm=ce.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",ee(this.options.HTMLAttributes,t),0]}});var am=ce.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=to(fe=>fe.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:u}=s.node;if(!(u===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),g=u-1,b=s.node.child(g),E=m.posAtIndex(g,s.depth);if(!b.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let N=i.indexAfter(-3),D=Mp(S.contentMatchAt(N));if(!D||!S.canReplaceWith(N,N,D))return!1;let T=D.createAndFill();if(!T)return!1;let{tr:B}=e,R=i.after(-2);B.replaceWith(R,R,T);let Y=B.doc.resolve(R),ne=ue.near(Y,1);B.setSelection(ne);let q=E,Q=E+b.nodeSize;return B.delete(q,Q),B.scrollIntoView(),n.dispatch(B),!0}}}});var _2=/^```([a-z]+)?[\s\n]$/,S2=/^~~~([a-z]+)?[\s\n]$/,Sx=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ee(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` +3. "-" cannot repeat`);at.customSchemes.push([t,e])}function h2(){at.scanner=a2(at.customSchemes);for(let t=0;t{let i=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=nv(n.doc,[...e]);if(iv(l).forEach(({newRange:d})=>{let f=rv(r.doc,d,b=>b.isTextblock),h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&m){let b=m.split(" ").filter(S=>S!=="");if(b.length<=0)return!1;let g=b[b.length-1],E=h.pos+m.lastIndexOf(g);if(!g)return!1;let w=mu(g).map(S=>S.toObject(t.defaultProtocol));if(!m2(w))return!1;w.filter(S=>S.isLink).map(S=>({...S,from:E+S.start+1,to:E+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{pc(S.from,S.to,r.doc).some(O=>O.mark.type===t.type)||s.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!s.steps.length)return s}})}function b2(t){return new Oe({key:new ze("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=r.target,l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;let u=Op(e.state,t.type.name),d=r.target,f=(i=d?.href)!==null&&i!==void 0?i:u.href,h=(o=d?.target)!==null&&o!==void 0?o:u.target;return d&&f?(window.open(f,h),!0):!1}}})}function y2(t){return new Oe({key:new ze("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});let u=Yh(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}var E2=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function go(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!t||t.replace(E2,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}var bx=st.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){qh(t);return}qh(t.scheme,t.optionalSlashes)})},onDestroy(){gx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!go(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!go(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!go(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ee(this.options.HTMLAttributes,t),0]:["a",ee(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!go(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[xn({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=Yh(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!go(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(g2({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!go(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(b2({type:this.type})),this.options.linkOnPaste&&t.push(y2({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});var Jh=bx.extend({addOptions(){return{...this.parent?.(),openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{}}},addAttributes(){return{href:{default:null},id:{default:null},target:{default:this.options.HTMLAttributes.target},hreflang:{default:null},rel:{default:null},referrerpolicy:{default:null},class:{default:null},as_button:{default:null,parseHTML:t=>t.getAttribute("data-as-button"),renderHTML:t=>({"data-as-button":t.as_button})},button_theme:{default:null,parseHTML:t=>t.getAttribute("data-as-button-theme"),renderHTML:t=>({"data-as-button-theme":t.button_theme})}}}});var v2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,yx=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",ee(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[gc({find:v2,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var Xh=yx.extend({addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},lazy:{default:null,parseHTML:t=>t.getAttribute("loading")==="lazy"?t.getAttribute("data-lazy"):null,renderHTML:t=>{if(t.lazy)return{"data-lazy":t.lazy,loading:"lazy"}}},srcset:{default:null},sizes:{default:null},media:{default:null,parseHTML:t=>t.getAttribute("data-media-id"),renderHTML:t=>t.media?{"data-media-id":t.media}:{}}}}});var w2=wc.extend({addAttributes(){return{class:{default:null}}}});var Zh=st.create({name:"small",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"small"}]},renderHTML({HTMLAttributes:t}){return["small",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{setSmall:()=>({commands:t})=>t.setMark(this.name),toggleSmall:()=>({commands:t})=>t.toggleMark(this.name),unsetSmall:()=>({commands:t})=>t.unsetMark(this.name)}}});function Ex(t,e=null){return e?t.createChecked(null,e):t.createAndFill()}function vx(t){if(t.cached.gridNodeTypes)return t.cached.gridNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridRole&&(e[r.spec.gridRole]=r)}),t.cached.gridNodeTypes=e,e}function wx(t,e,n,r){let i=vx(t),o=[];for(let s=0;st.getAttribute("type")},cols:{default:2,parseHTML:t=>t.getAttribute("cols")}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGrid:({cols:t=3,type:e="responsive"}={})=>({tr:n,dispatch:r,editor:i})=>{let o=wx(i.schema,t,e);if(r){let s=n.selection.anchor+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(le.near(n.doc.resolve(s)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGrid()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridRole:Te(re(t,"gridRole",e))}}});var Qh=ce.create({name:"gridColumn",content:"block+",gridRole:"column",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid__column"}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var xx=t=>t.match(/(youtube\.com|youtu\.be)(.+)?$/),x2=(t=!1)=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",em=t=>{let{url:e,controls:n,nocookie:r,startAt:i}=t,o=null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")&&(o=e.split("/").pop()),e.includes("/shorts/")&&(o=e.split("/shorts/").pop()),!o){let d=/v=([-\w]+)/gm.exec(e);d&&d[1]&&(o=d[1])}if(!o)return null;let s=`${x2(r)}${o}`,l=[];return n?l.push("controls=1"):l.push("controls=0"),i&&l.push(`start=${i}`),l.length&&(s+=`?${l.join("&")}`),s};var tm=ce.create({name:"youtube",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},start:{default:0},controls:{default:!0},nocookie:{default:!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>{if(!xx(t.src))return!1;let n=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=em({url:t.src,controls:t.controls,nocookie:t.nocookie,startAt:t.start||0});return["div",{"data-youtube-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowFullscreen,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var _x=t=>t.match(/(vimeo\.com)(.+)?$/),nm=t=>{let{url:e,autoplay:n,loop:r,title:i,byline:o,portrait:s}=t;if(e.includes("/video/"))return e;let u=/\.com\/([0-9]+)/gm.exec(e);if(!u||!u[1])return null;let d=`https://player.vimeo.com/video/${u[1]}`,f=[`autoplay=${n}`,`loop=${r}`,`title=${i}`,`byline=${o}`,`portrait=${s}`];return d+=`?${f.join("&")}`,d};var rm=ce.create({name:"vimeo",selectable:!0,draggable:!0,atom:!0,addOptions(){return{inline:!1,HTMLAttributes:{},allowFullscreen:!0,width:640,height:480}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:0},loop:{default:0},title:{default:0},byline:{default:0},portrait:{default:0},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-vimeo-video] iframe"}]},addCommands(){return{setVimeoVideo:t=>({commands:e})=>{if(!_x(t.src))return!1;let n=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return e.insertContent({type:this.name,attrs:{...t,src:n}})}}},renderHTML({HTMLAttributes:t}){let e=nm({url:t.src,autoplay:t?.autoplay||0,loop:t?.loop||0,title:t?.title||0,byline:t?.byline||0,portrait:t?.portrait||0});return["div",{"data-vimeo-video":"",class:t.responsive?"responsive":null},["iframe",{src:e,width:t.width,height:t.height,allowfullscreen:this.options.allowfullscreen,frameborder:0,allow:"autoplay; fullscreen; picture-in-picture",style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var im=ce.create({name:"video",selectable:!0,draggable:!0,atom:!0,inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addOptions(){return{inline:!1,HTMLAttributes:{autoplay:null,controls:null,loop:null},width:640,height:480}},addAttributes(){return{style:{default:null,parseHTML:t=>t.getAttribute("style")},responsive:{default:!0,parseHTML:t=>t.classList.contains("responsive")??!1},src:{default:null},width:{default:this.options.width,parseHTML:t=>t.getAttribute("width")},height:{default:this.options.height,parseHTML:t=>t.getAttribute("height")},autoplay:{default:null,parseHTML:t=>t.getAttribute("autoplay")},controls:{default:null,parseHTML:t=>t.getAttribute("controls")},loop:{default:null,parseHTML:t=>t.getAttribute("loop")},"data-aspect-width":{default:null,parseHTML:t=>t.getAttribute("data-aspect-width")},"data-aspect-height":{default:null,parseHTML:t=>t.getAttribute("data-aspect-height")}}},parseHTML(){return[{tag:"div[data-native-video] video"}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-native-video":"",class:t.responsive?"responsive":null},["video",{src:t.src,width:t.width,height:t.height,autoplay:t.autoplay?"true":null,controls:t.controls?"true":null,loop:t.loop?"true":null,style:t.responsive?`aspect-ratio: ${t["data-aspect-width"]} / ${t["data-aspect-height"]}; width: 100%; height: auto;`:null,"data-aspect-width":t.responsive?t["data-aspect-width"]:null,"data-aspect-height":t.responsive?t["data-aspect-height"]:null}]]}});var om=ce.create({name:"details",content:"detailsSummary detailsContent",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,addOptions(){return{HTMLAttributes:{}}},addAttributes(){return{}},parseHTML(){return[{tag:"details"}]},renderHTML({HTMLAttributes:t}){return["details",ee(this.options.HTMLAttributes,t),0]},addNodeView(){return({editor:t,getPos:e,node:n,HTMLAttributes:r})=>{let i=document.createElement("div"),o=document.createElement("div"),s=ee(this.options.HTMLAttributes,r,{"data-type":this.name});return Object.entries(s).forEach(([l,u])=>i.setAttribute(l,u)),{dom:i,contentDOM:i,ignoreMutation(l){return l.type==="selection"?!1:!i.contains(l.target)||i===l.target},update:l=>l.type===this.type}}},addCommands(){return{setDetails:()=>({state:t,chain:e})=>{var n;let{schema:r,selection:i}=t,{$from:o,$to:s}=i,l=o.blockRange(s);if(!l)return!1;let u=t.doc.slice(l.start,l.end);if(!r.nodes.detailsContent.contentMatch.matchFragment(u.content))return!1;let f=((n=u.toJSON())===null||n===void 0?void 0:n.content)||[];return e().insertContentAt({from:l.start,to:l.end},{type:this.name,content:[{type:"detailsSummary"},{type:"detailsContent",content:f}]}).setTextSelection(l.start+2).run()},unsetDetails:()=>({state:t,chain:e})=>{let{selection:n,schema:r}=t,i=to(S=>S.type===this.type)(n);if(!i)return!1;let o=eo(i.node,S=>S.type===r.nodes.detailsSummary),s=eo(i.node,S=>S.type===r.nodes.detailsContent);if(!o.length||!s.length)return!1;let l=o[0],u=s[0],d=i.pos,f=t.doc.resolve(d),h=d+i.node.nodeSize,m={from:d,to:h},b=u.node.content.toJSON()||[],g=f.parent.type.contentMatch.defaultType,w=[g?.create(null,l.node.content).toJSON(),...b];return e().insertContentAt(m,w).setTextSelection(d+1).run()}}},addKeyboardShortcuts(){return{Backspace:()=>{let{schema:t,selection:e}=this.editor.state,{empty:n,$anchor:r}=e;return!n||r.parent.type!==t.nodes.detailsSummary?!1:r.parentOffset!==0?this.editor.commands.command(({tr:i})=>{let o=r.pos-1,s=r.pos;return i.delete(o,s),!0}):this.editor.commands.unsetDetails()}}}});var sm=ce.create({name:"detailsSummary",content:"text*",defining:!0,selectable:!1,isolating:!0,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"summary"}]},renderHTML({HTMLAttributes:t}){return["summary",ee(this.options.HTMLAttributes,t),0]}});var am=ce.create({name:"detailsContent",content:"block+",defining:!0,selectable:!1,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:'div[data-type="details-content"]'}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t,{"data-type":"details-content"}),0]},addKeyboardShortcuts(){return{Enter:({editor:t})=>{let{state:e,view:n}=t,{selection:r}=e,{$from:i,empty:o}=r,s=to(fe=>fe.type===this.type)(r);if(!o||!s||!s.node.childCount)return!1;let l=i.index(s.depth),{childCount:u}=s.node;if(!(u===l+1))return!1;let f=s.node.type.contentMatch.defaultType,h=f?.createAndFill();if(!h)return!1;let m=e.doc.resolve(s.pos+1),b=u-1,g=s.node.child(b),E=m.posAtIndex(b,s.depth);if(!g.eq(h))return!1;let S=i.node(-3);if(!S)return!1;let O=i.indexAfter(-3),k=Mp(S.contentMatchAt(O));if(!k||!S.canReplaceWith(O,O,k))return!1;let T=k.createAndFill();if(!T)return!1;let{tr:P}=e,I=i.after(-2);P.replaceWith(I,I,T);let Y=P.doc.resolve(I),ne=ue.near(Y,1);P.setSelection(ne);let q=E,Q=E+g.nodeSize;return P.delete(q,Q),P.scrollIntoView(),n.dispatch(P),!0}}}});var _2=/^```([a-z]+)?[\s\n]$/,S2=/^~~~([a-z]+)?[\s\n]$/,Sx=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ee(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(ue.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[sa({find:_2,type:this.type,getAttributes:t=>({language:t[1]})}),sa({find:S2,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Oe({key:new ze("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!n||!o)return!1;let{tr:s,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,` -`));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function T2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ix(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ix(n)}),t}var bu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dx(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var C2="",Tx=t=>!!t.scope,A2=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},cm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Dx(e)}openNode(e){if(!Tx(e))return;let n=A2(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Tx(e)&&(this.buffer+=C2)}value(){return this.buffer}span(e){this.buffer+=``}},Cx=(t={})=>{let e={children:[]};return Object.assign(e,t),e},um=class t{constructor(){this.rootNode=Cx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=Cx({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},dm=class extends um{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new cm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ca(t){return t?typeof t=="string"?t:t.source:null}function Lx(t){return yo("(?=",t,")")}function M2(t){return yo("(?:",t,")*")}function N2(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>Ca(n)).join("")}function k2(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function pm(...t){return"("+(k2(t).capture?"":"?:")+t.map(r=>Ca(r)).join("|")+")"}function Px(t){return new RegExp(t.toString()+"|").exec("").length-1}function O2(t,e){let n=t&&t.exec(e);return n&&n.index===0}var R2=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function hm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ca(r),s="";for(;o.length>0;){let l=R2.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var I2=/\b\B/,Bx="[a-zA-Z]\\w*",mm="[a-zA-Z_]\\w*",Fx="\\b\\d+(\\.\\d+)?",Hx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$x="\\b(0b[01]+)",D2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L2=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ci({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Aa={begin:"\\\\[\\s\\S]",relevance:0},P2={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Aa]},B2={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Aa]},F2={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Eu=function(t,e,n={}){let r=Ci({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=pm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},H2=Eu("//","$"),$2=Eu("/\\*","\\*/"),z2=Eu("#","$"),U2={scope:"number",begin:Fx,relevance:0},W2={scope:"number",begin:Hx,relevance:0},K2={scope:"number",begin:$x,relevance:0},V2={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Aa,{begin:/\[/,end:/\]/,relevance:0,contains:[Aa]}]},G2={scope:"title",begin:Bx,relevance:0},q2={scope:"title",begin:mm,relevance:0},Y2={begin:"\\.\\s*"+mm,relevance:0},J2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},gu=Object.freeze({__proto__:null,APOS_STRING_MODE:P2,BACKSLASH_ESCAPE:Aa,BINARY_NUMBER_MODE:K2,BINARY_NUMBER_RE:$x,COMMENT:Eu,C_BLOCK_COMMENT_MODE:$2,C_LINE_COMMENT_MODE:H2,C_NUMBER_MODE:W2,C_NUMBER_RE:Hx,END_SAME_AS_BEGIN:J2,HASH_COMMENT_MODE:z2,IDENT_RE:Bx,MATCH_NOTHING_RE:I2,METHOD_GUARD:Y2,NUMBER_MODE:U2,NUMBER_RE:Fx,PHRASAL_WORDS_MODE:F2,QUOTE_STRING_MODE:B2,REGEXP_MODE:V2,RE_STARTERS_RE:D2,SHEBANG:L2,TITLE_MODE:G2,UNDERSCORE_IDENT_RE:mm,UNDERSCORE_TITLE_MODE:q2});function X2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Z2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function j2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=X2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Q2(t,e){Array.isArray(t.illegal)&&(t.illegal=pm(...t.illegal))}function eF(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function tF(t,e){t.relevance===void 0&&(t.relevance=1)}var nF=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=yo(n.beforeMatch,Lx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},rF=["of","and","for","in","not","or","if","then","parent","list","value"],iF="keyword";function zx(t,e,n=iF){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,zx(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,oF(u[0],u[1])]})}}function oF(t,e){return e?Number(e):sF(t)?0:1}function sF(t){return rF.includes(t.toLowerCase())}var Ax={},bo=t=>{console.error(t)},Mx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ls=(t,e)=>{Ax[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Ax[`${t}/${e}`]=!0)},yu=new Error;function Ux(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=Px(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function aF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),yu;Ux(t,t.begin,{key:"beginScope"}),t.begin=hm(t.begin,{joinWith:""})}}function lF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),yu;Ux(t,t.end,{key:"endScope"}),t.end=hm(t.end,{joinWith:""})}}function cF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function uF(t){cF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),aF(t),lF(t)}function dF(t){function e(s,l){return new RegExp(Ca(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=Px(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(hm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[Z2,eF,uF,nF].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[j2,Q2,tF].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=zx(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ca(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return fF(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ci(t.classNameAliases||{}),o(t)}function Wx(t){return t?t.endsWithParent||Wx(t.starts):!1}function fF(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ci(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Wx(t)?Ci(t,{starts:t.starts?Ci(t.starts):null}):Object.isFrozen(t)?Ci(t):t}var pF="11.10.0",fm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},lm=Dx,Nx=Ci,kx=Symbol("nomatch"),hF=7,Kx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:dm};function u(A){return l.noHighlightRe.test(A)}function d(A){let I=A.className+" ";I+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(I);if(z){let j=q(z[1]);return j||(Mx(o.replace("{}",z[1])),Mx("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return I.split(/\s+/).find(j=>u(j)||q(j))}function f(A,I,z){let j="",ie="";typeof I=="object"?(j=A,z=I.ignoreIllegals,ie=I.language):(ls("10.7.0","highlight(lang, code, ...args) has been deprecated."),ls("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=I),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,I,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=hF&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=g(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=O2(L.endRe,X);if(se){if(L["on:end"]){let Fe=new bu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new bu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=I.substring(L.index),se=Re(V,L,X);if(!se)return kx;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=I.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==kx)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw bo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=dF(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(I,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(I);if(!L)break;let H=I.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(I.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:lm(I),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:I.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:lm(I),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let I={value:lm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return I._emitter.addText(A),I}function g(A,I){I=I||l.languages||Object.keys(e);let z=m(A),j=I.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function b(A,I,z){let j=I&&n[I]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let I=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new fm("One of your code blocks includes unescaped HTML.",A.innerHTML);I=A;let j=I.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):g(j);A.innerHTML=ie.value,A.dataset.highlighted="yes",b(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=Nx(l,A)}let S=()=>{T(),ls("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){T(),ls("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function T(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function B(){D&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",B,!1);function R(A,I){let z=null;try{z=I(t)}catch(j){if(bo("Language definition for '{}' could not be registered.".replace("{}",A)),i)bo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=I.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let I of Object.keys(n))n[I]===A&&delete n[I]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:I}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=I})}function fe(A){let I=q(A);return I&&!I.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=I=>{A["before:highlightBlock"](Object.assign({block:I.el},I))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=I=>{A["after:highlightBlock"](Object.assign({block:I.el},I))})}function me(A){we(A),r.push(A)}function Ce(A){let I=r.indexOf(A);I!==-1&&r.splice(I,1)}function ge(A,I){let z=A;r.forEach(function(j){j[z]&&j[z](I)})}function ye(A){return ls("10.7.0","highlightBlock will be removed entirely in v12.0"),ls("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:g,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:N,registerLanguage:R,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:Nx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=pF,t.regex={concat:yo,lookahead:Lx,either:pm,optional:N2,anyNumberOfTimes:M2};for(let A in gu)typeof gu[A]=="object"&&Ix(gu[A]);return Object.assign(t,gu),t},cs=Kx({});cs.newInstance=()=>Kx({});var mF=cs;cs.HighlightJS=cs;cs.default=cs;var gF=T2(mF);function Vx(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Vx(n.children,r):{text:n.value,classes:r}}).flat()}function Ox(t){return t.value||t.children||[]}function bF(t){return!!gF.getLanguage(t)}function Rx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(t,o=>o.type.name===e).forEach(o=>{var s;let l=o.pos+1,u=o.node.attrs.language||r,d=n.listLanguages(),f=u&&(d.includes(u)||bF(u)||!((s=n.registered)===null||s===void 0)&&s.call(n,u))?Ox(n.highlight(u,o.node.textContent)):Ox(n.highlightAuto(o.node.textContent));Vx(f).forEach(h=>{let m=l+h.text.length;if(h.classes.length){let g=wt.inline(l,m,{class:h.classes.join(" ")});i.push(g)}l=m})}),ot.create(t,i)}function yF(t){return typeof t=="function"}function EF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>yF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Oe({key:new ze("lowlight"),state:{init:(i,{doc:o})=>Rx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=eo(s.doc,m=>m.type.name===t),h=eo(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(g=>g.pos>=m.from&&g.pos+g.node.nodeSize<=m.to)))?Rx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Gx=Sx.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],EF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var gm=Gx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var bm=ce.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var ym=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function vu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function qx(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Yx(t,e,n,r,i,o,s){let l=qx(t),u=[];if(n==="asymmetric")u.push(vu(l.builderColumn,i,s)),u.push(vu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=Yx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(le.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(re(t,"gridBuilderRole",e))}}});var vm=ce.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var wm=We.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Oe({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var xm=ce.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",ee(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=` +`));return s.replaceSelectionWith(this.type.create({language:o},u)),s.selection.$from.parent.type!==this.type&&s.setSelection(le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function T2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ix(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&Ix(n)}),t}var bu=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dx(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Ci(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var C2="",Tx=t=>!!t.scope,A2=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},cm=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Dx(e)}openNode(e){if(!Tx(e))return;let n=A2(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){Tx(e)&&(this.buffer+=C2)}value(){return this.buffer}span(e){this.buffer+=``}},Cx=(t={})=>{let e={children:[]};return Object.assign(e,t),e},um=class t{constructor(){this.rootNode=Cx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=Cx({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},dm=class extends um{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new cm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Ca(t){return t?typeof t=="string"?t:t.source:null}function Lx(t){return yo("(?=",t,")")}function M2(t){return yo("(?:",t,")*")}function N2(t){return yo("(?:",t,")?")}function yo(...t){return t.map(n=>Ca(n)).join("")}function k2(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function pm(...t){return"("+(k2(t).capture?"":"?:")+t.map(r=>Ca(r)).join("|")+")"}function Px(t){return new RegExp(t.toString()+"|").exec("").length-1}function O2(t,e){let n=t&&t.exec(e);return n&&n.index===0}var R2=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function hm(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Ca(r),s="";for(;o.length>0;){let l=R2.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var I2=/\b\B/,Bx="[a-zA-Z]\\w*",mm="[a-zA-Z_]\\w*",Fx="\\b\\d+(\\.\\d+)?",Hx="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$x="\\b(0b[01]+)",D2="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",L2=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=yo(e,/.*\b/,t.binary,/\b.*/)),Ci({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},Aa={begin:"\\\\[\\s\\S]",relevance:0},P2={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Aa]},B2={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Aa]},F2={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Eu=function(t,e,n={}){let r=Ci({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=pm("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},H2=Eu("//","$"),$2=Eu("/\\*","\\*/"),z2=Eu("#","$"),U2={scope:"number",begin:Fx,relevance:0},W2={scope:"number",begin:Hx,relevance:0},K2={scope:"number",begin:$x,relevance:0},V2={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Aa,{begin:/\[/,end:/\]/,relevance:0,contains:[Aa]}]},G2={scope:"title",begin:Bx,relevance:0},q2={scope:"title",begin:mm,relevance:0},Y2={begin:"\\.\\s*"+mm,relevance:0},J2=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},gu=Object.freeze({__proto__:null,APOS_STRING_MODE:P2,BACKSLASH_ESCAPE:Aa,BINARY_NUMBER_MODE:K2,BINARY_NUMBER_RE:$x,COMMENT:Eu,C_BLOCK_COMMENT_MODE:$2,C_LINE_COMMENT_MODE:H2,C_NUMBER_MODE:W2,C_NUMBER_RE:Hx,END_SAME_AS_BEGIN:J2,HASH_COMMENT_MODE:z2,IDENT_RE:Bx,MATCH_NOTHING_RE:I2,METHOD_GUARD:Y2,NUMBER_MODE:U2,NUMBER_RE:Fx,PHRASAL_WORDS_MODE:F2,QUOTE_STRING_MODE:B2,REGEXP_MODE:V2,RE_STARTERS_RE:D2,SHEBANG:L2,TITLE_MODE:G2,UNDERSCORE_IDENT_RE:mm,UNDERSCORE_TITLE_MODE:q2});function X2(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Z2(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function j2(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=X2,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Q2(t,e){Array.isArray(t.illegal)&&(t.illegal=pm(...t.illegal))}function eF(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function tF(t,e){t.relevance===void 0&&(t.relevance=1)}var nF=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=yo(n.beforeMatch,Lx(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},rF=["of","and","for","in","not","or","if","then","parent","list","value"],iF="keyword";function zx(t,e,n=iF){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,zx(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,oF(u[0],u[1])]})}}function oF(t,e){return e?Number(e):sF(t)?0:1}function sF(t){return rF.includes(t.toLowerCase())}var Ax={},bo=t=>{console.error(t)},Mx=(t,...e)=>{console.log(`WARN: ${t}`,...e)},ls=(t,e)=>{Ax[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),Ax[`${t}/${e}`]=!0)},yu=new Error;function Ux(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=Px(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function aF(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw bo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yu;if(typeof t.beginScope!="object"||t.beginScope===null)throw bo("beginScope must be object"),yu;Ux(t,t.begin,{key:"beginScope"}),t.begin=hm(t.begin,{joinWith:""})}}function lF(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw bo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yu;if(typeof t.endScope!="object"||t.endScope===null)throw bo("endScope must be object"),yu;Ux(t,t.end,{key:"endScope"}),t.end=hm(t.end,{joinWith:""})}}function cF(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function uF(t){cF(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),aF(t),lF(t)}function dF(t){function e(s,l){return new RegExp(Ca(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=Px(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(hm(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[Z2,eF,uF,nF].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[j2,Q2,tF].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=zx(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=Ca(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return fF(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ci(t.classNameAliases||{}),o(t)}function Wx(t){return t?t.endsWithParent||Wx(t.starts):!1}function fF(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Ci(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Wx(t)?Ci(t,{starts:t.starts?Ci(t.starts):null}):Object.isFrozen(t)?Ci(t):t}var pF="11.10.0",fm=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},lm=Dx,Nx=Ci,kx=Symbol("nomatch"),hF=7,Kx=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:dm};function u(A){return l.noHighlightRe.test(A)}function d(A){let D=A.className+" ";D+=A.parentNode?A.parentNode.className:"";let z=l.languageDetectRe.exec(D);if(z){let j=q(z[1]);return j||(Mx(o.replace("{}",z[1])),Mx("Falling back to no-highlight mode for this block.",A)),j?z[1]:"no-highlight"}return D.split(/\s+/).find(j=>u(j)||q(j))}function f(A,D,z){let j="",ie="";typeof D=="object"?(j=A,z=D.ignoreIllegals,ie=D.language):(ls("10.7.0","highlight(lang, code, ...args) has been deprecated."),ls("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),ie=A,j=D),z===void 0&&(z=!0);let xe={code:j,language:ie};ge("before:highlight",xe);let Ae=xe.result?xe.result:h(xe.language,xe.code,z);return Ae.code=xe.code,ge("after:highlight",Ae),Ae}function h(A,D,z,j){let ie=Object.create(null);function xe(L,H){return L.keywords[H]}function Ae(){if(!V.keywords){_e.addText(pe);return}let L=0;V.keywordPatternRe.lastIndex=0;let H=V.keywordPatternRe.exec(pe),X="";for(;H;){X+=pe.substring(L,H.index);let se=Je.case_insensitive?H[0].toLowerCase():H[0],Fe=xe(V,se);if(Fe){let[rt,wr]=Fe;if(_e.addText(X),X="",ie[se]=(ie[se]||0)+1,ie[se]<=hF&&(ut+=wr),rt.startsWith("_"))X+=H[0];else{let F=Je.classNameAliases[rt]||rt;Be(H[0],F)}}else X+=H[0];L=V.keywordPatternRe.lastIndex,H=V.keywordPatternRe.exec(pe)}X+=pe.substring(L),_e.addText(X)}function je(){if(pe==="")return;let L=null;if(typeof V.subLanguage=="string"){if(!e[V.subLanguage]){_e.addText(pe);return}L=h(V.subLanguage,pe,!0,yt[V.subLanguage]),yt[V.subLanguage]=L._top}else L=b(pe,V.subLanguage.length?V.subLanguage:null);V.relevance>0&&(ut+=L.relevance),_e.__addSublanguage(L._emitter,L.language)}function Ne(){V.subLanguage!=null?je():Ae(),pe=""}function Be(L,H){L!==""&&(_e.startScope(H),_e.addText(L),_e.endScope())}function _t(L,H){let X=1,se=H.length-1;for(;X<=se;){if(!L._emit[X]){X++;continue}let Fe=Je.classNameAliases[L[X]]||L[X],rt=H[X];Fe?Be(rt,Fe):(pe=rt,Ae(),pe=""),X++}}function kt(L,H){return L.scope&&typeof L.scope=="string"&&_e.openNode(Je.classNameAliases[L.scope]||L.scope),L.beginScope&&(L.beginScope._wrap?(Be(pe,Je.classNameAliases[L.beginScope._wrap]||L.beginScope._wrap),pe=""):L.beginScope._multi&&(_t(L.beginScope,H),pe="")),V=Object.create(L,{parent:{value:V}}),V}function Re(L,H,X){let se=O2(L.endRe,X);if(se){if(L["on:end"]){let Fe=new bu(L);L["on:end"](H,Fe),Fe.isMatchIgnored&&(se=!1)}if(se){for(;L.endsParent&&L.parent;)L=L.parent;return L}}if(L.endsWithParent)return Re(L.parent,H,X)}function St(L){return V.matcher.regexIndex===0?(pe+=L[0],1):(Ot=!0,0)}function Xt(L){let H=L[0],X=L.rule,se=new bu(X),Fe=[X.__beforeBegin,X["on:begin"]];for(let rt of Fe)if(rt&&(rt(L,se),se.isMatchIgnored))return St(H);return X.skip?pe+=H:(X.excludeBegin&&(pe+=H),Ne(),!X.returnBegin&&!X.excludeBegin&&(pe=H)),kt(X,L),X.returnBegin?0:H.length}function pt(L){let H=L[0],X=D.substring(L.index),se=Re(V,L,X);if(!se)return kx;let Fe=V;V.endScope&&V.endScope._wrap?(Ne(),Be(H,V.endScope._wrap)):V.endScope&&V.endScope._multi?(Ne(),_t(V.endScope,L)):Fe.skip?pe+=H:(Fe.returnEnd||Fe.excludeEnd||(pe+=H),Ne(),Fe.excludeEnd&&(pe=H));do V.scope&&_e.closeNode(),!V.skip&&!V.subLanguage&&(ut+=V.relevance),V=V.parent;while(V!==se.parent);return se.starts&&kt(se.starts,L),Fe.returnEnd?0:H.length}function an(){let L=[];for(let H=V;H!==Je;H=H.parent)H.scope&&L.unshift(H.scope);L.forEach(H=>_e.openNode(H))}let Zt={};function Tt(L,H){let X=H&&H[0];if(pe+=L,X==null)return Ne(),0;if(Zt.type==="begin"&&H.type==="end"&&Zt.index===H.index&&X===""){if(pe+=D.slice(H.index,H.index+1),!i){let se=new Error(`0 width match regex (${A})`);throw se.languageName=A,se.badRule=Zt.rule,se}return 1}if(Zt=H,H.type==="begin")return Xt(H);if(H.type==="illegal"&&!z){let se=new Error('Illegal lexeme "'+X+'" for mode "'+(V.scope||"")+'"');throw se.mode=V,se}else if(H.type==="end"){let se=pt(H);if(se!==kx)return se}if(H.type==="illegal"&&X==="")return 1;if(Bt>1e5&&Bt>H.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pe+=X,X.length}let Je=q(A);if(!Je)throw bo(o.replace("{}",A)),new Error('Unknown language: "'+A+'"');let jn=dF(Je),Pt="",V=j||jn,yt={},_e=new l.__emitter(l);an();let pe="",ut=0,dt=0,Bt=0,Ot=!1;try{if(Je.__emitTokens)Je.__emitTokens(D,_e);else{for(V.matcher.considerAll();;){Bt++,Ot?Ot=!1:V.matcher.considerAll(),V.matcher.lastIndex=dt;let L=V.matcher.exec(D);if(!L)break;let H=D.substring(dt,L.index),X=Tt(H,L);dt=L.index+X}Tt(D.substring(dt))}return _e.finalize(),Pt=_e.toHTML(),{language:A,value:Pt,relevance:ut,illegal:!1,_emitter:_e,_top:V}}catch(L){if(L.message&&L.message.includes("Illegal"))return{language:A,value:lm(D),illegal:!0,relevance:0,_illegalBy:{message:L.message,index:dt,context:D.slice(dt-100,dt+100),mode:L.mode,resultSoFar:Pt},_emitter:_e};if(i)return{language:A,value:lm(D),illegal:!1,relevance:0,errorRaised:L,_emitter:_e,_top:V};throw L}}function m(A){let D={value:lm(A),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return D._emitter.addText(A),D}function b(A,D){D=D||l.languages||Object.keys(e);let z=m(A),j=D.filter(q).filter(fe).map(Ne=>h(Ne,A,!1));j.unshift(z);let ie=j.sort((Ne,Be)=>{if(Ne.relevance!==Be.relevance)return Be.relevance-Ne.relevance;if(Ne.language&&Be.language){if(q(Ne.language).supersetOf===Be.language)return 1;if(q(Be.language).supersetOf===Ne.language)return-1}return 0}),[xe,Ae]=ie,je=xe;return je.secondBest=Ae,je}function g(A,D,z){let j=D&&n[D]||z;A.classList.add("hljs"),A.classList.add(`language-${j}`)}function E(A){let D=null,z=d(A);if(u(z))return;if(ge("before:highlightElement",{el:A,language:z}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),l.throwUnescapedHTML))throw new fm("One of your code blocks includes unescaped HTML.",A.innerHTML);D=A;let j=D.textContent,ie=z?f(j,{language:z,ignoreIllegals:!0}):b(j);A.innerHTML=ie.value,A.dataset.highlighted="yes",g(A,z,ie.language),A.result={language:ie.language,re:ie.relevance,relevance:ie.relevance},ie.secondBest&&(A.secondBest={language:ie.secondBest.language,relevance:ie.secondBest.relevance}),ge("after:highlightElement",{el:A,result:ie,text:j})}function w(A){l=Nx(l,A)}let S=()=>{T(),ls("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){T(),ls("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function T(){if(document.readyState==="loading"){k=!0;return}document.querySelectorAll(l.cssSelector).forEach(E)}function P(){k&&T()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",P,!1);function I(A,D){let z=null;try{z=D(t)}catch(j){if(bo("Language definition for '{}' could not be registered.".replace("{}",A)),i)bo(j);else throw j;z=s}z.name||(z.name=A),e[A]=z,z.rawDefinition=D.bind(null,t),z.aliases&&Q(z.aliases,{languageName:A})}function Y(A){delete e[A];for(let D of Object.keys(n))n[D]===A&&delete n[D]}function ne(){return Object.keys(e)}function q(A){return A=(A||"").toLowerCase(),e[A]||e[n[A]]}function Q(A,{languageName:D}){typeof A=="string"&&(A=[A]),A.forEach(z=>{n[z.toLowerCase()]=D})}function fe(A){let D=q(A);return D&&!D.disableAutodetect}function we(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=D=>{A["before:highlightBlock"](Object.assign({block:D.el},D))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=D=>{A["after:highlightBlock"](Object.assign({block:D.el},D))})}function me(A){we(A),r.push(A)}function Ce(A){let D=r.indexOf(A);D!==-1&&r.splice(D,1)}function ge(A,D){let z=A;r.forEach(function(j){j[z]&&j[z](D)})}function ye(A){return ls("10.7.0","highlightBlock will be removed entirely in v12.0"),ls("10.7.0","Please use highlightElement now."),E(A)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:T,highlightElement:E,highlightBlock:ye,configure:w,initHighlighting:S,initHighlightingOnLoad:O,registerLanguage:I,unregisterLanguage:Y,listLanguages:ne,getLanguage:q,registerAliases:Q,autoDetection:fe,inherit:Nx,addPlugin:me,removePlugin:Ce}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=pF,t.regex={concat:yo,lookahead:Lx,either:pm,optional:N2,anyNumberOfTimes:M2};for(let A in gu)typeof gu[A]=="object"&&Ix(gu[A]);return Object.assign(t,gu),t},cs=Kx({});cs.newInstance=()=>Kx({});var mF=cs;cs.HighlightJS=cs;cs.default=cs;var gF=T2(mF);function Vx(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Vx(n.children,r):{text:n.value,classes:r}}).flat()}function Ox(t){return t.value||t.children||[]}function bF(t){return!!gF.getLanguage(t)}function Rx({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(t,o=>o.type.name===e).forEach(o=>{var s;let l=o.pos+1,u=o.node.attrs.language||r,d=n.listLanguages(),f=u&&(d.includes(u)||bF(u)||!((s=n.registered)===null||s===void 0)&&s.call(n,u))?Ox(n.highlight(u,o.node.textContent)):Ox(n.highlightAuto(o.node.textContent));Vx(f).forEach(h=>{let m=l+h.text.length;if(h.classes.length){let b=wt.inline(l,m,{class:h.classes.join(" ")});i.push(b)}l=m})}),ot.create(t,i)}function yF(t){return typeof t=="function"}function EF({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>yF(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Oe({key:new ze("lowlight"),state:{init:(i,{doc:o})=>Rx({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=eo(s.doc,m=>m.type.name===t),h=eo(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?Rx({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Gx=Sx.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],EF({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var gm=Gx.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var bm=ce.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",ee(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var ym=We.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.style&&t.style.includes("text-align")?{}:t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});function vu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function qx(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function Yx(t,e,n,r,i,o,s){let l=qx(t),u=[];if(n==="asymmetric")u.push(vu(l.builderColumn,i,s)),u.push(vu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=Yx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(le.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Te(re(t,"gridBuilderRole",e))}}});var vm=ce.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",ee(this.options.HTMLAttributes,t),0]}});var wm=We.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Oe({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var xm=ce.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",ee(t)]},addNodeView(){return({editor:t,node:e,getPos:n})=>{let r=document.createElement("div");r.contentEditable="false",r.classList.add("tiptap-block-wrapper");let i=typeof e.attrs.data=="object"?JSON.stringify(e.attrs.data):e.attrs.data;return r.innerHTML=`
- `,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),u=n();return l?(u.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),u.focus(l.end+1)):t.coordinates?(u.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(u.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function vF(t){var e;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=t,u=r&&!i,d=ov(n),f=new RegExp(`\\s${d}$`),h=s?"^":"",m=i?"":d,g=u?new RegExp(`${h}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;let E=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;let S=w.input.slice(Math.max(0,w.index-1),w.index),N=new RegExp(`^[${o?.join("")}\0]?$`).test(S);if(o!==null&&!N)return null;let D=E+w.index,T=D+w[0].length;return u&&f.test(b.slice(T-1,T+1))&&(w[0]+=" ",T+=1),D=l.pos?{range:{from:D,to:T},query:w[0].slice(n.length),text:w[0]}:null}var wF=new ze("suggestion");function Jx({pluginKey:t=wF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:u="suggestion",command:d=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=vF}){let b,E=h?.(),w=new Oe({key:t,view(){return{update:async(S,N)=>{var D,T,B,R,Y,ne,q;let Q=(D=this.key)===null||D===void 0?void 0:D.getState(N),fe=(T=this.key)===null||T===void 0?void 0:T.getState(S.state),we=Q.active&&fe.active&&Q.range.from!==fe.range.from,me=!Q.active&&fe.active,Ce=Q.active&&!fe.active,ge=!me&&!Ce&&Q.query!==fe.query,ye=me||we&&ge,A=ge||we,I=Ce||we&≥if(!ye&&!A&&!I)return;let z=I&&!ye?Q:fe,j=S.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);b={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:ie=>d({editor:e,range:z.range,props:ie}),decorationNode:j,clientRect:j?()=>{var ie;let{decorationId:xe}=(ie=this.key)===null||ie===void 0?void 0:ie.getState(e.state),Ae=S.dom.querySelector(`[data-decoration-id="${xe}"]`);return Ae?.getBoundingClientRect()||null}:null},ye&&((B=E?.onBeforeStart)===null||B===void 0||B.call(E,b)),A&&((R=E?.onBeforeUpdate)===null||R===void 0||R.call(E,b)),(A||ye)&&(b.items=await f({editor:e,query:z.query})),I&&((Y=E?.onExit)===null||Y===void 0||Y.call(E,b)),A&&((ne=E?.onUpdate)===null||ne===void 0||ne.call(E,b)),ye&&((q=E?.onStart)===null||q===void 0||q.call(E,b))},destroy:()=>{var S;b&&((S=E?.onExit)===null||S===void 0||S.call(E,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,N,D,T){let{isEditable:B}=e,{composing:R}=e.view,{selection:Y}=S,{empty:ne,from:q}=Y,Q={...N};if(Q.composing=R,B&&(ne||e.view.composing)){(qN.range.to)&&!R&&!N.composing&&(Q.active=!1);let fe=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:Y.$from}),we=`id_${Math.floor(Math.random()*4294967295)}`;fe&&m({editor:e,state:T,range:fe.range,isActive:N.active})?(Q.active=!0,Q.decorationId=N.decorationId?N.decorationId:we,Q.range=fe.range,Q.query=fe.query,Q.text=fe.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(S,N){var D;let{active:T,range:B}=w.getState(S.state);return T&&((D=E?.onKeyDown)===null||D===void 0?void 0:D.call(E,{view:S,event:N,range:B}))||!1},decorations(S){let{active:N,range:D,decorationId:T}=w.getState(S);return N?ot.create(S.doc,[wt.inline(D.from,D.to,{nodeName:l,class:u,"data-decoration-id":T})]):null}}});return w}var xF=new ze("mergeTag"),_m=ce.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",ee({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Jx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:xF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=` + `,{dom:r}}},addCommands(){return{insertBlock:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},{type:this.name,attrs:t}),r.setTextSelection(t.coordinates.pos);let{selection:i}=n,{$from:o,$to:s}=i,l=o.blockRange(s);return l?(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:this.name,attrs:t}):r.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),r.setTextSelection(l.end)):(s.parentOffset===0?r.insertContentAt(Math.max(s.pos-1,0),{type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}):r.setNode({type:"paragraph"}).insertContentAt({from:o.pos,to:s.pos},{type:this.name,attrs:t}),r.setTextSelection(s.pos+1))},updateBlock:t=>({commands:e,chain:n,state:r})=>{let{selection:i}=r,{$from:o,$to:s}=i,l=o.blockRange(s),u=n();return l?(u.insertContentAt({from:l.start,to:l.end},{type:this.name,attrs:t}),u.focus(l.end+1)):t.coordinates?(u.insertContentAt({from:t.coordinates,to:t.coordinates+1},{type:this.name,attrs:t}),!1):(u.insertContentAt({from:o.pos,to:o.pos+1},{type:this.name,attrs:t}),!1)},removeBlock:()=>({commands:t})=>t.deleteSelection()}}});function vF(t){var e;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=t,u=r&&!i,d=ov(n),f=new RegExp(`\\s${d}$`),h=s?"^":"",m=i?"":d,b=u?new RegExp(`${h}${d}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${d}[^\\s${m}]*`,"gm"),g=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!g)return null;let E=l.pos-g.length,w=Array.from(g.matchAll(b)).pop();if(!w||w.input===void 0||w.index===void 0)return null;let S=w.input.slice(Math.max(0,w.index-1),w.index),O=new RegExp(`^[${o?.join("")}\0]?$`).test(S);if(o!==null&&!O)return null;let k=E+w.index,T=k+w[0].length;return u&&f.test(g.slice(T-1,T+1))&&(w[0]+=" ",T+=1),k=l.pos?{range:{from:k,to:T},query:w[0].slice(n.length),text:w[0]}:null}var wF=new ze("suggestion");function Jx({pluginKey:t=wF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:u="suggestion",command:d=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:b=vF}){let g,E=h?.(),w=new Oe({key:t,view(){return{update:async(S,O)=>{var k,T,P,I,Y,ne,q;let Q=(k=this.key)===null||k===void 0?void 0:k.getState(O),fe=(T=this.key)===null||T===void 0?void 0:T.getState(S.state),we=Q.active&&fe.active&&Q.range.from!==fe.range.from,me=!Q.active&&fe.active,Ce=Q.active&&!fe.active,ge=!me&&!Ce&&Q.query!==fe.query,ye=me||we&&ge,A=ge||we,D=Ce||we&≥if(!ye&&!A&&!D)return;let z=D&&!ye?Q:fe,j=S.dom.querySelector(`[data-decoration-id="${z.decorationId}"]`);g={editor:e,range:z.range,query:z.query,text:z.text,items:[],command:ie=>d({editor:e,range:z.range,props:ie}),decorationNode:j,clientRect:j?()=>{var ie;let{decorationId:xe}=(ie=this.key)===null||ie===void 0?void 0:ie.getState(e.state),Ae=S.dom.querySelector(`[data-decoration-id="${xe}"]`);return Ae?.getBoundingClientRect()||null}:null},ye&&((P=E?.onBeforeStart)===null||P===void 0||P.call(E,g)),A&&((I=E?.onBeforeUpdate)===null||I===void 0||I.call(E,g)),(A||ye)&&(g.items=await f({editor:e,query:z.query})),D&&((Y=E?.onExit)===null||Y===void 0||Y.call(E,g)),A&&((ne=E?.onUpdate)===null||ne===void 0||ne.call(E,g)),ye&&((q=E?.onStart)===null||q===void 0||q.call(E,g))},destroy:()=>{var S;g&&((S=E?.onExit)===null||S===void 0||S.call(E,g))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(S,O,k,T){let{isEditable:P}=e,{composing:I}=e.view,{selection:Y}=S,{empty:ne,from:q}=Y,Q={...O};if(Q.composing=I,P&&(ne||e.view.composing)){(qO.range.to)&&!I&&!O.composing&&(Q.active=!1);let fe=b({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:Y.$from}),we=`id_${Math.floor(Math.random()*4294967295)}`;fe&&m({editor:e,state:T,range:fe.range,isActive:O.active})?(Q.active=!0,Q.decorationId=O.decorationId?O.decorationId:we,Q.range=fe.range,Q.query=fe.query,Q.text=fe.text):Q.active=!1}else Q.active=!1;return Q.active||(Q.decorationId=null,Q.range={from:0,to:0},Q.query=null,Q.text=null),Q}},props:{handleKeyDown(S,O){var k;let{active:T,range:P}=w.getState(S.state);return T&&((k=E?.onKeyDown)===null||k===void 0?void 0:k.call(E,{view:S,event:O,range:P}))||!1},decorations(S){let{active:O,range:k,decorationId:T}=w.getState(S);return O?ot.create(S.doc,[wt.inline(k.from,k.to,{nodeName:l,class:u,"data-decoration-id":T})]):null}}});return w}var xF=new ze("mergeTag"),_m=ce.create({name:"mergeTag",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}}}},parseHTML(){return[{tag:`span[data-type='${this.name}']`}]},renderHTML({node:t,HTMLAttributes:e}){return["span",ee({"data-type":this.name},e),`{{ ${t.attrs.id} }}`]},renderText({node:t}){return`{{ ${t.attrs.id} }}`},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1,{selection:r}=e,{empty:i,anchor:o}=r;return i?(e.doc.nodesBetween(o-1,o,(s,l)=>{if(s.type.name===this.name)return n=!0,t.insertText("{{",l,l+s.nodeSize),!1}),n):!1})}},addCommands(){return{insertMergeTag:t=>({chain:e,state:n})=>{let r=e();if(![null,void 0].includes(t.coordinates?.pos))return r.insertContentAt({from:t.coordinates.pos,to:t.coordinates.pos},[{type:this.name,attrs:{id:t.tag}},{type:"text",text:" "}]),r}}},addProseMirrorPlugins(){return[Jx({editor:this.editor,char:"{{",items:({query:t})=>this.options.mergeTags.filter(e=>e.toLowerCase().startsWith(t.toLowerCase())).slice(0,5),pluginKey:xF,command:({editor:t,range:e,props:n})=>{t.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),window.getSelection()?.collapseToEnd()},allow:({state:t,range:e})=>{let n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)},render:()=>{let t,e;return{onStart:n=>{if(!n.clientRect)return;let r=`
{n.command({id:i.detail.item})}),e=is("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var Sm=We.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var Tm=We.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var Cm=We.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var Am=We.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function _F(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xx(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=_F(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Zx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},u={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],b=["true","false"],E={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:b,built_in:[...w,...S,"set","shopt",...N,...D]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,E,s,l,u,n]}}function jx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},D={begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:g,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:w}}}function Qx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},g=e.optional(i)+t.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},B={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},R=[B,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:R.concat([{begin:/\(/,end:/\)/,keywords:T,contains:R.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:g,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function e_(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},E=t.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[E,g,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let w={variants:[b,g,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},N=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+N+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[w,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}var SF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),TF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],AF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],MF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],NF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function t_(t){let e=t.regex,n=SF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AF.join("|")+")"},{begin:":(:)?("+MF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:CF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TF.join("|")+")\\b"}]}}function n_(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function r_(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"a_(t,e,n-1))}function l_(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+a_("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,s_,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s_,d]}}var c_="[A-Za-z$_][0-9A-Za-z$_]*",kF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],OF=["true","false","null","undefined","NaN","Infinity"],u_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],d_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IF=[].concat(f_,u_,d_);function p_(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:c_,keyword:kF,literal:OF,built_in:IF,"variable.language":RF},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(N,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...u_,...d_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...f_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,N,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function h_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ds="[0-9](_*[0-9])*",_u=`\\.(${ds})`,Su="[0-9a-fA-F](_*[0-9a-fA-F])*",DF={className:"number",variants:[{begin:`(\\b(${ds})((${_u})|\\.)?|(${_u}))[eE][+-]?(${ds})[fFdD]?\\b`},{begin:`\\b(${ds})((${_u})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_u})[fFdD]?\\b`},{begin:`\\b(${ds})[fFdD]\\b`},{begin:`\\b0[xX]((${Su})\\.?|(${Su})?\\.(${Su}))[pP][+-]?(${ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Su})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function m_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=DF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},d]}}var LF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),PF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],g_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],b_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],FF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),HF=g_.concat(b_);function y_(t){let e=LF(t),n=HF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(D){return{className:"string",begin:"~?"+D+".*?"+D}},d=function(D,T,B){return{className:D,begin:T,relevance:B}},f={$pattern:/[a-z-]+/,keyword:r,attribute:BF.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),g={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+FF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+PF.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+g_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},N={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,w,N,b,S,g,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function E_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function v_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let g=[n,u];return[d,f,h,m].forEach(w=>{w.contains=w.contains.concat(g)}),g=g.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},i,r,u,s]}}function x_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function __(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},u=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(g,b,E="\\1")=>{let w=E==="\\1"?E:e.concat(E,b);return e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,E,r)},h=(g,b,E)=>e.concat(e.concat("(?:",g,")"),b,/(?:\\.|[^\\\/])*?/,E,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function S_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,g={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:w,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(E),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),B={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[ne,o,Y,t.C_BLOCK_COMMENT_MODE,g,b,B]},Q={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(w).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(Q);let fe=[ne,Y,t.C_BLOCK_COMMENT_MODE,g,b,B],we={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...fe]},...fe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:D,contains:[we,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,Q,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},B,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,g,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},g,b]}}function T_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function C_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function A_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",g=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${g}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},w={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,E,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,E,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,w,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,S,h]}]}}function M_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function N_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function k_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},R=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=R,E.contains=R;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:R}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:R}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(R)}}function O_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:""},n]}}var $F=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),zF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],UF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],WF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],KF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],VF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function R_(t){let e=$F(t),n=KF,r=WF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+VF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:UF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function I_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function D_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,b=[...d,...u].filter(D=>!f.includes(D)),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},w={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function N(D,{exceptions:T,when:B}={}){let R=B;return T=T||[],D.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:R(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(b,{when:D=>D.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:b.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,E,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,w]}}function F_(t){return t?typeof t=="string"?t:t.source:null}function Tu(t){return nt("(?=",t,")")}function nt(...t){return t.map(n=>F_(n)).join("")}function GF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(GF(t).capture?"":"?:")+t.map(r=>F_(r)).join("|")+")"}var Om=t=>nt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),qF=["Protocol","Type"].map(Om),L_=["init","self"].map(Om),YF=["Any","Self"],Mm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],P_=["false","nil","true"],JF=["assignment","associativity","higherThan","left","lowerThan","none","right"],XF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],B_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],H_=Sn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),$_=Sn(H_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Nm=nt(H_,$_,"*"),z_=Sn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cu=Sn(z_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xr=nt(z_,Cu,"*"),km=nt(/[A-Z]/,Cu,"*"),ZF=["autoclosure",nt(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Xr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],jF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function U_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...qF,...L_)],className:{2:"keyword"}},o={match:nt(/\./,Sn(...Mm)),relevance:0},s=Mm.filter(Re=>typeof Re=="string").concat(["_|0"]),l=Mm.filter(Re=>typeof Re!="string").concat(YF).map(Om),u={variants:[{className:"keyword",match:Sn(...l,...L_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(XF),literal:P_},f=[i,o,u],h={match:nt(/\./,Sn(...B_)),relevance:0},m={className:"built_in",match:nt(/\b/,Sn(...B_),/(?=\()/)},g=[h,m],b={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:Nm},{match:`\\.(\\.|${$_})+`}]},w=[b,E],S="([0-9]_*)+",N="([0-9a-fA-F]_*)+",D={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${N})(\\.(${N}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(Re="")=>({className:"subst",variants:[{match:nt(/\\/,Re,/[0\\tnr"']/)},{match:nt(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),B=(Re="")=>({className:"subst",match:nt(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),R=(Re="")=>({className:"subst",label:"interpol",begin:nt(/\\/,Re,/\(/),end:/\)/}),Y=(Re="")=>({begin:nt(Re,/"""/),end:nt(/"""/,Re),contains:[T(Re),B(Re),R(Re)]}),ne=(Re="")=>({begin:nt(Re,/"/),end:nt(/"/,Re),contains:[T(Re),R(Re)]}),q={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ne(),ne("#"),ne("##"),ne("###")]},Q={match:nt(/`/,Xr,/`/)},fe={className:"variable",match:/\$\d+/},we={className:"variable",match:`\\$${Cu}+`},me=[Q,fe,we],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jF,contains:[...w,D,q]}]}},ge={className:"keyword",match:nt(/@/,Sn(...ZF))},ye={className:"meta",match:nt(/@/,Xr)},A=[Ce,ge,ye],I={match:Tu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cu,"+")},{className:"type",match:km,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Tu(km)),relevance:0}]},z={begin://,keywords:d,contains:[...r,...f,...A,b,I]};I.contains.push(z);let j={match:nt(Xr,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",j,...r,...f,...g,...w,D,q,...me,...A,I]},xe={begin://,contains:[...r,I]},Ae={begin:Sn(Tu(nt(Xr,/\s*:/)),Tu(nt(Xr,/\s+/,Xr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Xr}]},je={begin:/\(/,end:/\)/,keywords:d,contains:[Ae,...r,...f,...w,D,q,...A,I,ie],endsParent:!0,illegal:/["']/},Ne={match:[/func/,/\s+/,Sn(Q.match,Xr,Nm)],className:{1:"keyword",3:"title.function"},contains:[xe,je,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,je,e],illegal:/\[|%/},_t={match:[/operator/,/\s+/,Nm],className:{1:"keyword",3:"title"}},kt={begin:[/precedencegroup/,/\s+/,km],className:{1:"keyword",3:"title"},contains:[I],keywords:[...JF,...P_],end:/}/};for(let Re of q.variants){let St=Re.contains.find(pt=>pt.label==="interpol");St.keywords=d;let Xt=[...f,...g,...w,D,q,...me];St.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,Ne,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},_t,kt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...g,...w,D,q,...me,...A,I,ie]}}var Au="[A-Za-z$_][0-9A-Za-z$_]*",W_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],K_=["true","false","null","undefined","NaN","Infinity"],V_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],G_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],q_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Y_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J_=[].concat(q_,V_,G_);function QF(t){let e=t.regex,n=(I,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(I,z)=>{let j=I[0].length+I.index,ie=I.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(I,{after:j})||z.ignoreMatch());let xe,Ae=I.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:Au,keyword:W_,literal:K_,built_in:J_,"variable.language":Y_},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},D=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,{match:/\$\d+/},h];m.contains=D.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(D)});let T=[].concat(N,m.contains),B=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...V_,...G_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(I){return e.concat("(?!",I.join("|"),")")}let me={match:e.concat(/\b/,we([...q_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,g,b,E,w,N,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},me,fe,Y,ge,{match:/\$[(.]/}]}}function X_(t){let e=QF(t),n=Au,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],u={$pattern:Au,keyword:W_.concat(l),literal:K_,built_in:J_.concat(r),"variable.language":Y_},d={className:"meta",begin:"@"+n},f=(m,g,b)=>{let E=m.contains.findIndex(w=>w.label===g);if(E===-1)throw new Error("can not find mode to replace");m.contains.splice(E,1,b)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Z_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function j_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,u,d,l]}}function Q_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function eS(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,b,o],w=[...E];return w.pop(),w.push(s),m.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}var wS=ef(vS(),1);var Zn=wS.default;var _S=ef(xS(),1),ka=Object.assign(wo(Error),{eval:wo(EvalError),range:wo(RangeError),reference:wo(ReferenceError),syntax:wo(SyntaxError),type:wo(TypeError),uri:wo(URIError)});function wo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,_S.default)(n,...r);return new t(i)}}var WH={}.hasOwnProperty,SS="hljs-";function TS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw ka("Expected `string` for name, got `%s`",t);if(!Zn.getLanguage(t))throw ka("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw ka("Expected `string` for value, got `%s`",e);r==null&&(r=SS),Zn.configure({__emitter:zm,classPrefix:r});let i=Zn.highlight(e,{language:t,ignoreIllegals:!0});if(Zn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function KH(t,e={}){let n=e.subset||Zn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=SS),typeof t!="string")throw ka("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function VH(t,e){Zn.registerLanguage(t,e)}var GH=function(t,e){if(typeof t=="string")Zn.registerAliases(e,{languageName:t});else{let n;for(n in t)WH.call(t,n)&&Zn.registerAliases(t[n],{languageName:n})}};function qH(t){return!!Zn.getLanguage(t)}function YH(){return Zn.listLanguages()}var zm=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},De={highlight:TS,highlightAuto:KH,registerLanguage:VH,registered:qH,listLanguages:YH,registerAlias:GH};De.registerLanguage("arduino",Xx);De.registerLanguage("bash",Zx);De.registerLanguage("c",jx);De.registerLanguage("cpp",Qx);De.registerLanguage("csharp",e_);De.registerLanguage("css",t_);De.registerLanguage("diff",n_);De.registerLanguage("go",r_);De.registerLanguage("graphql",i_);De.registerLanguage("ini",o_);De.registerLanguage("java",l_);De.registerLanguage("javascript",p_);De.registerLanguage("json",h_);De.registerLanguage("kotlin",m_);De.registerLanguage("less",y_);De.registerLanguage("lua",E_);De.registerLanguage("makefile",v_);De.registerLanguage("markdown",w_);De.registerLanguage("objectivec",x_);De.registerLanguage("perl",__);De.registerLanguage("php",S_);De.registerLanguage("php-template",T_);De.registerLanguage("plaintext",C_);De.registerLanguage("python",A_);De.registerLanguage("python-repl",M_);De.registerLanguage("r",N_);De.registerLanguage("ruby",k_);De.registerLanguage("rust",O_);De.registerLanguage("scss",R_);De.registerLanguage("shell",I_);De.registerLanguage("sql",D_);De.registerLanguage("swift",U_);De.registerLanguage("typescript",X_);De.registerLanguage("vbnet",Z_);De.registerLanguage("wasm",j_);De.registerLanguage("xml",Q_);De.registerLanguage("yaml",eS);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var u6={grad:360/400,turn:360,rad:360/(Math.PI*2)},CS=t=>jH(Iu(t)),Iu=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Nt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Nt(parseInt(t.substring(6,8),16)/255,2):1});var AS=t=>ZH(XH(t)),JH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Nt(t),s:Nt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Nt(i/2),a:Nt(r,2)}};var Oa=t=>{let{h:e,s:n,l:r}=JH(t);return`hsl(${e}, ${n}%, ${r}%)`};var XH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),u=i%6;return{r:Nt([n,s,o,o,l,n][u]*255),g:Nt([l,n,n,s,o,o][u]*255),b:Nt([o,o,l,n,n,s][u]*255),a:Nt(r,2)}};var Ru=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},ZH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Ru(Nt(r*255)):"";return"#"+Ru(t)+Ru(e)+Ru(n)+i},jH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Nt(60*(s<0?s+6:s)),s:Nt(i?o/i*100:0),v:Nt(i/255*100),a:r}};var Um=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var MS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Um(Iu(t),Iu(e));var NS={},Du=t=>{let e=NS[t];return e||(e=document.createElement("template"),e.innerHTML=t,NS[t]=e),e},Ra=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var hs=!1,Wm=t=>"touches"in t,QH=t=>hs&&!Wm(t)?!1:(hs||(hs=Wm(t)),!0),kS=(t,e)=>{let n=Wm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ra(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},e$=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ra(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ms=class{constructor(e,n,r,i){let o=Du(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(hs?"touchmove":"mousemove",this),n(hs?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!QH(e)||!hs&&e.button!=0)return;this.el.focus(),kS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),kS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":e$(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Lu=class extends ms{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Oa({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Nt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Pu=class extends ms{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Oa(e)},{"background-color":Oa({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Nt(e.s)}%, Brightness ${Nt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var OS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var RS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var IS="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Bu=Symbol("same"),Km=Symbol("color"),DS=Symbol("hsva"),Vm=Symbol("update"),LS=Symbol("parts"),PS=Symbol("css"),BS=Symbol("sliders"),Fu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[PS](){return[OS,RS,IS]}get[BS](){return[Pu,Lu]}get color(){return this[Km]}set color(e){if(!this[Bu](e)){let n=this.colorModel.toHsva(e);this[Vm](n),this[Km]=e}}constructor(){super();let e=Du(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[LS]=this[BS].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Bu](i)||(this.color=i)}handleEvent(e){let n=this[DS],r={...n,...e.detail};this[Vm](r);let i;!Um(r,n)&&!this[Bu](i=this.colorModel.fromHsva(r))&&(this[Km]=i,Ra(this,"color-changed",{value:i}))}[Bu](e){return this.color&&this.colorModel.equal(e,this.color)}[Vm](e){this[DS]=e,this[LS].forEach(n=>n.update(e))}};var t$={defaultColor:"#000",toHsva:CS,fromHsva:({h:t,s:e,v:n})=>AS({h:t,s:e,v:n,a:1}),equal:MS,fromAttr:t=>t},Hu=class extends Fu{get colorModel(){return t$}};var $S=ef(FS(),1);customElements.define("tiptap-hex-color-picker",Hu);var n$={blockquote:[sv],bold:[av],"bullet-list":[uv],"checked-list":[_h],code:[dv],"code-block":[gm.configure({lowlight:De,HTMLAttributes:{class:"hljs"}})],color:[pv],details:[om,sm,am],grid:[jh,Qh],"grid-builder":[Em,vm],heading:[Ev.configure({levels:[1,2,3,4,5,6]})],highlight:[gw],hr:[Tv],hurdle:[bm],italic:[Cv],lead:[Sh],link:[Jh.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Xh.configure({inline:!0})],oembed:[tm,rm,im],"ordered-list":[Nv],small:[Zh],strike:[Ov],subscript:[Rv],superscript:[Iv],table:[uw.configure({resizable:!0}),fw,dw,pw],underline:[mw]},r$=window.TiptapEditorExtensions||{},HS={...n$,...r$},$u=document.getElementById("activeLocale");$u&&$u.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:$u.value}});$u.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function i$({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",bubbleMenuTools:o=[],floatingMenuTools:s=[],placeholder:l=null,mergeTags:u=[],customDocument:d=null,nodePlaceholders:f=[],showOnlyCurrentPlaceholder:h=!0}){let m=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,bubbleMenuTools:o,floatingMenuTools:s,getExtensions(){let g=this.tools.map(E=>typeof E=="string"?E:E.id),b=[d?Rp.extend({content:d}):Rp,hw,wc,mv,bv,yv,Sv,fv,wm,Sm,Tm,Cm,Am.configure({statePath:e}),xm];if((l||f)&&!r&&b.push(kv.configure({showOnlyCurrent:h,placeholder:({node:E})=>f?.[E.type.name]||l||""})),g.length){let E=Object.keys(HS),w=[],S=["paragraph"];b.push(ex.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"auto",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:N,from:D,to:T})=>{if(Ur(N,"oembed")||Ur(N,"vimeo")||Ur(N,"youtube")||Ur(N,"video")||Ur(N,"tiptapBlock"))return!1;if(Ur(N,"link")||Ur(N,"table")||D!==T)return!0}})),this.floatingMenuTools.length&&(b.push(tx.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(N=>{g.includes(N)||g.push(N)})),this.bubbleMenuTools.length&&this.bubbleMenuTools.forEach(N=>{g.includes(N)||g.push(N)}),g.forEach(N=>{E.includes(N)?HS[N].forEach(D=>{["ordered-list","bullet-list","checked-list"].includes(N)?(b.push(D),b.includes($p)||b.push($p)):b.push(D)}):["align-left","align-right","align-center","align-justify"].includes(N)&&(N==="align-left"&&w.push("start"),N==="align-center"&&w.push("center"),N==="align-right"&&w.push("end"),N==="align-justify"&&w.push("justify"),g.includes("heading")&&S.push("heading"),typeof b.find(T=>T.name==="textAlign")>"u"&&b.push(ym.configure({types:S,alignments:w})))})}return u?.length&&b.push(_m.configure({mergeTags:u})),b},init:function(){let g=this.$refs.element.querySelector(".tiptap");g&&(g.remove(),m=null),this.initEditor(this.state);let b=this.$el.parentElement.closest("[x-sortable]");b&&(window.Sortable.utils.on(b,"start",()=>{b.classList.add("sorting")}),window.Sortable.utils.on(b,"end",()=>{b.classList.remove("sorting")})),this.$watch("state",(E,w)=>{typeof E<"u"&&((0,$S.isEqual)(w,Alpine.raw(E))||this.updateEditorContent(E))})},initEditor(g){if(!this.$el.querySelector(".tiptap")){let b=this;m=new sc({element:b.$refs.element,extensions:b.getExtensions(),editable:!b.disabled,content:g,editorProps:{handlePaste(E,w,S){S.content.descendants(N=>{N.type.name==="tiptapBlock"&&(N.attrs.statePath=b.statePath,N.attrs.data=JSON.parse(N.attrs.data))})}},onUpdate({editor:E}){b.state=E.isEmpty?null:E.getJSON(),b.updatedAt=Date.now()},onSelectionUpdate(){b.updatedAt=Date.now()},onBlur(){b.updatedAt=Date.now()},onFocus(){b.updatedAt=Date.now()}})}},isActive(g,b={}){return m.isActive(g,b)},editor(){return m},blur(){let g=this.$el.querySelectorAll("[data-tippy-content]");g&&g.forEach(b=>b.destroy()),this.updatedAt=Date.now()},updateEditorContent(g){if(m.isEditable){let{from:b,to:E}=m.state.selection;m.commands.setContent(g,!0),m.chain().focus().setTextSelection({from:b,to:E}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(g){this.locale=g.detail.locale},insertContent(g){if(g.detail.statePath===this.statePath)switch(g.detail.type){case"media":this.insertMedia(g);return;case"video":this.insertVideo(g);return;case"link":this.insertLink(g);return;case"source":this.insertSource(g);return;case"grid":this.insertGridBuilder(g);return;default:return}},insertMedia(g){Array.isArray(g.detail.media)?g.detail.media.forEach(b=>{this.executeMediaInsert(b)}):this.executeMediaInsert(g.detail.media)},executeMediaInsert(g=null){if(!(!g||g?.url===null)&&g){let b=g?.url||g?.src,E=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],S=/.*\.([a-zA-Z]*)\??/.exec(b.toLowerCase());S!==null&&E.includes(S[1])?m.chain().focus().setImage({src:b,alt:g?.alt,title:g?.title,width:g?.width,height:g?.height,lazy:g?.lazy,srcset:g?.srcset,sizes:g?.sizes,media:g?.media}).run():m.chain().focus().extendMarkRange("link").setLink({href:b}).insertContent(g?.link_text).run()}},insertVideo(g){let b=g.detail.video;if(!b||b.url===null)return;let E={src:b.url,width:b.responsive?b.width*100:b.width,height:b.responsive?b.height*100:b.height,responsive:b.responsive??!0,"data-aspect-width":b.width,"data-aspect-height":b.height};b.url.includes("youtube")||b.url.includes("youtu.be")?m.chain().focus().setYoutubeVideo({...E,controls:b.youtube_options.includes("controls"),nocookie:b.youtube_options.includes("nocookie"),start:b.start_at??0}).run():b.url.includes("vimeo")?m.chain().focus().setVimeoVideo({...E,autoplay:b.vimeo_options.includes("autoplay"),loop:b.vimeo_options.includes("loop"),title:b.vimeo_options.includes("show_title"),byline:b.vimeo_options.includes("byline"),portrait:b.vimeo_options.includes("portrait")}).run():m.chain().focus().setVideo({...E,autoplay:b.native_options.includes("autoplay"),loop:b.native_options.includes("loop"),controls:b.native_options.includes("controls")}).run()},insertLink(g){let b=g.detail;if(!(b.href===null&&b.id===null)){if(b.href===""&&b.id===null){this.unsetLink();return}m.chain().focus().setTextSelection({from:b.coordinates[0].$from.pos,to:b.coordinates[0].$to.pos}).extendMarkRange("link").setLink({href:b.href,id:b.id??null,target:b.target??null,hreflang:b.hreflang??null,rel:b.rel??null,referrerpolicy:b.referrerpolicy??null,as_button:b.as_button??null,button_theme:b.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){m.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(g){this.updateEditorContent(g.detail.source)},insertGridBuilder(g){let b=g.detail.data,E="responsive",w=parseInt(b.asymmetric_left)??null,S=parseInt(b.asymmetric_right)??null;b.fixed&&(E="fixed"),b.asymmetric&&(E="asymmetric"),m.chain().focus().insertGridBuilder({cols:b.columns,type:E,stackAt:b.stack_at,asymmetricLeft:w,asymmetricRight:S}).run()},insertBlock(g){g.detail.statePath===this.statePath&&(m.commands.insertBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus())},insertMergeTag(g){m.commands.insertMergeTag({tag:g.detail.tag,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus()},openBlockSettings(g){g.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,g.detail)},updateBlock(g){g.detail.statePath===this.statePath&&(m.commands.updateBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),m.isFocused||m.commands.focus())},deleteBlock(g){g.detail.statePath===this.statePath&&m.commands.removeBlock()}}}export{i$ as default}; + `;t=document.createElement("div"),t.innerHTML=r,t.addEventListener("merge-tags-select",i=>{n.command({id:i.detail.item})}),e=is("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t,allowHTML:!0,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate(n){if(!n.items.length){e[0].hide();return}e[0].show(),t.dispatchEvent(new CustomEvent("merge-tags-update-items",{detail:n.items}))},onKeyDown(n){t.dispatchEvent(new CustomEvent("merge-tags-key-down",{detail:n.event}))},onExit(){e[0].destroy()}}}})]}});var Sm=We.create({name:"classExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{class:{default:null,parseHTML:t=>t.getAttribute("class")??null,renderHTML:t=>t.class?{class:t.class}:null}}}]}});var Tm=We.create({name:"idExtension",addGlobalAttributes(){return[{types:["heading","link"],attributes:{id:{default:null,parseHTML:t=>t.getAttribute("id")??null,renderHTML:t=>t.id?{id:t.id}:null}}}]}});var Cm=We.create({name:"styleExtension",addGlobalAttributes(){return[{types:["heading","paragraph","link","image","listItem","bulletList","orderedList","table","tableHeader","tableRow","tableCell","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.getAttribute("style")??null,renderHTML:t=>t.style?{style:t.style}:null}}}]}});var Am=We.create({name:"statePath",addOptions(){return{statePath:null}},addStorage(){return{statePath:null}},onBeforeCreate(){this.storage.statePath=this.options.statePath},addCommands(){return{getStatePath:()=>()=>this.storage.statePath}}});function _F(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},I=[P,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:I.concat([{begin:/\(/,end:/\)/,keywords:T,contains:I.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Xx(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=_F(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Zx(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let l={className:"",begin:/\\"/},u={className:"string",begin:/'/,end:/'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],g=["true","false"],E={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],k=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:g,built_in:[...w,...S,"set","shopt",...O,...k]},contains:[h,t.SHEBANG(),m,d,t.HASH_COMMENT_MODE,o,E,s,l,u,n]}}function jx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},S=[h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:S.concat([{begin:/\(/,end:/\)/,keywords:w,contains:S.concat(["self"]),relevance:0}]),relevance:0},k={begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:b,returnBegin:!0,contains:[t.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:h,strings:d,keywords:w}}}function Qx(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},b=e.optional(i)+t.IDENT_RE+"\\s*\\(",g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:E,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},I=[P,h,l,n,t.C_BLOCK_COMMENT_MODE,f,d],Y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:I.concat([{begin:/\(/,end:/\)/,keywords:T,contains:I.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+s+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:b,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,t.C_BLOCK_COMMENT_MODE,h]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"",keywords:T,contains:["self",l]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function e_(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},l=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=t.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:s},m=t.inherit(h,{illegal:/\n/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,m]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},E=t.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[g,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],m.contains=[E,b,f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let w={variants:[g,b,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",k={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},w,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,S,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[w,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},k]}}var SF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),TF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],AF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],MF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],NF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function t_(t){let e=t.regex,n=SF(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+AF.join("|")+")"},{begin:":(:)?("+MF.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+NF.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:CF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TF.join("|")+")\\b"}]}}function n_(t){let e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function r_(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"a_(t,e,n-1))}function l_(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+a_("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},d={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[f,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,s_,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},s_,d]}}var c_="[A-Za-z$_][0-9A-Za-z$_]*",kF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],OF=["true","false","null","undefined","NaN","Infinity"],u_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],d_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],RF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IF=[].concat(f_,u_,d_);function p_(t){let e=t.regex,n=(D,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,z)=>{let j=D[0].length+D.index,ie=D.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(D,{after:j})||z.ignoreMatch());let xe,Ae=D.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:c_,keyword:kF,literal:OF,built_in:IF,"variable.language":RF},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},g={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,E,w,{match:/\$\d+/},h];m.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});let T=[].concat(O,m.contains),P=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),I={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...u_,...d_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(D){return e.concat("(?!",D.join("|"),")")}let me={match:e.concat(/\b/,we([...f_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,E,w,O,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,fe,Y,ge,{match:/\$[(.]/}]}}function h_(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ds="[0-9](_*[0-9])*",_u=`\\.(${ds})`,Su="[0-9a-fA-F](_*[0-9a-fA-F])*",DF={className:"number",variants:[{begin:`(\\b(${ds})((${_u})|\\.)?|(${_u}))[eE][+-]?(${ds})[fFdD]?\\b`},{begin:`\\b(${ds})((${_u})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${_u})[fFdD]?\\b`},{begin:`\\b(${ds})[fFdD]\\b`},{begin:`\\b0[xX]((${Su})\\.?|(${Su})?\\.(${Su}))[pP][+-]?(${ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Su})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function m_(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},d=DF,f=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=h;return m.variants[1].contains=[h],h.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,f,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,t.C_LINE_COMMENT_MODE,f],relevance:0},t.C_LINE_COMMENT_MODE,f,l,u,s,t.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},d]}}var LF=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),PF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],BF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],g_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],b_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],FF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),HF=g_.concat(b_);function y_(t){let e=LF(t),n=HF,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],u=function(k){return{className:"string",begin:"~?"+k+".*?"+k}},d=function(k,T,P){return{className:k,begin:T,relevance:P}},f={$pattern:/[a-z-]+/,keyword:r,attribute:BF.join(" ")},h={begin:"\\(",end:"\\)",contains:l,keywords:f,relevance:0};l.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,u("'"),u('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,h,d("variable","@@?"+i,10),d("variable","@\\{"+i+"\\}"),d("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let m=l.concat({begin:/\{/,end:/\}/,contains:s}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},g={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+FF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},E={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:l,relevance:0}},w={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,b,d("keyword","all\\b"),d("variable","@\\{"+i+"\\}"),{begin:"\\b("+PF.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,d("selector-tag",o,0),d("selector-id","#"+o),d("selector-class","\\."+o,0),d("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+g_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b_.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},e.FUNCTION_DISPATCH]},O={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[S]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,E,w,O,g,S,b,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function E_(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function v_(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=t.inherit(d,{contains:[]}),m=t.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(h);let b=[n,u];return[d,f,h,m].forEach(w=>{w.contains=w.contains.concat(b)}),b=b.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},i,r,u,s]}}function x_(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function __(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},u=[t.BACKSLASH_ESCAPE,o,l],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(b,g,E="\\1")=>{let w=E==="\\1"?E:e.concat(E,g);return e.concat(e.concat("(?:",b,")"),g,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,E,r)},h=(b,g,E)=>e.concat(e.concat("(?:",b,")"),g,/(?:\\.|[^\\\/])*?/,E,r),m=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:h("(?:m|qr)?",/\//,/\//)},{begin:h("m|qr",e.either(...d,{capture:!0}),/\1/)},{begin:h("m|qr",/\(/,/\)/)},{begin:h("m|qr",/\[/,/\]/)},{begin:h("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=m,s.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function S_(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(me,Ce)=>{Ce.data._beginMatch=me[1]||me[2]},"on:end":(me,Ce)=>{Ce.data._beginMatch!==me[1]&&Ce.ignoreMatch()}},h=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,b={scope:"string",variants:[d,u,f,h]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},E=["false","null","true"],w=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],S=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],k={keyword:w,literal:(me=>{let Ce=[];return me.forEach(ge=>{Ce.push(ge),ge.toLowerCase()===ge?Ce.push(ge.toUpperCase()):Ce.push(ge.toLowerCase())}),Ce})(E),built_in:S},T=me=>me.map(Ce=>Ce.replace(/\|\d+$/,"")),P={variants:[{match:[/new/,e.concat(m,"+"),e.concat("(?!",T(S).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},I=e.concat(r,"\\b(?!\\()"),Y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),I],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),I],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:k,contains:[ne,o,Y,t.C_BLOCK_COMMENT_MODE,b,g,P]},Q={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(w).join("\\b|"),"|",T(S).join("\\b|"),"\\b)"),r,e.concat(m,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(Q);let fe=[ne,Y,t.C_BLOCK_COMMENT_MODE,b,g,P],we={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...fe]},...fe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:k,contains:[we,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},s,{scope:"variable.language",match:/\$this\b/},o,Q,Y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},P,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:k,contains:["self",o,Y,t.C_BLOCK_COMMENT_MODE,b,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},b,g]}}function T_(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function C_(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function A_(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,f,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",b=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,g=`\\b|${r.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${b}))[eE][+-]?(${m})[jJ]?(?=${g})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${m})[jJ](?=${g})`}]},w={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,E,h,t.HASH_COMMENT_MODE]}]};return d.contains=[h,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,E,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},h,w,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,S,h]}]}}function M_(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function N_(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function k_(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[t.COMMENT("#","$",{contains:[l]}),t.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},h={className:"string",contains:[t.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},I=[h,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:n}],relevance:0},g,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=I,E.contains=I;let Q=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:I}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(Q).concat(d).concat(I)}}function O_(t){let e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],o=["true","false","Some","None","Ok","Err"],s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:l,keyword:i,literal:o,built_in:s},illegal:""},n]}}var $F=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),zF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],UF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],WF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],KF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],VF=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function R_(t){let e=$F(t),n=KF,r=WF,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+zF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+VF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,l,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:UF.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function I_(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function D_(t){let e=t.regex,n=t.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=f,g=[...d,...u].filter(k=>!f.includes(k)),E={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},w={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function O(k,{exceptions:T,when:P}={}){let I=P;return T=T||[],k.map(Y=>Y.match(/\|\d+$/)||T.includes(Y)?Y:I(Y)?`${Y}|0`:Y)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:k=>k.length<3}),literal:o,type:l,built_in:h},contains:[{begin:e.either(...m),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:g.concat(m),literal:o,type:l}},{className:"type",begin:e.either(...s)},S,E,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,w]}}function F_(t){return t?typeof t=="string"?t:t.source:null}function Tu(t){return nt("(?=",t,")")}function nt(...t){return t.map(n=>F_(n)).join("")}function GF(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Sn(...t){return"("+(GF(t).capture?"":"?:")+t.map(r=>F_(r)).join("|")+")"}var Om=t=>nt(/\b/,t,/\w$/.test(t)?/\b/:/\B/),qF=["Protocol","Type"].map(Om),L_=["init","self"].map(Om),YF=["Any","Self"],Mm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],P_=["false","nil","true"],JF=["assignment","associativity","higherThan","left","lowerThan","none","right"],XF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],B_=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],H_=Sn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),$_=Sn(H_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Nm=nt(H_,$_,"*"),z_=Sn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Cu=Sn(z_,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Xr=nt(z_,Cu,"*"),km=nt(/[A-Z]/,Cu,"*"),ZF=["autoclosure",nt(/convention\(/,Sn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",nt(/objc\(/,Xr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],jF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function U_(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,Sn(...qF,...L_)],className:{2:"keyword"}},o={match:nt(/\./,Sn(...Mm)),relevance:0},s=Mm.filter(Re=>typeof Re=="string").concat(["_|0"]),l=Mm.filter(Re=>typeof Re!="string").concat(YF).map(Om),u={variants:[{className:"keyword",match:Sn(...l,...L_)}]},d={$pattern:Sn(/\b\w+/,/#\w+/),keyword:s.concat(XF),literal:P_},f=[i,o,u],h={match:nt(/\./,Sn(...B_)),relevance:0},m={className:"built_in",match:nt(/\b/,Sn(...B_),/(?=\()/)},b=[h,m],g={match:/->/,relevance:0},E={className:"operator",relevance:0,variants:[{match:Nm},{match:`\\.(\\.|${$_})+`}]},w=[g,E],S="([0-9]_*)+",O="([0-9a-fA-F]_*)+",k={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(Re="")=>({className:"subst",variants:[{match:nt(/\\/,Re,/[0\\tnr"']/)},{match:nt(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Re="")=>({className:"subst",match:nt(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(Re="")=>({className:"subst",label:"interpol",begin:nt(/\\/,Re,/\(/),end:/\)/}),Y=(Re="")=>({begin:nt(Re,/"""/),end:nt(/"""/,Re),contains:[T(Re),P(Re),I(Re)]}),ne=(Re="")=>({begin:nt(Re,/"/),end:nt(/"/,Re),contains:[T(Re),I(Re)]}),q={className:"string",variants:[Y(),Y("#"),Y("##"),Y("###"),ne(),ne("#"),ne("##"),ne("###")]},Q={match:nt(/`/,Xr,/`/)},fe={className:"variable",match:/\$\d+/},we={className:"variable",match:`\\$${Cu}+`},me=[Q,fe,we],Ce={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jF,contains:[...w,k,q]}]}},ge={className:"keyword",match:nt(/@/,Sn(...ZF))},ye={className:"meta",match:nt(/@/,Xr)},A=[Ce,ge,ye],D={match:Tu(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Cu,"+")},{className:"type",match:km,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:nt(/\s+&\s+/,Tu(km)),relevance:0}]},z={begin://,keywords:d,contains:[...r,...f,...A,g,D]};D.contains.push(z);let j={match:nt(Xr,/\s*:/),keywords:"_|0",relevance:0},ie={begin:/\(/,end:/\)/,relevance:0,keywords:d,contains:["self",j,...r,...f,...b,...w,k,q,...me,...A,D]},xe={begin://,contains:[...r,D]},Ae={begin:Sn(Tu(nt(Xr,/\s*:/)),Tu(nt(Xr,/\s+/,Xr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Xr}]},je={begin:/\(/,end:/\)/,keywords:d,contains:[Ae,...r,...f,...w,k,q,...A,D,ie],endsParent:!0,illegal:/["']/},Ne={match:[/func/,/\s+/,Sn(Q.match,Xr,Nm)],className:{1:"keyword",3:"title.function"},contains:[xe,je,e],illegal:[/\[/,/%/]},Be={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,je,e],illegal:/\[|%/},_t={match:[/operator/,/\s+/,Nm],className:{1:"keyword",3:"title"}},kt={begin:[/precedencegroup/,/\s+/,km],className:{1:"keyword",3:"title"},contains:[D],keywords:[...JF,...P_],end:/}/};for(let Re of q.variants){let St=Re.contains.find(pt=>pt.label==="interpol");St.keywords=d;let Xt=[...f,...b,...w,k,q,...me];St.contains=[...Xt,{begin:/\(/,end:/\)/,contains:["self",...Xt]}]}return{name:"Swift",keywords:d,contains:[...r,Ne,Be,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:d,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...f]},_t,kt,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...f,...b,...w,k,q,...me,...A,D,ie]}}var Au="[A-Za-z$_][0-9A-Za-z$_]*",W_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],K_=["true","false","null","undefined","NaN","Infinity"],V_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],G_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],q_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Y_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],J_=[].concat(q_,V_,G_);function QF(t){let e=t.regex,n=(D,{after:z})=>{let j="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,z)=>{let j=D[0].length+D.index,ie=D.input[j];if(ie==="<"||ie===","){z.ignoreMatch();return}ie===">"&&(n(D,{after:j})||z.ignoreMatch());let xe,Ae=D.input.substring(j);if(xe=Ae.match(/^\s*=/)){z.ignoreMatch();return}if((xe=Ae.match(/^\s+extends\s+/))&&xe.index===0){z.ignoreMatch();return}}},l={$pattern:Au,keyword:W_,literal:K_,built_in:J_,"variable.language":Y_},u="[0-9](_?[0-9])*",d=`\\.(${u})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${f})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${f})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},b={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},g={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,m]},O={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,E,w,{match:/\$\d+/},h];m.contains=k.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(k)});let T=[].concat(O,m.contains),P=T.concat([{begin:/\(/,end:/\)/,keywords:l,contains:["self"].concat(T)}]),I={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P},Y={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...V_,...G_]}},q={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Q={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(D){return e.concat("(?!",D.join("|"),")")}let me={match:e.concat(/\b/,we([...q_,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},Ce={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ge={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},ye="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(ye)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),q,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,E,w,O,{match:/\$\d+/},h,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},A,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,t.REGEXP_MODE,{className:"function",begin:ye,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},Q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},me,fe,Y,ge,{match:/\$[(.]/}]}}function X_(t){let e=QF(t),n=Au,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],u={$pattern:Au,keyword:W_.concat(l),literal:K_,built_in:J_.concat(r),"variable.language":Y_},d={className:"meta",begin:"@"+n},f=(m,b,g)=>{let E=m.contains.findIndex(w=>w.label===b);if(E===-1)throw new Error("can not find mode to replace");m.contains.splice(E,1,g)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(d),e.contains=e.contains.concat([d,i,o]),f(e,"shebang",t.SHEBANG()),f(e,"use_strict",s);let h=e.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Z_(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,l,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},h=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,d,f,h,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function j_(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,u,d,l]}}function Q_(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},t.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function eS(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},b={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},E=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},h,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},b,g,o],w=[...E];return w.pop(),w.push(s),m.contains=w,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}var wS=ef(vS(),1);var Zn=wS.default;var _S=ef(xS(),1),ka=Object.assign(wo(Error),{eval:wo(EvalError),range:wo(RangeError),reference:wo(ReferenceError),syntax:wo(SyntaxError),type:wo(TypeError),uri:wo(URIError)});function wo(t){return e.displayName=t.displayName||t.name,e;function e(n,...r){let i=n&&(0,_S.default)(n,...r);return new t(i)}}var WH={}.hasOwnProperty,SS="hljs-";function TS(t,e,n={}){let r=n.prefix;if(typeof t!="string")throw ka("Expected `string` for name, got `%s`",t);if(!Zn.getLanguage(t))throw ka("Unknown language: `%s` is not registered",t);if(typeof e!="string")throw ka("Expected `string` for value, got `%s`",e);r==null&&(r=SS),Zn.configure({__emitter:zm,classPrefix:r});let i=Zn.highlight(e,{language:t,ignoreIllegals:!0});if(Zn.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function KH(t,e={}){let n=e.subset||Zn.listLanguages(),r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(r==null&&(r=SS),typeof t!="string")throw ka("Expected `string` for value, got `%s`",t);for(;++io.data.relevance&&(o=l)}return o}function VH(t,e){Zn.registerLanguage(t,e)}var GH=function(t,e){if(typeof t=="string")Zn.registerAliases(e,{languageName:t});else{let n;for(n in t)WH.call(t,n)&&Zn.registerAliases(t[n],{languageName:n})}};function qH(t){return!!Zn.getLanguage(t)}function YH(){return Zn.listLanguages()}var zm=class{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(e){let n=e.split(".").map((o,s)=>s?o+"_".repeat(s):this.options.classPrefix+o),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}},De={highlight:TS,highlightAuto:KH,registerLanguage:VH,registered:qH,listLanguages:YH,registerAlias:GH};De.registerLanguage("arduino",Xx);De.registerLanguage("bash",Zx);De.registerLanguage("c",jx);De.registerLanguage("cpp",Qx);De.registerLanguage("csharp",e_);De.registerLanguage("css",t_);De.registerLanguage("diff",n_);De.registerLanguage("go",r_);De.registerLanguage("graphql",i_);De.registerLanguage("ini",o_);De.registerLanguage("java",l_);De.registerLanguage("javascript",p_);De.registerLanguage("json",h_);De.registerLanguage("kotlin",m_);De.registerLanguage("less",y_);De.registerLanguage("lua",E_);De.registerLanguage("makefile",v_);De.registerLanguage("markdown",w_);De.registerLanguage("objectivec",x_);De.registerLanguage("perl",__);De.registerLanguage("php",S_);De.registerLanguage("php-template",T_);De.registerLanguage("plaintext",C_);De.registerLanguage("python",A_);De.registerLanguage("python-repl",M_);De.registerLanguage("r",N_);De.registerLanguage("ruby",k_);De.registerLanguage("rust",O_);De.registerLanguage("scss",R_);De.registerLanguage("shell",I_);De.registerLanguage("sql",D_);De.registerLanguage("swift",U_);De.registerLanguage("typescript",X_);De.registerLanguage("vbnet",Z_);De.registerLanguage("wasm",j_);De.registerLanguage("xml",Q_);De.registerLanguage("yaml",eS);var Mi=(t,e=0,n=1)=>t>n?n:tMath.round(n*t)/n;var u6={grad:360/400,turn:360,rad:360/(Math.PI*2)},CS=t=>jH(Iu(t)),Iu=t=>(t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Nt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Nt(parseInt(t.substring(6,8),16)/255,2):1});var AS=t=>ZH(XH(t)),JH=({h:t,s:e,v:n,a:r})=>{let i=(200-e)*n/100;return{h:Nt(t),s:Nt(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:Nt(i/2),a:Nt(r,2)}};var Oa=t=>{let{h:e,s:n,l:r}=JH(t);return`hsl(${e}, ${n}%, ${r}%)`};var XH=({h:t,s:e,v:n,a:r})=>{t=t/360*6,e=e/100,n=n/100;let i=Math.floor(t),o=n*(1-e),s=n*(1-(t-i)*e),l=n*(1-(1-t+i)*e),u=i%6;return{r:Nt([n,s,o,o,l,n][u]*255),g:Nt([l,n,n,s,o,o][u]*255),b:Nt([o,o,l,n,n,s][u]*255),a:Nt(r,2)}};var Ru=t=>{let e=t.toString(16);return e.length<2?"0"+e:e},ZH=({r:t,g:e,b:n,a:r})=>{let i=r<1?Ru(Nt(r*255)):"";return"#"+Ru(t)+Ru(e)+Ru(n)+i},jH=({r:t,g:e,b:n,a:r})=>{let i=Math.max(t,e,n),o=i-Math.min(t,e,n),s=o?i===t?(e-n)/o:i===e?2+(n-t)/o:4+(t-e)/o:0;return{h:Nt(60*(s<0?s+6:s)),s:Nt(i?o/i*100:0),v:Nt(i/255*100),a:r}};var Um=(t,e)=>{if(t===e)return!0;for(let n in t)if(t[n]!==e[n])return!1;return!0};var MS=(t,e)=>t.toLowerCase()===e.toLowerCase()?!0:Um(Iu(t),Iu(e));var NS={},Du=t=>{let e=NS[t];return e||(e=document.createElement("template"),e.innerHTML=t,NS[t]=e),e},Ra=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};var hs=!1,Wm=t=>"touches"in t,QH=t=>hs&&!Wm(t)?!1:(hs||(hs=Wm(t)),!0),kS=(t,e)=>{let n=Wm(e)?e.touches[0]:e,r=t.el.getBoundingClientRect();Ra(t.el,"move",t.getMove({x:Mi((n.pageX-(r.left+window.pageXOffset))/r.width),y:Mi((n.pageY-(r.top+window.pageYOffset))/r.height)}))},e$=(t,e)=>{let n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),Ra(t.el,"move",t.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},ms=class{constructor(e,n,r,i){let o=Du(`
`);e.appendChild(o.content.cloneNode(!0));let s=e.querySelector(`[part=${n}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=i,this.nodes=[s.firstChild,s]}set dragging(e){let n=e?document.addEventListener:document.removeEventListener;n(hs?"touchmove":"mousemove",this),n(hs?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!QH(e)||!hs&&e.button!=0)return;this.el.focus(),kS(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),kS(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":e$(this,e);break}}style(e){e.forEach((n,r)=>{for(let i in n)this.nodes[r].style.setProperty(i,n[i])})}};var Lu=class extends ms{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Oa({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Nt(e)}`)}getMove(e,n){return{h:n?Mi(this.h+e.x*360,0,360):360*e.x}}};var Pu=class extends ms{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Oa(e)},{"background-color":Oa({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Nt(e.s)}%, Brightness ${Nt(e.v)}%`)}getMove(e,n){return{s:n?Mi(this.hsva.s+e.x*100,0,100):e.x*100,v:n?Mi(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}};var OS=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var RS="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var IS="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Bu=Symbol("same"),Km=Symbol("color"),DS=Symbol("hsva"),Vm=Symbol("update"),LS=Symbol("parts"),PS=Symbol("css"),BS=Symbol("sliders"),Fu=class extends HTMLElement{static get observedAttributes(){return["color"]}get[PS](){return[OS,RS,IS]}get[BS](){return[Pu,Lu]}get color(){return this[Km]}set color(e){if(!this[Bu](e)){let n=this.colorModel.toHsva(e);this[Vm](n),this[Km]=e}}constructor(){super();let e=Du(``),n=this.attachShadow({mode:"open"});n.appendChild(e.content.cloneNode(!0)),n.addEventListener("move",this),this[LS]=this[BS].map(r=>new r(n))}connectedCallback(){if(this.hasOwnProperty("color")){let e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,n,r){let i=this.colorModel.fromAttr(r);this[Bu](i)||(this.color=i)}handleEvent(e){let n=this[DS],r={...n,...e.detail};this[Vm](r);let i;!Um(r,n)&&!this[Bu](i=this.colorModel.fromHsva(r))&&(this[Km]=i,Ra(this,"color-changed",{value:i}))}[Bu](e){return this.color&&this.colorModel.equal(e,this.color)}[Vm](e){this[DS]=e,this[LS].forEach(n=>n.update(e))}};var t$={defaultColor:"#000",toHsva:CS,fromHsva:({h:t,s:e,v:n})=>AS({h:t,s:e,v:n,a:1}),equal:MS,fromAttr:t=>t},Hu=class extends Fu{get colorModel(){return t$}};var $S=ef(FS(),1);customElements.define("tiptap-hex-color-picker",Hu);var n$={blockquote:[sv],bold:[av],"bullet-list":[uv],"checked-list":[_h],code:[dv],"code-block":[gm.configure({lowlight:De,HTMLAttributes:{class:"hljs"}})],color:[pv],details:[om,sm,am],grid:[jh,Qh],"grid-builder":[Em,vm],heading:[Ev.configure({levels:[1,2,3,4,5,6]})],highlight:[gw],hr:[Tv],hurdle:[bm],italic:[Cv],lead:[Sh],link:[Jh.configure({openOnClick:!1,autolink:!1,HTMLAttributes:{rel:null,hreflang:null,class:null}})],media:[Xh.configure({inline:!0})],oembed:[tm,rm,im],"ordered-list":[Nv],small:[Zh],strike:[Ov],subscript:[Rv],superscript:[Iv],table:[uw.configure({resizable:!0}),fw,dw,pw],underline:[mw]},r$=window.TiptapEditorExtensions||{},HS={...n$,...r$},$u=document.getElementById("activeLocale");$u&&$u.addEventListener("change",()=>{let t=new CustomEvent("locale-change",{bubbles:!0,detail:{locale:$u.value}});$u.dispatchEvent(t)});document.addEventListener("livewire:navigating",()=>{window.filamentTiptapEditors={}});document.addEventListener("dblclick",function(t){(t.target&&(t.target.hasAttribute("data-youtube-video")||t.target.hasAttribute("data-vimeo-video"))||t.target.hasAttribute("data-native-video"))&&(t.target.firstChild.style.pointerEvents="all")});Livewire.on("insertFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-content",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("insertBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("insert-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});Livewire.on("updateBlockFromAction",t=>{setTimeout(()=>{let e=new CustomEvent("update-block",{bubble:!0,detail:t});window.dispatchEvent(e)},100)});function i$({state:t,statePath:e,tools:n=[],disabled:r=!1,locale:i="en",bubbleMenuTools:o=[],floatingMenuTools:s=[],placeholder:l=null,mergeTags:u=[],customDocument:d=null,nodePlaceholders:f=[],showOnlyCurrentPlaceholder:h=!0,debounce:m=null}){let b=null;return{id:null,modalId:null,tools:n,state:t,statePath:e,fullScreenMode:!1,updatedAt:Date.now(),disabled:r,locale:i,bubbleMenuTools:o,floatingMenuTools:s,getExtensions(){let g=this.tools.map(w=>typeof w=="string"?w:w.id),E=[d?Rp.extend({content:d}):Rp,hw,wc,mv,bv,yv,Sv,fv,wm,Sm,Tm,Cm,Am.configure({statePath:e}),xm];if((l||f)&&!r&&E.push(kv.configure({showOnlyCurrent:h,placeholder:({node:w})=>f?.[w.type.name]||l||""})),g.length){let w=Object.keys(HS),S=[],O=["paragraph"];E.push(ex.configure({element:this.$refs.bubbleMenu,tippyOptions:{duration:[500,0],maxWidth:"none",placement:"auto",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10},shouldShow:({state:k,from:T,to:P})=>{if(Ur(k,"oembed")||Ur(k,"vimeo")||Ur(k,"youtube")||Ur(k,"video")||Ur(k,"tiptapBlock"))return!1;if(Ur(k,"link")||Ur(k,"table")||T!==P)return!0}})),this.floatingMenuTools.length&&(E.push(tx.configure({element:this.$refs.floatingMenu,tippyOptions:{duration:[500,0],maxWidth:"none",theme:"tiptap-editor-bubble",interactive:!0,appendTo:this.$refs.element,zIndex:10}})),this.floatingMenuTools.forEach(k=>{g.includes(k)||g.push(k)})),this.bubbleMenuTools.length&&this.bubbleMenuTools.forEach(k=>{g.includes(k)||g.push(k)}),g.forEach(k=>{w.includes(k)?HS[k].forEach(T=>{["ordered-list","bullet-list","checked-list"].includes(k)?(E.push(T),E.includes($p)||E.push($p)):E.push(T)}):["align-left","align-right","align-center","align-justify"].includes(k)&&(k==="align-left"&&S.push("start"),k==="align-center"&&S.push("center"),k==="align-right"&&S.push("end"),k==="align-justify"&&S.push("justify"),g.includes("heading")&&O.push("heading"),typeof E.find(P=>P.name==="textAlign")>"u"&&E.push(ym.configure({types:O,alignments:S})))})}return u?.length&&E.push(_m.configure({mergeTags:u})),E},init:function(){let g=this.$refs.element.querySelector(".tiptap");g&&(g.remove(),b=null),this.initEditor(this.state);let E=this.$el.parentElement.closest("[x-sortable]");E&&(window.Sortable.utils.on(E,"start",()=>{E.classList.add("sorting")}),window.Sortable.utils.on(E,"end",()=>{E.classList.remove("sorting")})),this.$watch("state",(w,S)=>{typeof w<"u"&&((0,$S.isEqual)(S,Alpine.raw(w))||this.updateEditorContent(w))})},initEditor(g){if(!this.$el.querySelector(".tiptap")){let E=this;b=new sc({element:E.$refs.element,extensions:E.getExtensions(),editable:!E.disabled,content:g,editorProps:{handlePaste(w,S,O){O.content.descendants(k=>{k.type.name==="tiptapBlock"&&(k.attrs.statePath=E.statePath,k.attrs.data=JSON.parse(k.attrs.data))})}},onUpdate({editor:w}){E.updatedAt=Date.now(),clearTimeout(E.timeOut),E.timeOut=setTimeout(function(){E.state=w.isEmpty?null:w.getJSON()},m??0)},onSelectionUpdate(){E.updatedAt=Date.now()},onBlur(){E.updatedAt=Date.now()},onFocus(){E.updatedAt=Date.now()}})}},isActive(g,E={}){return b.isActive(g,E)},editor(){return b},blur(){let g=this.$el.querySelectorAll("[data-tippy-content]");g&&g.forEach(E=>E.destroy()),this.updatedAt=Date.now()},updateEditorContent(g){if(b.isEditable){let{from:E,to:w}=b.state.selection;b.commands.setContent(g,!0),b.chain().focus().setTextSelection({from:E,to:w}).run()}},refreshEditorContent(){this.$nextTick(()=>this.updateEditorContent(this.state))},updateLocale(g){this.locale=g.detail.locale},insertContent(g){if(g.detail.statePath===this.statePath)switch(g.detail.type){case"media":this.insertMedia(g);return;case"video":this.insertVideo(g);return;case"link":this.insertLink(g);return;case"source":this.insertSource(g);return;case"grid":this.insertGridBuilder(g);return;default:return}},insertMedia(g){Array.isArray(g.detail.media)?g.detail.media.forEach(E=>{this.executeMediaInsert(E)}):this.executeMediaInsert(g.detail.media)},executeMediaInsert(g=null){if(!(!g||g?.url===null)&&g){let E=g?.url||g?.src,w=["jpg","jpeg","svg","png","webp","gif","avif","jxl","heic"],O=/.*\.([a-zA-Z]*)\??/.exec(E.toLowerCase());O!==null&&w.includes(O[1])?b.chain().focus().setImage({src:E,alt:g?.alt,title:g?.title,width:g?.width,height:g?.height,lazy:g?.lazy,srcset:g?.srcset,sizes:g?.sizes,media:g?.media}).run():b.chain().focus().extendMarkRange("link").setLink({href:E}).insertContent(g?.link_text).run()}},insertVideo(g){let E=g.detail.video;if(!E||E.url===null)return;let w={src:E.url,width:E.responsive?E.width*100:E.width,height:E.responsive?E.height*100:E.height,responsive:E.responsive??!0,"data-aspect-width":E.width,"data-aspect-height":E.height};E.url.includes("youtube")||E.url.includes("youtu.be")?b.chain().focus().setYoutubeVideo({...w,controls:E.youtube_options.includes("controls"),nocookie:E.youtube_options.includes("nocookie"),start:E.start_at??0}).run():E.url.includes("vimeo")?b.chain().focus().setVimeoVideo({...w,autoplay:E.vimeo_options.includes("autoplay"),loop:E.vimeo_options.includes("loop"),title:E.vimeo_options.includes("show_title"),byline:E.vimeo_options.includes("byline"),portrait:E.vimeo_options.includes("portrait")}).run():b.chain().focus().setVideo({...w,autoplay:E.native_options.includes("autoplay"),loop:E.native_options.includes("loop"),controls:E.native_options.includes("controls")}).run()},insertLink(g){let E=g.detail;if(!(E.href===null&&E.id===null)){if(E.href===""&&E.id===null){this.unsetLink();return}b.chain().focus().setTextSelection({from:E.coordinates[0].$from.pos,to:E.coordinates[0].$to.pos}).extendMarkRange("link").setLink({href:E.href,id:E.id??null,target:E.target??null,hreflang:E.hreflang??null,rel:E.rel??null,referrerpolicy:E.referrerpolicy??null,as_button:E.as_button??null,button_theme:E.button_theme??null}).selectTextblockEnd().run()}},unsetLink(){b.chain().focus().extendMarkRange("link").unsetLink().selectTextblockEnd().run()},insertSource(g){this.updateEditorContent(g.detail.source)},insertGridBuilder(g){let E=g.detail.data,w="responsive",S=parseInt(E.asymmetric_left)??null,O=parseInt(E.asymmetric_right)??null;E.fixed&&(w="fixed"),E.asymmetric&&(w="asymmetric"),b.chain().focus().insertGridBuilder({cols:E.columns,type:w,stackAt:E.stack_at,asymmetricLeft:S,asymmetricRight:O}).run()},insertBlock(g){g.detail.statePath===this.statePath&&(b.commands.insertBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),b.isFocused||b.commands.focus())},insertMergeTag(g){b.commands.insertMergeTag({tag:g.detail.tag,coordinates:g.detail.coordinates}),b.isFocused||b.commands.focus()},openBlockSettings(g){g.detail.statePath===this.statePath&&this.$wire.dispatchFormEvent("tiptap::updateBlock",this.statePath,g.detail)},updateBlock(g){g.detail.statePath===this.statePath&&(b.commands.updateBlock({type:g.detail.type,statePath:g.detail.statePath,data:g.detail.data,preview:g.detail.preview,label:g.detail.label,coordinates:g.detail.coordinates}),b.isFocused||b.commands.focus())},deleteBlock(g){g.detail.statePath===this.statePath&&b.commands.removeBlock()}}}export{i$ as default}; /*! Bundled license information: lodash/lodash.js: