lexxy 0.1.15.beta → 0.1.16.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascript/lexxy.js +388 -12
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.min.js +2 -2
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/lib/lexxy/version.rb +1 -1
- metadata +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{DirectUpload as e}from"@rails/activestorage";
|
|
2
|
-
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:t,setPrototypeOf:n,isFrozen:r,getPrototypeOf:i,getOwnPropertyDescriptor:s}=Object;let{freeze:o,seal:a,create:l}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),u||(u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const d=T(Array.prototype.forEach),h=T(Array.prototype.lastIndexOf),g=T(Array.prototype.pop),p=T(Array.prototype.push),f=T(Array.prototype.splice),m=T(String.prototype.toLowerCase),y=T(String.prototype.toString),_=T(String.prototype.match),b=T(String.prototype.replace),x=T(String.prototype.indexOf),k=T(String.prototype.trim),v=T(Object.prototype.hasOwnProperty),S=T(RegExp.prototype.test),w=(C=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(C,t)});var C;function T(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return c(e,t,r)}}function E(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m;n&&n(e,null);let s=t.length;for(;s--;){let n=t[s];if("string"==typeof n){const e=i(n);e!==n&&(r(t)||(t[s]=e),n=e)}e[n]=!0}return e}function N(e){for(let t=0;t<e.length;t++){v(e,t)||(e[t]=null)}return e}function A(e){const n=l(null);for(const[r,i]of t(e)){v(e,r)&&(Array.isArray(i)?n[r]=N(i):i&&"object"==typeof i&&i.constructor===Object?n[r]=A(i):n[r]=i)}return n}function L(e,t){for(;null!==e;){const n=s(e,t);if(n){if(n.get)return T(n.get);if("function"==typeof n.value)return T(n.value)}e=i(e)}return function(){return null}}const P=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=o(["#text"]),z=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B=o(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=a(/<%[\w\W]*|[\w\W]*%>/gm),K=a(/\$\{[\w\W]*/gm),j=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),q=a(/^aria-[\-\w]+$/),J=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=a(/^html$/i),Y=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var X=Object.freeze({__proto__:null,ARIA_ATTR:q,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:Y,DATA_ATTR:j,DOCTYPE_NAME:Z,ERB_EXPR:H,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:V,MUSTACHE_EXPR:W,TMPLIT_EXPR:K});const Q=1,ee=3,te=7,ne=8,re=9,ie=function(){return"undefined"==typeof window?null:window};var se=function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const r=t=>e(t);if(r.version="3.3.0",r.removed=[],!n||!n.document||n.document.nodeType!==re||!n.Element)return r.isSupported=!1,r;let{document:i}=n;const s=i,a=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:u,Node:C,Element:T,NodeFilter:N,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:K,trustedTypes:j}=n,q=T.prototype,V=L(q,"cloneNode"),G=L(q,"remove"),Y=L(q,"nextSibling"),se=L(q,"childNodes"),oe=L(q,"parentNode");if("function"==typeof u){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let ae,le="";const{implementation:ce,createNodeIterator:ue,createDocumentFragment:de,getElementsByTagName:he}=i,{importNode:ge}=s;let pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"==typeof t&&"function"==typeof oe&&ce&&void 0!==ce.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:me,TMPLIT_EXPR:ye,DATA_ATTR:_e,ARIA_ATTR:be,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:ke,CUSTOM_ELEMENT:ve}=X;let{IS_ALLOWED_URI:Se}=X,we=null;const Ce=E({},[...P,...O,...F,...R,...D]);let Te=null;const Ee=E({},[...z,...B,...$,...U]);let Ne=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,Le=null;const Pe=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Oe=!0,Fe=!0,Ie=!1,Re=!0,Me=!1,De=!0,ze=!1,Be=!1,$e=!1,Ue=!1,We=!1,He=!1,Ke=!0,je=!1,qe=!0,Je=!1,Ve={},Ge=null;const Ze=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=E({},["audio","video","img","source","image","track"]);let Qe=null;const et=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xhtml";let it=rt,st=!1,ot=null;const at=E({},[tt,nt,rt],y);let lt=E({},["mi","mo","mn","ms","mtext"]),ct=E({},["annotation-xml"]);const ut=E({},["title","style","font","a","script"]);let dt=null;const ht=["application/xhtml+xml","text/html"];let gt=null,pt=null;const ft=i.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!pt||pt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),dt=-1===ht.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,gt="application/xhtml+xml"===dt?y:m,we=v(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,gt):Ce,Te=v(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,gt):Ee,ot=v(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,y):at,Qe=v(e,"ADD_URI_SAFE_ATTR")?E(A(et),e.ADD_URI_SAFE_ATTR,gt):et,Ye=v(e,"ADD_DATA_URI_TAGS")?E(A(Xe),e.ADD_DATA_URI_TAGS,gt):Xe,Ge=v(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,gt):Ze,Ae=v(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,gt):A({}),Le=v(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,gt):A({}),Ve=!!v(e,"USE_PROFILES")&&e.USE_PROFILES,Oe=!1!==e.ALLOW_ARIA_ATTR,Fe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,De=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,We=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,$e=e.FORCE_BODY||!1,Ke=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Je=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||J,it=e.NAMESPACE||rt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&mt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ne.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Fe=!1),We&&(Ue=!0),Ve&&(we=E({},D),Te=[],!0===Ve.html&&(E(we,P),E(Te,z)),!0===Ve.svg&&(E(we,O),E(Te,B),E(Te,U)),!0===Ve.svgFilters&&(E(we,F),E(Te,B),E(Te,U)),!0===Ve.mathMl&&(E(we,R),E(Te,$),E(Te,U))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Pe.tagCheck=e.ADD_TAGS:(we===Ce&&(we=A(we)),E(we,e.ADD_TAGS,gt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Pe.attributeCheck=e.ADD_ATTR:(Te===Ee&&(Te=A(Te)),E(Te,e.ADD_ATTR,gt))),e.ADD_URI_SAFE_ATTR&&E(Qe,e.ADD_URI_SAFE_ATTR,gt),e.FORBID_CONTENTS&&(Ge===Ze&&(Ge=A(Ge)),E(Ge,e.FORBID_CONTENTS,gt)),qe&&(we["#text"]=!0),ze&&E(we,["html","head","body"]),we.table&&(E(we,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ae=e.TRUSTED_TYPES_POLICY,le=ae.createHTML("")}else void 0===ae&&(ae=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(j,a)),null!==ae&&"string"==typeof le&&(le=ae.createHTML(""));o&&o(e),pt=e}},_t=E({},[...O,...F,...I]),bt=E({},[...R,...M]),xt=function(e){p(r.removed,{element:e});try{oe(e).removeChild(e)}catch(t){G(e)}},kt=function(e,t){try{p(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Ue||We)try{xt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if($e)e="<remove></remove>"+e;else{const t=_(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===dt&&it===rt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ae?ae.createHTML(e):e;if(it===rt)try{t=(new K).parseFromString(r,dt)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(it,"template",null);try{t.documentElement.innerHTML=st?le:r}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),it===rt?he.call(t,ze?"html":"body")[0]:ze?t.documentElement:s},St=function(e){return ue.call(e.ownerDocument||e,e,N.SHOW_ELEMENT|N.SHOW_COMMENT|N.SHOW_TEXT|N.SHOW_PROCESSING_INSTRUCTION|N.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ct=function(e){return"function"==typeof C&&e instanceof C};function Tt(e,t,n){d(e,(e=>{e.call(r,t,n,pt)}))}const Et=function(e){let t=null;if(Tt(pe.beforeSanitizeElements,e,null),wt(e))return xt(e),!0;const n=gt(e.nodeName);if(Tt(pe.uponSanitizeElement,e,{tagName:n,allowedTags:we}),De&&e.hasChildNodes()&&!Ct(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return xt(e),!0;if(e.nodeType===te)return xt(e),!0;if(De&&e.nodeType===ne&&S(/<[/\w]/g,e.data))return xt(e),!0;if(!(Pe.tagCheck instanceof Function&&Pe.tagCheck(n))&&(!we[n]||Ae[n])){if(!Ae[n]&&At(n)){if(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,n))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))return!1}if(qe&&!Ge[n]){const t=oe(e)||e.parentNode,n=se(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=V(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Y(e))}}}return xt(e),!0}return e instanceof T&&!function(e){let t=oe(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});const n=m(e.tagName),r=m(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===rt?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(_t[n]):e.namespaceURI===tt?t.namespaceURI===rt?"math"===n:t.namespaceURI===nt?"math"===n&&ct[r]:Boolean(bt[n]):e.namespaceURI===rt?!(t.namespaceURI===nt&&!ct[r])&&!(t.namespaceURI===tt&&!lt[r])&&!bt[n]&&(ut[n]||!_t[n]):!("application/xhtml+xml"!==dt||!ot[e.namespaceURI]))}(e)?(xt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===ee&&(t=e.textContent,d([fe,me,ye],(e=>{t=b(t,e," ")})),e.textContent!==t&&(p(r.removed,{element:e.cloneNode()}),e.textContent=t)),Tt(pe.afterSanitizeElements,e,null),!1):(xt(e),!0)},Nt=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in i||n in ft))return!1;if(Fe&&!Le[t]&&S(_e,t));else if(Oe&&S(be,t));else if(Pe.attributeCheck instanceof Function&&Pe.attributeCheck(t,e));else if(!Te[t]||Le[t]){if(!(At(e)&&(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&S(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t,e))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Qe[t]);else if(S(Se,b(n,ke,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Ye[e]){if(Ie&&!S(xe,b(n,ke,"")));else if(n)return!1}else;return!0},At=function(e){return"annotation-xml"!==e&&_(e,ve)},Lt=function(e){Tt(pe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0};let i=t.length;for(;i--;){const s=t[i],{name:o,namespaceURI:a,value:l}=s,c=gt(o),u=l;let h="value"===o?u:k(u);if(n.attrName=c,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Tt(pe.uponSanitizeAttribute,e,n),h=n.attrValue,!je||"id"!==c&&"name"!==c||(kt(o,e),h="user-content-"+h),De&&S(/((--!?|])>)|<\/(style|title|textarea)/i,h)){kt(o,e);continue}if("attributename"===c&&_(h,"href")){kt(o,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){kt(o,e);continue}if(!Re&&S(/\/>/i,h)){kt(o,e);continue}Me&&d([fe,me,ye],(e=>{h=b(h,e," ")}));const p=gt(e.nodeName);if(Nt(p,c,h)){if(ae&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=ae.createHTML(h);break;case"TrustedScriptURL":h=ae.createScriptURL(h)}if(h!==u)try{a?e.setAttributeNS(a,o,h):e.setAttribute(o,h),wt(e)?xt(e):g(r.removed)}catch(t){kt(o,e)}}else kt(o,e)}Tt(pe.afterSanitizeAttributes,e,null)},Pt=function e(t){let n=null;const r=St(t);for(Tt(pe.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Tt(pe.uponSanitizeShadowNode,n,null),Et(n),Lt(n),n.content instanceof c&&e(n.content);Tt(pe.afterSanitizeShadowDOM,t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,o=null,a=null;if(st=!e,st&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ct(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Be||yt(t),r.removed=[],"string"==typeof e&&(Je=!1),Je){if(e.nodeName){const t=gt(e.nodeName);if(!we[t]||Ae[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof C)n=vt("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Ue&&!Me&&!ze&&-1===e.indexOf("<"))return ae&&He?ae.createHTML(e):e;if(n=vt(e),!n)return Ue?null:He?le:""}n&&$e&&xt(n.firstChild);const l=St(Je?e:n);for(;o=l.nextNode();)Et(o),Lt(o),o.content instanceof c&&Pt(o.content);if(Je)return e;if(Ue){if(We)for(a=de.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(Te.shadowroot||Te.shadowrootmode)&&(a=ge.call(s,a,!0)),a}let u=ze?n.outerHTML:n.innerHTML;return ze&&we["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(Z,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Me&&d([fe,me,ye],(e=>{u=b(u,e," ")})),ae&&He?ae.createHTML(u):u},r.setConfig=function(){yt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Be=!0},r.clearConfig=function(){pt=null,Be=!1},r.isValidAttribute=function(e,t,n){pt||yt({});const r=gt(e),i=gt(t);return Nt(r,i,n)},r.addHook=function(e,t){"function"==typeof t&&p(pe[e],t)},r.removeHook=function(e,t){if(void 0!==t){const n=h(pe[e],t);return-1===n?void 0:f(pe[e],n,1)[0]}return g(pe[e])},r.removeHooks=function(e){pe[e]=[]},r.removeAllHooks=function(){pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}();function oe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ae(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}se.addHook("uponSanitizeElement",((e,t)=>{"strong"!==t.tagName&&"em"!==t.tagName||e.removeAttribute("class")}));const le="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ce=le&&"documentMode"in document?document.documentMode:null,ue=le&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),de=le&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),he=!(!le||!("InputEvent"in window)||ce)&&"getTargetRanges"in new window.InputEvent("input"),ge=le&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pe=le&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fe=le&&/Android/.test(navigator.userAgent),me=le&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ye=le&&fe&&me,_e=le&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ue&&!me;function be(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const xe=0,ke=1,ve=2,Se=1,we=2,Ce=3,Te=4,Ee=5,Ne=6,Ae=ge||pe||_e?" ":"",Le="\n\n",Pe=de?" ":Ae,Oe="֑-߿יִ-﷽ﹰ-ﻼ",Fe="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Ie=new RegExp("^[^"+Fe+"]*["+Oe+"]"),Re=new RegExp("^[^"+Oe+"]*["+Fe+"]"),Me={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},De={directionless:1,unmergeable:2},ze={center:2,end:6,justify:4,left:1,right:3,start:5},Be={[we]:"center",[Ne]:"end",[Te]:"justify",[Se]:"left",[Ce]:"right",[Ee]:"start"},$e={normal:0,segmented:2,token:1},Ue={[xe]:"normal",[ve]:"segmented",[ke]:"token"},We="$config";function He(e,t,n,r,i,s){let o=e.getFirstChild();for(;null!==o;){const e=o.__key;o.__parent===t&&(ss(o)&&He(o,e,n,r,i,s),n.has(e)||s.delete(e),i.push(e)),o=o.getNextSibling()}}let Ke=!1,je=0;function qe(e){je=e.timeStamp}function Je(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Zs(e,n)}function Ve(e,t,n){const r=Do(Po(n));let i=null,s=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,s=r.focusOffset);const o=e.nodeValue;null!==o&&co(t,o,i,s,!1)}function Ge(e,t,n){if(si(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Bs(t)&&n.isAttached()}function Ze(e,t,n,r){for(let i=e;i&&!Yo(i);i=To(i)){const e=Zs(i,t);if(void 0!==e){const t=Vs(e,n);if(t)return ls(t)||!Bo(i)?void 0:[i,t]}else if(i===r)return[r,to(n)]}}function Ye(e,t,n){Ke=!0;const r=performance.now()-je>100;try{ts(e,(()=>{const i=vi()||function(e){return e.getEditorState().read((()=>{const e=vi();return null!==e?e.clone():null}))}(e),s=new Map,o=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,g=d.target,p=Ze(g,e,a,o);if(!p)continue;const[f,m]=p;if("characterData"===h)r&&Gr(m)&&Bs(g)&&Ge(i,g,m)&&Ve(g,m,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],i=Gs(r),s=r.parentNode;if(null!=s&&r!==l&&null===i&&!Je(r,s,e)){if(de){const e=(Bo(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}s.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];(Je(r,g,e)||l===r)&&(g.appendChild(r),t++)}r!==t&&s.set(f,m)}}}if(s.size>0)for(const[t,n]of s)n.reconcileObservedMutation(t,e);const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],s=n.parentNode;null==s||"BR"!==n.nodeName||Je(n,i,e)||s.removeChild(n)}}n.takeRecords()}null!==i&&(c&&no(i),de&&vo(e)&&i.insertRawText(u))}))}finally{Ke=!1}}function Xe(e){const t=e._observer;null!==t&&Ye(e,t.takeRecords(),t)}function Qe(e){!function(e){0===je&&Po(e).addEventListener("textInput",qe,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ye(e,t,n)}))}let et=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||lt).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function tt(e,t,n="latest"){const r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function nt(e,t,n){let r;if($i(),"function"==typeof n){const i=e.getLatest(),s=tt(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const i=e.getWritable();return st(i).updateFromKnown(t,r),i}function rt(e){const t=new Map,n=new Set;for(let r="function"==typeof e?e:e.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){const{ownNodeConfig:e}=Qo(r);if(e&&e.stateConfigs)for(const r of e.stateConfigs){let e;"stateConfig"in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}let it=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:s}=this.sharedNodeState,o=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(const i in t){const t=e.get(i);t&&n.has(t)||r++}return r}(s,n,r);this.size=o}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(const n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return at(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(const[i,s]of Object.entries(n)){const n=e.get(i);n?t.has(n)||t.set(n,n.parse(s)):(r=r||{},r[i]=s)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=at(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){const n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function st(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new it(t,ot(t));return t.__state=n,n}function ot(e){return e.__state?e.__state.sharedNodeState:Es(jo(),e.getType()).sharedNodeState}function at(e){if(e)for(const t in e)return e}function lt(e){return e}function ct(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ut(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r)for(const[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0;return!1}function dt(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ht(e,t){const n=e.__mode,r=e.__format,i=e.__style,s=t.__mode,o=t.__format,a=t.__style,l=e.__state,c=t.__state;return(null===n||n===s)&&(null===r||r===o)&&(null===i||i===a)&&(null===e.__state||l===c||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;const n=new Set;return!(e&&ct(n,e,t)||t&&ct(n,t,e)||e&&ut(n,e,t)||t&&ut(n,t,e))}(l,c))}function gt(e,t){const n=e.mergeWithSibling(t),r=Hi()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function pt(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Gr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(ht(t,r)){r=gt(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Gr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(ht(r,n)){r=gt(r,n);break}break}n.remove()}}else r.remove()}function ft(e){return mt(e.anchor),mt(e.focus),e}function mt(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Gr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!ss(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let yt,_t,bt,xt,kt,vt,St,wt,Ct,Tt,Et="",Nt=null,At="",Lt="",Pt=!1,Ot=!1;function Ft(e,t){const n=St.get(e);if(null!==t){const n=Gt(e);n.parentNode===t&&t.removeChild(n)}if(wt.has(e)||_t._keyToDOMMap.delete(e),ss(n)){const e=jt(n,St);It(e,0,e.length-1,null)}void 0!==n&&bo(Tt,bt,xt,n,"destroyed")}function It(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&Ft(t,r)}}function Rt(e,t){e.setProperty("text-align",t)}const Mt="40px";function Dt(e,t){const n=yt.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Mt;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function zt(e,t){const n=e.style;0===t?Rt(n,""):1===t?Rt(n,"left"):2===t?Rt(n,"center"):3===t?Rt(n,"right"):4===t?Rt(n,"justify"):5===t?Rt(n,"start"):6===t&&Rt(n,"end")}function Bt(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(us(e))return null;const n=e.getParentOrThrow();return us(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function $t(e,t){const n=wt.get(e);void 0===n&&oe(60);const r=n.createDOM(yt,_t);if(function(e,t,n){const r=n._keyToDOMMap;(function(e,t,n){e[`__lexicalKey_${t._key}`]=n})(t,n,e),r.set(e,t)}(e,r,_t),Gr(n)?r.setAttribute("data-lexical-text","true"):ls(n)&&r.setAttribute("data-lexical-decorator","true"),ss(n)){const e=n.__indent,t=n.__size;if(Bt(r,n),0!==e&&Dt(r,e),0!==t){const e=t-1;Ut(jt(n,wt),n,0,e,n.getDOMSlot(r))}const i=n.__format;0!==i&&zt(r,i),n.isInline()||Ht(null,n,r),wo(n)&&(Et+=Le,Lt+=Le)}else{const t=n.getTextContent();if(ls(n)){const t=n.decorate(_t,yt);null!==t&&Jt(e,t),r.contentEditable="false"}Et+=t,Lt+=t}return null!==t&&t.insertChild(r),bo(Tt,bt,xt,n,"created"),r}function Ut(e,t,n,r,i){const s=Et;Et="";let o=n;for(;o<=r;++o){$t(e[o],i);const t=wt.get(e[o]);null!==t&&Gr(t)&&(null===Nt&&(Nt=t.getFormat()),""===At&&(At=t.getStyle()))}wo(t)&&(Et+=Le),i.element.__lexicalTextContent=Et,Et=s+Et}function Wt(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return Pr(e)?"line-break":ls(e)&&e.isInline()?"decorator":null}return"empty"}return null}function Ht(e,t,n){const r=Wt(e,St),i=Wt(t,wt);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Kt(e,t,n){var r;Nt=null,At="",function(e,t,n){const r=Et,i=e.__size,s=t.__size;Et="";const o=n.element;if(1===i&&1===s){const n=e.__first,i=t.__first;if(n===i)qt(n,o);else{const e=Gt(n),t=$t(i,null);try{o.replaceChild(t,e)}catch(r){if("object"==typeof r&&null!=r){const s=`${r.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw new Error(s)}throw r}Ft(n,null)}const s=wt.get(i);Gr(s)&&(null===Nt&&(Nt=s.getFormat()),""===At&&(At=s.getStyle()))}else{const r=jt(e,St),a=jt(t,wt);if(r.length!==i&&oe(227),a.length!==s&&oe(228),0===i)0!==s&&Ut(a,t,0,s-1,n);else if(0===s){if(0!==i){const e=null==n.after&&null==n.before&&null==n.element.__lexicalLineBreak;It(r,0,i-1,e?null:o),e&&(o.textContent="")}}else!function(e,t,n,r,i,s){const o=r-1,a=i-1;let l,c,u=s.getFirstChild(),d=0,h=0;for(;d<=o&&h<=a;){const e=t[d],r=n[h];if(e===r)u=Vt(qt(r,s.element)),d++,h++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const i=c.has(e),o=l.has(r);if(i)if(o){const e=Co(_t,r);e===u?u=Vt(qt(r,s.element)):(s.withBefore(u).insertChild(e),qt(r,s.element)),d++,h++}else $t(r,s.withBefore(u)),h++;else u=Vt(Gt(e)),Ft(e,s.element),d++}const i=wt.get(r);null!==i&&Gr(i)&&(null===Nt&&(Nt=i.getFormat()),""===At&&(At=i.getStyle()))}const g=d>o,p=h>a;if(g&&!p){const t=n[a+1],r=void 0===t?null:_t.getElementByKey(t);Ut(n,e,h,a,s.withBefore(r))}else p&&!g&&It(t,d,o,s.element)}(t,r,a,i,s,n)}wo(t)&&(Et+=Le),o.__lexicalTextContent=Et,Et=r+Et}(e,t,t.getDOMSlot(n)),r=t,null==Nt||Nt===r.__textFormat||Ot||r.setTextFormat(Nt),function(e){""===At||At===e.__textStyle||Ot||e.setTextStyle(At)}(t)}function jt(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&oe(101),n.push(r),r=e.__next}return n}function qt(e,t){const n=St.get(e);let r=wt.get(e);void 0!==n&&void 0!==r||oe(61);const i=Pt||vt.has(e)||kt.has(e),s=Co(_t,e);if(n===r&&!i){if(ss(n)){const e=s.__lexicalTextContent;void 0!==e&&(Et+=e,Lt+=e)}else{const e=n.getTextContent();Lt+=e,Et+=e}return s}if(n!==r&&i&&bo(Tt,bt,xt,r,"updated"),r.updateDOM(n,s,yt)){const n=$t(e,null);return null===t&&oe(62),t.replaceChild(n,s),Ft(e,null),n}if(ss(n)&&ss(r)){const e=r.__indent;(Pt||e!==n.__indent)&&Dt(s,e);const t=r.__format;if((Pt||t!==n.__format)&&zt(s,t),i&&(Kt(n,r,s),us(r)||r.isInline()||Ht(n,r,s)),wo(r)&&(Et+=Le,Lt+=Le),(Pt||r.__dir!==n.__dir)&&(Bt(s,r),us(r)&&!Pt))for(const e of r.getChildren())ss(e)&&Bt(Co(_t,e.getKey()),e)}else{const t=r.getTextContent();if(ls(r)){const t=r.decorate(_t,yt);null!==t&&Jt(e,t)}Et+=t,Lt+=t}if(!Ot&&us(r)&&r.__cachedText!==Lt){const e=r.getWritable();e.__cachedText=Lt,r=e}return s}function Jt(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(null===n){if(r[e]===t)return;n=Xs(_t)}n[e]=t}function Vt(e){let t=e.nextSibling;return null!==t&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function Gt(e){const t=Ct.get(e);return void 0===t&&oe(75,e),t}function Zt(e){return{type:e}}const Yt=Zt("SELECTION_CHANGE_COMMAND"),Xt=Zt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Qt=Zt("CLICK_COMMAND"),en=Zt("DELETE_CHARACTER_COMMAND"),tn=Zt("INSERT_LINE_BREAK_COMMAND"),nn=Zt("INSERT_PARAGRAPH_COMMAND"),rn=Zt("CONTROLLED_TEXT_INSERTION_COMMAND"),sn=Zt("PASTE_COMMAND"),on=Zt("REMOVE_TEXT_COMMAND"),an=Zt("DELETE_WORD_COMMAND"),ln=Zt("DELETE_LINE_COMMAND"),cn=Zt("FORMAT_TEXT_COMMAND"),un=Zt("UNDO_COMMAND"),dn=Zt("REDO_COMMAND"),hn=Zt("KEYDOWN_COMMAND"),gn=Zt("KEY_ARROW_RIGHT_COMMAND"),pn=Zt("MOVE_TO_END"),fn=Zt("KEY_ARROW_LEFT_COMMAND"),mn=Zt("MOVE_TO_START"),yn=Zt("KEY_ARROW_UP_COMMAND"),_n=Zt("KEY_ARROW_DOWN_COMMAND"),bn=Zt("KEY_ENTER_COMMAND"),xn=Zt("KEY_SPACE_COMMAND"),kn=Zt("KEY_BACKSPACE_COMMAND"),vn=Zt("KEY_ESCAPE_COMMAND"),Sn=Zt("KEY_DELETE_COMMAND"),wn=Zt("KEY_TAB_COMMAND"),Cn=Zt("INSERT_TAB_COMMAND"),Tn=Zt("INDENT_CONTENT_COMMAND"),En=Zt("OUTDENT_CONTENT_COMMAND"),Nn=Zt("DROP_COMMAND"),An=Zt("FORMAT_ELEMENT_COMMAND"),Ln=Zt("DRAGSTART_COMMAND"),Pn=Zt("DRAGOVER_COMMAND"),On=Zt("DRAGEND_COMMAND"),Fn=Zt("COPY_COMMAND"),In=Zt("CUT_COMMAND"),Rn=Zt("SELECT_ALL_COMMAND"),Mn=Zt("CLEAR_EDITOR_COMMAND"),Dn=Zt("CLEAR_HISTORY_COMMAND"),zn=Zt("CAN_REDO_COMMAND"),Bn=Zt("CAN_UNDO_COMMAND"),$n=Zt("FOCUS_COMMAND"),Un=Zt("BLUR_COMMAND"),Wn=Zt("KEY_MODIFIER_COMMAND"),Hn=Object.freeze({}),Kn=[["keydown",function(e,t){if(!(jn=e.timeStamp,qn=e.key,t.isComposing()||So(t,hn,e)||null==e.key)){if(tr&&mo(e))return ts(t,(()=>{dr(t,nr)})),tr=!1,void(nr="");if(function(e){return go(e,"ArrowRight",{shiftKey:"any"})}(e))So(t,gn,e);else if(function(e){return go(e,"ArrowRight",po)}(e))So(t,pn,e);else if(function(e){return go(e,"ArrowLeft",{shiftKey:"any"})}(e))So(t,fn,e);else if(function(e){return go(e,"ArrowLeft",po)}(e))So(t,mn,e);else if(function(e){return go(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))So(t,yn,e);else if(function(e){return go(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))So(t,_n,e);else if(function(e){return go(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))Qn=!0,So(t,bn,e);else if(function(e){return" "===e.key}(e))So(t,xn,e);else if(function(e){return ue&&go(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),Qn=!0,So(t,tn,!0);else if(function(e){return go(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))Qn=!1,So(t,bn,e);else if(function(e){return go(e,"Backspace",{shiftKey:"any"})||ue&&go(e,"h",{ctrlKey:!0})}(e))mo(e)?So(t,kn,e):(e.preventDefault(),So(t,en,!0));else if(function(e){return"Escape"===e.key}(e))So(t,vn,e);else if(function(e){return go(e,"Delete",{})||ue&&go(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),So(t,en,!1)):So(t,Sn,e);else if(function(e){return go(e,"Backspace",fo)}(e))e.preventDefault(),So(t,an,!0);else if(function(e){return go(e,"Delete",fo)}(e))e.preventDefault(),So(t,an,!1);else if(function(e){return ue&&go(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),So(t,ln,!0);else if(function(e){return ue&&(go(e,"Delete",{metaKey:!0})||go(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),So(t,ln,!1);else if(function(e){return go(e,"b",po)}(e))e.preventDefault(),So(t,cn,"bold");else if(function(e){return go(e,"u",po)}(e))e.preventDefault(),So(t,cn,"underline");else if(function(e){return go(e,"i",po)}(e))e.preventDefault(),So(t,cn,"italic");else if(function(e){return go(e,"Tab",{shiftKey:"any"})}(e))So(t,wn,e);else if(function(e){return go(e,"z",po)}(e))e.preventDefault(),So(t,un,void 0);else if(function(e){return ue?go(e,"z",{metaKey:!0,shiftKey:!0}):go(e,"y",{ctrlKey:!0})||go(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),So(t,dn,void 0);else{const n=t._editorState._selection;null===n||si(n)?yo(e)&&(e.preventDefault(),So(t,Rn,e)):function(e){return go(e,"c",po)}(e)?(e.preventDefault(),So(t,Fn,e)):function(e){return go(e,"x",po)}(e)?(e.preventDefault(),So(t,In,e)):yo(e)&&(e.preventDefault(),So(t,Rn,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&So(t,Wn,e)}}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;$o(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&ts(t,(()=>{Ls(n)||(Xn=!0)}))}],["compositionstart",function(e,t){ts(t,(()=>{const n=vi();if(si(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();qs(r.key),(e.timeStamp<jn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Gr(i)&&i.getStyle()!==n.style)&&So(t,rn,Pe)}}))}],["compositionend",function(e,t){de?er=!0:pe||!ge&&!_e?ts(t,(()=>{dr(t,e.data)})):(tr=!0,nr=e.data)}],["input",function(e,t){e.stopPropagation(),ts(t,(()=>{if(Bo(e.target)&&Ls(e.target))return;const n=vi(),r=e.data,i=ur(e);if(null!=r&&si(n)&&sr(n,i,r,e.timeStamp,!1)){er&&(dr(t,r),er=!1);const i=n.anchor.getNode(),s=Do(Po(t));if(null===s)return;const o=n.isBackward(),a=o?n.anchor.offset:n.focus.offset,l=o?n.focus.offset:n.anchor.offset;he&&!n.isCollapsed()&&Gr(i)&&null!==s.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===ao(s.anchorNode)||So(t,rn,r);const c=r.length;de&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),ge||pe||_e||!t.isComposing()||(jn=0,qs(null))}else lo(!1,t,null!==r?r:void 0),er&&(dr(t,r||void 0),er=!1);!function(){$i();Xe(Hi())}()}),{event:e}),Vn=null}],["click",function(e,t){ts(t,(()=>{const n=vi(),r=Do(Po(t)),i=Si();if(r)if(si(n)){const t=n.anchor,s=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!us(s)&&1===eo().getChildrenSize()&&s.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&s!==n.focus.getNode()){const e=ea(s,(e=>ss(e)&&!e.isInline()));ss(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=r.anchorNode;(Bo(n)||Bs(n))&&no(ki(i,r,t,e))}So(t,Qt,e)}))}],["cut",Hn],["copy",Hn],["dragstart",Hn],["dragover",Hn],["dragend",Hn],["paste",Hn],["focus",Hn],["blur",Hn],["drop",Hn]];he&&Kn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=ur(e);"deleteCompositionText"===n||de&&vo(t)||"insertCompositionText"!==n&&ts(t,(()=>{const i=vi();if("deleteContentBackward"===n){if(null===i){const e=Si();if(!si(e))return;no(e.clone())}if(si(i)){const n=i.anchor.key===i.focus.key;if(s=e.timeStamp,"MediaLast"===qn&&s<jn+30&&t.isComposing()&&n){if(qs(null),jn=0,setTimeout((()=>{ts(t,(()=>{qs(null)}))}),30),si(i)){const e=i.anchor.getNode();e.markDirty(),Gr(e)||oe(142),cr(i,e)}}else{qs(null),e.preventDefault();const r=i.anchor.getNode(),s=r.getTextContent(),o=r.canInsertTextAfter(),a=0===i.anchor.offset&&i.focus.offset===s.length;let l=ye&&n&&!a&&o;if(l&&i.isCollapsed()&&(l=!ls(ko(i.anchor,!0))),!l){So(t,en,!0);const e=vi();ye&&si(e)&&e.isCollapsed()&&(rr=e,setTimeout((()=>rr=null)))}}return}}var s;if(!si(i))return;const o=e.data;null!==Vn&&lo(!1,t,Vn),i.dirty&&null===Vn||!i.isCollapsed()||us(i.anchor.getNode())||null===r||i.applyDOMRange(r),Vn=null;const a=i.anchor,l=i.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":So(t,rn,e);break;case"insertFromComposition":qs(null),So(t,rn,e);break;case"insertLineBreak":qs(null),So(t,tn,!1);break;case"insertParagraph":qs(null),Qn&&!pe?(Qn=!1,So(t,tn,!1)):So(t,nn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":So(t,sn,e);break;case"deleteByComposition":(function(e,t){return e!==t||ss(e)||ss(t)||!Ds(e)||!Ds(t)})(c,u)&&So(t,on,e);break;case"deleteByDrag":case"deleteByCut":So(t,on,e);break;case"deleteContent":So(t,en,!1);break;case"deleteWordBackward":So(t,an,!0);break;case"deleteWordForward":So(t,an,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":So(t,ln,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":So(t,ln,!1);break;case"formatStrikeThrough":So(t,cn,"strikethrough");break;case"formatBold":So(t,cn,"bold");break;case"formatItalic":So(t,cn,"italic");break;case"formatUnderline":So(t,cn,"underline");break;case"historyUndo":So(t,un,void 0);break;case"historyRedo":So(t,dn,void 0)}else{if("\n"===o)e.preventDefault(),So(t,tn,!1);else if(o===Le)e.preventDefault(),So(t,nn,void 0);else if(null==o&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=o&&sr(i,r,o,e.timeStamp,!0)?(e.preventDefault(),So(t,rn,o)):Vn=o;Jn=e.timeStamp}}))}(e,t)]);let jn=0,qn=null,Jn=0,Vn=null;const Gn=new WeakMap,Zn=new WeakMap;let Yn=!1,Xn=!1,Qn=!1,er=!1,tr=!1,nr="",rr=null,ir=[0,"",0,"root",0];function sr(e,t,n,r,i){const s=e.anchor,o=e.focus,a=s.getNode(),l=Hi(),c=Do(Po(l)),u=null!==c?c.anchorNode:null,d=s.key,h=l.getElementByKey(d),g=n.length;return d!==o.key||!Gr(a)||(!i&&(!he||Jn<r+50)||a.isDirty()&&g<2||io(n))&&s.offset!==o.offset&&!a.isComposing()||zs(a)||a.isDirty()&&g>1||(i||!he)&&null!==h&&!a.isComposing()&&u!==Us(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=Ds(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Gr(t)||ss(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function or(e,t){return Bs(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function ar(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=e;Yn&&(Yn=!1,or(r,i)&&or(s,o)&&!rr)||ts(t,(()=>{if(!n)return void no(null);if(!Os(t,r,s))return;let a=vi();if(rr&&si(a)&&a.isCollapsed()){const e=a.anchor,t=rr.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(a=rr.clone(),no(a))}if(rr=null,si(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const i=Po(t).event,s=i?i.timeStamp:performance.now(),[o,l,c,u,d]=ir,h=eo(),g=!1===t.isComposing()&&""===h.getTextContent();if(s<d+200&&n.offset===c&&n.key===u)lr(a,o,l);else if("text"===n.type)Gr(r)||oe(141),cr(a,r);else if("element"===n.type&&!g){ss(r)||oe(259);const e=n.getNode();e.isEmpty()?function(e,t){lr(e,t.getTextFormat(),t.getTextStyle())}(a,e):lr(a,0,"")}}else{const e=n.key,t=a.focus.key,r=a.getNodes(),s=r.length,l=a.isBackward(),c=l?o:i,u=l?i:o,d=l?t:e,h=l?e:t;let g=2047,p=!1;for(let e=0;e<s;e++){const t=r[e],n=t.getTextContentSize();if(Gr(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===s-1&&t.__key===h&&0===u)&&(p=!0,g&=t.getFormat(),0===g))break}a.format=p?g:0}}So(t,Yt,void 0)}))}function lr(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function cr(e,t){lr(e,t.getFormat(),t.getStyle())}function ur(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function dr(e,t){const n=e._compositionKey;if(qs(null),null!==n&&null!=t){if(""===t){const t=Vs(n),r=Us(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Gr(t)&&co(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=vi();if(si(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void So(e,bn,null)}}}lo(!0,e,t)}function hr(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const gr=new Map;function pr(e){const t=function(e){const t=Lo(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=Is(t.anchorNode);if(null===n)return;Xn&&(Xn=!1,ts(n,(()=>{const r=Si(),i=t.anchorNode;(Bo(i)||Bs(i))&&no(ki(r,t,n,e))})));const r=so(n),i=r[r.length-1],s=i._key,o=gr.get(s),a=o||i;a!==n&&ar(t,a,!1),ar(t,n,!0),n!==i?gr.set(s,n):o&&gr.delete(s)}function fr(e){e._lexicalHandled=!0}function mr(e){return!0===e._lexicalHandled}function yr(e){const t=Gn.get(e);if(void 0===t)return;const n=Zn.get(t);if(void 0===n)return;const r=n-1;r>=0||oe(164),Gn.delete(e),Zn.set(t,r),0===r&&t.removeEventListener("selectionchange",pr);const i=Rs(e);Fs(i)?(function(e){if(null!==e._parentEditor){const t=so(e),n=t[t.length-1]._key;gr.get(n)===e&&gr.delete(n)}else gr.delete(e._key)}(i),e.__lexicalEditor=null):i&&oe(198);const s=hr(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}function _r(e,t,n){$i();const r=e.__key,i=e.getParent();if(null===i)return;const s=function(e){const t=vi();if(!si(t)||!ss(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),s=r.getNode();return Ao(i,e)&&n.set(e.__key,0,"element"),Ao(s,e)&&r.set(e.__key,0,"element"),t}(e);let o=!1;if(si(s)&&t){const t=s.anchor,n=s.focus;t.key===r&&(Ti(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Ti(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ai(s)&&t&&e.isSelected()&&e.selectPrevious();if(si(s)&&t&&!o){const t=e.getIndexWithinParent();Ks(e),wi(s,i,t,-1)}else Ks(e);n||Oo(i)||i.canBeEmpty()||!i.isEmpty()||_r(i,t),t&&s&&us(i)&&i.isEmpty()&&i.selectEnd()}const br=Symbol.for("ephemeral");function xr(e){return e[br]||!1}class kr{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=Qo(this);return void 0===e&&oe(64,this.name),e}static clone(e){oe(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),function(e,t){const n=function(){const e=ws;return ws=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);$i(),Ui();const r=Hi(),i=Wi(),s=""+Ts++;i._nodeMap.set(s,e),ss(e)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,e.__key=s}(this,e)}getType(){return this.__type}isInline(){oe(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Vs(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||vi();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Gr(this))return n;if(si(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(ls(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Vs(e)}getParentOrThrow(){const e=this.getParent();return null===e&&oe(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Oo(t))return ss(e)||e===this&&ls(e)||oe(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&oe(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Vs(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Vs(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=ss(this)?this:this.getParent(),n=ss(e)?e:e.getParent(),r=t&&n?La(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=La(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===Ea(t):("same"!==t.type&&"ancestor"!==t.type&&oe(279),!1)))}isParentOf(e){const t=La(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const s=i.__key;if(r.has(s)||(r.add(s),n.push(i)),i===e)break;const o=ss(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==o){i=o;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&oe(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=Hi()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(xr(this))return this;const e=Vs(this.__key);return null===e&&oe(113),e}getWritable(){if(xr(this))return this;$i();const e=Wi(),t=Hi(),n=e._nodeMap,r=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,o=vi();if(null!==o&&o.setCachedNodes(null),s.has(r))return js(i),i;const a=Go(i);return s.add(r),js(a),n.set(r,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){oe(70)}updateDOM(e,t,n){oe(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){oe(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const e of ot(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&st(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){_r(this,!0,e)}replace(e,t){$i();let n=vi();null!==n&&(n=n.clone()),Io(this,e);const r=this.getLatest(),i=this.__key,s=e.__key,o=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;Ks(o);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,g=r.__parent;if(_r(r,!1,!0),null===c?a.__first=s:c.getWritable().__next=s,o.__prev=d,null===u?a.__last=s:u.getWritable().__prev=s,o.__next=h,o.__parent=g,a.__size=l,t&&(ss(this)&&ss(o)||oe(139),this.getChildren().forEach((e=>{o.append(e)}))),si(n)){no(n);const e=n.anchor,t=n.focus;e.key===i&&ri(e,o),t.key===i&&ri(t,o)}return Js()===i&&qs(s),o}insertAfter(e,t=!0){$i(),Io(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),s=vi();let o=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(Ks(r),si(s)){const e=i.__key,n=s.anchor,r=s.focus;o="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&si(s)){const e=this.getIndexWithinParent();wi(s,c,e+1);const t=c.__key;o&&s.anchor.set(t,e+2,"element"),a&&s.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){$i(),Io(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;Ks(r);const s=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===s?o.__first=i:s.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=vi();return t&&si(c)&&wi(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return _s()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){$i();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(ss(n))return n.select();if(!Gr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){$i();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(ss(n))return n.select(0,0);if(!Gr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const vr="historic",Sr="history-merge",wr="collaboration",Cr="skip-scroll-into-view",Tr="skip-dom-selection",Er="skip-selection-focus";class Nr extends kr{static getType(){return"linebreak"}static clone(e){return new Nr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Ho(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Or(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Or(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Ho(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Or(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&Or(r))return!0}return!1}(e)?null:{conversion:Ar,priority:0}}}static importJSON(e){return Lr().updateFromJSON(e)}}function Ar(e){return{node:Lr()}}function Lr(){return Fo(new Nr)}function Pr(e){return e instanceof Nr}function Or(e){return Bs(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Fr(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Ir(e,t){return 1&t?"strong":2&t?"em":"span"}function Rr(e,t,n,r,i){const s=r.classList;let o=_o(i,"base");void 0!==o&&s.add(...o),o=_o(i,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;void 0!==o&&(8&n&&4&n?(a=!0,l||s.add(...o)):l&&s.remove(...o));for(const e in Me){const r=Me[e];if(o=_o(i,e),void 0!==o)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&s.remove(...o);continue}(0===(t&r)||l&&"underline"===e||"strikethrough"===e)&&s.add(...o)}else t&r&&s.remove(...o)}}function Mr(e,t,n){const r=t.firstChild,i=n.isComposing(),s=e+(i?Ae:"");if(null==r)t.textContent=s;else{const e=r.nodeValue;if(e!==s)if(i||de){const[t,n,i]=function(e,t){const n=e.length,r=t.length;let i=0,s=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;s+i<n&&s+i<r&&e[n-s-1]===t[r-s-1];)s++;return[i,n-i-s,t.slice(i,r-s)]}(e,s);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=s}}function Dr(e,t,n,r,i,s){Mr(i,e,t);const o=s.theme.text;void 0!==o&&Rr(0,0,r,e,o)}function zr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Br extends kr{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Br(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Ue[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Js()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Me[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Ws(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=Fr(0,n),i=Ir(0,n),s=null===r?i:r,o=document.createElement(s);let a=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(a=document.createElement(i),o.appendChild(a)),Dr(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&(o.style.cssText=l),o}updateDOM(e,t,n){const r=this.__text,i=e.__format,s=this.__format,o=Fr(0,i),a=Fr(0,s),l=Ir(0,i),c=Ir(0,s);if((null===o?l:o)!==(null===a?c:a))return!0;if(o===a&&l!==c){const e=t.firstChild;null==e&&oe(48);const i=document.createElement(c);return Dr(i,this,0,s,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==o&&(u=t.firstChild,null==u&&oe(49)),Mr(r,u,this);const d=n.theme.text;void 0!==d&&i!==s&&Rr(0,i,s,u,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Kr,priority:0}),b:()=>({conversion:Ur,priority:0}),code:()=>({conversion:Jr,priority:0}),em:()=>({conversion:Jr,priority:0}),i:()=>({conversion:Jr,priority:0}),mark:()=>({conversion:Jr,priority:0}),s:()=>({conversion:Jr,priority:0}),span:()=>({conversion:$r,priority:0}),strong:()=>({conversion:Jr,priority:0}),sub:()=>({conversion:Jr,priority:0}),sup:()=>({conversion:Jr,priority:0}),u:()=>({conversion:Jr,priority:0})}}static importJSON(e){return Vr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Bo(t)||oe(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=zr(t,"b")),this.hasFormat("italic")&&(t=zr(t,"i")),this.hasFormat("strikethrough")&&(t=zr(t,"s")),this.hasFormat("underline")&&(t=zr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Me[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?De[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Ws(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=$e[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){$i();let n=e,r=t;const i=vi(),s=this.getTextContent(),o=this.__key;if("string"==typeof s){const e=s.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!si(i))return _i(o,n,o,r,"text","text");{const e=Js();e!==i.anchor.key&&e!==i.focus.key||qs(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),s=i.__text,o=n.length;let a=e;a<0&&(a=o+a,a<0&&(a=0));const l=vi();if(r&&si(l)){const t=e+o;l.setTextNodeRange(i,t,i,t)}const c=s.slice(0,a)+n+s.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){$i();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Js(),s=n.length;e.sort(((e,t)=>e-t)),e.push(s);const o=[],a=e.length;for(let t=0,r=0;t<s&&r<=a;r++){const i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}const l=o.length;if(1===l)return[t];const c=o[0],u=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),p=t.__detail;let f=!1,m=null,y=null;const _=vi();if(si(_)){const[e,t]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];"text"===e.type&&e.key===r&&(m=e),"text"===t.type&&t.key===r&&(y=t)}t.isSegmented()?(d=Vr(c),d.__format=h,d.__style=g,d.__detail=p,d.__state=dt(t,d),f=!0):d=t.setTextContent(c);const b=[d];for(let e=1;e<l;e++){const n=Vr(o[e]);n.__format=h,n.__style=g,n.__detail=p,n.__state=dt(t,n);const s=n.__key;i===r&&qs(s),b.push(n)}const x=m?m.offset:null,k=y?y.offset:null;let v=0;for(const e of b){if(!m&&!y)break;const t=v+e.getTextContentSize();if(null!==m&&null!==x&&x<=t&&x>=v&&(m.set(e.getKey(),x-v,"text"),x<t&&(m=null)),null!==y&&null!==k&&k<=t&&k>=v){y.set(e.getKey(),k-v,"text");break}v=t}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&js(t),null!==n&&js(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();f?(e.splice(t,0,b),this.remove()):e.splice(t,1,b),si(_)&&wi(_,u,t,l-1)}return b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||oe(50);const n=this.__key,r=e.__key,i=this.__text,s=i.length;Js()===r&&qs(n);const o=vi();if(si(o)){const i=o.anchor,a=o.focus;null!==i&&i.key===r&&Ei(i,t,n,e,s),null!==a&&a.key===r&&Ei(a,t,n,e,s)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function $r(e){return{forChild:Zr(e.style),node:null}}function Ur(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Zr(t.style,n?void 0:"bold"),node:null}}const Wr=new WeakMap;function Hr(e){if(!Bo(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Kr(e){const t=e;null===e.parentElement&&oe(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Wr.get(n))&&!Hr(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)Wr.set(r[e],i);return i}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(Lr()):"\t"===r?t.push(Xr()):""!==r&&t.push(Vr(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=jr(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=jr(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Vr(n)}}function jr(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,Bo(n)){const e=n.style.display;if(""===e&&!Wo(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(Bs(n))return n;if("BR"===n.nodeName)return null}}const qr={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Jr(e){const t=qr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Zr(e.style,t),node:null}}function Vr(e=""){return Fo(new Br(e))}function Gr(e){return e instanceof Br}function Zr(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,s=r.includes("line-through"),o="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Gr(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class Yr extends Br{static getType(){return"tab"}static clone(e){return new Yr(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=_o(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Xr().updateFromJSON(e)}setTextContent(e){return"\t"!==e&&""!==e&&ae(126),super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||oe(286),this}setDetail(e){return 2!==e&&oe(127),this}setMode(e){return"normal"!==e&&oe(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Xr(){return Fo(new Yr)}function Qr(e){return e instanceof Yr}class ei{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Ta($a(Pa(this,"next")),$a(Pa(e,"next")))<0}getNode(){const e=Vs(this.key);return null===e&&oe(20),e}set(e,t,n,r){const i=this._selection,s=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Bi()||(Js()===s&&qs(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function ti(e,t,n){return new ei(e,t,n)}function ni(e,t){let n=t.__key,r=e.offset,i="element";if(Gr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!ss(t)){const e=t.getNextSibling();if(Gr(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function ri(e,t){if(ss(t)){const n=t.getLastDescendant();ss(n)||Gr(n)?ni(e,n):ni(e,t)}else ni(e,t)}class ii{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ai(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new ii(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let i;if(Gr(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=Vs(e);null!==t&&n.push(t)}return Bi()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((vi()||Si())===this&&e[0]){const t=fa(e[0],"next");Fa(wa(t,t))}for(const t of e)t.remove()}}function si(e){return e instanceof oi}class oi{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!si(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=function(e){const t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);const i=new Set,s=new Set;for(const n of e)if(da(n)){const{origin:e}=n;0===t.length?i.add(e):(s.add(e),t.push(e))}else{const{origin:e}=n;ss(e)&&s.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),ua(e.focus)&&ss(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=ba(e.focus.origin,"previous");da(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xa(n))i.delete(n.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!ss(e)||s.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=$a(e.anchor),r=$a(e.anchor.getFlipped()),i=e=>ca(e)?e.origin:e.getNodeAtCaret(),s=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(s)}return t}(Ha(Ra(this),"next"));return Bi()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[o,a]=ci(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(ss(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Gr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=o<a?e.slice(o,a):e.slice(a,o)):e=s?e.slice(o):e.slice(a):d===n&&(e=s?e.slice(0,a):e.slice(0,o)),l+=e}else!ls(d)&&!Pr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Hi(),n=t.getEditorState()._selection,r=mi(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,s]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),ft(this)}clone(){const e=this.anchor,t=this.focus;return new oi(ti(e.key,e.offset,e.type),ti(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Ws(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Me[e];return 0!==(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(Lr()):"\t"===r?n.push(Xr()):n.push(Vr(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let s=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(s=n,o=t),"element"===s.type&&function(e,t,n,r){const i=e.getNode(),s=i.getChildAtIndex(e.offset),o=Vr();if(o.setFormat(n),o.setStyle(r),bs(s))s.splice(0,0,[o]);else{const e=us(i)?_s().append(o):o;null===s?i.append(e):s.insertBefore(e)}e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(s,o,r,i),"element"===o.type&&Oa(o,$a(Pa(o,"next")));const a=s.offset;let l=o.offset;const c=this.getNodes(),u=c.length;let d=c[0];Gr(d)||oe(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=c[u-1];if(1===u&&"element"===o.type&&(l=h,o.set(s.key,l,"text")),this.isCollapsed()&&a===h&&(zs(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Gr(t)&&t.canInsertTextBefore()&&!zs(t)||(t=Vr(),t.setFormat(r),t.setStyle(i),g.canInsertTextAfter()?d.insertAfter(t):g.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(zs(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Gr(t)&&!zs(t)||(t=Vr(),t.setFormat(r),g.canInsertTextBefore()?d.insertBefore(t):g.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const e=Vr(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||ss(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),fi(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(Ds(d)){const t=Vr(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Qr(d)){const t=Vr(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Vr(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(i)}const s=l-a;d=d.spliceText(a,s,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...p.getParentKeys()]),n=ss(d)?d:d.getParentOrThrow();let r=ss(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===o.type&&(0!==l||""===p.getTextContent())||"element"===o.type&&p.getIndexWithinParent()<l)if(Gr(p)&&!Ds(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=Vr(p.getTextContent());p.replace(e),p=e}us(o.getNode())||"text"!==o.type||(p=p.spliceText(0,l,"")),t.add(p.__key)}else{const e=p.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?p.remove():e.remove()}else t.add(p.__key);const s=r.getChildren(),g=new Set(c),f=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=s.length-1;e>=0;e--){const t=s[e];if(t.is(d)||ss(t)&&t.isParentOf(d))break;t.isAttached()&&(!g.has(t)||t.is(i)?f||m.insertAfter(t,!1):t.remove())}if(!f){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Ds(d))if(a===h)d.select();else{const t=Vr(e);t.select(),d.replace(t)}else d=d.spliceText(a,h-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){const e=vi()===this;Ia(this,Ba(Ra(this))),e&&vi()!==this&&no(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void qs(null);const n=this.getNodes(),r=[];for(const e of n)Gr(e)&&r.push(e);const i=t=>{n.forEach((n=>{if(ss(n)){const r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},s=r.length;if(0===s)return this.toggleFormat(e),qs(null),void i(t);const o=this.anchor,a=this.focus,l=this.isBackward(),c=l?a:o,u=l?o:a;let d=0,h=r[0],g="element"===c.type?0:c.offset;if("text"===c.type&&g===h.getTextContentSize()&&(d=1,h=r[1],g=0),null==h)return;const p=h.getFormatFlags(e,t);i(p);const f=s-1;let m=r[f];const y="text"===u.type?u.offset:m.getTextContentSize();if(h.is(m)){if(g===y)return;if(zs(h)||0===g&&y===h.getTextContentSize())h.setFormat(p);else{const e=h.splitText(g,y),t=0===g?e[0]:e[1];t.setFormat(p),"text"===c.type&&c.set(t.__key,0,"text"),"text"===u.type&&u.set(t.__key,y-g,"text")}return void(this.format=p)}0===g||zs(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const _=m.getFormatFlags(e,p);y>0&&(y===m.getTextContentSize()||zs(m)||([m]=m.splitText(y)),m.setFormat(_));for(let t=d+1;t<f;t++){const n=r[t],i=n.getFormatFlags(e,_);n.setFormat(i)}"text"===c.type&&c.set(h.__key,g,"text"),"text"===u.type&&u.set(m.__key,y,"text"),this.format=p|_}insertNodes(e){if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const t=vi();return si(t)||oe(134),t.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=ea(t,Ko),r=e[e.length-1];if(ss(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=Li(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>(ss(e)||ls(e))&&!e.isInline()))){ss(n)||oe(211,t.constructor.name,t.getType());const i=Li(this);return n.splice(i,0,e),void r.selectEnd()}const i=function(e){const t=_s();let n=null;for(let r=0;r<e.length;r++){const i=e[r],s=Pr(i);if(s||ls(i)&&i.isInline()||ss(i)&&i.isInline()||Gr(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),s))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),s=i.getLastDescendant(),o=i.getChildren(),a=ss(n)&&n.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;ss(u=c)&&Ko(u)&&!u.isEmpty()&&ss(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(ss(n)||oe(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=o[1]),c&&(null===n&&oe(212,t.constructor.name,t.getType()),function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const i=[t];for(;r!==n;)r.getNextSibling()||oe(140),r=r.getNextSibling(),i.push(r);let s=e;for(const e of i)s=s.insertAfter(e)}(n,c));const d=ea(s,Ko);a&&ss(d)&&(a.canMergeWhenEmpty()||Ko(l))&&(d.append(...a.getChildren()),a.remove()),ss(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=ss(n)?n.getLastChild():null;Pr(h)&&d!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=_s();return eo().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Li(this),t=ea(this.anchor.getNode(),Ko);ss(t)||oe(213);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){const t=Lr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=[...this.getNodes()],t=e.length;let n=e[0],r=e[t-1];const[i,s]=ci(this),o=this.isBackward(),[a,l]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=o?[s,i]:[i,s];if(0===t)return[];if(1===t){if(Gr(n)&&!this.isCollapsed()){const e=n.splitText(c,u),t=0===c?e[0]:e[1];return t?(a.set(t.getKey(),0,"text"),l.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(Gr(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),Gr(r)){const t=r.getTextContent().length;0===u?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,l.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(Oi(this,e,t,n))return;const r="move"===e,i=Hi(),s=Do(Po(i));if(!s)return;const o=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();if(null===a||null===o||!ss(l)||l.isInline()||l.canBeEmpty()||Mo(o,i,a),this.dirty){let e=Co(i,this.anchor.key),t=Co(i,this.focus.key);"text"===this.anchor.type&&(e=Us(e)),"text"===this.focus.type&&(t=Us(t)),e&&t&&Ni(s,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),i=us(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Oo(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!r){const n=this.getNodes(),r=[];let o=!1;for(let e=0;e<n.length;e++){const t=n[e];Ao(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){const e=r[0];ss(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=r[r.length-1];ss(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,s=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,s,!0)}(this)}}"lineboundary"===n&&Oi(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ss(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ss(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=Sa(Pa(t,e?"previous":"next"));if(r.getTextSlices().every((e=>null===e||0===e.distance))){let e={type:"initial"};for(const t of r.iterNodeCarets("shadowRoot"))if(da(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(ss(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=$a(t);Ia(this,wa(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(ua(t)){if(ss(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(ls(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&ss(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=xi();e.add(t.origin.getKey()),no(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;return Ia(this,wa(!t.origin.isEmpty()&&n.isEmpty()?Ma(fa(n,t.direction)):r.anchor,t)),this.removeText()}}const i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&ui(this,t.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){const t=i.offset,s=r.getTextContentSize();if(r.is(n)||e&&t!==s||!e&&0!==t)return void hi(r,e,t)}else if(null!==n&&n.isSegmented()){const i=t.offset,s=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==s)return void hi(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,s=r.offset,o=e<s,a=o?e:s,l=o?s:e,c=l-1;a!==c&&function(e){return!(io(e)||di(e))}(i.getTextContent().slice(a,l))&&(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&us(e.getParent())&&null===e.getPreviousSibling()&&ui(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ai(e){return e instanceof ii}function li(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ci(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[li(n),li(r)]}function ui(e,t){for(let n=t;n;n=n.getParent()){if(ss(n)){if(n.collapseAtStart(e))return!0;if(Oo(n))break}if(n.getPreviousSibling())break}return!1}const di=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function hi(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,a=0;for(let e=0;e<s;e++){const r=e===s-1;if(a=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function gi(e,t,n,r){let i,s=t;if(Bo(e)){let o=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;s===l&&(o=!0,s=l-1);let u=a[s],d=!1;if(u===c)u=a[s+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&s--}if(i=ro(u),Gr(i))s=ya(i,o?"next":"previous");else{let a=ro(e);if(null===a)return null;if(ss(a)){const l=r.getElementByKey(a.getKey());null===l&&oe(214);const c=a.getDOMSlot(l);[a,s]=c.resolveChildIndex(a,l,e,t),ss(a)||oe(215),o&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let u=a.getChildAtIndex(s);if(ss(u)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){const e=o?u.getLastDescendant():u.getFirstDescendant();null===e?a=u:(u=e,a=ss(u)?u:u.getParentOrThrow()),s=0}Gr(u)?(i=u,a=null,s=ya(u,o?"next":"previous")):u!==a&&o&&!d&&(ss(a)||oe(216),s=Math.min(a.getChildrenSize(),s+1))}else{const n=a.getIndexWithinParent();s=0===t&&ls(a)&&ro(e)===a?n:n+1,a=a.getParentOrThrow()}if(ss(a))return ti(a.__key,s,"element")}}else i=ro(e);return Gr(i)?ti(i.__key,ya(i,s,"clamp"),"text"):null}function pi(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),s=i.getParent();if(t){if((n||!t)&&null===r&&ss(s)&&s.isInline()){const t=s.getPreviousSibling();Gr(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else ss(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Gr(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(t&&ss(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&ss(s)&&s.isInline()&&!s.canInsertTextAfter()){const t=s.getNextSibling();Gr(t)&&e.set(t.__key,0,"text")}}}function fi(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);pi(e,r,i),pi(t,!r,i),i&&t.set(e.key,e.offset,e.type);const s=Hi();if(s.isComposing()&&s._compositionKey!==e.key&&si(n)){const r=n.anchor,i=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(i.key,i.offset,i.type,!0)}}}function mi(e,t,n,r,i,s){if(null===e||null===n||!Os(i,e,n))return null;const o=gi(e,t,si(s)?s.anchor:null,i);if(null===o)return null;const a=gi(n,r,si(s)?s.focus:null,i);if(null===a)return null;if("element"===o.type&&"element"===a.type){const t=ro(e),r=ro(n);if(ls(t)&&ls(r))return null}return fi(o,a,s),[o,a]}function yi(e){return ss(e)&&!e.isInline()}function _i(e,t,n,r,i,s){const o=Wi(),a=new oi(ti(e,t,i),ti(n,r,s),0,"");return a.dirty=!0,o._selection=a,a}function bi(){const e=ti("root",0,"element"),t=ti("root",0,"element");return new oi(e,t,0,"")}function xi(){return new ii(new Set)}function ki(e,t,n,r){const i=n._window;if(null===i)return null;const s=r||i.event,o=s?s.type:void 0,a="selectionchange"===o,l=!Ke&&(a||"beforeinput"===o||"compositionstart"===o||"compositionend"===o||"click"===o&&s&&3===s.detail||"drop"===o||void 0===o);let c,u,d,h;if(si(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,(a||void 0===o)&&si(e)&&!Os(n,c,u))return e.clone();const g=mi(c,d,u,h,n,e);if(null===g)return null;const[p,f]=g;return new oi(p,f,si(e)?e.format:0,si(e)?e.style:"")}function vi(){return Wi()._selection}function Si(){return Hi()._editorState._selection}function wi(e,t,n,r=1){const i=e.anchor,s=e.focus,o=i.getNode(),a=s.getNode();if(!t.is(o)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),s.set(l,n,"element"),Ci(e)}}else{const o=e.isBackward(),a=o?s:i,c=a.getNode(),u=o?i:s,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}Ci(e)}function Ci(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,s=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!ss(s))return;const e=s.getChildrenSize(),i=n>=e,o=i?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Gr(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}}else{if(ss(s)){const e=s.getChildrenSize(),r=n>=e,i=r?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Gr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(ss(o)){const e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(Gr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Ti(e,t,n,r,i){let s=null,o=0,a=null;null!==r?(s=r.__key,Gr(r)?(o=r.getTextContentSize(),a="text"):ss(r)&&(o=r.getChildrenSize(),a="element")):null!==i&&(s=i.__key,Gr(i)?a="text":ss(i)&&(a="element")),null!==s&&null!==a?e.set(s,o,a):(o=t.getIndexWithinParent(),-1===o&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function Ei(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Ni(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function Ai(e){let t=vi()||Si();null===t&&(t=eo().selectEnd()),t.insertNodes(e)}function Li(e){let t=e;e.isCollapsed()||t.removeText();const n=vi();si(n)&&(t=n),si(t)||oe(161);const r=t.anchor;let i=r.getNode(),s=r.offset;for(;!Ko(i);){const e=i;if([i,s]=Pi(i,s),e.is(i))break}return s}function Pi(e,t){const n=e.getParent();if(!n){const e=_s();return eo().append(e),e.select(),[eo(),0]}if(Gr(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!ss(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new oi(ti(e.__key,t,"element"),ti(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Oi(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){const[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}const s=Pa(e.focus,n?"previous":"next"),o="lineboundary"===r,a="move"===t;let l=s,c="decorators-and-blocks"===i;if(!Ua(l)){for(const e of l){c=!1;const{origin:t}=e;if(!ls(t)||t.isIsolated()||(l=e,!o||!t.isInline()))break}if(c)for(const e of Sa(s).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(da(e))e.origin.isInline()||(l=e);else{if(ss(e.origin))continue;ls(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===s)return!1;if(a&&!o&&ls(l.origin)&&l.origin.isKeyboardSelectable()){const e=xi();return e.add(l.origin.getKey()),no(e),!0}return l=$a(l),a&&Oa(e.anchor,l),Oa(e.focus,l),c||!o}let Fi=null,Ii=null,Ri=!1,Mi=!1,Di=0;const zi={characterData:!0,childList:!0,subtree:!0};function Bi(){return Ri||null!==Fi&&Fi._readOnly}function $i(){Ri&&oe(13)}function Ui(){Di>99&&oe(14)}function Wi(){return null===Fi&&oe(195,Ki()),Fi}function Hi(){return null===Ii&&oe(196,Ki()),Ii}function Ki(){let e=0;const t=new Set,n=Ss.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=Rs(r);if(Fs(i))e++;else if(i){let e=String(i.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function ji(e,t,n){const r=t.__type,i=Es(e,r);let s=n.get(r);void 0===s&&(s=Array.from(i.transforms),n.set(r,s));const o=s.length;for(let e=0;e<o&&(s[e](t),t.isAttached());e++);}function qi(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Ji(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const e of r)n.add(e)}function Vi(e){return Gi(e,Hi()._nodes)}function Gi(e,t){const n=e.type,r=t.get(n);void 0===r&&oe(17,n);const i=r.klass;e.type!==i.getType()&&oe(18,i.name);const s=i.importJSON(e),o=e.children;if(ss(s)&&Array.isArray(o))for(let e=0;e<o.length;e++){const n=Gi(o[e],t);s.append(n)}return s}function Zi(e,t,n){const r=Fi,i=Ri,s=Ii;Fi=t,Ri=!0,Ii=e;try{return n()}finally{Fi=r,Ri=i,Ii=s}}function Yi(e,t){const n=e._pendingEditorState,r=e._rootElement,i=e._headless||null===r;if(null===n)return;const s=e._editorState,o=s._selection,a=n._selection,l=0!==e._dirtyType,c=Fi,u=Ri,d=Ii,h=e._updating,g=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==g){Ii=e,Fi=n,Ri=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;g.disconnect(),p=function(e,t,n,r,i,s){Et="",Lt="",Pt=2===r,_t=n,yt=n._config,bt=n._nodes,xt=_t._listeners.mutation,kt=i,vt=s,St=e._nodeMap,wt=t._nodeMap,Ot=t._readOnly,Ct=new Map(n._keyToDOMMap);const o=new Map;return Tt=o,qt("root",null),_t=void 0,bt=void 0,kt=void 0,vt=void 0,St=void 0,wt=void 0,yt=void 0,Ct=void 0,Tt=void 0,o}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Mi)throw t;return xs(e,null,r,n),Qe(e),e._dirtyType=2,Mi=!0,Yi(e,s),void(Mi=!1)}finally{g.observe(r,zi),e._updating=h,Fi=c,Ri=u,Ii=d}}n._readOnly||(n._readOnly=!0);const f=e._dirtyLeaves,m=e._dirtyElements,y=e._normalizedNodes,_=e._updateTags,b=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let s;for(s in r)i.has(s)||(r===n&&(r=Xs(e)),delete r[s])}(e,n);const x=i?null:Do(Po(e));if(e._editable&&null!==x&&(l||null===a||a.dirty||!a.is(o))&&null!==r&&!_.has(Tr)){Ii=e,Fi=n;try{if(null!==g&&g.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&Mo(t,e,r),function(e,t,n,r,i,s){const o=r.anchorNode,a=r.focusNode,l=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(i.has(wr)&&u!==s||null!==u&&Ps(u))return;if(!si(t))return void(null!==e&&Os(n,o,a)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,f=Co(n,g),m=Co(n,p),y=d.offset,_=h.offset,b=t.format,x=t.style,k=t.isCollapsed();let v=f,S=m,w=!1;if("text"===d.type){v=Us(f);const e=d.getNode();w=e.getFormat()!==b||e.getStyle()!==x}else si(e)&&"text"===e.anchor.type&&(w=!0);var C,T,E,N,A;if("text"===h.type&&(S=Us(m)),null!==v&&null!==S&&(k&&(null===e||w||si(e)&&(e.format!==b||e.style!==x))&&(C=b,T=x,E=y,N=g,A=performance.now(),ir=[C,T,E,N,A]),l!==y||c!==_||o!==v||a!==S||"Range"===r.type&&k||(null!==u&&s.contains(u)||i.has(Er)||s.focus({preventScroll:!0}),"element"===d.type))){if(Ni(r,v,y,S,_),!i.has(Cr)&&t.isCollapsed()&&null!==s&&s===document.activeElement){const e=si(t)&&"element"===t.anchor.type?v.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=Eo(n),i=Lo(r);if(null===r||null===i)return;let{top:s,bottom:o}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Po(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(s<a?n=-(a-s):o>l&&(n=o-l),0!==n)if(t)i.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;s-=t,o-=t}if(t)break;c=To(c)}}(n,t,s)}}Yn=!0}}(o,a,e,x,_,r)}!function(e,t,n){let r=e._blockCursorElement;if(si(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const i=n.anchor,s=i.getNode(),o=i.offset;let a=!1,l=null;if(o===s.getChildrenSize())Ro(s.getChildAtIndex(o-1))&&(a=!0);else{const t=s.getChildAtIndex(o);if(null!==t&&Ro(t)){const n=t.getPreviousSibling();(null===n||Ro(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(s.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=be(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Mo(r,e,t)}(e,r,a)}finally{null!==g&&g.observe(r,zi),Ii=d,Fi=c}}null!==p&&function(e,t,n,r,i){const s=Array.from(e._listeners.mutation),o=s.length;for(let e=0;e<o;e++){const[o,a]=s[e];for(const e of a){const s=t.get(e);void 0!==s&&o(s,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,p,_,f,s),si(a)||null===a||null!==o&&o.is(a)||e.dispatchCommand(Yt,void 0);const k=e._pendingDecorators;null!==k&&(e._decorators=k,e._pendingDecorators=null,Xi("decorator",e,!0,k)),function(e,t,n){const r=Qs(t),i=Qs(n);r!==i&&Xi("textcontent",e,!0,i)}(e,t||s,n),Xi("update",e,!0,{dirtyElements:m,dirtyLeaves:f,editorState:n,mutatedNodes:p,normalizedNodes:y,prevEditorState:t||s,tags:_}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,b),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;es(e,t,r)}}}(e)}function Xi(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function Qi(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t,s=e._pendingEditorState;let o;void 0!==i&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(null===s&&oe(191),s._flushSync=!0),o&&e._deferred.push(o),Ji(e,i.tag)),null==s?es(e,n,i):n()}}return r}function es(e,t,n){const r=e._updateTags;let i,s=!1,o=!1;void 0!==n&&(i=n.onUpdate,Ji(e,n.tag),s=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let l=e._pendingEditorState,c=!1;(null===l||l._readOnly)&&(l=e._pendingEditorState=ds(l||a),c=!0),l._flushSync=o;const u=Fi,d=Ri,h=Ii,g=e._updating;Fi=l,Ri=!1,e._updating=!0,Ii=e;const p=e._headless||null===e.getRootElement();Cs(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=Do(Po(e));return si(n)||null==n?ki(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),s=Qi(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(si(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),0!==e._dirtyType&&(s?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Gr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&pt(t)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,s=Js(),o=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);Gr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&pt(r),void 0!==r&&qi(r,s)&&ji(t,r,o),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Di++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,c.delete("root")&&c.set("root",!0);for(const e of c){const n=e[0],a=e[1];if(r.set(n,a),!a)continue;const l=i.get(n);void 0!==l&&qi(l,s)&&ji(t,l,o)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Di++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Qi(e),function(e,t,n,r){const i=e._nodeMap,s=t._nodeMap,o=[];for(const[e]of r){const t=s.get(e);void 0!==t&&(t.isAttached()||(ss(t)&&He(t,e,i,s,o,r),i.has(e)||r.delete(e),o.push(e)))}for(const e of o)s.delete(e);for(const e of n){const t=s.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),s.delete(e))}}(a,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);const i=l._selection;if(si(i)){const e=l._nodeMap,t=i.anchor.key,n=i.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||oe(19)}else ai(i)&&0===i._nodes.size&&(l._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Yi(e)}finally{Fi=u,Ri=d,Ii=h,e._updating=g,Di=0}const f=0!==e._dirtyType||e._deferred.length>0||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(l,e);f?l._flushSync?(l._flushSync=!1,Yi(e)):c&&As((()=>{Yi(e)})):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function ts(e,t,n){Ii===e&&void 0===n?t():es(e,t,n)}class ns{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new ns(this.element,e,this.after)}withAfter(e){return new ns(this.element,this.before,e)}withElement(e){return this.element===e?this:new ns(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return null!==t&&t.parentElement!==this.element&&oe(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&oe(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&oe(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(_e||pe||ge);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),e){const e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){const t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}const i=rs(t,n);i.push(r);const s=rs(t,this.element);let o=e.getIndexWithinParent();for(let e=0;e<s.length;e++){const t=i[e],n=s[e];if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function rs(e,t){const n=[];let r=t;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return r!==e&&oe(225),n.reverse()}class is extends kr{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Be[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Hi()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Gr(t)&&e.push(t),ss(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ss(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ss(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return ss(e)&&e.getLastDescendant()||e||null}const r=t[e];return ss(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Vs(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&oe(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Vs(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&oe(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),ss(i)&&r!==n-1&&!i.isInline()&&(e+=Le)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),ss(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){const t=ze[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=Me[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return Ws(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){$i();const n=vi();let r=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Gr(e)||ss(e))return e.select(0,0)}else if(!(void 0!==e&&e!==s||void 0!==t&&t!==s)){const e=this.getLastChild();if(Gr(e)||ss(e))return e.select()}void 0===r&&(r=s),void 0===i&&(i=s);const o=this.__key;return si(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):_i(o,r,o,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?ze[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){xr(this)&&oe(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||oe(226,String(e),String(t),String(r));const s=i.__key,o=[],a=[],l=this.getChildAtIndex(e+t);let c=null,u=r-t+n.length;if(0!==e)if(e===r)c=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(c=t.getPreviousSibling())}if(t>0){let e=null===c?this.getFirstChild():c.getNextSibling();for(let n=0;n<t;n++){null===e&&oe(100);const t=e.getNextSibling(),n=e.__key;Ks(e.getWritable()),a.push(n),e=t}}let d=c;for(const e of n){null!==d&&e.is(d)&&(c=d=d.getPreviousSibling());const t=e.getWritable();t.__parent===s&&u--,Ks(t);const n=e.__key;if(null===d)i.__first=n,t.__prev=null;else{const e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===s&&oe(76),t.__parent=s,o.push(n),d=e}if(e+t===r)null!==d&&(d.getWritable().__next=null,i.__last=d.__key);else if(null!==l){const e=l.getWritable();if(null!==d){const t=d.getWritable();e.__prev=d.__key,t.__next=l.__key}else e.__prev=null}if(i.__size=u,a.length){const e=vi();if(si(e)){const t=new Set(a),n=new Set(o),{anchor:r,focus:i}=e;os(r,t,n)&&Ti(r,r.getNode(),this,c,l),os(i,t,n)&&Ti(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||Oo(this)||this.remove()}}return i}getDOMSlot(e){return new ns(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){const e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");const n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){const i=t.getElementByKey(e.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function ss(e){return e instanceof is}function os(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class as extends kr{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ls(e){return e instanceof as}class cs extends is{__cachedText;static getType(){return"root"}static clone(){return new cs}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){oe(51)}getTextContent(){const e=this.__cachedText;return!Bi()&&0!==Hi()._dirtyType||null===e?super.getTextContent():e}remove(){oe(52)}replace(e){oe(53)}insertBefore(e){oe(54)}insertAfter(e){oe(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const e of n)ss(e)||ls(e)||oe(282);return super.splice(e,t,n)}static importJSON(e){return eo().updateFromJSON(e)}collapseAtStart(){return!0}}function us(e){return e instanceof cs}function ds(e){return new ps(new Map(e._nodeMap))}function hs(){return new ps(new Map([["root",new cs]]))}function gs(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&oe(130,n.name),ss(e)){const r=t.children;Array.isArray(r)||oe(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=gs(i[e]);r.push(t)}}return t}class ps{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return Zi(t&&t.editor||null,this,e)}clone(e){const t=new ps(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Zi(null,this,(()=>({root:gs(eo())})))}}class fs extends is{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class ms extends is{static getType(){return"paragraph"}static clone(e){return new ms(e.__key)}createDOM(e){const t=document.createElement("p"),n=_o(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:ys,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return _s().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){const n=_s();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Gr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function ys(e){const t=_s();return e.style&&(t.setFormat(e.style.textAlign),Zo(e,t)),{node:t}}function _s(){return Fo(new ms)}function bs(e){return e instanceof ms}function xs(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=hs(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const s=e._observer;null!==s&&(s.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function ks(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:e}=Qo(r),i=r.transform;if(!n.has(i)){n.add(i);const e=r.transform();e&&t.add(e)}if(e){const n=e.$transform;n&&t.add(n),r=e.extends}else{const e=Object.getPrototypeOf(r);r=e.prototype instanceof kr&&e!==kr?e:void 0}}return t}function vs(e){const t=e||{},n=Ii,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,s=t.disableEvents||!1,o=hs(),a=t.namespace||(null!==i?i._config.namespace:oo()),l=t.editorState,c=[cs,Br,Nr,Yr,ms,fs,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let g;if(void 0===e&&null!==n)g=n._nodes;else{g=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}Qo(t);const i=t.getType(),s=ks(t);g.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:rt(c[e]),transforms:s})}}const p=new Ss(o,i,g,{disableEvents:s,namespace:a,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)})),t&&i(t),n}(g,d?d.import:void 0),h,e);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=2),p}class Ss{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,s,o,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=oo(),this._onError=i,this._htmlConversions=s,this._editable=o,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&oe(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(e);void 0===i&&oe(36,String(e));const s=i[n];return s.add(t),()=>{s.delete(t),i.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let s=i.get(t);void 0===s&&(s=new Set,i.set(t,s)),s.add(r);const o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(t,r),()=>{s.delete(r),0===s.size&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&oe(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=Vo(n).get(t.getType());if(!r)return;const i=new Map;for(const e of r.keys())i.set(e,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){const n=Vo(e.getEditorState()),r=[];for(const e of t){const t=n.get(e);t&&r.push(t)}0!==r.length&&e.update((()=>{for(const e of r)for(const t of e.keys()){const e=Vs(t);e&&e.markDirty()}}),null===e._pendingEditorState?{tag:Sr}:void 0)}(this,r.map((e=>e.klass.getType()))),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return So(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=_o(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,xs(this,t,e,r),null!==t&&(this._config.disableEvents||yr(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Lo(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,Qe(this),this._updateTags.add(Sr),Yi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;Gn.set(e,n);const r=Zn.get(n)??0;r<1&&n.addEventListener("selectionchange",pr),Zn.set(n,r+1),e.__lexicalEditor=t;const i=hr(e);for(let n=0;n<Kn.length;n++){const[r,s]=Kn[n],o="function"==typeof s?e=>{mr(e)||(fr(e),(t.isEditable()||"click"===r)&&s(e,t))}:e=>{if(mr(e))return;fr(e);const n=t.isEditable();switch(r){case"cut":return n&&So(t,In,e);case"copy":return So(t,Fn,e);case"paste":return n&&So(t,sn,e);case"dragstart":return n&&So(t,Ln,e);case"dragover":return n&&So(t,Pn,e);case"dragend":return n&&So(t,On,e);case"focus":return n&&So(t,$n,e);case"blur":return n&&So(t,Un,e);case"drop":return n&&So(t,Nn,e)}};e.addEventListener(r,o),i.push((()=>{e.removeEventListener(r,o)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Sr),Yi(this);Xi("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&oe(38);let n=e;n._readOnly&&(n=ds(e),n._selection=e._selection?e._selection.clone():null),Xe(this);const r=this._pendingEditorState,i=this._updateTags,s=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=s&&i.add(s),Yi(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&i.add(s),this._updating||Yi(this)}parseEditorState(e,t){return function(e,t,n){const r=hs(),i=Fi,s=Ri,o=Ii,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Fi=r,Ri=!1,Ii=t,Cs(null);try{const i=t._nodes;Gi(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,Fi=i,Ri=s,Ii=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Yi(this),this.getEditorState().read(e,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):es(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),ts(this,(()=>{const r=vi(),i=eo();null!==r?r.dirty||no(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),No("focus"),function(e){$i(),Hi()._deferred.push(e)}((()=>{n.removeAttribute("autocapitalize"),e&&e()}))})),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Do(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Xi("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ss.version="0.38.2+prod.esm";let ws=null;function Cs(e){ws=e}let Ts=1;function Es(e,t){const n=Ns(e,t);return void 0===n&&oe(30,t),n}function Ns(e,t){return e._nodes.get(t)}const As="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Ls(e){return ls(Ys(e))}function Ps(e){const t=document.activeElement;if(!Bo(t))return!1;const n=t.nodeName;return ls(Ys(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Rs(t))}function Os(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Ps(t)&&Is(t)===e}catch(e){return!1}}function Fs(e){return e instanceof Ss}function Is(e){let t=e;for(;null!=t;){const e=Rs(t);if(Fs(e))return e;t=To(t)}return null}function Rs(e){return e?e.__lexicalEditor:null}function Ms(e){return Ie.test(e)?"rtl":Re.test(e)?"ltr":null}function Ds(e){return Qr(e)||e.isToken()}function zs(e){return Ds(e)||e.isSegmented()}function Bs(e){return $o(e)&&3===e.nodeType}function $s(e){return $o(e)&&9===e.nodeType}function Us(e){let t=e;for(;null!=t;){if(Bs(t))return t;t=t.firstChild}return null}function Ws(e,t,n){const r=Me[t];if(null!==n&&(e&r)===(n&r))return e;let i=e^r;return"subscript"===t?i&=-65:"superscript"===t?i&=-33:"lowercase"===t?(i&=-513,i&=-1025):"uppercase"===t?(i&=-257,i&=-1025):"capitalize"===t&&(i&=-257,i&=-513),i}function Hs(e){return Gr(e)||Pr(e)||ls(e)}function Ks(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),s=e.getNextSibling(),o=null!==s?s.__key:null,a=null!==i?i.__key:null,l=null!==i?i.getWritable():null,c=null!==s?s.getWritable():null;null===i&&(r.__first=o),null===s&&(r.__last=a),null!==l&&(l.__next=o),null!==c&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function js(e){Ui(),xr(e)&&oe(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Wi(),i=Hi(),s=r._nodeMap,o=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,s,o);const a=t.__key;i._dirtyType=1,ss(e)?o.set(a,!0):i._dirtyLeaves.add(a)}function qs(e){$i();const t=Hi(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Vs(n);null!==e&&e.getWritable()}if(null!==e){const t=Vs(e);null!==t&&t.getWritable()}}}function Js(){return Bi()?null:Hi()._compositionKey}function Vs(e,t){const n=(t||Wi())._nodeMap.get(e);return void 0===n?null:n}function Gs(e,t){const n=Zs(e,Hi());return void 0!==n?Vs(n,t):null}function Zs(e,t){return e[`__lexicalKey_${t._key}`]}function Ys(e,t){let n=e;for(;null!=n;){const e=Gs(n,t);if(null!==e)return e;n=To(n)}return null}function Xs(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Qs(e){return e.read((()=>eo().getTextContent()))}function eo(){return to(Wi())}function to(e){return e._nodeMap.get("root")}function no(e){$i();const t=Wi();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function ro(e){const t=Hi(),n=function(e,t){let n=e;for(;null!=n;){const e=Zs(n,t);if(void 0!==e)return e;n=To(n)}return null}(e,t);return null===n?e===t.getRootElement()?Vs("root"):null:Vs(n)}function io(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function so(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function oo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function ao(e){return Bs(e)?e.nodeValue:null}function lo(e,t,n){const r=Do(Po(t));if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let t=ao(i);const r=Ys(i);if(null!==t&&Gr(r)){if(t===Ae&&n){const e=n.length;t=n,s=e,o=e}null!==t&&co(r,t,s,o,e)}}}function co(e,t,n,r,i){let s=e;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let a=t;(o||i)&&t[t.length-1]===Ae&&(a=t.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(""===a){if(qs(null),ge||pe||_e)s.remove();else{const e=Hi();setTimeout((()=>{e.update((()=>{s.isAttached()&&s.remove()}))}),20)}return}const t=s.getParent(),i=Si(),l=s.getTextContentSize(),c=Js(),u=s.getKey();if(s.isToken()||null!==c&&u===c&&!o||si(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!s.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===l&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const d=vi();if(!si(d)||null===n||null===r)return void uo(s,a,d);if(d.setTextNodeRange(s,n,s,r),s.isSegmented()){const e=Vr(s.getTextContent());s.replace(e),s=e}uo(s,a,d)}}}function uo(e,t,n){if(e.setTextContent(t),si(n)){const t=e.getKey();for(const r of["anchor","focus"]){const i=n[r];"text"===i.type&&i.key===t&&(i.offset=ya(e,i.offset,"clamp"))}}}function ho(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function go(e,t,n){return function(e,t){return ho(e,t,"altKey")&&ho(e,t,"ctrlKey")&&ho(e,t,"shiftKey")&&ho(e,t,"metaKey")}(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const po={ctrlKey:!ue,metaKey:ue},fo={altKey:ue,ctrlKey:!ue};function mo(e){return"Backspace"===e.key}function yo(e){return go(e,"a",po)}function _o(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=be(i);return n[t]=e,e}return i}function bo(e,t,n,r,i){if(0===n.size)return;const s=r.__type,o=r.__key,a=t.get(s);void 0===a&&oe(33,s);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(o),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(o,d?"updated":i)}function xo(e,t,n){const r=e.getParent();let i=n,s=e;return null!==r&&(t&&0===n?(i=s.getIndexWithinParent(),s=r):t||n!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(t?i-1:i)}function ko(e,t){const n=e.offset;if("element"===e.type)return xo(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?xo(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function vo(e){const t=Po(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function So(e,t,n){return function(e,t,n){const r=so(e);for(let i=4;i>=0;i--)for(let s=0;s<r.length;s++){const o=r[s],a=o._commands.get(t);if(void 0!==a){const t=a[i];if(void 0!==t){const r=Array.from(t),i=r.length;let s=!1;if(ts(o,(()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(s=!0)})),s)return s}}}return!1}(e,t,n)}function wo(e){return!us(e)&&!e.isLastChild()&&!e.isInline()}function Co(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&oe(75,t),n}function To(e){const t=e.assignedSlot||e.parentElement;return Uo(t)?t.host:t}function Eo(e){return $s(e)?e:Bo(e)?e.ownerDocument:null}function No(e){$i(),Hi()._updateTags.add(e)}function Ao(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Lo(e){const t=Eo(e);return t?t.defaultView:null}function Po(e){const t=e._window;return null===t&&oe(78),t}function Oo(e){return us(e)||ss(e)&&e.isShadowRoot()}function Fo(e){const t=Hi(),n=e.getType(),r=Ns(t,n);void 0===r&&oe(200,e.constructor.name,n);const{replace:i,replaceWithKlass:s}=r;if(null!==i){const t=i(e),r=t.constructor;return null!==s?t instanceof s||oe(201,s.name,s.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||oe(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&oe(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Io(e,t){!us(e.getParent())||ss(t)||ls(t)||oe(99)}function Ro(e){return(ls(e)||ss(e)&&!e.canBeEmpty())&&!e.isInline()}function Mo(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Do(e){return le?(e||window).getSelection():null}function zo(e){return Bo(e)&&"A"===e.tagName}function Bo(e){return $o(e)&&1===e.nodeType}function $o(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Uo(e){return $o(e)&&11===e.nodeType}function Wo(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Ho(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function Ko(e){if(ls(e)&&!e.isInline())return!0;if(!ss(e)||Oo(e))return!1;const t=e.getFirstChild(),n=null===t||Pr(t)||Gr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function jo(){return Hi()}const qo=new WeakMap,Jo=new Map;function Vo(e){if(!e._readOnly&&e.isEmpty())return Jo;e._readOnly||oe(192);let t=qo.get(e);return t||(t=function(e){const t=new Map;for(const[n,r]of e._nodeMap){const e=r.__type;let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),qo.set(e,t)),t}function Go(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Zo(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Yo(e){return!0===e.__lexicalUnmanaged}function Xo(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==kr[t]}function Qo(e){const t=We in e.prototype?e.prototype[We]():void 0,n=function(e){if(!(e===kr||e.prototype instanceof kr)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(e){}try{Ss.version&&(n=JSON.parse(Ss.version))}catch(e){}oe(290,e.name,t,n)}return e===as||e===is||e===kr}(e),r=!n&&Xo(e,"getType")?e.getType():void 0;let i,s=r;if(t)if(r)i=t[r];else for(const[e,n]of Object.entries(t))s=e,i=n;if(!n&&s&&(Xo(e,"getType")||(e.getType=()=>s),Xo(e,"clone")||(e.clone=t=>(Cs(t),new e)),Xo(e,"importJSON")||(e.importJSON=i&&i.$importJSON||(t=>(new e).updateFromJSON(t))),!Xo(e,"importDOM")&&i)){const{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:s}}const ea=(e,t)=>{let n=e;for(;null!=n&&!us(n);){if(t(n))return n;n=n.getParent()}return null},ta={next:"previous",previous:"next"};class na{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Ca({hasNext:ua,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return fa(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return fa(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const s=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();null!==t&&o.size<e;t=t.getAdjacentCaret()){const e=t.origin.getWritable();o.set(e.getKey(),e)}for(const e of r){if(o.size>0){const t=i.getNodeAtCaret();if(t)if(o.delete(t.getKey()),o.delete(e.getKey()),t.is(e)||i.origin.is(e));else{const n=e.getParent();n&&n.is(s)&&e.remove(),t.replace(e)}else null===t&&oe(263,Array.from(o).join(" "))}else i.insert(e);i=fa(e,this.direction)}for(const e of o.values())e.remove();return this}}class ra extends na{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ba(e,this.direction)}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=sa(this.direction);return fa(this.getNodeAtCaret(),e)||ba(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof ra&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const ia={root:us,shadowRoot:Oo};function sa(e){return ta[e]}function oa(e,t="root"){return ia[t](e)?null:e}class aa extends na{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:fa(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return ss(this.origin)?ba(this.origin,this.direction):null}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=sa(this.direction);return fa(this.getNodeAtCaret(),e)||ba(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof aa&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof aa||e instanceof la)&&this.direction===e.direction&&this.origin.is(e.origin)}}class la extends na{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ma(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){return ma(this.origin,sa(this.direction),this.offset)}isSamePointCaret(e){return e instanceof la&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof aa||e instanceof la)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return fa(this.origin,this.direction)}}function ca(e){return e instanceof la}function ua(e){return e instanceof aa}function da(e){return e instanceof ra}const ha={next:class extends la{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends la{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ga={next:class extends aa{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends aa{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pa={next:class extends ra{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends ra{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function fa(e,t){return e?new ga[t](e):null}function ma(e,t,n){return e?new ha[t](e,ya(e,n)):null}function ya(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&ae(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function _a(e,t){return new va(e,t)}function ba(e,t){return ss(e)?new pa[t](e):null}function xa(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class ka{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new ka(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return ca(t)?function(e,t){const{direction:n,origin:r}=e;return _a(e,ya(r,"focus"===t?sa(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){const{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[_a(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=ca(n),i=t=>t.isSameNodeCaret(n)?null:xa(t)||t.getParentCaret(e);return Ca({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class va{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return ma(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function Sa(e){return wa(e,fa(eo(),e.direction))}function wa(e,t){return e.direction!==t.direction&&oe(265),new ka(e,t,e.direction)}function Ca(e){const{initial:t,hasNext:n,step:r,map:i}=e;let s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};const e={done:!1,value:i(s)};return s=r(s),e}}}function Ta(e,t){const n=La(e.origin,t.origin);switch(null===n&&oe(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const n="text"===e.type,r="text"===t.type;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return Ea(n)}}function Ea(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let s=t,o=n;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return null===s?1:-1}function Na(e,t){return t.is(e)}function Aa(e){return ss(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function La(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[t,r]=Aa(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Aa(t);r;i=r,r=r.getParent()){const s=n.get(r);if(void 0!==s)return null===s?(Na(e,r)||oe(276),{commonAncestor:r,type:"ancestor"}):null===i?(Na(t,r)||oe(277),{commonAncestor:r,type:"descendant"}):((ss(s)||Na(e,s))&&(ss(i)||Na(t,i))&&r.is(s.getParent())&&r.is(i.getParent())||oe(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function Pa(e,t){const{type:n,key:r,offset:i}=e,s=function(e){const t=Vs(e);return null===t&&oe(63,e),t}(e.key);return"text"===n?(Gr(s)||oe(266,s.getType(),r),ma(s,t,i)):(ss(s)||oe(267,s.getType(),r),function(e,t,n){let r=ba(e,"next");for(let e=0;e<t;e++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return Wa(r,n)}(s,e.offset,t))}function Oa(e,t){const{origin:n,direction:r}=t,i="next"===r;ca(t)?e.set(n.getKey(),t.offset,"text"):ua(t)?Gr(n)?e.set(n.getKey(),ya(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(da(t)&&ss(n)||oe(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Fa(e){const t=vi(),n=si(t)?t:bi();return Ia(n,e),no(n),n}function Ia(e,t){Oa(e.anchor,t.anchor),Oa(e.focus,t.focus)}function Ra(e){const{anchor:t,focus:n}=e,r=Pa(t,"next"),i=Pa(n,"next"),s=Ta(r,i)<=0?"next":"previous";return wa(Wa(r,s),Wa(i,s))}function Ma(e){const{direction:t,origin:n}=e,r=fa(n,sa(t)).getNodeAtCaret();return r?fa(r,t):ba(n.getParentOrThrow(),t)}function Da(e,t="root"){const n=[e];for(let r=da(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Ma(r));return n}function za(e){return!!e&&e.origin.isAttached()}function Ba(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const s=Ha(e,r),o=Da(s.anchor,n),a=Da(s.focus.getFlipped(),n),l=new Set,c=[];for(const e of s.iterNodeCarets(n))if(da(e))l.add(e.origin.getKey());else if(ua(e)){const{origin:t}=e;ss(t)&&!l.has(t.getKey())||c.push(t)}for(const e of c)e.remove();for(const e of s.getTextSlices()){if(!e)continue;const{origin:t}=e.caret,n=t.getTextContentSize(),s=Ma(fa(t,r)),l=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===i||"token"===l&&0!==e.distance)s.remove();else if(0!==e.distance){i="removeEmptySlices";let t=e.removeTextSlice();const n=e.caret.origin;if("segmented"===l){const e=t.origin,n=Vr(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());s.replaceOrInsert(n),t=ma(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(a[0].origin)&&(a[0]=t.getFlipped())}}let u,d;for(const e of o)if(za(e)){u=$a(e);break}for(const e of a)if(za(e)){d=$a(e);break}const h=function(e,t,n){if(!e||!t)return null;const r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;const s=r.getParents().reverse();s.push(r);const o=i.getParents().reverse();o.push(i);const a=Math.min(s.length,o.length);let l;for(l=0;l<a&&s[l]===o[l];l++);const c=(e,t)=>{let n;for(let r=l;r<e.length;r++){const i=e[r];if(Oo(i))return;!n&&t(i)&&(n=i)}return n},u=c(s,Ko),d=u&&c(o,(e=>n.has(e.getKey())&&Ko(e)));return u&&d?[u,d]:null}(u,d,l);if(h){const[e,t]=h;ba(e,"previous").splice(0,t.getChildren()),t.remove()}const g=[u,d,...o,...a].find(za);if(g)return function(e){return wa(e,e)}(Wa($a(g),e.direction));oe(269,JSON.stringify(o.map((e=>e.origin.__key))))}function $a(e){const t=function(e){let t=e;for(;da(t);){const e=xa(t);if(!da(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Gr(t.origin))return ca(t)?t:ma(t.origin,n,n);const r=t.getAdjacentCaret();return ua(r)&&Gr(r.origin)?ma(r.origin,n,sa(n)):t}function Ua(e){return ca(e)&&e.offset!==ya(e.origin,e.direction)}function Wa(e,t){return e.direction===t?e:e.getFlipped()}function Ha(e,t){return e.direction===t?e:wa(Wa(e.focus,t),Wa(e.anchor,t))}function Ka(){const e=document.head.querySelector("meta[name=csp-nonce]");return e?.content}const ja=new Map;function qa(e){const t={};if(!e)return t;const n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Ja(e){let t=ja.get(e);return void 0===t&&(t=qa(e),ja.set(e,t)),t}function Va(e){const t=jo().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function Ga(e){return Va(us(e)?e:e.getParentOrThrow())}function Za(e){const t=Ga(e);return null!==t&&"rtl"===t.direction}function Ya(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!zs(t)&&null!==r){const[i,s]=r,o=e.isBackward(),a=i.getNode(),l=s.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[r,i]=ci(e),s=a.is(l),c=t.is(o?l:a),u=t.is(o?a:l);let d,h=0;s?(h=r>i?i:r,d=r>i?r:i):c?(h=o?i:r,d=void 0):u&&(h=0,d=o?r:i);const g=t.__text.slice(h,d);g!==t.__text&&("clone"===n&&(t=function(e){return(t=Go(e))[br]=!0,t;var t}(t)),t.__text=g)}}return t}function Xa(e){const t=e.getStyle(),n=qa(t);ja.set(t,n)}function Qa(e){const t=el(e);return null!==t&&"vertical-rl"===t.writingMode}function el(e){const t=e.anchor.getNode();return ss(t)?Va(t):Ga(t)}function tl(e,t){let n=Qa(e)?!t:t;nl(e)&&(n=!n);const r=Pa(e.focus,n?"previous":"next");if(Ua(r))return!1;for(const e of Sa(r)){if(da(e))return!e.origin.isInline();if(!ss(e.origin)){if(ls(e.origin))return!0;break}}return!1}function nl(e){const t=el(e);return null!==t&&"rtl"===t.direction}function rl(e,t,n){const r=nl(e);let i;i=Qa(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}const il="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,sl=il&&"documentMode"in document?document.documentMode:null;function ol(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function al(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ll(e,...t){const n=ol(...t);n.length>0&&e.classList.add(...n)}function cl(e,...t){const n=ol(...t);n.length>0&&e.classList.remove(...n)}function ul(e){return e?e.getAdjacentCaret():null}function dl(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function hl(e){const t=ea(e,(e=>ss(e)&&!e.isInline()));return ss(t)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t}function gl(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}il&&"InputEvent"in window&&!sl&&new window.InputEvent("input");const pl=Symbol.for("preact-signals");function fl(){if(bl>1)return void bl--;let e,t=!1;for(;void 0!==yl;){let n=yl;for(yl=void 0,xl++;void 0!==n;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Cl(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(xl=0,bl--,t)throw e}let ml,yl;function _l(e){const t=ml;ml=void 0;try{return e()}finally{ml=t}}let bl=0,xl=0,kl=0;function vl(e){if(void 0===ml)return;let t=e.n;return void 0===t||t.t!==ml?(t={i:0,S:e,p:ml.s,n:void 0,t:ml,e:void 0,x:void 0,r:t},void 0!==ml.s&&(ml.s.n=t),ml.s=t,e.n=t,32&ml.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=ml.s,t.n=void 0,ml.s.n=t,ml.s=t),t):void 0}function Sl(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function wl(e,t){return new Sl(e,t)}function Cl(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Tl(e){for(let t=e.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function El(e){let t,n=e.s;for(;void 0!==n;){const e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function Nl(e,t){Sl.call(this,void 0),this.x=e,this.s=void 0,this.g=kl-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Al(e){const t=e.u;if(e.u=void 0,"function"==typeof t){bl++;const n=ml;ml=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Ll(e),t}finally{ml=n,fl()}}}function Ll(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Al(e)}function Pl(e){if(ml!==this)throw new Error("Out-of-order effect");El(this),ml=e,this.f&=-2,8&this.f&&Ll(this),fl()}function Ol(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function Fl(e,t){const n=new Ol(e,t);try{n.c()}catch(e){throw n.d(),e}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Sl.prototype.brand=pl,Sl.prototype.h=function(){return!0},Sl.prototype.S=function(e){const t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:_l((()=>{var e;null==(e=this.W)||e.call(this)})))},Sl.prototype.U=function(e){if(void 0!==this.t){const t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&_l((()=>{var e;null==(e=this.Z)||e.call(this)})))}},Sl.prototype.subscribe=function(e){return Fl((()=>{const t=this.value,n=ml;ml=void 0;try{e(t)}finally{ml=n}}),{name:"sub"})},Sl.prototype.valueOf=function(){return this.value},Sl.prototype.toString=function(){return this.value+""},Sl.prototype.toJSON=function(){return this.value},Sl.prototype.peek=function(){const e=ml;ml=void 0;try{return this.value}finally{ml=e}},Object.defineProperty(Sl.prototype,"value",{get(){const e=vl(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(xl>100)throw new Error("Cycle detected");this.v=e,this.i++,kl++,bl++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{fl()}}}}),Nl.prototype=new Sl,Nl.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===kl)return!0;if(this.g=kl,this.f|=1,this.i>0&&!Cl(this))return this.f&=-2,!0;const e=ml;try{Tl(this),ml=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ml=e,El(this),this.f&=-2,!0},Nl.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}Sl.prototype.S.call(this,e)},Nl.prototype.U=function(e){if(void 0!==this.t&&(Sl.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Nl.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(Nl.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=vl(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ol.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},Ol.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Al(this),Tl(this),bl++;const e=ml;return ml=this,Pl.bind(this,e)},Ol.prototype.N=function(){2&this.f||(this.f|=2,this.o=yl,yl=this)},Ol.prototype.d=function(){this.f|=8,1&this.f||Ll(this)},Ol.prototype.dispose=function(){this.d()};new Set;Symbol.for("@lexical/extension/LexicalBuilder");function Il(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Rl(e){let t=e.getParent();sc(t)||Il(40);let n=t;for(;null!==n;)n=n.getParent(),sc(n)&&(t=n);return t}function Ml(e){let t=[];const n=e.getChildren().filter(Xl);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();sc(i)?t=t.concat(Ml(i)):t.push(r)}return t}function Dl(e){return Xl(e)&&sc(e.getFirstChild())}function zl(e){return Yl().append(e)}function Bl(e,t){return Xl(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function $l(e){const t=vi();if(null!==t){let n=t.getNodes();if(si(t)){const r=t.getStartEndPoints();null===r&&Il(143);const[i]=r,s=i.getNode(),o=s.getParent();if(Oo(s)){const e=s.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=_s();s.append(e),n=e.select().getNodes()}}else if(Bl(s,n)){const t=ic(e);if(Oo(o)){s.replace(t);const e=Yl();ss(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(Xl(s)){const e=s.getParentOrThrow();Ul(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(ss(i)&&i.isEmpty()&&!Xl(i)&&!r.has(i.getKey())){Wl(i,e);continue}let s=Hs(i)?i.getParent():Xl(i)&&i.isEmpty()?i:null;for(;null!=s;){const t=s.getKey();if(sc(s)){if(!r.has(t)){const n=ic(e);Ul(n,s.getChildren()),s.replace(n),r.add(t)}break}{const n=s.getParent();if(Oo(n)&&!r.has(t)){r.add(t),Wl(s,e);break}s=n}}}}}function Ul(e,t){e.splice(e.getChildrenSize(),0,t)}function Wl(e,t){if(sc(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=Yl();let s;if(Ul(i,e.getChildren()),sc(n)&&t===n.getListType())n.append(i),sc(r)&&t===r.getListType()&&(Ul(n,r.getChildren()),r.remove()),s=n;else if(sc(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const n=ic(t);n.append(i),e.replace(n),s=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),s}function Hl(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Dl(n)&&Dl(r)&&(Hl(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Kl(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())Xl(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),sc(r.getFirstChild())||n++)}function jl(e){const t=new Set;if(Dl(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Dl(r)&&Dl(i)){const n=i.getFirstChild();if(sc(n)){n.append(e);const i=r.getFirstChild();sc(i)&&(Ul(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Dl(r)){const t=r.getFirstChild();if(sc(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(Dl(i)){const t=i.getFirstChild();sc(t)&&t.append(e)}else if(sc(n)){const t=Yl().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=ic(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(s),s.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ql(e){if(Dl(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(sc(n?n.getParent():void 0)&&Xl(n)&&sc(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=Yl(),s=ic(r);i.append(s),e.getPreviousSiblings().forEach((e=>s.append(e)));const o=Yl(),a=ic(r);o.append(a),Ul(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Jl(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let Vl=class extends is{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(null==e.__checked)return;const t=e.getParent();sc(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)},extends:is,importDOM:{li:()=>({conversion:Gl,priority:0})}})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t,n){const r=t.getParent();!sc(r)||"check"!==r.getListType()||sc(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this,e),t.value=this.__value,function(e,t,n){const r=[],i=[],s=t.list,o=s?s.listitem:void 0;let a;if(s&&s.nested&&(a=s.nested.listitem),void 0!==o&&r.push(...Jl(o)),s){const e=n.getParent(),t=sc(e)&&"check"===e.getListType(),o=n.getChecked();t&&!o||i.push(s.listitemUnchecked),t&&o||i.push(s.listitemChecked),t&&r.push(o?s.listitemChecked:s.listitemUnchecked)}if(void 0!==a){const e=Jl(a);n.getChildren().some((e=>sc(e)))?r.push(...e):i.push(...e)}i.length>0&&cl(e,...i),r.length>0&&ll(e,...r)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&(""===i?t.removeAttribute("style"):t.style.cssText=i),function(e,t,n){const r=Ja(t.__textStyle);for(const t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(const t in Ja(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(ss(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Xl(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!sc(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=ic(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(ss(e)||Il(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(sc(n)||Il(39),Xl(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=ic(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Dl(t)&&Dl(n)&&(Hl(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=Yl().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=_s();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=Xl(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return sc(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Xl(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&Il(117),(e=Math.floor(e))>=0||Il(199);let t=this.getIndent();for(;t!==e;)t<e?(jl(this),t++):(ql(this),t--);return this}canInsertAfter(e){return Xl(e)}canReplaceWith(e){return Xl(e)}canMergeWith(e){return Xl(e)||bs(e)}extractWithChild(e,t){if(!si(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ic("bullet")}canMergeWhenEmpty(){return!0}};function Gl(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return Zl(t);if(e.classList.contains("joplin-checkbox"))for(const t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return Zl(t.children[0]);const t=e.getAttribute("aria-checked");return{node:Yl("true"===t||"false"!==t&&void 0)}}function Zl(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:Yl(e.hasAttribute("checked"))}}function Yl(e){return Fo(new Vl(void 0,e))}function Xl(e){return e instanceof Vl}let Ql=class extends is{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();sc(t)&&e.getListType()===t.getListType()&&Hl(e,t)}(e),Kl(e)},extends:is,importDOM:{ol:()=>({conversion:nc,priority:0}),ul:()=>({conversion:nc,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=rc[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,ec(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(ec(t,n.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Bo(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){const t=n[e];Xl(t)||(r===n&&(r=[...n]),r[e]=Yl().append(!ss(t)||sc(t)||t.isInline()?t:Vr(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Xl(e)}};function ec(e,t,n){const r=[],i=[],s=t.list;if(void 0!==s){const e=s[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(Xl(n)){const e=n.getParent();if(sc(e)){t++,n=e.getParent();continue}Il(40)}return t}return t}(n)-1,o=t%e.length,a=e[o],l=s[n.__tag];let c;const u=s.nested,d=s.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==a){r.push(...Jl(a));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(void 0!==c){const e=Jl(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&cl(e,...i),r.length>0&&ll(e,...r)}function tc(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Xl(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{sc(e)&&t.push(zl(e))}))}else t.push(zl(r))}return t}function nc(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=ic("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(Bo(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?ic("check"):ic("bullet")),{after:tc,node:n}}const rc={ol:"number",ul:"bullet"};function ic(e="number",t=1){return Fo(new Ql(e,t))}function sc(e){return e instanceof Ql}const oc=Zt("UPDATE_LIST_START_COMMAND"),ac=Zt("INSERT_UNORDERED_LIST_COMMAND"),lc=Zt("INSERT_ORDERED_LIST_COMMAND"),cc=Zt("REMOVE_LIST_COMMAND");function uc(e){return al(e.registerCommand(lc,(()=>($l("number"),!0)),1),e.registerCommand(oc,(e=>{const{listNodeKey:t,newStart:n}=e,r=Vs(t);return!!sc(r)&&("number"===r.getListType()&&(r.setStart(n),Kl(r)),!0)}),1),e.registerCommand(ac,(()=>($l("bullet"),!0)),1),e.registerCommand(cc,(()=>(function(){const e=vi();if(si(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Bl(r,n))t.add(Rl(r));else for(let e=0;e<n.length;e++){const r=n[e];if(Hs(r)){const e=dl(r,Vl);null!=e&&t.add(Rl(e))}}for(const n of t){let t=n;const r=Ml(n);for(const n of r){const r=_s().setTextStyle(e.style).setTextFormat(e.format);Ul(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Oa(e.anchor,$a(ba(r,"next"))),n.__key===e.focus.key&&Oa(e.focus,$a(ba(r,"next"))),n.remove()}n.remove()}}}(),!0)),1),e.registerCommand(nn,(()=>function(){const e=vi();if(!si(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Xl(t)||0!==t.getChildrenSize())return!1;const n=Rl(t),r=t.getParent();sc(r)||Il(40);const i=r.getParent();let s;if(Oo(i))s=_s(),n.insertAfter(s);else{if(!Xl(i))return!1;s=Yl(),i.insertAfter(s)}s.setTextStyle(e.style).setTextFormat(e.format).select();const o=t.getNextSiblings();if(o.length>0){const e=ic(r.getListType());if(Xl(s)){const t=Yl();t.append(e),s.insertAfter(t)}else s.insertAfter(e);e.append(...o)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!Xl(e)&&!sc(e))break;t=e}t.remove()}(t),!0}()),1),e.registerNodeTransform(Vl,(e=>{const t=e.getFirstChild();if(t){if(Gr(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=vi();si(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(Br,(e=>{const t=e.getParent();if(Xl(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function dc(e,t){const n=$s(t)?t.body.childNodes:t.childNodes;let r=[];const i=[];for(const t of n)if(!pc.has(t.nodeName)){const n=fc(t,e,i,!1);null!==n&&(r=r.concat(n))}return function(e){for(const t of e)t.getNextSibling()instanceof fs&&t.insertAfter(Lr());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(i),r}function hc(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=eo().getChildren();for(let i=0;i<r.length;i++)gc(e,r[i],n,t);return n.innerHTML}function gc(e,t,n,r=null){let i=null===r||t.isSelected(r);const s=ss(t)&&t.excludeFromCopy("html");let o=t;null!==r&&Gr(t)&&(o=Ya(r,t,"clone"));const a=ss(o)?o.getChildren():[],l=Ns(e,o.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,o):o.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<a.length;n++){const s=a[n],o=gc(e,s,h,r);!i&&ss(t)&&o&&t.extractWithChild(s,r,"html")&&(i=!0)}if(i&&!s){if((Bo(u)||Uo(u))&&u.append(h),n.append(u),d){const e=d.call(o,u);e&&(Uo(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return i}const pc=new Set(["STYLE","SCRIPT"]);function fc(e,t,n,r,i=new Map,s){let o=[];if(pc.has(e.nodeName))return o;let a=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(a=Array.isArray(t)?t[t.length-1]:t,null!==a){for(const[,e]of i)if(a=e(a,s),!a)break;a&&o.push(...Array.isArray(t)?t:[a])}null!=c.forChild&&i.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const g=(null==a||!Oo(a))&&(null!=a&&yi(a)||r);for(let e=0;e<d.length;e++)h.push(...fc(d[e],t,n,g,new Map(i),a));return null!=u&&(h=u(h)),Ho(e)&&(h=function(e,t,n){const r=e.style.textAlign,i=[];let s=[];for(let e=0;e<t.length;e++){const o=t[e];if(yi(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(s.push(o),e===t.length-1||e<t.length-1&&yi(t[e+1])){const e=n();e.setFormat(r),e.append(...s),i.push(e),s=[]}}return i}(e,h,g?()=>{const e=new fs;return n.push(e),e}:_s)),null==a?h.length>0?o=o.concat(h):Ho(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(Wo(e.nextSibling)&&Wo(e.previousSibling))}(e)&&(o=o.concat(Lr())):ss(a)&&a.append(...h),o}function mc(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yc(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return _c(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=Vi(e[n]);Gr(r)&&Xa(r),t.push(r)}return t}(e.nodes),t)}catch(e){console.error(e)}const i=e.getData("text/html"),s=e.getData("text/plain");if(i&&s!==i)try{return _c(n,dc(n,(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(i),"text/html")),t)}catch(e){console.error(e)}const o=s||e.getData("text/uri-list");if(null!=o)if(si(t)){const e=o.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=vi();if(si(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([Xr()]):n.insertText(r)}}}else t.insertRawText(o)}function _c(e,t,n){e.dispatchCommand(Xt,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(si(e)&&e.isCollapsed()){let t=null;const n=Pa(e.anchor,"previous");if(n)if(ca(n))t=n.origin;else{const e=wa(n,ba(eo(),"next").getFlipped());for(const n of e){if(Gr(n.origin)){t=n.origin;break}if(ss(n.origin)&&!n.origin.isInline())break}}if(t&&Gr(t)){const n=t.getFormat(),r=t.getStyle();e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}}}(n))}function bc(e,t,n,r=[]){let i=null===t||n.isSelected(t);const s=ss(n)&&n.excludeFromCopy("html");let o=n;null!==t&&Gr(o)&&(o=Ya(t,o,"clone"));const a=ss(o)?o.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&mc(58,n.name),ss(e)){const e=t.children;Array.isArray(e)||mc(59,n.name)}return t}(o);Gr(o)&&0===o.getTextContentSize()&&(i=!1);for(let r=0;r<a.length;r++){const s=a[r],o=bc(e,t,s,l.children);!i&&ss(n)&&o&&n.extractWithChild(s,t,"clone")&&(i=!0)}if(i&&!s)r.push(l);else if(Array.isArray(l.children))for(let e=0;e<l.children.length;e++){const t=l.children[e];r.push(t)}return i}let xc=null;async function kc(e,t,n){if(null!==xc)return!1;if(null!==t)return new Promise(((r,i)=>{e.update((()=>{r(vc(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,s=i.document,o=Do(i);if(null===r||null===o)return!1;const a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),o.removeAllRanges(),o.addRange(l),new Promise(((t,r)=>{const o=e.registerCommand(Fn,(r=>(gl(r,ClipboardEvent)&&(o(),null!==xc&&(i.clearTimeout(xc),xc=null),t(vc(e,r,n))),!0)),4);xc=i.setTimeout((()=>{o(),xc=null,t(!1)}),50),s.execCommand("copy"),a.remove()}))}function vc(e,t,n){if(void 0===n){const t=Do(e._window),r=vi();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=t.anchorNode,s=t.focusNode;if(null!==i&&null!==s&&!Os(e,i,s))return!1;n=function(e=vi()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=jo();for(const[r,i]of Sc){const s=i(n,e);null!==s&&(t[r]=s)}}return t}(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const[n]of Sc)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const Sc=[["text/html",function(e,t=vi()){return null==t&&mc(166),si(t)&&t.isCollapsed()||0===t.getNodes().length?"":hc(e,t)}],["application/x-lexical-editor",function(e,t=vi()){return null==t&&mc(166),si(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=eo().getChildren();for(let i=0;i<r.length;i++)bc(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function wc(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const Cc="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Tc=Cc&&"documentMode"in document?document.documentMode:null,Ec=Cc&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Nc=!(!Cc||!("InputEvent"in window)||Tc)&&"getTargetRanges"in new window.InputEvent("input"),Ac=Cc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Lc=Cc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pc=Cc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Oc=Cc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ec&&!Pc,Fc=Zt("DRAG_DROP_PASTE_FILE");let Ic=class e extends is{static getType(){return"quote"}static clone(t){return new e(t.__key)}createDOM(e){const t=document.createElement("blockquote");return ll(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:$c,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Rc().updateFromJSON(e)}insertNewAfter(e,t){const n=_s(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Rc(){return Fo(new Ic)}function Mc(e){return e instanceof Ic}let Dc=class e extends is{__tag;static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){ll(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Bc,priority:0}),h2:e=>({conversion:Bc,priority:0}),h3:e=>({conversion:Bc,priority:0}),h4:e=>({conversion:Bc,priority:0}),h5:e=>({conversion:Bc,priority:0}),h6:e=>({conversion:Bc,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&zc(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>zc(e)?{conversion:e=>({node:Uc("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Uc(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?_s():Uc(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=_s();e.select(),this.replace(e,!0)}return i}collapseAtStart(){const e=this.isEmpty()?_s():Uc(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function zc(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Bc(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=Uc(t),null!==e.style&&(Zo(e,n),n.setFormat(e.style.textAlign))),{node:n}}function $c(e){const t=Rc();return null!==e.style&&(t.setFormat(e.style.textAlign),Zo(e,t)),{node:t}}function Uc(e="h1"){return Fo(new Dc(e))}function Wc(e){return e instanceof Dc}function Hc(e){let t=null;if(gl(e,DragEvent)?t=e.dataTransfer:gl(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function Kc(e){const t=vi();if(!si(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const i=r[t],s=i.getKey();if(n.has(s))continue;const o=ea(i,(e=>ss(e)&&!e.isInline()));if(null===o)continue;const a=o.getKey();o.canIndent()&&!n.has(a)&&(n.add(a),e(o))}return n.size>0}function jc(e){return ls(Ys(e))}function qc(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Jc(e){return al(e.registerCommand(Qt,(e=>{const t=vi();return!!ai(t)&&(t.clear(),!0)}),0),e.registerCommand(en,(e=>{const t=vi();return si(t)?(t.deleteCharacter(e),!0):!!ai(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(an,(e=>{const t=vi();return!!si(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(ln,(e=>{const t=vi();return!!si(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(rn,(t=>{const n=vi();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)yc(r,n,e);else if(si(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(on,(()=>{const e=vi();return!!si(e)&&(e.removeText(),!0)}),0),e.registerCommand(cn,(e=>{const t=vi();return!!si(t)&&(t.formatText(e),!0)}),0),e.registerCommand(An,(e=>{const t=vi();if(!si(t)&&!ai(t))return!1;const n=t.getNodes();for(const t of n){const n=ea(t,(e=>ss(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(tn,(e=>{const t=vi();return!!si(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(nn,(()=>{const e=vi();return!!si(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(Cn,(()=>(Ai([Xr()]),!0)),0),e.registerCommand(Tn,(()=>Kc((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(En,(()=>Kc((e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(yn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(si(t)){const n=ko(t.focus,!0);if(!e.shiftKey&&ls(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(_n,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(si(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===eo().getChildrenSize()}(t))return e.preventDefault(),!0;const n=ko(t.focus,!1);if(!e.shiftKey&&ls(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(fn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),Za(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!si(t))return!1;if(tl(t,!0)){const n=e.shiftKey;return e.preventDefault(),rl(t,n,!0),!0}return!1}),0),e.registerCommand(gn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),Za(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!si(t))return!1;const n=e.shiftKey;return!!tl(t,!1)&&(e.preventDefault(),rl(t,n,!1),!0)}),0),e.registerCommand(kn,(t=>{if(jc(t.target))return!1;const n=vi();if(si(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(us(n))return!1;const r=hl(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(En,void 0);if(Lc&&"ko-KR"===navigator.language)return!1}else if(!ai(n))return!1;return t.preventDefault(),e.dispatchCommand(en,!0)}),0),e.registerCommand(Sn,(t=>{if(jc(t.target))return!1;const n=vi();return!(!si(n)&&!ai(n))&&(t.preventDefault(),e.dispatchCommand(en,!1))}),0),e.registerCommand(bn,(t=>{const n=vi();if(!si(n))return!1;if(qc(n),null!==t){if((Lc||Ac||Oc)&&Nc)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(tn,!1)}return e.dispatchCommand(nn,void 0)}),0),e.registerCommand(vn,(()=>!!si(vi())&&(e.blur(),!0)),0),e.registerCommand(Nn,(t=>{const[,n]=Hc(t);if(n.length>0){const r=wc(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,s=Ys(i);if(null!==s){const e=bi();if(Gr(s))e.anchor.set(s.getKey(),t,"text"),e.focus.set(s.getKey(),t,"text");else{const t=s.getParentOrThrow().getKey(),n=s.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}no(ft(e))}e.dispatchCommand(Fc,n)}return t.preventDefault(),!0}return!!si(vi())}),0),e.registerCommand(Ln,(e=>{const[t]=Hc(e),n=vi();return!(t&&!si(n))}),0),e.registerCommand(Pn,(e=>{const[t]=Hc(e),n=vi();if(t&&!si(n))return!1;const r=wc(e.clientX,e.clientY);if(null!==r){ls(Ys(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(Rn,(()=>(function(e){const t=eo();if(si(e)){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),ft(e),e}{const e=t.select(0,t.getChildrenSize());no(ft(e))}}(),!0)),0),e.registerCommand(Fn,(t=>(kc(e,gl(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(In,(t=>(async function(e,t){await kc(t,gl(e,ClipboardEvent)?e:null),t.update((()=>{const e=vi();si(e)?e.removeText():ai(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(sn,(t=>{const[,n,r]=Hc(t);return n.length>0&&!r?(e.dispatchCommand(Fc,n),!0):(!$o(t.target)||!Ps(t.target))&&(null!==vi()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=vi(),r=gl(e,InputEvent)||gl(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&yc(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(xn,(e=>{const t=vi();return si(t)&&qc(t),!1}),0),e.registerCommand(wn,(e=>{const t=vi();return si(t)&&qc(t),!1}),0))}var Vc=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof s?new s(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,s;switch(n=n||{},i.util.type(t)){case"Object":if(s=i.util.objId(t),n[s])return n[s];for(var o in r={},n[s]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return s=i.util.objId(t),n[s]?n[s]:(r=[],n[s]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var s=(r=r||i.languages)[e],o={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(a)||(o[a]=s[a])}var c=r[e];return r[e]=o,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,r,s){s=s||{};var o=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,e(l,n,a,s)):(s[o(l)]=!0,e(l,n,null,s))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var s,o=0;s=r.elements[o++];)i.highlightElement(s,!0===t,r.callback)},highlightElement:function(t,n,r){var s=i.util.getLanguage(t),o=i.languages[s];i.util.setLanguage(t,s);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,s);var l={element:t,language:s,grammar:o,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),s.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,s=0;r=n[s++];)r(t)}},Token:s};function s(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function a(e,t,n,r,l,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var g=n[h];g=Array.isArray(g)?g:[g];for(var p=0;p<g.length;++p){if(d&&d.cause==h+","+p)return;var f=g[p],m=f.inside,y=!!f.lookbehind,_=!!f.greedy,b=f.alias;if(_&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var k=f.pattern||f,v=r.next,S=l;v!==t.tail&&!(d&&S>=d.reach);S+=v.value.length,v=v.next){var w=v.value;if(t.length>e.length)return;if(!(w instanceof s)){var C,T=1;if(_){if(!(C=o(k,S,e,y))||C.index>=e.length)break;var E=C.index,N=C.index+C[0].length,A=S;for(A+=v.value.length;E>=A;)A+=(v=v.next).value.length;if(S=A-=v.value.length,v.value instanceof s)continue;for(var L=v;L!==t.tail&&(A<N||"string"==typeof L.value);L=L.next)T++,A+=L.value.length;T--,w=e.slice(S,A),C.index-=S}else if(!(C=o(k,0,w,y)))continue;E=C.index;var P=C[0],O=w.slice(0,E),F=w.slice(E+P.length),I=S+w.length;d&&I>d.reach&&(d.reach=I);var R=v.prev;if(O&&(R=c(t,R,O),S+=O.length),u(t,R,T),v=c(t,R,new s(h,m?i.tokenize(P,m):P,b,P)),F&&c(t,v,F),T>1){var M={cause:h+","+p,reach:I};a(e,t,n,v.prev,S,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,s.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),i.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,s=n.code,o=n.immediateClose;e.postMessage(i.highlight(s,i.languages[r],r)),o&&e.close()}),!1),i):i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var g=document.readyState;"loading"===g||"interactive"===g&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
|
|
2
|
+
/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:t,setPrototypeOf:n,isFrozen:r,getPrototypeOf:i,getOwnPropertyDescriptor:s}=Object;let{freeze:o,seal:a,create:l}=Object,{apply:c,construct:u}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),u||(u=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const d=T(Array.prototype.forEach),h=T(Array.prototype.lastIndexOf),g=T(Array.prototype.pop),p=T(Array.prototype.push),f=T(Array.prototype.splice),m=T(String.prototype.toLowerCase),y=T(String.prototype.toString),_=T(String.prototype.match),b=T(String.prototype.replace),x=T(String.prototype.indexOf),k=T(String.prototype.trim),v=T(Object.prototype.hasOwnProperty),S=T(RegExp.prototype.test),w=(C=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(C,t)});var C;function T(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return c(e,t,r)}}function E(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m;n&&n(e,null);let s=t.length;for(;s--;){let n=t[s];if("string"==typeof n){const e=i(n);e!==n&&(r(t)||(t[s]=e),n=e)}e[n]=!0}return e}function N(e){for(let t=0;t<e.length;t++){v(e,t)||(e[t]=null)}return e}function A(e){const n=l(null);for(const[r,i]of t(e)){v(e,r)&&(Array.isArray(i)?n[r]=N(i):i&&"object"==typeof i&&i.constructor===Object?n[r]=A(i):n[r]=i)}return n}function L(e,t){for(;null!==e;){const n=s(e,t);if(n){if(n.get)return T(n.get);if("function"==typeof n.value)return T(n.value)}e=i(e)}return function(){return null}}const P=o(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),F=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),O=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=o(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),R=o(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),M=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=o(["#text"]),z=o(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),B=o(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=o(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),U=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H=a(/<%[\w\W]*|[\w\W]*%>/gm),K=a(/\$\{[\w\W]*/gm),j=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),q=a(/^aria-[\-\w]+$/),J=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=a(/^(?:\w+script|data):/i),G=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Z=a(/^html$/i),Y=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var X=Object.freeze({__proto__:null,ARIA_ATTR:q,ATTR_WHITESPACE:G,CUSTOM_ELEMENT:Y,DATA_ATTR:j,DOCTYPE_NAME:Z,ERB_EXPR:H,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:V,MUSTACHE_EXPR:W,TMPLIT_EXPR:K});const Q=1,ee=3,te=7,ne=8,re=9,ie=function(){return"undefined"==typeof window?null:window};var se=function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const r=t=>e(t);if(r.version="3.3.0",r.removed=[],!n||!n.document||n.document.nodeType!==re||!n.Element)return r.isSupported=!1,r;let{document:i}=n;const s=i,a=s.currentScript,{DocumentFragment:c,HTMLTemplateElement:u,Node:C,Element:T,NodeFilter:N,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:H,DOMParser:K,trustedTypes:j}=n,q=T.prototype,V=L(q,"cloneNode"),G=L(q,"remove"),Y=L(q,"nextSibling"),se=L(q,"childNodes"),oe=L(q,"parentNode");if("function"==typeof u){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let ae,le="";const{implementation:ce,createNodeIterator:ue,createDocumentFragment:de,getElementsByTagName:he}=i,{importNode:ge}=s;let pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"==typeof t&&"function"==typeof oe&&ce&&void 0!==ce.createHTMLDocument;const{MUSTACHE_EXPR:fe,ERB_EXPR:me,TMPLIT_EXPR:ye,DATA_ATTR:_e,ARIA_ATTR:be,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:ke,CUSTOM_ELEMENT:ve}=X;let{IS_ALLOWED_URI:Se}=X,we=null;const Ce=E({},[...P,...F,...O,...R,...D]);let Te=null;const Ee=E({},[...z,...B,...$,...U]);let Ne=Object.seal(l(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,Le=null;const Pe=Object.seal(l(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fe=!0,Oe=!0,Ie=!1,Re=!0,Me=!1,De=!0,ze=!1,Be=!1,$e=!1,Ue=!1,We=!1,He=!1,Ke=!0,je=!1,qe=!0,Je=!1,Ve={},Ge=null;const Ze=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=E({},["audio","video","img","source","image","track"]);let Qe=null;const et=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xhtml";let it=rt,st=!1,ot=null;const at=E({},[tt,nt,rt],y);let lt=E({},["mi","mo","mn","ms","mtext"]),ct=E({},["annotation-xml"]);const ut=E({},["title","style","font","a","script"]);let dt=null;const ht=["application/xhtml+xml","text/html"];let gt=null,pt=null;const ft=i.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},yt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!pt||pt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),dt=-1===ht.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,gt="application/xhtml+xml"===dt?y:m,we=v(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,gt):Ce,Te=v(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,gt):Ee,ot=v(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,y):at,Qe=v(e,"ADD_URI_SAFE_ATTR")?E(A(et),e.ADD_URI_SAFE_ATTR,gt):et,Ye=v(e,"ADD_DATA_URI_TAGS")?E(A(Xe),e.ADD_DATA_URI_TAGS,gt):Xe,Ge=v(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,gt):Ze,Ae=v(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,gt):A({}),Le=v(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,gt):A({}),Ve=!!v(e,"USE_PROFILES")&&e.USE_PROFILES,Fe=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,Ie=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,De=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,We=e.RETURN_DOM_FRAGMENT||!1,He=e.RETURN_TRUSTED_TYPE||!1,$e=e.FORCE_BODY||!1,Ke=!1!==e.SANITIZE_DOM,je=e.SANITIZE_NAMED_PROPS||!1,qe=!1!==e.KEEP_CONTENT,Je=e.IN_PLACE||!1,Se=e.ALLOWED_URI_REGEXP||J,it=e.NAMESPACE||rt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&mt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ne.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ne.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Oe=!1),We&&(Ue=!0),Ve&&(we=E({},D),Te=[],!0===Ve.html&&(E(we,P),E(Te,z)),!0===Ve.svg&&(E(we,F),E(Te,B),E(Te,U)),!0===Ve.svgFilters&&(E(we,O),E(Te,B),E(Te,U)),!0===Ve.mathMl&&(E(we,R),E(Te,$),E(Te,U))),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Pe.tagCheck=e.ADD_TAGS:(we===Ce&&(we=A(we)),E(we,e.ADD_TAGS,gt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Pe.attributeCheck=e.ADD_ATTR:(Te===Ee&&(Te=A(Te)),E(Te,e.ADD_ATTR,gt))),e.ADD_URI_SAFE_ATTR&&E(Qe,e.ADD_URI_SAFE_ATTR,gt),e.FORBID_CONTENTS&&(Ge===Ze&&(Ge=A(Ge)),E(Ge,e.FORBID_CONTENTS,gt)),qe&&(we["#text"]=!0),ze&&E(we,["html","head","body"]),we.table&&(E(we,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ae=e.TRUSTED_TYPES_POLICY,le=ae.createHTML("")}else void 0===ae&&(ae=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}}(j,a)),null!==ae&&"string"==typeof le&&(le=ae.createHTML(""));o&&o(e),pt=e}},_t=E({},[...F,...O,...I]),bt=E({},[...R,...M]),xt=function(e){p(r.removed,{element:e});try{oe(e).removeChild(e)}catch(t){G(e)}},kt=function(e,t){try{p(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Ue||We)try{xt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if($e)e="<remove></remove>"+e;else{const t=_(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===dt&&it===rt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ae?ae.createHTML(e):e;if(it===rt)try{t=(new K).parseFromString(r,dt)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(it,"template",null);try{t.documentElement.innerHTML=st?le:r}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),it===rt?he.call(t,ze?"html":"body")[0]:ze?t.documentElement:s},St=function(e){return ue.call(e.ownerDocument||e,e,N.SHOW_ELEMENT|N.SHOW_COMMENT|N.SHOW_TEXT|N.SHOW_PROCESSING_INSTRUCTION|N.SHOW_CDATA_SECTION,null)},wt=function(e){return e instanceof H&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof W)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ct=function(e){return"function"==typeof C&&e instanceof C};function Tt(e,t,n){d(e,(e=>{e.call(r,t,n,pt)}))}const Et=function(e){let t=null;if(Tt(pe.beforeSanitizeElements,e,null),wt(e))return xt(e),!0;const n=gt(e.nodeName);if(Tt(pe.uponSanitizeElement,e,{tagName:n,allowedTags:we}),De&&e.hasChildNodes()&&!Ct(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent))return xt(e),!0;if(e.nodeType===te)return xt(e),!0;if(De&&e.nodeType===ne&&S(/<[/\w]/g,e.data))return xt(e),!0;if(!(Pe.tagCheck instanceof Function&&Pe.tagCheck(n))&&(!we[n]||Ae[n])){if(!Ae[n]&&At(n)){if(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,n))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))return!1}if(qe&&!Ge[n]){const t=oe(e)||e.parentNode,n=se(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const i=V(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Y(e))}}}return xt(e),!0}return e instanceof T&&!function(e){let t=oe(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});const n=m(e.tagName),r=m(t.tagName);return!!ot[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===rt?"svg"===n:t.namespaceURI===tt?"svg"===n&&("annotation-xml"===r||lt[r]):Boolean(_t[n]):e.namespaceURI===tt?t.namespaceURI===rt?"math"===n:t.namespaceURI===nt?"math"===n&&ct[r]:Boolean(bt[n]):e.namespaceURI===rt?!(t.namespaceURI===nt&&!ct[r])&&!(t.namespaceURI===tt&&!lt[r])&&!bt[n]&&(ut[n]||!_t[n]):!("application/xhtml+xml"!==dt||!ot[e.namespaceURI]))}(e)?(xt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===ee&&(t=e.textContent,d([fe,me,ye],(e=>{t=b(t,e," ")})),e.textContent!==t&&(p(r.removed,{element:e.cloneNode()}),e.textContent=t)),Tt(pe.afterSanitizeElements,e,null),!1):(xt(e),!0)},Nt=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in i||n in ft))return!1;if(Oe&&!Le[t]&&S(_e,t));else if(Fe&&S(be,t));else if(Pe.attributeCheck instanceof Function&&Pe.attributeCheck(t,e));else if(!Te[t]||Le[t]){if(!(At(e)&&(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&S(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t,e))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&S(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Qe[t]);else if(S(Se,b(n,ke,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Ye[e]){if(Ie&&!S(xe,b(n,ke,"")));else if(n)return!1}else;return!0},At=function(e){return"annotation-xml"!==e&&_(e,ve)},Lt=function(e){Tt(pe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||wt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Te,forceKeepAttr:void 0};let i=t.length;for(;i--;){const s=t[i],{name:o,namespaceURI:a,value:l}=s,c=gt(o),u=l;let h="value"===o?u:k(u);if(n.attrName=c,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Tt(pe.uponSanitizeAttribute,e,n),h=n.attrValue,!je||"id"!==c&&"name"!==c||(kt(o,e),h="user-content-"+h),De&&S(/((--!?|])>)|<\/(style|title|textarea)/i,h)){kt(o,e);continue}if("attributename"===c&&_(h,"href")){kt(o,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){kt(o,e);continue}if(!Re&&S(/\/>/i,h)){kt(o,e);continue}Me&&d([fe,me,ye],(e=>{h=b(h,e," ")}));const p=gt(e.nodeName);if(Nt(p,c,h)){if(ae&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(p,c)){case"TrustedHTML":h=ae.createHTML(h);break;case"TrustedScriptURL":h=ae.createScriptURL(h)}if(h!==u)try{a?e.setAttributeNS(a,o,h):e.setAttribute(o,h),wt(e)?xt(e):g(r.removed)}catch(t){kt(o,e)}}else kt(o,e)}Tt(pe.afterSanitizeAttributes,e,null)},Pt=function e(t){let n=null;const r=St(t);for(Tt(pe.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Tt(pe.uponSanitizeShadowNode,n,null),Et(n),Lt(n),n.content instanceof c&&e(n.content);Tt(pe.afterSanitizeShadowDOM,t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,o=null,a=null;if(st=!e,st&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ct(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Be||yt(t),r.removed=[],"string"==typeof e&&(Je=!1),Je){if(e.nodeName){const t=gt(e.nodeName);if(!we[t]||Ae[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof C)n=vt("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!Ue&&!Me&&!ze&&-1===e.indexOf("<"))return ae&&He?ae.createHTML(e):e;if(n=vt(e),!n)return Ue?null:He?le:""}n&&$e&&xt(n.firstChild);const l=St(Je?e:n);for(;o=l.nextNode();)Et(o),Lt(o),o.content instanceof c&&Pt(o.content);if(Je)return e;if(Ue){if(We)for(a=de.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(Te.shadowroot||Te.shadowrootmode)&&(a=ge.call(s,a,!0)),a}let u=ze?n.outerHTML:n.innerHTML;return ze&&we["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(Z,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Me&&d([fe,me,ye],(e=>{u=b(u,e," ")})),ae&&He?ae.createHTML(u):u},r.setConfig=function(){yt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Be=!0},r.clearConfig=function(){pt=null,Be=!1},r.isValidAttribute=function(e,t,n){pt||yt({});const r=gt(e),i=gt(t);return Nt(r,i,n)},r.addHook=function(e,t){"function"==typeof t&&p(pe[e],t)},r.removeHook=function(e,t){if(void 0!==t){const n=h(pe[e],t);return-1===n?void 0:f(pe[e],n,1)[0]}return g(pe[e])},r.removeHooks=function(e){pe[e]=[]},r.removeAllHooks=function(){pe={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}();function oe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ae(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}se.addHook("uponSanitizeElement",((e,t)=>{"strong"!==t.tagName&&"em"!==t.tagName||e.removeAttribute("class")}));const le="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ce=le&&"documentMode"in document?document.documentMode:null,ue=le&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),de=le&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),he=!(!le||!("InputEvent"in window)||ce)&&"getTargetRanges"in new window.InputEvent("input"),ge=le&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),pe=le&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fe=le&&/Android/.test(navigator.userAgent),me=le&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ye=le&&fe&&me,_e=le&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ue&&!me;function be(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}const xe=0,ke=1,ve=2,Se=1,we=2,Ce=3,Te=4,Ee=5,Ne=6,Ae=ge||pe||_e?" ":"",Le="\n\n",Pe=de?" ":Ae,Fe="֑-߿יִ-﷽ﹰ-ﻼ",Oe="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Ie=new RegExp("^[^"+Oe+"]*["+Fe+"]"),Re=new RegExp("^[^"+Fe+"]*["+Oe+"]"),Me={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},De={directionless:1,unmergeable:2},ze={center:2,end:6,justify:4,left:1,right:3,start:5},Be={[we]:"center",[Ne]:"end",[Te]:"justify",[Se]:"left",[Ce]:"right",[Ee]:"start"},$e={normal:0,segmented:2,token:1},Ue={[xe]:"normal",[ve]:"segmented",[ke]:"token"},We="$config";function He(e,t,n,r,i,s){let o=e.getFirstChild();for(;null!==o;){const e=o.__key;o.__parent===t&&(ss(o)&&He(o,e,n,r,i,s),n.has(e)||s.delete(e),i.push(e)),o=o.getNextSibling()}}let Ke=!1,je=0;function qe(e){je=e.timeStamp}function Je(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Zs(e,n)}function Ve(e,t,n){const r=Do(Po(n));let i=null,s=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,s=r.focusOffset);const o=e.nodeValue;null!==o&&co(t,o,i,s,!1)}function Ge(e,t,n){if(si(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Bs(t)&&n.isAttached()}function Ze(e,t,n,r){for(let i=e;i&&!Yo(i);i=To(i)){const e=Zs(i,t);if(void 0!==e){const t=Vs(e,n);if(t)return ls(t)||!Bo(i)?void 0:[i,t]}else if(i===r)return[r,to(n)]}}function Ye(e,t,n){Ke=!0;const r=performance.now()-je>100;try{ts(e,(()=>{const i=vi()||function(e){return e.getEditorState().read((()=>{const e=vi();return null!==e?e.clone():null}))}(e),s=new Map,o=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,g=d.target,p=Ze(g,e,a,o);if(!p)continue;const[f,m]=p;if("characterData"===h)r&&Gr(m)&&Bs(g)&&Ge(i,g,m)&&Ve(g,m,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],i=Gs(r),s=r.parentNode;if(null!=s&&r!==l&&null===i&&!Je(r,s,e)){if(de){const e=(Bo(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}s.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];(Je(r,g,e)||l===r)&&(g.appendChild(r),t++)}r!==t&&s.set(f,m)}}}if(s.size>0)for(const[t,n]of s)n.reconcileObservedMutation(t,e);const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],s=n.parentNode;null==s||"BR"!==n.nodeName||Je(n,i,e)||s.removeChild(n)}}n.takeRecords()}null!==i&&(c&&no(i),de&&vo(e)&&i.insertRawText(u))}))}finally{Ke=!1}}function Xe(e){const t=e._observer;null!==t&&Ye(e,t.takeRecords(),t)}function Qe(e){!function(e){0===je&&Po(e).addEventListener("textInput",qe,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ye(e,t,n)}))}let et=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||lt).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function tt(e,t,n="latest"){const r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function nt(e,t,n){let r;if($i(),"function"==typeof n){const i=e.getLatest(),s=tt(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const i=e.getWritable();return st(i).updateFromKnown(t,r),i}function rt(e){const t=new Map,n=new Set;for(let r="function"==typeof e?e:e.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){const{ownNodeConfig:e}=Qo(r);if(e&&e.stateConfigs)for(const r of e.stateConfigs){let e;"stateConfig"in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}let it=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:s}=this.sharedNodeState,o=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(const i in t){const t=e.get(i);t&&n.has(t)||r++}return r}(s,n,r);this.size=o}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(const n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return at(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(const[i,s]of Object.entries(n)){const n=e.get(i);n?t.has(n)||t.set(n,n.parse(s)):(r=r||{},r[i]=s)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=at(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){const n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function st(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new it(t,ot(t));return t.__state=n,n}function ot(e){return e.__state?e.__state.sharedNodeState:Es(jo(),e.getType()).sharedNodeState}function at(e){if(e)for(const t in e)return e}function lt(e){return e}function ct(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function ut(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r)for(const[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0;return!1}function dt(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ht(e,t){const n=e.__mode,r=e.__format,i=e.__style,s=t.__mode,o=t.__format,a=t.__style,l=e.__state,c=t.__state;return(null===n||n===s)&&(null===r||r===o)&&(null===i||i===a)&&(null===e.__state||l===c||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;const n=new Set;return!(e&&ct(n,e,t)||t&&ct(n,t,e)||e&&ut(n,e,t)||t&&ut(n,t,e))}(l,c))}function gt(e,t){const n=e.mergeWithSibling(t),r=Hi()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function pt(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Gr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(ht(t,r)){r=gt(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Gr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(ht(r,n)){r=gt(r,n);break}break}n.remove()}}else r.remove()}function ft(e){return mt(e.anchor),mt(e.focus),e}function mt(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Gr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!ss(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let yt,_t,bt,xt,kt,vt,St,wt,Ct,Tt,Et="",Nt=null,At="",Lt="",Pt=!1,Ft=!1;function Ot(e,t){const n=St.get(e);if(null!==t){const n=Gt(e);n.parentNode===t&&t.removeChild(n)}if(wt.has(e)||_t._keyToDOMMap.delete(e),ss(n)){const e=jt(n,St);It(e,0,e.length-1,null)}void 0!==n&&bo(Tt,bt,xt,n,"destroyed")}function It(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&Ot(t,r)}}function Rt(e,t){e.setProperty("text-align",t)}const Mt="40px";function Dt(e,t){const n=yt.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Mt;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function zt(e,t){const n=e.style;0===t?Rt(n,""):1===t?Rt(n,"left"):2===t?Rt(n,"center"):3===t?Rt(n,"right"):4===t?Rt(n,"justify"):5===t?Rt(n,"start"):6===t&&Rt(n,"end")}function Bt(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(us(e))return null;const n=e.getParentOrThrow();return us(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function $t(e,t){const n=wt.get(e);void 0===n&&oe(60);const r=n.createDOM(yt,_t);if(function(e,t,n){const r=n._keyToDOMMap;(function(e,t,n){e[`__lexicalKey_${t._key}`]=n})(t,n,e),r.set(e,t)}(e,r,_t),Gr(n)?r.setAttribute("data-lexical-text","true"):ls(n)&&r.setAttribute("data-lexical-decorator","true"),ss(n)){const e=n.__indent,t=n.__size;if(Bt(r,n),0!==e&&Dt(r,e),0!==t){const e=t-1;Ut(jt(n,wt),n,0,e,n.getDOMSlot(r))}const i=n.__format;0!==i&&zt(r,i),n.isInline()||Ht(null,n,r),wo(n)&&(Et+=Le,Lt+=Le)}else{const t=n.getTextContent();if(ls(n)){const t=n.decorate(_t,yt);null!==t&&Jt(e,t),r.contentEditable="false"}Et+=t,Lt+=t}return null!==t&&t.insertChild(r),bo(Tt,bt,xt,n,"created"),r}function Ut(e,t,n,r,i){const s=Et;Et="";let o=n;for(;o<=r;++o){$t(e[o],i);const t=wt.get(e[o]);null!==t&&Gr(t)&&(null===Nt&&(Nt=t.getFormat()),""===At&&(At=t.getStyle()))}wo(t)&&(Et+=Le),i.element.__lexicalTextContent=Et,Et=s+Et}function Wt(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return Pr(e)?"line-break":ls(e)&&e.isInline()?"decorator":null}return"empty"}return null}function Ht(e,t,n){const r=Wt(e,St),i=Wt(t,wt);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Kt(e,t,n){var r;Nt=null,At="",function(e,t,n){const r=Et,i=e.__size,s=t.__size;Et="";const o=n.element;if(1===i&&1===s){const n=e.__first,i=t.__first;if(n===i)qt(n,o);else{const e=Gt(n),t=$t(i,null);try{o.replaceChild(t,e)}catch(r){if("object"==typeof r&&null!=r){const s=`${r.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw new Error(s)}throw r}Ot(n,null)}const s=wt.get(i);Gr(s)&&(null===Nt&&(Nt=s.getFormat()),""===At&&(At=s.getStyle()))}else{const r=jt(e,St),a=jt(t,wt);if(r.length!==i&&oe(227),a.length!==s&&oe(228),0===i)0!==s&&Ut(a,t,0,s-1,n);else if(0===s){if(0!==i){const e=null==n.after&&null==n.before&&null==n.element.__lexicalLineBreak;It(r,0,i-1,e?null:o),e&&(o.textContent="")}}else!function(e,t,n,r,i,s){const o=r-1,a=i-1;let l,c,u=s.getFirstChild(),d=0,h=0;for(;d<=o&&h<=a;){const e=t[d],r=n[h];if(e===r)u=Vt(qt(r,s.element)),d++,h++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const i=c.has(e),o=l.has(r);if(i)if(o){const e=Co(_t,r);e===u?u=Vt(qt(r,s.element)):(s.withBefore(u).insertChild(e),qt(r,s.element)),d++,h++}else $t(r,s.withBefore(u)),h++;else u=Vt(Gt(e)),Ot(e,s.element),d++}const i=wt.get(r);null!==i&&Gr(i)&&(null===Nt&&(Nt=i.getFormat()),""===At&&(At=i.getStyle()))}const g=d>o,p=h>a;if(g&&!p){const t=n[a+1],r=void 0===t?null:_t.getElementByKey(t);Ut(n,e,h,a,s.withBefore(r))}else p&&!g&&It(t,d,o,s.element)}(t,r,a,i,s,n)}wo(t)&&(Et+=Le),o.__lexicalTextContent=Et,Et=r+Et}(e,t,t.getDOMSlot(n)),r=t,null==Nt||Nt===r.__textFormat||Ft||r.setTextFormat(Nt),function(e){""===At||At===e.__textStyle||Ft||e.setTextStyle(At)}(t)}function jt(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&oe(101),n.push(r),r=e.__next}return n}function qt(e,t){const n=St.get(e);let r=wt.get(e);void 0!==n&&void 0!==r||oe(61);const i=Pt||vt.has(e)||kt.has(e),s=Co(_t,e);if(n===r&&!i){if(ss(n)){const e=s.__lexicalTextContent;void 0!==e&&(Et+=e,Lt+=e)}else{const e=n.getTextContent();Lt+=e,Et+=e}return s}if(n!==r&&i&&bo(Tt,bt,xt,r,"updated"),r.updateDOM(n,s,yt)){const n=$t(e,null);return null===t&&oe(62),t.replaceChild(n,s),Ot(e,null),n}if(ss(n)&&ss(r)){const e=r.__indent;(Pt||e!==n.__indent)&&Dt(s,e);const t=r.__format;if((Pt||t!==n.__format)&&zt(s,t),i&&(Kt(n,r,s),us(r)||r.isInline()||Ht(n,r,s)),wo(r)&&(Et+=Le,Lt+=Le),(Pt||r.__dir!==n.__dir)&&(Bt(s,r),us(r)&&!Pt))for(const e of r.getChildren())ss(e)&&Bt(Co(_t,e.getKey()),e)}else{const t=r.getTextContent();if(ls(r)){const t=r.decorate(_t,yt);null!==t&&Jt(e,t)}Et+=t,Lt+=t}if(!Ft&&us(r)&&r.__cachedText!==Lt){const e=r.getWritable();e.__cachedText=Lt,r=e}return s}function Jt(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(null===n){if(r[e]===t)return;n=Xs(_t)}n[e]=t}function Vt(e){let t=e.nextSibling;return null!==t&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function Gt(e){const t=Ct.get(e);return void 0===t&&oe(75,e),t}function Zt(e){return{type:e}}const Yt=Zt("SELECTION_CHANGE_COMMAND"),Xt=Zt("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Qt=Zt("CLICK_COMMAND"),en=Zt("DELETE_CHARACTER_COMMAND"),tn=Zt("INSERT_LINE_BREAK_COMMAND"),nn=Zt("INSERT_PARAGRAPH_COMMAND"),rn=Zt("CONTROLLED_TEXT_INSERTION_COMMAND"),sn=Zt("PASTE_COMMAND"),on=Zt("REMOVE_TEXT_COMMAND"),an=Zt("DELETE_WORD_COMMAND"),ln=Zt("DELETE_LINE_COMMAND"),cn=Zt("FORMAT_TEXT_COMMAND"),un=Zt("UNDO_COMMAND"),dn=Zt("REDO_COMMAND"),hn=Zt("KEYDOWN_COMMAND"),gn=Zt("KEY_ARROW_RIGHT_COMMAND"),pn=Zt("MOVE_TO_END"),fn=Zt("KEY_ARROW_LEFT_COMMAND"),mn=Zt("MOVE_TO_START"),yn=Zt("KEY_ARROW_UP_COMMAND"),_n=Zt("KEY_ARROW_DOWN_COMMAND"),bn=Zt("KEY_ENTER_COMMAND"),xn=Zt("KEY_SPACE_COMMAND"),kn=Zt("KEY_BACKSPACE_COMMAND"),vn=Zt("KEY_ESCAPE_COMMAND"),Sn=Zt("KEY_DELETE_COMMAND"),wn=Zt("KEY_TAB_COMMAND"),Cn=Zt("INSERT_TAB_COMMAND"),Tn=Zt("INDENT_CONTENT_COMMAND"),En=Zt("OUTDENT_CONTENT_COMMAND"),Nn=Zt("DROP_COMMAND"),An=Zt("FORMAT_ELEMENT_COMMAND"),Ln=Zt("DRAGSTART_COMMAND"),Pn=Zt("DRAGOVER_COMMAND"),Fn=Zt("DRAGEND_COMMAND"),On=Zt("COPY_COMMAND"),In=Zt("CUT_COMMAND"),Rn=Zt("SELECT_ALL_COMMAND"),Mn=Zt("CLEAR_EDITOR_COMMAND"),Dn=Zt("CLEAR_HISTORY_COMMAND"),zn=Zt("CAN_REDO_COMMAND"),Bn=Zt("CAN_UNDO_COMMAND"),$n=Zt("FOCUS_COMMAND"),Un=Zt("BLUR_COMMAND"),Wn=Zt("KEY_MODIFIER_COMMAND"),Hn=Object.freeze({}),Kn=[["keydown",function(e,t){if(!(jn=e.timeStamp,qn=e.key,t.isComposing()||So(t,hn,e)||null==e.key)){if(tr&&mo(e))return ts(t,(()=>{dr(t,nr)})),tr=!1,void(nr="");if(function(e){return go(e,"ArrowRight",{shiftKey:"any"})}(e))So(t,gn,e);else if(function(e){return go(e,"ArrowRight",po)}(e))So(t,pn,e);else if(function(e){return go(e,"ArrowLeft",{shiftKey:"any"})}(e))So(t,fn,e);else if(function(e){return go(e,"ArrowLeft",po)}(e))So(t,mn,e);else if(function(e){return go(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))So(t,yn,e);else if(function(e){return go(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))So(t,_n,e);else if(function(e){return go(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))Qn=!0,So(t,bn,e);else if(function(e){return" "===e.key}(e))So(t,xn,e);else if(function(e){return ue&&go(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),Qn=!0,So(t,tn,!0);else if(function(e){return go(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))Qn=!1,So(t,bn,e);else if(function(e){return go(e,"Backspace",{shiftKey:"any"})||ue&&go(e,"h",{ctrlKey:!0})}(e))mo(e)?So(t,kn,e):(e.preventDefault(),So(t,en,!0));else if(function(e){return"Escape"===e.key}(e))So(t,vn,e);else if(function(e){return go(e,"Delete",{})||ue&&go(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),So(t,en,!1)):So(t,Sn,e);else if(function(e){return go(e,"Backspace",fo)}(e))e.preventDefault(),So(t,an,!0);else if(function(e){return go(e,"Delete",fo)}(e))e.preventDefault(),So(t,an,!1);else if(function(e){return ue&&go(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),So(t,ln,!0);else if(function(e){return ue&&(go(e,"Delete",{metaKey:!0})||go(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),So(t,ln,!1);else if(function(e){return go(e,"b",po)}(e))e.preventDefault(),So(t,cn,"bold");else if(function(e){return go(e,"u",po)}(e))e.preventDefault(),So(t,cn,"underline");else if(function(e){return go(e,"i",po)}(e))e.preventDefault(),So(t,cn,"italic");else if(function(e){return go(e,"Tab",{shiftKey:"any"})}(e))So(t,wn,e);else if(function(e){return go(e,"z",po)}(e))e.preventDefault(),So(t,un,void 0);else if(function(e){return ue?go(e,"z",{metaKey:!0,shiftKey:!0}):go(e,"y",{ctrlKey:!0})||go(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),So(t,dn,void 0);else{const n=t._editorState._selection;null===n||si(n)?yo(e)&&(e.preventDefault(),So(t,Rn,e)):function(e){return go(e,"c",po)}(e)?(e.preventDefault(),So(t,On,e)):function(e){return go(e,"x",po)}(e)?(e.preventDefault(),So(t,In,e)):yo(e)&&(e.preventDefault(),So(t,Rn,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&So(t,Wn,e)}}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;$o(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&ts(t,(()=>{Ls(n)||(Xn=!0)}))}],["compositionstart",function(e,t){ts(t,(()=>{const n=vi();if(si(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();qs(r.key),(e.timeStamp<jn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Gr(i)&&i.getStyle()!==n.style)&&So(t,rn,Pe)}}))}],["compositionend",function(e,t){de?er=!0:pe||!ge&&!_e?ts(t,(()=>{dr(t,e.data)})):(tr=!0,nr=e.data)}],["input",function(e,t){e.stopPropagation(),ts(t,(()=>{if(Bo(e.target)&&Ls(e.target))return;const n=vi(),r=e.data,i=ur(e);if(null!=r&&si(n)&&sr(n,i,r,e.timeStamp,!1)){er&&(dr(t,r),er=!1);const i=n.anchor.getNode(),s=Do(Po(t));if(null===s)return;const o=n.isBackward(),a=o?n.anchor.offset:n.focus.offset,l=o?n.focus.offset:n.anchor.offset;he&&!n.isCollapsed()&&Gr(i)&&null!==s.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===ao(s.anchorNode)||So(t,rn,r);const c=r.length;de&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),ge||pe||_e||!t.isComposing()||(jn=0,qs(null))}else lo(!1,t,null!==r?r:void 0),er&&(dr(t,r||void 0),er=!1);!function(){$i();Xe(Hi())}()}),{event:e}),Vn=null}],["click",function(e,t){ts(t,(()=>{const n=vi(),r=Do(Po(t)),i=Si();if(r)if(si(n)){const t=n.anchor,s=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!us(s)&&1===eo().getChildrenSize()&&s.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&s!==n.focus.getNode()){const e=ea(s,(e=>ss(e)&&!e.isInline()));ss(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=r.anchorNode;(Bo(n)||Bs(n))&&no(ki(i,r,t,e))}So(t,Qt,e)}))}],["cut",Hn],["copy",Hn],["dragstart",Hn],["dragover",Hn],["dragend",Hn],["paste",Hn],["focus",Hn],["blur",Hn],["drop",Hn]];he&&Kn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=ur(e);"deleteCompositionText"===n||de&&vo(t)||"insertCompositionText"!==n&&ts(t,(()=>{const i=vi();if("deleteContentBackward"===n){if(null===i){const e=Si();if(!si(e))return;no(e.clone())}if(si(i)){const n=i.anchor.key===i.focus.key;if(s=e.timeStamp,"MediaLast"===qn&&s<jn+30&&t.isComposing()&&n){if(qs(null),jn=0,setTimeout((()=>{ts(t,(()=>{qs(null)}))}),30),si(i)){const e=i.anchor.getNode();e.markDirty(),Gr(e)||oe(142),cr(i,e)}}else{qs(null),e.preventDefault();const r=i.anchor.getNode(),s=r.getTextContent(),o=r.canInsertTextAfter(),a=0===i.anchor.offset&&i.focus.offset===s.length;let l=ye&&n&&!a&&o;if(l&&i.isCollapsed()&&(l=!ls(ko(i.anchor,!0))),!l){So(t,en,!0);const e=vi();ye&&si(e)&&e.isCollapsed()&&(rr=e,setTimeout((()=>rr=null)))}}return}}var s;if(!si(i))return;const o=e.data;null!==Vn&&lo(!1,t,Vn),i.dirty&&null===Vn||!i.isCollapsed()||us(i.anchor.getNode())||null===r||i.applyDOMRange(r),Vn=null;const a=i.anchor,l=i.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":So(t,rn,e);break;case"insertFromComposition":qs(null),So(t,rn,e);break;case"insertLineBreak":qs(null),So(t,tn,!1);break;case"insertParagraph":qs(null),Qn&&!pe?(Qn=!1,So(t,tn,!1)):So(t,nn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":So(t,sn,e);break;case"deleteByComposition":(function(e,t){return e!==t||ss(e)||ss(t)||!Ds(e)||!Ds(t)})(c,u)&&So(t,on,e);break;case"deleteByDrag":case"deleteByCut":So(t,on,e);break;case"deleteContent":So(t,en,!1);break;case"deleteWordBackward":So(t,an,!0);break;case"deleteWordForward":So(t,an,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":So(t,ln,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":So(t,ln,!1);break;case"formatStrikeThrough":So(t,cn,"strikethrough");break;case"formatBold":So(t,cn,"bold");break;case"formatItalic":So(t,cn,"italic");break;case"formatUnderline":So(t,cn,"underline");break;case"historyUndo":So(t,un,void 0);break;case"historyRedo":So(t,dn,void 0)}else{if("\n"===o)e.preventDefault(),So(t,tn,!1);else if(o===Le)e.preventDefault(),So(t,nn,void 0);else if(null==o&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=o&&sr(i,r,o,e.timeStamp,!0)?(e.preventDefault(),So(t,rn,o)):Vn=o;Jn=e.timeStamp}}))}(e,t)]);let jn=0,qn=null,Jn=0,Vn=null;const Gn=new WeakMap,Zn=new WeakMap;let Yn=!1,Xn=!1,Qn=!1,er=!1,tr=!1,nr="",rr=null,ir=[0,"",0,"root",0];function sr(e,t,n,r,i){const s=e.anchor,o=e.focus,a=s.getNode(),l=Hi(),c=Do(Po(l)),u=null!==c?c.anchorNode:null,d=s.key,h=l.getElementByKey(d),g=n.length;return d!==o.key||!Gr(a)||(!i&&(!he||Jn<r+50)||a.isDirty()&&g<2||io(n))&&s.offset!==o.offset&&!a.isComposing()||zs(a)||a.isDirty()&&g>1||(i||!he)&&null!==h&&!a.isComposing()&&u!==Us(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=Ds(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Gr(t)||ss(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function or(e,t){return Bs(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function ar(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=e;Yn&&(Yn=!1,or(r,i)&&or(s,o)&&!rr)||ts(t,(()=>{if(!n)return void no(null);if(!Fs(t,r,s))return;let a=vi();if(rr&&si(a)&&a.isCollapsed()){const e=a.anchor,t=rr.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(a=rr.clone(),no(a))}if(rr=null,si(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const i=Po(t).event,s=i?i.timeStamp:performance.now(),[o,l,c,u,d]=ir,h=eo(),g=!1===t.isComposing()&&""===h.getTextContent();if(s<d+200&&n.offset===c&&n.key===u)lr(a,o,l);else if("text"===n.type)Gr(r)||oe(141),cr(a,r);else if("element"===n.type&&!g){ss(r)||oe(259);const e=n.getNode();e.isEmpty()?function(e,t){lr(e,t.getTextFormat(),t.getTextStyle())}(a,e):lr(a,0,"")}}else{const e=n.key,t=a.focus.key,r=a.getNodes(),s=r.length,l=a.isBackward(),c=l?o:i,u=l?i:o,d=l?t:e,h=l?e:t;let g=2047,p=!1;for(let e=0;e<s;e++){const t=r[e],n=t.getTextContentSize();if(Gr(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===s-1&&t.__key===h&&0===u)&&(p=!0,g&=t.getFormat(),0===g))break}a.format=p?g:0}}So(t,Yt,void 0)}))}function lr(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function cr(e,t){lr(e,t.getFormat(),t.getStyle())}function ur(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function dr(e,t){const n=e._compositionKey;if(qs(null),null!==n&&null!=t){if(""===t){const t=Vs(n),r=Us(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Gr(t)&&co(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=vi();if(si(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void So(e,bn,null)}}}lo(!0,e,t)}function hr(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const gr=new Map;function pr(e){const t=function(e){const t=Lo(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=Is(t.anchorNode);if(null===n)return;Xn&&(Xn=!1,ts(n,(()=>{const r=Si(),i=t.anchorNode;(Bo(i)||Bs(i))&&no(ki(r,t,n,e))})));const r=so(n),i=r[r.length-1],s=i._key,o=gr.get(s),a=o||i;a!==n&&ar(t,a,!1),ar(t,n,!0),n!==i?gr.set(s,n):o&&gr.delete(s)}function fr(e){e._lexicalHandled=!0}function mr(e){return!0===e._lexicalHandled}function yr(e){const t=Gn.get(e);if(void 0===t)return;const n=Zn.get(t);if(void 0===n)return;const r=n-1;r>=0||oe(164),Gn.delete(e),Zn.set(t,r),0===r&&t.removeEventListener("selectionchange",pr);const i=Rs(e);Os(i)?(function(e){if(null!==e._parentEditor){const t=so(e),n=t[t.length-1]._key;gr.get(n)===e&&gr.delete(n)}else gr.delete(e._key)}(i),e.__lexicalEditor=null):i&&oe(198);const s=hr(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}function _r(e,t,n){$i();const r=e.__key,i=e.getParent();if(null===i)return;const s=function(e){const t=vi();if(!si(t)||!ss(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),s=r.getNode();return Ao(i,e)&&n.set(e.__key,0,"element"),Ao(s,e)&&r.set(e.__key,0,"element"),t}(e);let o=!1;if(si(s)&&t){const t=s.anchor,n=s.focus;t.key===r&&(Ti(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Ti(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else ai(s)&&t&&e.isSelected()&&e.selectPrevious();if(si(s)&&t&&!o){const t=e.getIndexWithinParent();Ks(e),wi(s,i,t,-1)}else Ks(e);n||Fo(i)||i.canBeEmpty()||!i.isEmpty()||_r(i,t),t&&s&&us(i)&&i.isEmpty()&&i.selectEnd()}const br=Symbol.for("ephemeral");function xr(e){return e[br]||!1}class kr{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=Qo(this);return void 0===e&&oe(64,this.name),e}static clone(e){oe(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),function(e,t){const n=function(){const e=ws;return ws=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);$i(),Ui();const r=Hi(),i=Wi(),s=""+Ts++;i._nodeMap.set(s,e),ss(e)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,e.__key=s}(this,e)}getType(){return this.__type}isInline(){oe(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Vs(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||vi();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Gr(this))return n;if(si(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(ls(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Vs(e)}getParentOrThrow(){const e=this.getParent();return null===e&&oe(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Fo(t))return ss(e)||e===this&&ls(e)||oe(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&oe(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Vs(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Vs(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=ss(this)?this:this.getParent(),n=ss(e)?e:e.getParent(),r=t&&n?La(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const t=La(this,e);return null!==t&&("descendant"===t.type||("branch"===t.type?-1===Ea(t):("same"!==t.type&&"ancestor"!==t.type&&oe(279),!1)))}isParentOf(e){const t=La(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;null!==i;){const s=i.__key;if(r.has(s)||(r.add(s),n.push(i)),i===e)break;const o=ss(i)?t?i.getFirstChild():i.getLastChild():null;if(null!==o){i=o;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(null!==a){i=a;continue}const l=i.getParentOrThrow();if(r.has(l.__key)||n.push(l),l===e)break;let c=null,u=l;do{if(null===u&&oe(68),c=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),null===u)break;null!==c||r.has(u.__key)||n.push(u)}while(null===c);i=c}return t||n.reverse(),n}isDirty(){const e=Hi()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(xr(this))return this;const e=Vs(this.__key);return null===e&&oe(113),e}getWritable(){if(xr(this))return this;$i();const e=Wi(),t=Hi(),n=e._nodeMap,r=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,o=vi();if(null!==o&&o.setCachedNodes(null),s.has(r))return js(i),i;const a=Go(i);return s.add(r),js(a),n.set(r,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){oe(70)}updateDOM(e,t,n){oe(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){oe(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const e of ot(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&st(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){_r(this,!0,e)}replace(e,t){$i();let n=vi();null!==n&&(n=n.clone()),Io(this,e);const r=this.getLatest(),i=this.__key,s=e.__key,o=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;Ks(o);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,g=r.__parent;if(_r(r,!1,!0),null===c?a.__first=s:c.getWritable().__next=s,o.__prev=d,null===u?a.__last=s:u.getWritable().__prev=s,o.__next=h,o.__parent=g,a.__size=l,t&&(ss(this)&&ss(o)||oe(139),this.getChildren().forEach((e=>{o.append(e)}))),si(n)){no(n);const e=n.anchor,t=n.focus;e.key===i&&ri(e,o),t.key===i&&ri(t,o)}return Js()===i&&qs(s),o}insertAfter(e,t=!0){$i(),Io(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),s=vi();let o=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(Ks(r),si(s)){const e=i.__key,n=s.anchor,r=s.focus;o="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&si(s)){const e=this.getIndexWithinParent();wi(s,c,e+1);const t=c.__key;o&&s.anchor.set(t,e+2,"element"),a&&s.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){$i(),Io(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;Ks(r);const s=this.getPreviousSibling(),o=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===s?o.__first=i:s.getWritable().__next=i,o.__size++,n.__prev=i,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=vi();return t&&si(c)&&wi(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return _s()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){$i();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(ss(n))return n.select();if(!Gr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){$i();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(ss(n))return n.select(0,0);if(!Gr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const vr="historic",Sr="history-merge",wr="collaboration",Cr="skip-scroll-into-view",Tr="skip-dom-selection",Er="skip-selection-focus";class Nr extends kr{static getType(){return"linebreak"}static clone(e){return new Nr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Ho(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Fr(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Fr(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Ho(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Fr(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&Fr(r))return!0}return!1}(e)?null:{conversion:Ar,priority:0}}}static importJSON(e){return Lr().updateFromJSON(e)}}function Ar(e){return{node:Lr()}}function Lr(){return Oo(new Nr)}function Pr(e){return e instanceof Nr}function Fr(e){return Bs(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Or(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function Ir(e,t){return 1&t?"strong":2&t?"em":"span"}function Rr(e,t,n,r,i){const s=r.classList;let o=_o(i,"base");void 0!==o&&s.add(...o),o=_o(i,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;void 0!==o&&(8&n&&4&n?(a=!0,l||s.add(...o)):l&&s.remove(...o));for(const e in Me){const r=Me[e];if(o=_o(i,e),void 0!==o)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&s.remove(...o);continue}(0===(t&r)||l&&"underline"===e||"strikethrough"===e)&&s.add(...o)}else t&r&&s.remove(...o)}}function Mr(e,t,n){const r=t.firstChild,i=n.isComposing(),s=e+(i?Ae:"");if(null==r)t.textContent=s;else{const e=r.nodeValue;if(e!==s)if(i||de){const[t,n,i]=function(e,t){const n=e.length,r=t.length;let i=0,s=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;s+i<n&&s+i<r&&e[n-s-1]===t[r-s-1];)s++;return[i,n-i-s,t.slice(i,r-s)]}(e,s);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=s}}function Dr(e,t,n,r,i,s){Mr(i,e,t);const o=s.theme.text;void 0!==o&&Rr(0,0,r,e,o)}function zr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class Br extends kr{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Br(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Ue[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Js()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Me[e];return 0!==(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Ws(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=Or(0,n),i=Ir(0,n),s=null===r?i:r,o=document.createElement(s);let a=o;this.hasFormat("code")&&o.setAttribute("spellcheck","false"),null!==r&&(a=document.createElement(i),o.appendChild(a)),Dr(a,this,0,n,this.__text,e);const l=this.__style;return""!==l&&(o.style.cssText=l),o}updateDOM(e,t,n){const r=this.__text,i=e.__format,s=this.__format,o=Or(0,i),a=Or(0,s),l=Ir(0,i),c=Ir(0,s);if((null===o?l:o)!==(null===a?c:a))return!0;if(o===a&&l!==c){const e=t.firstChild;null==e&&oe(48);const i=document.createElement(c);return Dr(i,this,0,s,r,n),t.replaceChild(i,e),!1}let u=t;null!==a&&null!==o&&(u=t.firstChild,null==u&&oe(49)),Mr(r,u,this);const d=n.theme.text;void 0!==d&&i!==s&&Rr(0,i,s,u,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Kr,priority:0}),b:()=>({conversion:Ur,priority:0}),code:()=>({conversion:Jr,priority:0}),em:()=>({conversion:Jr,priority:0}),i:()=>({conversion:Jr,priority:0}),mark:()=>({conversion:Jr,priority:0}),s:()=>({conversion:Jr,priority:0}),span:()=>({conversion:$r,priority:0}),strong:()=>({conversion:Jr,priority:0}),sub:()=>({conversion:Jr,priority:0}),sup:()=>({conversion:Jr,priority:0}),u:()=>({conversion:Jr,priority:0})}}static importJSON(e){return Vr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Bo(t)||oe(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=zr(t,"b")),this.hasFormat("italic")&&(t=zr(t,"i")),this.hasFormat("strikethrough")&&(t=zr(t,"s")),this.hasFormat("underline")&&(t=zr(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Me[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?De[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Ws(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=$e[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){$i();let n=e,r=t;const i=vi(),s=this.getTextContent(),o=this.__key;if("string"==typeof s){const e=s.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!si(i))return _i(o,n,o,r,"text","text");{const e=Js();e!==i.anchor.key&&e!==i.focus.key||qs(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),s=i.__text,o=n.length;let a=e;a<0&&(a=o+a,a<0&&(a=0));const l=vi();if(r&&si(l)){const t=e+o;l.setTextNodeRange(i,t,i,t)}const c=s.slice(0,a)+n+s.slice(a+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){$i();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Js(),s=n.length;e.sort(((e,t)=>e-t)),e.push(s);const o=[],a=e.length;for(let t=0,r=0;t<s&&r<=a;r++){const i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}const l=o.length;if(1===l)return[t];const c=o[0],u=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),p=t.__detail;let f=!1,m=null,y=null;const _=vi();if(si(_)){const[e,t]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];"text"===e.type&&e.key===r&&(m=e),"text"===t.type&&t.key===r&&(y=t)}t.isSegmented()?(d=Vr(c),d.__format=h,d.__style=g,d.__detail=p,d.__state=dt(t,d),f=!0):d=t.setTextContent(c);const b=[d];for(let e=1;e<l;e++){const n=Vr(o[e]);n.__format=h,n.__style=g,n.__detail=p,n.__state=dt(t,n);const s=n.__key;i===r&&qs(s),b.push(n)}const x=m?m.offset:null,k=y?y.offset:null;let v=0;for(const e of b){if(!m&&!y)break;const t=v+e.getTextContentSize();if(null!==m&&null!==x&&x<=t&&x>=v&&(m.set(e.getKey(),x-v,"text"),x<t&&(m=null)),null!==y&&null!==k&&k<=t&&k>=v){y.set(e.getKey(),k-v,"text");break}v=t}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&js(t),null!==n&&js(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();f?(e.splice(t,0,b),this.remove()):e.splice(t,1,b),si(_)&&wi(_,u,t,l-1)}return b}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||oe(50);const n=this.__key,r=e.__key,i=this.__text,s=i.length;Js()===r&&qs(n);const o=vi();if(si(o)){const i=o.anchor,a=o.focus;null!==i&&i.key===r&&Ei(i,t,n,e,s),null!==a&&a.key===r&&Ei(a,t,n,e,s)}const a=e.__text,l=t?a+i:i+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function $r(e){return{forChild:Zr(e.style),node:null}}function Ur(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Zr(t.style,n?void 0:"bold"),node:null}}const Wr=new WeakMap;function Hr(e){if(!Bo(e))return!1;if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function Kr(e){const t=e;null===e.parentElement&&oe(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Wr.get(n))&&!Hr(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)Wr.set(r[e],i);return i}(t)){const e=n.split(/(\r?\n|\t)/),t=[],r=e.length;for(let n=0;n<r;n++){const r=e[n];"\n"===r||"\r\n"===r?t.push(Lr()):"\t"===r?t.push(Xr()):""!==r&&t.push(Vr(r))}return{node:t}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===n)return{node:null};if(" "===n[0]){let e=t,r=!0;for(;null!==e&&null!==(e=jr(e,!1));){const t=e.textContent||"";if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=jr(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Vr(n)}}function jr(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,Bo(n)){const e=n.style.display;if(""===e&&!Wo(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(Bs(n))return n;if("BR"===n.nodeName)return null}}const qr={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Jr(e){const t=qr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Zr(e.style,t),node:null}}function Vr(e=""){return Oo(new Br(e))}function Gr(e){return e instanceof Br}function Zr(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,s=r.includes("line-through"),o="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Gr(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),s&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),o&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class Yr extends Br{static getType(){return"tab"}static clone(e){return new Yr(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=_o(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Xr().updateFromJSON(e)}setTextContent(e){return"\t"!==e&&""!==e&&ae(126),super.setTextContent("\t")}spliceText(e,t,n,r){return""===n&&0===t||"\t"===n&&1===t||oe(286),this}setDetail(e){return 2!==e&&oe(127),this}setMode(e){return"normal"!==e&&oe(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Xr(){return Oo(new Yr)}function Qr(e){return e instanceof Yr}class ei{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Ta($a(Pa(this,"next")),$a(Pa(e,"next")))<0}getNode(){const e=Vs(this.key);return null===e&&oe(20),e}set(e,t,n,r){const i=this._selection,s=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Bi()||(Js()===s&&qs(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function ti(e,t,n){return new ei(e,t,n)}function ni(e,t){let n=t.__key,r=e.offset,i="element";if(Gr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!ss(t)){const e=t.getNextSibling();if(Gr(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function ri(e,t){if(ss(t)){const n=t.getLastDescendant();ss(n)||Gr(n)?ni(e,n):ni(e,t)}else ni(e,t)}class ii{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!ai(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new ii(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let i;if(Gr(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=Vs(e);null!==t&&n.push(t)}return Bi()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((vi()||Si())===this&&e[0]){const t=fa(e[0],"next");Oa(wa(t,t))}for(const t of e)t.remove()}}function si(e){return e instanceof oi}class oi{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!si(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=function(e){const t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);const i=new Set,s=new Set;for(const n of e)if(da(n)){const{origin:e}=n;0===t.length?i.add(e):(s.add(e),t.push(e))}else{const{origin:e}=n;ss(e)&&s.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),ua(e.focus)&&ss(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=ba(e.focus.origin,"previous");da(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xa(n))i.delete(n.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!ss(e)||s.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=$a(e.anchor),r=$a(e.anchor.getFlipped()),i=e=>ca(e)?e.origin:e.getNodeAtCaret(),s=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(s)}return t}(Ha(Ra(this),"next"));return Bi()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,s=r.isBefore(i),[o,a]=ci(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(ss(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Gr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=o<a?e.slice(o,a):e.slice(a,o)):e=s?e.slice(o):e.slice(a):d===n&&(e=s?e.slice(0,a):e.slice(0,o)),l+=e}else!ls(d)&&!Pr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Hi(),n=t.getEditorState()._selection,r=mi(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,s]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),ft(this)}clone(){const e=this.anchor,t=this.focus;return new oi(ti(e.key,e.offset,e.type),ti(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Ws(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Me[e];return 0!==(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(Lr()):"\t"===r?n.push(Xr()):n.push(Vr(r))}this.insertNodes(n)}insertText(e){const t=this.anchor,n=this.focus,r=this.format,i=this.style;let s=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(s=n,o=t),"element"===s.type&&function(e,t,n,r){const i=e.getNode(),s=i.getChildAtIndex(e.offset),o=Vr();if(o.setFormat(n),o.setStyle(r),bs(s))s.splice(0,0,[o]);else{const e=us(i)?_s().append(o):o;null===s?i.append(e):s.insertBefore(e)}e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(s,o,r,i),"element"===o.type&&Fa(o,$a(Pa(o,"next")));const a=s.offset;let l=o.offset;const c=this.getNodes(),u=c.length;let d=c[0];Gr(d)||oe(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=c[u-1];if(1===u&&"element"===o.type&&(l=h,o.set(s.key,l,"text")),this.isCollapsed()&&a===h&&(zs(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Gr(t)&&t.canInsertTextBefore()&&!zs(t)||(t=Vr(),t.setFormat(r),t.setStyle(i),g.canInsertTextAfter()?d.insertAfter(t):g.insertAfter(t)),t.select(0,0),d=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(zs(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Gr(t)&&!zs(t)||(t=Vr(),t.setFormat(r),g.canInsertTextBefore()?d.insertBefore(t):g.insertBefore(t)),t.select(),d=t,""!==e)return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const e=Vr(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||ss(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),fi(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(Ds(d)){const t=Vr(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Qr(d)){const t=Vr(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Vr(e);if(t.setFormat(r),t.setStyle(i),t.select(),0===a)d.insertBefore(t,!1);else{const[e]=d.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}d.setFormat(r),d.setStyle(i)}const s=l-a;d=d.spliceText(a,s,e,!0),""===d.getTextContent()?d.remove():"text"===this.anchor.type&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=t,this.style=n))}else{const t=new Set([...d.getParentKeys(),...p.getParentKeys()]),n=ss(d)?d:d.getParentOrThrow();let r=ss(p)?p:p.getParentOrThrow(),i=p;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===o.type&&(0!==l||""===p.getTextContent())||"element"===o.type&&p.getIndexWithinParent()<l)if(Gr(p)&&!Ds(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=Vr(p.getTextContent());p.replace(e),p=e}us(o.getNode())||"text"!==o.type||(p=p.spliceText(0,l,"")),t.add(p.__key)}else{const e=p.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?p.remove():e.remove()}else t.add(p.__key);const s=r.getChildren(),g=new Set(c),f=n.is(r),m=n.isInline()&&null===d.getNextSibling()?n:d;for(let e=s.length-1;e>=0;e--){const t=s[e];if(t.is(d)||ss(t)&&t.isParentOf(d))break;t.isAttached()&&(!g.has(t)||t.is(i)?f||m.insertAfter(t,!1):t.remove())}if(!f){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Ds(d))if(a===h)d.select();else{const t=Vr(e);t.select(),d.replace(t)}else d=d.spliceText(a,h-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e<u;e++){const n=c[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){const e=vi()===this;Ia(this,Ba(Ra(this))),e&&vi()!==this&&no(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void qs(null);const n=this.getNodes(),r=[];for(const e of n)Gr(e)&&r.push(e);const i=t=>{n.forEach((n=>{if(ss(n)){const r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},s=r.length;if(0===s)return this.toggleFormat(e),qs(null),void i(t);const o=this.anchor,a=this.focus,l=this.isBackward(),c=l?a:o,u=l?o:a;let d=0,h=r[0],g="element"===c.type?0:c.offset;if("text"===c.type&&g===h.getTextContentSize()&&(d=1,h=r[1],g=0),null==h)return;const p=h.getFormatFlags(e,t);i(p);const f=s-1;let m=r[f];const y="text"===u.type?u.offset:m.getTextContentSize();if(h.is(m)){if(g===y)return;if(zs(h)||0===g&&y===h.getTextContentSize())h.setFormat(p);else{const e=h.splitText(g,y),t=0===g?e[0]:e[1];t.setFormat(p),"text"===c.type&&c.set(t.__key,0,"text"),"text"===u.type&&u.set(t.__key,y-g,"text")}return void(this.format=p)}0===g||zs(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const _=m.getFormatFlags(e,p);y>0&&(y===m.getTextContentSize()||zs(m)||([m]=m.splitText(y)),m.setFormat(_));for(let t=d+1;t<f;t++){const n=r[t],i=n.getFormatFlags(e,_);n.setFormat(i)}"text"===c.type&&c.set(h.__key,g,"text"),"text"===u.type&&u.set(m.__key,y,"text"),this.format=p|_}insertNodes(e){if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const t=vi();return si(t)||oe(134),t.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=ea(t,Ko),r=e[e.length-1];if(ss(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=Li(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>(ss(e)||ls(e))&&!e.isInline()))){ss(n)||oe(211,t.constructor.name,t.getType());const i=Li(this);return n.splice(i,0,e),void r.selectEnd()}const i=function(e){const t=_s();let n=null;for(let r=0;r<e.length;r++){const i=e[r],s=Pr(i);if(s||ls(i)&&i.isInline()||ss(i)&&i.isInline()||Gr(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),s))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),s=i.getLastDescendant(),o=i.getChildren(),a=ss(n)&&n.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;ss(u=c)&&Ko(u)&&!u.isEmpty()&&ss(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(ss(n)||oe(211,t.constructor.name,t.getType()),n.append(...c.getChildren()),c=o[1]),c&&(null===n&&oe(212,t.constructor.name,t.getType()),function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const i=[t];for(;r!==n;)r.getNextSibling()||oe(140),r=r.getNextSibling(),i.push(r);let s=e;for(const e of i)s=s.insertAfter(e)}(n,c));const d=ea(s,Ko);a&&ss(d)&&(a.canMergeWhenEmpty()||Ko(l))&&(d.append(...a.getChildren()),a.remove()),ss(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=ss(n)?n.getLastChild():null;Pr(h)&&d!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=_s();return eo().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Li(this),t=ea(this.anchor.getNode(),Ko);ss(t)||oe(213);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],i=t.insertNewAfter(this,!1);return i?(i.append(...r),i.selectStart(),i):null}insertLineBreak(e){const t=Lr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=[...this.getNodes()],t=e.length;let n=e[0],r=e[t-1];const[i,s]=ci(this),o=this.isBackward(),[a,l]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=o?[s,i]:[i,s];if(0===t)return[];if(1===t){if(Gr(n)&&!this.isCollapsed()){const e=n.splitText(c,u),t=0===c?e[0]:e[1];return t?(a.set(t.getKey(),0,"text"),l.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(Gr(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,a.set(n.getKey(),0,"text"))),Gr(r)){const t=r.getTextContent().length;0===u?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,l.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(Fi(this,e,t,n))return;const r="move"===e,i=Hi(),s=Do(Po(i));if(!s)return;const o=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();if(null===a||null===o||!ss(l)||l.isInline()||l.canBeEmpty()||Mo(o,i,a),this.dirty){let e=Co(i,this.anchor.key),t=Co(i,this.focus.key);"text"===this.anchor.type&&(e=Us(e)),"text"===this.focus.type&&(t=Us(t)),e&&t&&Ni(s,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(s,e,t?"backward":"forward",n),s.rangeCount>0){const e=s.getRangeAt(0),n=this.anchor.getNode(),i=us(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Fo(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!r){const n=this.getNodes(),r=[];let o=!1;for(let e=0;e<n.length;e++){const t=n[e];Ao(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){const e=r[0];ss(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=r[r.length-1];ss(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}s.anchorNode===e.startContainer&&s.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,s=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,s,!0)}(this)}}"lineboundary"===n&&Fi(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&ss(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(ss(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=Sa(Pa(t,e?"previous":"next"));if(r.getTextSlices().every((e=>null===e||0===e.distance))){let e={type:"initial"};for(const t of r.iterNodeCarets("shadowRoot"))if(da(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(ss(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=$a(t);Ia(this,wa(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(ua(t)){if(ss(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(ls(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&ss(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=xi();e.add(t.origin.getKey()),no(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;return Ia(this,wa(!t.origin.isEmpty()&&n.isEmpty()?Ma(fa(n,t.direction)):r.anchor,t)),this.removeText()}}const i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&ui(this,t.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){const t=i.offset,s=r.getTextContentSize();if(r.is(n)||e&&t!==s||!e&&0!==t)return void hi(r,e,t)}else if(null!==n&&n.isSegmented()){const i=t.offset,s=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==s)return void hi(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,s=r.offset,o=e<s,a=o?e:s,l=o?s:e,c=l-1;a!==c&&function(e){return!(io(e)||di(e))}(i.getTextContent().slice(a,l))&&(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&us(e.getParent())&&null===e.getPreviousSibling()&&ui(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function ai(e){return e instanceof ii}function li(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function ci(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[li(n),li(r)]}function ui(e,t){for(let n=t;n;n=n.getParent()){if(ss(n)){if(n.collapseAtStart(e))return!0;if(Fo(n))break}if(n.getPreviousSibling())break}return!1}const di=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function hi(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,a=0;for(let e=0;e<s;e++){const r=e===s-1;if(a=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(a=void 0);break}}const l=i.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function gi(e,t,n,r){let i,s=t;if(Bo(e)){let o=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;s===l&&(o=!0,s=l-1);let u=a[s],d=!1;if(u===c)u=a[s+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&s--}if(i=ro(u),Gr(i))s=ya(i,o?"next":"previous");else{let a=ro(e);if(null===a)return null;if(ss(a)){const l=r.getElementByKey(a.getKey());null===l&&oe(214);const c=a.getDOMSlot(l);[a,s]=c.resolveChildIndex(a,l,e,t),ss(a)||oe(215),o&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let u=a.getChildAtIndex(s);if(ss(u)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){const e=o?u.getLastDescendant():u.getFirstDescendant();null===e?a=u:(u=e,a=ss(u)?u:u.getParentOrThrow()),s=0}Gr(u)?(i=u,a=null,s=ya(u,o?"next":"previous")):u!==a&&o&&!d&&(ss(a)||oe(216),s=Math.min(a.getChildrenSize(),s+1))}else{const n=a.getIndexWithinParent();s=0===t&&ls(a)&&ro(e)===a?n:n+1,a=a.getParentOrThrow()}if(ss(a))return ti(a.__key,s,"element")}}else i=ro(e);return Gr(i)?ti(i.__key,ya(i,s,"clamp"),"text"):null}function pi(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),s=i.getParent();if(t){if((n||!t)&&null===r&&ss(s)&&s.isInline()){const t=s.getPreviousSibling();Gr(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else ss(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Gr(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(t&&ss(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&ss(s)&&s.isInline()&&!s.canInsertTextAfter()){const t=s.getNextSibling();Gr(t)&&e.set(t.__key,0,"text")}}}function fi(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);pi(e,r,i),pi(t,!r,i),i&&t.set(e.key,e.offset,e.type);const s=Hi();if(s.isComposing()&&s._compositionKey!==e.key&&si(n)){const r=n.anchor,i=n.focus;e.set(r.key,r.offset,r.type,!0),t.set(i.key,i.offset,i.type,!0)}}}function mi(e,t,n,r,i,s){if(null===e||null===n||!Fs(i,e,n))return null;const o=gi(e,t,si(s)?s.anchor:null,i);if(null===o)return null;const a=gi(n,r,si(s)?s.focus:null,i);if(null===a)return null;if("element"===o.type&&"element"===a.type){const t=ro(e),r=ro(n);if(ls(t)&&ls(r))return null}return fi(o,a,s),[o,a]}function yi(e){return ss(e)&&!e.isInline()}function _i(e,t,n,r,i,s){const o=Wi(),a=new oi(ti(e,t,i),ti(n,r,s),0,"");return a.dirty=!0,o._selection=a,a}function bi(){const e=ti("root",0,"element"),t=ti("root",0,"element");return new oi(e,t,0,"")}function xi(){return new ii(new Set)}function ki(e,t,n,r){const i=n._window;if(null===i)return null;const s=r||i.event,o=s?s.type:void 0,a="selectionchange"===o,l=!Ke&&(a||"beforeinput"===o||"compositionstart"===o||"compositionend"===o||"click"===o&&s&&3===s.detail||"drop"===o||void 0===o);let c,u,d,h;if(si(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,(a||void 0===o)&&si(e)&&!Fs(n,c,u))return e.clone();const g=mi(c,d,u,h,n,e);if(null===g)return null;const[p,f]=g;return new oi(p,f,si(e)?e.format:0,si(e)?e.style:"")}function vi(){return Wi()._selection}function Si(){return Hi()._editorState._selection}function wi(e,t,n,r=1){const i=e.anchor,s=e.focus,o=i.getNode(),a=s.getNode();if(!t.is(o)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(l,n,"element"),s.set(l,n,"element"),Ci(e)}}else{const o=e.isBackward(),a=o?s:i,c=a.getNode(),u=o?i:s,d=u.getNode();if(t.is(c)){const e=a.offset;(n<=e&&r>0||n<e&&r<0)&&a.set(l,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(l,Math.max(0,e+r),"element")}}Ci(e)}function Ci(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,s=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!ss(s))return;const e=s.getChildrenSize(),i=n>=e,o=i?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Gr(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}}else{if(ss(s)){const e=s.getChildrenSize(),r=n>=e,i=r?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Gr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(ss(o)){const e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(Gr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Ti(e,t,n,r,i){let s=null,o=0,a=null;null!==r?(s=r.__key,Gr(r)?(o=r.getTextContentSize(),a="text"):ss(r)&&(o=r.getChildrenSize(),a="element")):null!==i&&(s=i.__key,Gr(i)?a="text":ss(i)&&(a="element")),null!==s&&null!==a?e.set(s,o,a):(o=t.getIndexWithinParent(),-1===o&&(o=n.getChildrenSize()),e.set(n.__key,o,"element"))}function Ei(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Ni(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function Ai(e){let t=vi()||Si();null===t&&(t=eo().selectEnd()),t.insertNodes(e)}function Li(e){let t=e;e.isCollapsed()||t.removeText();const n=vi();si(n)&&(t=n),si(t)||oe(161);const r=t.anchor;let i=r.getNode(),s=r.offset;for(;!Ko(i);){const e=i;if([i,s]=Pi(i,s),e.is(i))break}return s}function Pi(e,t){const n=e.getParent();if(!n){const e=_s();return eo().append(e),e.select(),[eo(),0]}if(Gr(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!ss(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new oi(ti(e.__key,t,"element"),ti(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Fi(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){const[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}const s=Pa(e.focus,n?"previous":"next"),o="lineboundary"===r,a="move"===t;let l=s,c="decorators-and-blocks"===i;if(!Ua(l)){for(const e of l){c=!1;const{origin:t}=e;if(!ls(t)||t.isIsolated()||(l=e,!o||!t.isInline()))break}if(c)for(const e of Sa(s).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(da(e))e.origin.isInline()||(l=e);else{if(ss(e.origin))continue;ls(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===s)return!1;if(a&&!o&&ls(l.origin)&&l.origin.isKeyboardSelectable()){const e=xi();return e.add(l.origin.getKey()),no(e),!0}return l=$a(l),a&&Fa(e.anchor,l),Fa(e.focus,l),c||!o}let Oi=null,Ii=null,Ri=!1,Mi=!1,Di=0;const zi={characterData:!0,childList:!0,subtree:!0};function Bi(){return Ri||null!==Oi&&Oi._readOnly}function $i(){Ri&&oe(13)}function Ui(){Di>99&&oe(14)}function Wi(){return null===Oi&&oe(195,Ki()),Oi}function Hi(){return null===Ii&&oe(196,Ki()),Ii}function Ki(){let e=0;const t=new Set,n=Ss.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=Rs(r);if(Os(i))e++;else if(i){let e=String(i.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function ji(e,t,n){const r=t.__type,i=Es(e,r);let s=n.get(r);void 0===s&&(s=Array.from(i.transforms),n.set(r,s));const o=s.length;for(let e=0;e<o&&(s[e](t),t.isAttached());e++);}function qi(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Ji(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const e of r)n.add(e)}function Vi(e){return Gi(e,Hi()._nodes)}function Gi(e,t){const n=e.type,r=t.get(n);void 0===r&&oe(17,n);const i=r.klass;e.type!==i.getType()&&oe(18,i.name);const s=i.importJSON(e),o=e.children;if(ss(s)&&Array.isArray(o))for(let e=0;e<o.length;e++){const n=Gi(o[e],t);s.append(n)}return s}function Zi(e,t,n){const r=Oi,i=Ri,s=Ii;Oi=t,Ri=!0,Ii=e;try{return n()}finally{Oi=r,Ri=i,Ii=s}}function Yi(e,t){const n=e._pendingEditorState,r=e._rootElement,i=e._headless||null===r;if(null===n)return;const s=e._editorState,o=s._selection,a=n._selection,l=0!==e._dirtyType,c=Oi,u=Ri,d=Ii,h=e._updating,g=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==g){Ii=e,Oi=n,Ri=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;g.disconnect(),p=function(e,t,n,r,i,s){Et="",Lt="",Pt=2===r,_t=n,yt=n._config,bt=n._nodes,xt=_t._listeners.mutation,kt=i,vt=s,St=e._nodeMap,wt=t._nodeMap,Ft=t._readOnly,Ct=new Map(n._keyToDOMMap);const o=new Map;return Tt=o,qt("root",null),_t=void 0,bt=void 0,kt=void 0,vt=void 0,St=void 0,wt=void 0,yt=void 0,Ct=void 0,Tt=void 0,o}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Mi)throw t;return xs(e,null,r,n),Qe(e),e._dirtyType=2,Mi=!0,Yi(e,s),void(Mi=!1)}finally{g.observe(r,zi),e._updating=h,Oi=c,Ri=u,Ii=d}}n._readOnly||(n._readOnly=!0);const f=e._dirtyLeaves,m=e._dirtyElements,y=e._normalizedNodes,_=e._updateTags,b=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let s;for(s in r)i.has(s)||(r===n&&(r=Xs(e)),delete r[s])}(e,n);const x=i?null:Do(Po(e));if(e._editable&&null!==x&&(l||null===a||a.dirty||!a.is(o))&&null!==r&&!_.has(Tr)){Ii=e,Oi=n;try{if(null!==g&&g.disconnect(),l||null===a||a.dirty){const t=e._blockCursorElement;null!==t&&Mo(t,e,r),function(e,t,n,r,i,s){const o=r.anchorNode,a=r.focusNode,l=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(i.has(wr)&&u!==s||null!==u&&Ps(u))return;if(!si(t))return void(null!==e&&Fs(n,o,a)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,f=Co(n,g),m=Co(n,p),y=d.offset,_=h.offset,b=t.format,x=t.style,k=t.isCollapsed();let v=f,S=m,w=!1;if("text"===d.type){v=Us(f);const e=d.getNode();w=e.getFormat()!==b||e.getStyle()!==x}else si(e)&&"text"===e.anchor.type&&(w=!0);var C,T,E,N,A;if("text"===h.type&&(S=Us(m)),null!==v&&null!==S&&(k&&(null===e||w||si(e)&&(e.format!==b||e.style!==x))&&(C=b,T=x,E=y,N=g,A=performance.now(),ir=[C,T,E,N,A]),l!==y||c!==_||o!==v||a!==S||"Range"===r.type&&k||(null!==u&&s.contains(u)||i.has(Er)||s.focus({preventScroll:!0}),"element"===d.type))){if(Ni(r,v,y,S,_),!i.has(Cr)&&t.isCollapsed()&&null!==s&&s===document.activeElement){const e=si(t)&&"element"===t.anchor.type?v.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=Eo(n),i=Lo(r);if(null===r||null===i)return;let{top:s,bottom:o}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Po(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(s<a?n=-(a-s):o>l&&(n=o-l),0!==n)if(t)i.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;s-=t,o-=t}if(t)break;c=To(c)}}(n,t,s)}}Yn=!0}}(o,a,e,x,_,r)}!function(e,t,n){let r=e._blockCursorElement;if(si(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const i=n.anchor,s=i.getNode(),o=i.offset;let a=!1,l=null;if(o===s.getChildrenSize())Ro(s.getChildAtIndex(o-1))&&(a=!0);else{const t=s.getChildAtIndex(o);if(null!==t&&Ro(t)){const n=t.getPreviousSibling();(null===n||Ro(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(s.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=be(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&Mo(r,e,t)}(e,r,a)}finally{null!==g&&g.observe(r,zi),Ii=d,Oi=c}}null!==p&&function(e,t,n,r,i){const s=Array.from(e._listeners.mutation),o=s.length;for(let e=0;e<o;e++){const[o,a]=s[e];for(const e of a){const s=t.get(e);void 0!==s&&o(s,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,p,_,f,s),si(a)||null===a||null!==o&&o.is(a)||e.dispatchCommand(Yt,void 0);const k=e._pendingDecorators;null!==k&&(e._decorators=k,e._pendingDecorators=null,Xi("decorator",e,!0,k)),function(e,t,n){const r=Qs(t),i=Qs(n);r!==i&&Xi("textcontent",e,!0,i)}(e,t||s,n),Xi("update",e,!0,{dirtyElements:m,dirtyLeaves:f,editorState:n,mutatedNodes:p,normalizedNodes:y,prevEditorState:t||s,tags:_}),function(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}(e,b),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;es(e,t,r)}}}(e)}function Xi(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=Array.from(t._listeners[e]);for(let e=0;e<n.length;e++)n[e].apply(null,r)}finally{t._updating=i}}function Qi(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t,s=e._pendingEditorState;let o;void 0!==i&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(null===s&&oe(191),s._flushSync=!0),o&&e._deferred.push(o),Ji(e,i.tag)),null==s?es(e,n,i):n()}}return r}function es(e,t,n){const r=e._updateTags;let i,s=!1,o=!1;void 0!==n&&(i=n.onUpdate,Ji(e,n.tag),s=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let l=e._pendingEditorState,c=!1;(null===l||l._readOnly)&&(l=e._pendingEditorState=ds(l||a),c=!0),l._flushSync=o;const u=Oi,d=Ri,h=Ii,g=e._updating;Oi=l,Ri=!1,e._updating=!0,Ii=e;const p=e._headless||null===e.getRootElement();Cs(null);try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=Do(Po(e));return si(n)||null==n?ki(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),s=Qi(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(si(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),0!==e._dirtyType&&(s?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Gr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&pt(t)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,s=Js(),o=new Map;let a=n,l=a.size,c=r,u=c.size;for(;l>0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=i.get(e);Gr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&pt(r),void 0!==r&&qi(r,s)&&ji(t,r,o),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Di++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,c.delete("root")&&c.set("root",!0);for(const e of c){const n=e[0],a=e[1];if(r.set(n,a),!a)continue;const l=i.get(n);void 0!==l&&qi(l,s)&&ji(t,l,o)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Di++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Qi(e),function(e,t,n,r){const i=e._nodeMap,s=t._nodeMap,o=[];for(const[e]of r){const t=s.get(e);void 0!==t&&(t.isAttached()||(ss(t)&&He(t,e,i,s,o,r),i.has(e)||r.delete(e),o.push(e)))}for(const e of o)s.delete(e);for(const e of n){const t=s.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),s.delete(e))}}(a,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);const i=l._selection;if(si(i)){const e=l._nodeMap,t=i.anchor.key,n=i.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||oe(19)}else ai(i)&&0===i._nodes.size&&(l._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Yi(e)}finally{Oi=u,Ri=d,Ii=h,e._updating=g,Di=0}const f=0!==e._dirtyType||e._deferred.length>0||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(l,e);f?l._flushSync?(l._flushSync=!1,Yi(e)):c&&As((()=>{Yi(e)})):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function ts(e,t,n){Ii===e&&void 0===n?t():es(e,t,n)}class ns{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new ns(this.element,e,this.after)}withAfter(e){return new ns(this.element,this.before,e)}withElement(e){return this.element===e?this:new ns(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return null!==t&&t.parentElement!==this.element&&oe(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&oe(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&oe(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(_e||pe||ge);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),e){const e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){const t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}const i=rs(t,n);i.push(r);const s=rs(t,this.element);let o=e.getIndexWithinParent();for(let e=0;e<s.length;e++){const t=i[e],n=s[e];if(void 0===t||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}}function rs(e,t){const n=[];let r=t;for(;r!==e&&null!==r;r=r.parentNode){let e=0;for(let t=r.previousSibling;null!==t;t=t.previousSibling)e++;n.push(e)}return r!==e&&oe(225),n.reverse()}class is extends kr{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Be[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=Hi()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Gr(t)&&e.push(t),ss(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;ss(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;ss(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return ss(e)&&e.getLastDescendant()||e||null}const r=t[e];return ss(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Vs(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&oe(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Vs(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&oe(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),ss(i)&&r!==n-1&&!i.isInline()&&(e+=Le)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),ss(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){const t=ze[e];return 0!==(this.getFormat()&t)}return!1}hasTextFormat(e){const t=Me[e];return 0!==(this.getTextFormat()&t)}getFormatFlags(e,t){return Ws(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){$i();const n=vi();let r=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Gr(e)||ss(e))return e.select(0,0)}else if(!(void 0!==e&&e!==s||void 0!==t&&t!==s)){const e=this.getLastChild();if(Gr(e)||ss(e))return e.select()}void 0===r&&(r=s),void 0===i&&(i=s);const o=this.__key;return si(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):_i(o,r,o,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?ze[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){xr(this)&&oe(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||oe(226,String(e),String(t),String(r));const s=i.__key,o=[],a=[],l=this.getChildAtIndex(e+t);let c=null,u=r-t+n.length;if(0!==e)if(e===r)c=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(c=t.getPreviousSibling())}if(t>0){let e=null===c?this.getFirstChild():c.getNextSibling();for(let n=0;n<t;n++){null===e&&oe(100);const t=e.getNextSibling(),n=e.__key;Ks(e.getWritable()),a.push(n),e=t}}let d=c;for(const e of n){null!==d&&e.is(d)&&(c=d=d.getPreviousSibling());const t=e.getWritable();t.__parent===s&&u--,Ks(t);const n=e.__key;if(null===d)i.__first=n,t.__prev=null;else{const e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===s&&oe(76),t.__parent=s,o.push(n),d=e}if(e+t===r)null!==d&&(d.getWritable().__next=null,i.__last=d.__key);else if(null!==l){const e=l.getWritable();if(null!==d){const t=d.getWritable();e.__prev=d.__key,t.__next=l.__key}else e.__prev=null}if(i.__size=u,a.length){const e=vi();if(si(e)){const t=new Set(a),n=new Set(o),{anchor:r,focus:i}=e;os(r,t,n)&&Ti(r,r.getNode(),this,c,l),os(i,t,n)&&Ti(i,i.getNode(),this,c,l),0!==u||this.canBeEmpty()||Fo(this)||this.remove()}}return i}getDOMSlot(e){return new ns(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){const e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");const n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=this.getDOMSlot(e);let r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){const i=t.getElementByKey(e.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}function ss(e){return e instanceof is}function os(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}class as extends kr{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ls(e){return e instanceof as}class cs extends is{__cachedText;static getType(){return"root"}static clone(){return new cs}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){oe(51)}getTextContent(){const e=this.__cachedText;return!Bi()&&0!==Hi()._dirtyType||null===e?super.getTextContent():e}remove(){oe(52)}replace(e){oe(53)}insertBefore(e){oe(54)}insertAfter(e){oe(55)}updateDOM(e,t){return!1}splice(e,t,n){for(const e of n)ss(e)||ls(e)||oe(282);return super.splice(e,t,n)}static importJSON(e){return eo().updateFromJSON(e)}collapseAtStart(){return!0}}function us(e){return e instanceof cs}function ds(e){return new ps(new Map(e._nodeMap))}function hs(){return new ps(new Map([["root",new cs]]))}function gs(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&oe(130,n.name),ss(e)){const r=t.children;Array.isArray(r)||oe(59,n.name);const i=e.getChildren();for(let e=0;e<i.length;e++){const t=gs(i[e]);r.push(t)}}return t}class ps{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return Zi(t&&t.editor||null,this,e)}clone(e){const t=new ps(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Zi(null,this,(()=>({root:gs(eo())})))}}class fs extends is{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class ms extends is{static getType(){return"paragraph"}static clone(e){return new ms(e.__key)}createDOM(e){const t=document.createElement("p"),n=_o(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:ys,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return _s().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){const n=_s();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Gr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function ys(e){const t=_s();return e.style&&(t.setFormat(e.style.textAlign),Zo(e,t)),{node:t}}function _s(){return Oo(new ms)}function bs(e){return e instanceof ms}function xs(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=hs(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const s=e._observer;null!==s&&(s.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function ks(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:e}=Qo(r),i=r.transform;if(!n.has(i)){n.add(i);const e=r.transform();e&&t.add(e)}if(e){const n=e.$transform;n&&t.add(n),r=e.extends}else{const e=Object.getPrototypeOf(r);r=e.prototype instanceof kr&&e!==kr?e:void 0}}return t}function vs(e){const t=e||{},n=Ii,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,s=t.disableEvents||!1,o=hs(),a=t.namespace||(null!==i?i._config.namespace:oo()),l=t.editorState,c=[cs,Br,Nr,Yr,ms,fs,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let g;if(void 0===e&&null!==n)g=n._nodes;else{g=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}Qo(t);const i=t.getType(),s=ks(t);g.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:rt(c[e]),transforms:s})}}const p=new Ss(o,i,g,{disableEvents:s,namespace:a,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)})),t&&i(t),n}(g,d?d.import:void 0),h,e);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=2),p}class Ss{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,s,o,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=oo(),this._onError=i,this._htmlConversions=s,this._editable=o,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&oe(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const i=r.get(e);void 0===i&&oe(36,String(e));const s=i[n];return s.add(t),()=>{s.delete(t),i.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let s=i.get(t);void 0===s&&(s=new Set,i.set(t,s)),s.add(r);const o=n&&n.skipInitialization;return void 0!==o&&o||this.initializeMutationListener(t,r),()=>{s.delete(r),0===s.size&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&oe(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=Vo(n).get(t.getType());if(!r)return;const i=new Map;for(const e of r.keys())i.set(e,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){const n=Vo(e.getEditorState()),r=[];for(const e of t){const t=n.get(e);t&&r.push(t)}0!==r.length&&e.update((()=>{for(const e of r)for(const t of e.keys()){const e=Vs(t);e&&e.markDirty()}}),null===e._pendingEditorState?{tag:Sr}:void 0)}(this,r.map((e=>e.klass.getType()))),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return So(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=_o(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,xs(this,t,e,r),null!==t&&(this._config.disableEvents||yr(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Lo(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,Qe(this),this._updateTags.add(Sr),Yi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;Gn.set(e,n);const r=Zn.get(n)??0;r<1&&n.addEventListener("selectionchange",pr),Zn.set(n,r+1),e.__lexicalEditor=t;const i=hr(e);for(let n=0;n<Kn.length;n++){const[r,s]=Kn[n],o="function"==typeof s?e=>{mr(e)||(fr(e),(t.isEditable()||"click"===r)&&s(e,t))}:e=>{if(mr(e))return;fr(e);const n=t.isEditable();switch(r){case"cut":return n&&So(t,In,e);case"copy":return So(t,On,e);case"paste":return n&&So(t,sn,e);case"dragstart":return n&&So(t,Ln,e);case"dragover":return n&&So(t,Pn,e);case"dragend":return n&&So(t,Fn,e);case"focus":return n&&So(t,$n,e);case"blur":return n&&So(t,Un,e);case"drop":return n&&So(t,Nn,e)}};e.addEventListener(r,o),i.push((()=>{e.removeEventListener(r,o)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Sr),Yi(this);Xi("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&oe(38);let n=e;n._readOnly&&(n=ds(e),n._selection=e._selection?e._selection.clone():null),Xe(this);const r=this._pendingEditorState,i=this._updateTags,s=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=s&&i.add(s),Yi(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&i.add(s),this._updating||Yi(this)}parseEditorState(e,t){return function(e,t,n){const r=hs(),i=Oi,s=Ri,o=Ii,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,Oi=r,Ri=!1,Ii=t,Cs(null);try{const i=t._nodes;Gi(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,Oi=i,Ri=s,Ii=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Yi(this),this.getEditorState().read(e,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):es(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),ts(this,(()=>{const r=vi(),i=eo();null!==r?r.dirty||no(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),No("focus"),function(e){$i(),Hi()._deferred.push(e)}((()=>{n.removeAttribute("autocapitalize"),e&&e()}))})),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Do(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Xi("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ss.version="0.38.2+prod.esm";let ws=null;function Cs(e){ws=e}let Ts=1;function Es(e,t){const n=Ns(e,t);return void 0===n&&oe(30,t),n}function Ns(e,t){return e._nodes.get(t)}const As="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Ls(e){return ls(Ys(e))}function Ps(e){const t=document.activeElement;if(!Bo(t))return!1;const n=t.nodeName;return ls(Ys(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Rs(t))}function Fs(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Ps(t)&&Is(t)===e}catch(e){return!1}}function Os(e){return e instanceof Ss}function Is(e){let t=e;for(;null!=t;){const e=Rs(t);if(Os(e))return e;t=To(t)}return null}function Rs(e){return e?e.__lexicalEditor:null}function Ms(e){return Ie.test(e)?"rtl":Re.test(e)?"ltr":null}function Ds(e){return Qr(e)||e.isToken()}function zs(e){return Ds(e)||e.isSegmented()}function Bs(e){return $o(e)&&3===e.nodeType}function $s(e){return $o(e)&&9===e.nodeType}function Us(e){let t=e;for(;null!=t;){if(Bs(t))return t;t=t.firstChild}return null}function Ws(e,t,n){const r=Me[t];if(null!==n&&(e&r)===(n&r))return e;let i=e^r;return"subscript"===t?i&=-65:"superscript"===t?i&=-33:"lowercase"===t?(i&=-513,i&=-1025):"uppercase"===t?(i&=-257,i&=-1025):"capitalize"===t&&(i&=-257,i&=-513),i}function Hs(e){return Gr(e)||Pr(e)||ls(e)}function Ks(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),s=e.getNextSibling(),o=null!==s?s.__key:null,a=null!==i?i.__key:null,l=null!==i?i.getWritable():null,c=null!==s?s.getWritable():null;null===i&&(r.__first=o),null===s&&(r.__last=a),null!==l&&(l.__next=o),null!==c&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function js(e){Ui(),xr(e)&&oe(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Wi(),i=Hi(),s=r._nodeMap,o=i._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,s,o);const a=t.__key;i._dirtyType=1,ss(e)?o.set(a,!0):i._dirtyLeaves.add(a)}function qs(e){$i();const t=Hi(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Vs(n);null!==e&&e.getWritable()}if(null!==e){const t=Vs(e);null!==t&&t.getWritable()}}}function Js(){return Bi()?null:Hi()._compositionKey}function Vs(e,t){const n=(t||Wi())._nodeMap.get(e);return void 0===n?null:n}function Gs(e,t){const n=Zs(e,Hi());return void 0!==n?Vs(n,t):null}function Zs(e,t){return e[`__lexicalKey_${t._key}`]}function Ys(e,t){let n=e;for(;null!=n;){const e=Gs(n,t);if(null!==e)return e;n=To(n)}return null}function Xs(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Qs(e){return e.read((()=>eo().getTextContent()))}function eo(){return to(Wi())}function to(e){return e._nodeMap.get("root")}function no(e){$i();const t=Wi();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function ro(e){const t=Hi(),n=function(e,t){let n=e;for(;null!=n;){const e=Zs(n,t);if(void 0!==e)return e;n=To(n)}return null}(e,t);return null===n?e===t.getRootElement()?Vs("root"):null:Vs(n)}function io(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function so(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function oo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function ao(e){return Bs(e)?e.nodeValue:null}function lo(e,t,n){const r=Do(Po(t));if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let t=ao(i);const r=Ys(i);if(null!==t&&Gr(r)){if(t===Ae&&n){const e=n.length;t=n,s=e,o=e}null!==t&&co(r,t,s,o,e)}}}function co(e,t,n,r,i){let s=e;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let a=t;(o||i)&&t[t.length-1]===Ae&&(a=t.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(""===a){if(qs(null),ge||pe||_e)s.remove();else{const e=Hi();setTimeout((()=>{e.update((()=>{s.isAttached()&&s.remove()}))}),20)}return}const t=s.getParent(),i=Si(),l=s.getTextContentSize(),c=Js(),u=s.getKey();if(s.isToken()||null!==c&&u===c&&!o||si(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!s.canInsertTextBefore()&&!o||i.focus.key===e.__key&&i.focus.offset===l&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const d=vi();if(!si(d)||null===n||null===r)return void uo(s,a,d);if(d.setTextNodeRange(s,n,s,r),s.isSegmented()){const e=Vr(s.getTextContent());s.replace(e),s=e}uo(s,a,d)}}}function uo(e,t,n){if(e.setTextContent(t),si(n)){const t=e.getKey();for(const r of["anchor","focus"]){const i=n[r];"text"===i.type&&i.key===t&&(i.offset=ya(e,i.offset,"clamp"))}}}function ho(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function go(e,t,n){return function(e,t){return ho(e,t,"altKey")&&ho(e,t,"ctrlKey")&&ho(e,t,"shiftKey")&&ho(e,t,"metaKey")}(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const po={ctrlKey:!ue,metaKey:ue},fo={altKey:ue,ctrlKey:!ue};function mo(e){return"Backspace"===e.key}function yo(e){return go(e,"a",po)}function _o(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=be(i);return n[t]=e,e}return i}function bo(e,t,n,r,i){if(0===n.size)return;const s=r.__type,o=r.__key,a=t.get(s);void 0===a&&oe(33,s);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(o),d="destroyed"===u&&"created"===i;(void 0===u||d)&&c.set(o,d?"updated":i)}function xo(e,t,n){const r=e.getParent();let i=n,s=e;return null!==r&&(t&&0===n?(i=s.getIndexWithinParent(),s=r):t||n!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(t?i-1:i)}function ko(e,t){const n=e.offset;if("element"===e.type)return xo(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?xo(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function vo(e){const t=Po(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function So(e,t,n){return function(e,t,n){const r=so(e);for(let i=4;i>=0;i--)for(let s=0;s<r.length;s++){const o=r[s],a=o._commands.get(t);if(void 0!==a){const t=a[i];if(void 0!==t){const r=Array.from(t),i=r.length;let s=!1;if(ts(o,(()=>{for(let t=0;t<i;t++)if(r[t](n,e))return void(s=!0)})),s)return s}}}return!1}(e,t,n)}function wo(e){return!us(e)&&!e.isLastChild()&&!e.isInline()}function Co(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&oe(75,t),n}function To(e){const t=e.assignedSlot||e.parentElement;return Uo(t)?t.host:t}function Eo(e){return $s(e)?e:Bo(e)?e.ownerDocument:null}function No(e){$i(),Hi()._updateTags.add(e)}function Ao(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Lo(e){const t=Eo(e);return t?t.defaultView:null}function Po(e){const t=e._window;return null===t&&oe(78),t}function Fo(e){return us(e)||ss(e)&&e.isShadowRoot()}function Oo(e){const t=Hi(),n=e.getType(),r=Ns(t,n);void 0===r&&oe(200,e.constructor.name,n);const{replace:i,replaceWithKlass:s}=r;if(null!==i){const t=i(e),r=t.constructor;return null!==s?t instanceof s||oe(201,s.name,s.getType(),r.name,r.getType(),e.constructor.name,n):t instanceof e.constructor&&r!==e.constructor||oe(202,r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&oe(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Io(e,t){!us(e.getParent())||ss(t)||ls(t)||oe(99)}function Ro(e){return(ls(e)||ss(e)&&!e.canBeEmpty())&&!e.isInline()}function Mo(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Do(e){return le?(e||window).getSelection():null}function zo(e){return Bo(e)&&"A"===e.tagName}function Bo(e){return $o(e)&&1===e.nodeType}function $o(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Uo(e){return $o(e)&&11===e.nodeType}function Wo(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Ho(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function Ko(e){if(ls(e)&&!e.isInline())return!0;if(!ss(e)||Fo(e))return!1;const t=e.getFirstChild(),n=null===t||Pr(t)||Gr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function jo(){return Hi()}const qo=new WeakMap,Jo=new Map;function Vo(e){if(!e._readOnly&&e.isEmpty())return Jo;e._readOnly||oe(192);let t=qo.get(e);return t||(t=function(e){const t=new Map;for(const[n,r]of e._nodeMap){const e=r.__type;let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),qo.set(e,t)),t}function Go(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Zo(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Yo(e){return!0===e.__lexicalUnmanaged}function Xo(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==kr[t]}function Qo(e){const t=We in e.prototype?e.prototype[We]():void 0,n=function(e){if(!(e===kr||e.prototype instanceof kr)){let t="<unknown>",n="<unknown>";try{t=e.getType()}catch(e){}try{Ss.version&&(n=JSON.parse(Ss.version))}catch(e){}oe(290,e.name,t,n)}return e===as||e===is||e===kr}(e),r=!n&&Xo(e,"getType")?e.getType():void 0;let i,s=r;if(t)if(r)i=t[r];else for(const[e,n]of Object.entries(t))s=e,i=n;if(!n&&s&&(Xo(e,"getType")||(e.getType=()=>s),Xo(e,"clone")||(e.clone=t=>(Cs(t),new e)),Xo(e,"importJSON")||(e.importJSON=i&&i.$importJSON||(t=>(new e).updateFromJSON(t))),!Xo(e,"importDOM")&&i)){const{importDOM:t}=i;t&&(e.importDOM=()=>t)}return{ownNodeConfig:i,ownNodeType:s}}const ea=(e,t)=>{let n=e;for(;null!=n&&!us(n);){if(t(n))return n;n=n.getParent()}return null},ta={next:"previous",previous:"next"};class na{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Ca({hasNext:ua,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return fa(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return fa(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const s=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();null!==t&&o.size<e;t=t.getAdjacentCaret()){const e=t.origin.getWritable();o.set(e.getKey(),e)}for(const e of r){if(o.size>0){const t=i.getNodeAtCaret();if(t)if(o.delete(t.getKey()),o.delete(e.getKey()),t.is(e)||i.origin.is(e));else{const n=e.getParent();n&&n.is(s)&&e.remove(),t.replace(e)}else null===t&&oe(263,Array.from(o).join(" "))}else i.insert(e);i=fa(e,this.direction)}for(const e of o.values())e.remove();return this}}class ra extends na{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ba(e,this.direction)}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=sa(this.direction);return fa(this.getNodeAtCaret(),e)||ba(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof ra&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const ia={root:us,shadowRoot:Fo};function sa(e){return ta[e]}function oa(e,t="root"){return ia[t](e)?null:e}class aa extends na{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:fa(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return ss(this.origin)?ba(this.origin,this.direction):null}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=sa(this.direction);return fa(this.getNodeAtCaret(),e)||ba(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof aa&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof aa||e instanceof la)&&this.direction===e.direction&&this.origin.is(e.origin)}}class la extends na{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ma(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return fa(oa(this.getParentAtCaret(),e),this.direction)}getFlipped(){return ma(this.origin,sa(this.direction),this.offset)}isSamePointCaret(e){return e instanceof la&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof aa||e instanceof la)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return fa(this.origin,this.direction)}}function ca(e){return e instanceof la}function ua(e){return e instanceof aa}function da(e){return e instanceof ra}const ha={next:class extends la{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends la{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},ga={next:class extends aa{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends aa{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pa={next:class extends ra{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends ra{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function fa(e,t){return e?new ga[t](e):null}function ma(e,t,n){return e?new ha[t](e,ya(e,n)):null}function ya(e,t,n="error"){const r=e.getTextContentSize();let i="next"===t?r:"previous"===t?0:t;return(i<0||i>r)&&("clamp"!==n&&ae(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function _a(e,t){return new va(e,t)}function ba(e,t){return ss(e)?new pa[t](e):null}function xa(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class ka{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new ka(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return ca(t)?function(e,t){const{direction:n,origin:r}=e;return _a(e,ya(r,"focus"===t?sa(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){const{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[_a(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=ca(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=ca(n),i=t=>t.isSameNodeCaret(n)?null:xa(t)||t.getParentCaret(e);return Ca({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class va{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return ma(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function Sa(e){return wa(e,fa(eo(),e.direction))}function wa(e,t){return e.direction!==t.direction&&oe(265),new ka(e,t,e.direction)}function Ca(e){const{initial:t,hasNext:n,step:r,map:i}=e;let s=t;return{[Symbol.iterator](){return this},next(){if(!n(s))return{done:!0,value:void 0};const e={done:!1,value:i(s)};return s=r(s),e}}}function Ta(e,t){const n=La(e.origin,t.origin);switch(null===n&&oe(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const n="text"===e.type,r="text"===t.type;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===t.type?1:-1;case"branch":return Ea(n)}}function Ea(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let s=t,o=n;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return null===s?1:-1}function Na(e,t){return t.is(e)}function Aa(e){return ss(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function La(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[t,r]=Aa(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Aa(t);r;i=r,r=r.getParent()){const s=n.get(r);if(void 0!==s)return null===s?(Na(e,r)||oe(276),{commonAncestor:r,type:"ancestor"}):null===i?(Na(t,r)||oe(277),{commonAncestor:r,type:"descendant"}):((ss(s)||Na(e,s))&&(ss(i)||Na(t,i))&&r.is(s.getParent())&&r.is(i.getParent())||oe(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function Pa(e,t){const{type:n,key:r,offset:i}=e,s=function(e){const t=Vs(e);return null===t&&oe(63,e),t}(e.key);return"text"===n?(Gr(s)||oe(266,s.getType(),r),ma(s,t,i)):(ss(s)||oe(267,s.getType(),r),function(e,t,n){let r=ba(e,"next");for(let e=0;e<t;e++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return Wa(r,n)}(s,e.offset,t))}function Fa(e,t){const{origin:n,direction:r}=t,i="next"===r;ca(t)?e.set(n.getKey(),t.offset,"text"):ua(t)?Gr(n)?e.set(n.getKey(),ya(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(da(t)&&ss(n)||oe(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function Oa(e){const t=vi(),n=si(t)?t:bi();return Ia(n,e),no(n),n}function Ia(e,t){Fa(e.anchor,t.anchor),Fa(e.focus,t.focus)}function Ra(e){const{anchor:t,focus:n}=e,r=Pa(t,"next"),i=Pa(n,"next"),s=Ta(r,i)<=0?"next":"previous";return wa(Wa(r,s),Wa(i,s))}function Ma(e){const{direction:t,origin:n}=e,r=fa(n,sa(t)).getNodeAtCaret();return r?fa(r,t):ba(n.getParentOrThrow(),t)}function Da(e,t="root"){const n=[e];for(let r=da(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Ma(r));return n}function za(e){return!!e&&e.origin.isAttached()}function Ba(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const s=Ha(e,r),o=Da(s.anchor,n),a=Da(s.focus.getFlipped(),n),l=new Set,c=[];for(const e of s.iterNodeCarets(n))if(da(e))l.add(e.origin.getKey());else if(ua(e)){const{origin:t}=e;ss(t)&&!l.has(t.getKey())||c.push(t)}for(const e of c)e.remove();for(const e of s.getTextSlices()){if(!e)continue;const{origin:t}=e.caret,n=t.getTextContentSize(),s=Ma(fa(t,r)),l=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===i||"token"===l&&0!==e.distance)s.remove();else if(0!==e.distance){i="removeEmptySlices";let t=e.removeTextSlice();const n=e.caret.origin;if("segmented"===l){const e=t.origin,n=Vr(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());s.replaceOrInsert(n),t=ma(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(a[0].origin)&&(a[0]=t.getFlipped())}}let u,d;for(const e of o)if(za(e)){u=$a(e);break}for(const e of a)if(za(e)){d=$a(e);break}const h=function(e,t,n){if(!e||!t)return null;const r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;const s=r.getParents().reverse();s.push(r);const o=i.getParents().reverse();o.push(i);const a=Math.min(s.length,o.length);let l;for(l=0;l<a&&s[l]===o[l];l++);const c=(e,t)=>{let n;for(let r=l;r<e.length;r++){const i=e[r];if(Fo(i))return;!n&&t(i)&&(n=i)}return n},u=c(s,Ko),d=u&&c(o,(e=>n.has(e.getKey())&&Ko(e)));return u&&d?[u,d]:null}(u,d,l);if(h){const[e,t]=h;ba(e,"previous").splice(0,t.getChildren()),t.remove()}const g=[u,d,...o,...a].find(za);if(g)return function(e){return wa(e,e)}(Wa($a(g),e.direction));oe(269,JSON.stringify(o.map((e=>e.origin.__key))))}function $a(e){const t=function(e){let t=e;for(;da(t);){const e=xa(t);if(!da(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Gr(t.origin))return ca(t)?t:ma(t.origin,n,n);const r=t.getAdjacentCaret();return ua(r)&&Gr(r.origin)?ma(r.origin,n,sa(n)):t}function Ua(e){return ca(e)&&e.offset!==ya(e.origin,e.direction)}function Wa(e,t){return e.direction===t?e:e.getFlipped()}function Ha(e,t){return e.direction===t?e:wa(Wa(e.focus,t),Wa(e.anchor,t))}function Ka(){const e=document.head.querySelector("meta[name=csp-nonce]");return e?.content}const ja=new Map;function qa(e){const t={};if(!e)return t;const n=e.split(";");for(const e of n)if(""!==e){const[n,r]=e.split(/:([^]+)/);n&&r&&(t[n.trim()]=r.trim())}return t}function Ja(e){let t=ja.get(e);return void 0===t&&(t=qa(e),ja.set(e,t)),t}function Va(e){const t=jo().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function Ga(e){return Va(us(e)?e:e.getParentOrThrow())}function Za(e){const t=Ga(e);return null!==t&&"rtl"===t.direction}function Ya(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!zs(t)&&null!==r){const[i,s]=r,o=e.isBackward(),a=i.getNode(),l=s.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[r,i]=ci(e),s=a.is(l),c=t.is(o?l:a),u=t.is(o?a:l);let d,h=0;s?(h=r>i?i:r,d=r>i?r:i):c?(h=o?i:r,d=void 0):u&&(h=0,d=o?r:i);const g=t.__text.slice(h,d);g!==t.__text&&("clone"===n&&(t=function(e){return(t=Go(e))[br]=!0,t;var t}(t)),t.__text=g)}}return t}function Xa(e){const t=e.getStyle(),n=qa(t);ja.set(t,n)}function Qa(e){const t=el(e);return null!==t&&"vertical-rl"===t.writingMode}function el(e){const t=e.anchor.getNode();return ss(t)?Va(t):Ga(t)}function tl(e,t){let n=Qa(e)?!t:t;nl(e)&&(n=!n);const r=Pa(e.focus,n?"previous":"next");if(Ua(r))return!1;for(const e of Sa(r)){if(da(e))return!e.origin.isInline();if(!ss(e.origin)){if(ls(e.origin))return!0;break}}return!1}function nl(e){const t=el(e);return null!==t&&"rtl"===t.direction}function rl(e,t,n){const r=nl(e);let i;i=Qa(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}const il="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,sl=il&&"documentMode"in document?document.documentMode:null;function ol(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function al(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ll(e,...t){const n=ol(...t);n.length>0&&e.classList.add(...n)}function cl(e,...t){const n=ol(...t);n.length>0&&e.classList.remove(...n)}function ul(e){return e?e.getAdjacentCaret():null}function dl(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function hl(e){const t=ea(e,(e=>ss(e)&&!e.isInline()));return ss(t)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(4,e.__key),t}function gl(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}il&&"InputEvent"in window&&!sl&&new window.InputEvent("input");const pl=Symbol.for("preact-signals");function fl(){if(bl>1)return void bl--;let e,t=!1;for(;void 0!==yl;){let n=yl;for(yl=void 0,xl++;void 0!==n;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Cl(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(xl=0,bl--,t)throw e}let ml,yl;function _l(e){const t=ml;ml=void 0;try{return e()}finally{ml=t}}let bl=0,xl=0,kl=0;function vl(e){if(void 0===ml)return;let t=e.n;return void 0===t||t.t!==ml?(t={i:0,S:e,p:ml.s,n:void 0,t:ml,e:void 0,x:void 0,r:t},void 0!==ml.s&&(ml.s.n=t),ml.s=t,e.n=t,32&ml.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=ml.s,t.n=void 0,ml.s.n=t,ml.s=t),t):void 0}function Sl(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function wl(e,t){return new Sl(e,t)}function Cl(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Tl(e){for(let t=e.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function El(e){let t,n=e.s;for(;void 0!==n;){const e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function Nl(e,t){Sl.call(this,void 0),this.x=e,this.s=void 0,this.g=kl-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Al(e){const t=e.u;if(e.u=void 0,"function"==typeof t){bl++;const n=ml;ml=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Ll(e),t}finally{ml=n,fl()}}}function Ll(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Al(e)}function Pl(e){if(ml!==this)throw new Error("Out-of-order effect");El(this),ml=e,this.f&=-2,8&this.f&&Ll(this),fl()}function Fl(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function Ol(e,t){const n=new Fl(e,t);try{n.c()}catch(e){throw n.d(),e}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Sl.prototype.brand=pl,Sl.prototype.h=function(){return!0},Sl.prototype.S=function(e){const t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:_l((()=>{var e;null==(e=this.W)||e.call(this)})))},Sl.prototype.U=function(e){if(void 0!==this.t){const t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&_l((()=>{var e;null==(e=this.Z)||e.call(this)})))}},Sl.prototype.subscribe=function(e){return Ol((()=>{const t=this.value,n=ml;ml=void 0;try{e(t)}finally{ml=n}}),{name:"sub"})},Sl.prototype.valueOf=function(){return this.value},Sl.prototype.toString=function(){return this.value+""},Sl.prototype.toJSON=function(){return this.value},Sl.prototype.peek=function(){const e=ml;ml=void 0;try{return this.value}finally{ml=e}},Object.defineProperty(Sl.prototype,"value",{get(){const e=vl(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(xl>100)throw new Error("Cycle detected");this.v=e,this.i++,kl++,bl++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{fl()}}}}),Nl.prototype=new Sl,Nl.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===kl)return!0;if(this.g=kl,this.f|=1,this.i>0&&!Cl(this))return this.f&=-2,!0;const e=ml;try{Tl(this),ml=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ml=e,El(this),this.f&=-2,!0},Nl.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}Sl.prototype.S.call(this,e)},Nl.prototype.U=function(e){if(void 0!==this.t&&(Sl.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},Nl.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(Nl.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=vl(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Fl.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.u=e)}finally{e()}},Fl.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Al(this),Tl(this),bl++;const e=ml;return ml=this,Pl.bind(this,e)},Fl.prototype.N=function(){2&this.f||(this.f|=2,this.o=yl,yl=this)},Fl.prototype.d=function(){this.f|=8,1&this.f||Ll(this)},Fl.prototype.dispose=function(){this.d()};new Set;Symbol.for("@lexical/extension/LexicalBuilder");function Il(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Rl(e){let t=e.getParent();sc(t)||Il(40);let n=t;for(;null!==n;)n=n.getParent(),sc(n)&&(t=n);return t}function Ml(e){let t=[];const n=e.getChildren().filter(Xl);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();sc(i)?t=t.concat(Ml(i)):t.push(r)}return t}function Dl(e){return Xl(e)&&sc(e.getFirstChild())}function zl(e){return Yl().append(e)}function Bl(e,t){return Xl(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function $l(e){const t=vi();if(null!==t){let n=t.getNodes();if(si(t)){const r=t.getStartEndPoints();null===r&&Il(143);const[i]=r,s=i.getNode(),o=s.getParent();if(Fo(s)){const e=s.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=_s();s.append(e),n=e.select().getNodes()}}else if(Bl(s,n)){const t=ic(e);if(Fo(o)){s.replace(t);const e=Yl();ss(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(Xl(s)){const e=s.getParentOrThrow();Ul(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(ss(i)&&i.isEmpty()&&!Xl(i)&&!r.has(i.getKey())){Wl(i,e);continue}let s=Hs(i)?i.getParent():Xl(i)&&i.isEmpty()?i:null;for(;null!=s;){const t=s.getKey();if(sc(s)){if(!r.has(t)){const n=ic(e);Ul(n,s.getChildren()),s.replace(n),r.add(t)}break}{const n=s.getParent();if(Fo(n)&&!r.has(t)){r.add(t),Wl(s,e);break}s=n}}}}}function Ul(e,t){e.splice(e.getChildrenSize(),0,t)}function Wl(e,t){if(sc(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=Yl();let s;if(Ul(i,e.getChildren()),sc(n)&&t===n.getListType())n.append(i),sc(r)&&t===r.getListType()&&(Ul(n,r.getChildren()),r.remove()),s=n;else if(sc(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const n=ic(t);n.append(i),e.replace(n),s=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),s}function Hl(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Dl(n)&&Dl(r)&&(Hl(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Kl(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())Xl(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),sc(r.getFirstChild())||n++)}function jl(e){const t=new Set;if(Dl(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Dl(r)&&Dl(i)){const n=i.getFirstChild();if(sc(n)){n.append(e);const i=r.getFirstChild();sc(i)&&(Ul(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Dl(r)){const t=r.getFirstChild();if(sc(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(Dl(i)){const t=i.getFirstChild();sc(t)&&t.append(e)}else if(sc(n)){const t=Yl().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=ic(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());t.append(s),s.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ql(e){if(Dl(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(sc(n?n.getParent():void 0)&&Xl(n)&&sc(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),i=Yl(),s=ic(r);i.append(s),e.getPreviousSiblings().forEach((e=>s.append(e)));const o=Yl(),a=ic(r);o.append(a),Ul(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Jl(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}let Vl=class extends is{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(null==e.__checked)return;const t=e.getParent();sc(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)},extends:is,importDOM:{li:()=>({conversion:Gl,priority:0})}})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t,n){const r=t.getParent();!sc(r)||"check"!==r.getListType()||sc(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this,e),t.value=this.__value,function(e,t,n){const r=[],i=[],s=t.list,o=s?s.listitem:void 0;let a;if(s&&s.nested&&(a=s.nested.listitem),void 0!==o&&r.push(...Jl(o)),s){const e=n.getParent(),t=sc(e)&&"check"===e.getListType(),o=n.getChecked();t&&!o||i.push(s.listitemUnchecked),t&&o||i.push(s.listitemChecked),t&&r.push(o?s.listitemChecked:s.listitemUnchecked)}if(void 0!==a){const e=Jl(a);n.getChildren().some((e=>sc(e)))?r.push(...e):i.push(...e)}i.length>0&&cl(e,...i),r.length>0&&ll(e,...r)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&(""===i?t.removeAttribute("style"):t.style.cssText=i),function(e,t,n){const r=Ja(t.__textStyle);for(const t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(const t in Ja(n.__textStyle))t in r||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(ss(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(Xl(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!sc(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=ic(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(ss(e)||Il(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(sc(n)||Il(39),Xl(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=ic(n.getListType());r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Dl(t)&&Dl(n)&&(Hl(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=Yl().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=_s();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=Xl(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return sc(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Xl(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&Il(117),(e=Math.floor(e))>=0||Il(199);let t=this.getIndent();for(;t!==e;)t<e?(jl(this),t++):(ql(this),t--);return this}canInsertAfter(e){return Xl(e)}canReplaceWith(e){return Xl(e)}canMergeWith(e){return Xl(e)||bs(e)}extractWithChild(e,t){if(!si(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ic("bullet")}canMergeWhenEmpty(){return!0}};function Gl(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return Zl(t);if(e.classList.contains("joplin-checkbox"))for(const t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return Zl(t.children[0]);const t=e.getAttribute("aria-checked");return{node:Yl("true"===t||"false"!==t&&void 0)}}function Zl(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:Yl(e.hasAttribute("checked"))}}function Yl(e){return Oo(new Vl(void 0,e))}function Xl(e){return e instanceof Vl}let Ql=class extends is{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();sc(t)&&e.getListType()===t.getListType()&&Hl(e,t)}(e),Kl(e)},extends:is,importDOM:{ol:()=>({conversion:nc,priority:0}),ul:()=>({conversion:nc,priority:0})}})}constructor(e="number",t=1,n){super(n);const r=rc[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,ec(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(ec(t,n.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Bo(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){const t=n[e];Xl(t)||(r===n&&(r=[...n]),r[e]=Yl().append(!ss(t)||sc(t)||t.isInline()?t:Vr(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Xl(e)}};function ec(e,t,n){const r=[],i=[],s=t.list;if(void 0!==s){const e=s[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(Xl(n)){const e=n.getParent();if(sc(e)){t++,n=e.getParent();continue}Il(40)}return t}return t}(n)-1,o=t%e.length,a=e[o],l=s[n.__tag];let c;const u=s.nested,d=s.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==a){r.push(...Jl(a));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(void 0!==c){const e=Jl(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&cl(e,...i),r.length>0&&ll(e,...r)}function tc(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(Xl(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{sc(e)&&t.push(zl(e))}))}else t.push(zl(r))}return t}function nc(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=ic("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(Bo(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?ic("check"):ic("bullet")),{after:tc,node:n}}const rc={ol:"number",ul:"bullet"};function ic(e="number",t=1){return Oo(new Ql(e,t))}function sc(e){return e instanceof Ql}const oc=Zt("UPDATE_LIST_START_COMMAND"),ac=Zt("INSERT_UNORDERED_LIST_COMMAND"),lc=Zt("INSERT_ORDERED_LIST_COMMAND"),cc=Zt("REMOVE_LIST_COMMAND");function uc(e){return al(e.registerCommand(lc,(()=>($l("number"),!0)),1),e.registerCommand(oc,(e=>{const{listNodeKey:t,newStart:n}=e,r=Vs(t);return!!sc(r)&&("number"===r.getListType()&&(r.setStart(n),Kl(r)),!0)}),1),e.registerCommand(ac,(()=>($l("bullet"),!0)),1),e.registerCommand(cc,(()=>(function(){const e=vi();if(si(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Bl(r,n))t.add(Rl(r));else for(let e=0;e<n.length;e++){const r=n[e];if(Hs(r)){const e=dl(r,Vl);null!=e&&t.add(Rl(e))}}for(const n of t){let t=n;const r=Ml(n);for(const n of r){const r=_s().setTextStyle(e.style).setTextFormat(e.format);Ul(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Fa(e.anchor,$a(ba(r,"next"))),n.__key===e.focus.key&&Fa(e.focus,$a(ba(r,"next"))),n.remove()}n.remove()}}}(),!0)),1),e.registerCommand(nn,(()=>function(){const e=vi();if(!si(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!Xl(t)||0!==t.getChildrenSize())return!1;const n=Rl(t),r=t.getParent();sc(r)||Il(40);const i=r.getParent();let s;if(Fo(i))s=_s(),n.insertAfter(s);else{if(!Xl(i))return!1;s=Yl(),i.insertAfter(s)}s.setTextStyle(e.style).setTextFormat(e.format).select();const o=t.getNextSiblings();if(o.length>0){const e=ic(r.getListType());if(Xl(s)){const t=Yl();t.append(e),s.insertAfter(t)}else s.insertAfter(e);e.append(...o)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!Xl(e)&&!sc(e))break;t=e}t.remove()}(t),!0}()),1),e.registerNodeTransform(Vl,(e=>{const t=e.getFirstChild();if(t){if(Gr(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=vi();si(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(Br,(e=>{const t=e.getParent();if(Xl(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function dc(e,t){const n=$s(t)?t.body.childNodes:t.childNodes;let r=[];const i=[];for(const t of n)if(!pc.has(t.nodeName)){const n=fc(t,e,i,!1);null!==n&&(r=r.concat(n))}return function(e){for(const t of e)t.getNextSibling()instanceof fs&&t.insertAfter(Lr());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(i),r}function hc(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=eo().getChildren();for(let i=0;i<r.length;i++)gc(e,r[i],n,t);return n.innerHTML}function gc(e,t,n,r=null){let i=null===r||t.isSelected(r);const s=ss(t)&&t.excludeFromCopy("html");let o=t;null!==r&&Gr(t)&&(o=Ya(r,t,"clone"));const a=ss(o)?o.getChildren():[],l=Ns(e,o.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,o):o.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<a.length;n++){const s=a[n],o=gc(e,s,h,r);!i&&ss(t)&&o&&t.extractWithChild(s,r,"html")&&(i=!0)}if(i&&!s){if((Bo(u)||Uo(u))&&u.append(h),n.append(u),d){const e=d.call(o,u);e&&(Uo(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return i}const pc=new Set(["STYLE","SCRIPT"]);function fc(e,t,n,r,i=new Map,s){let o=[];if(pc.has(e.nodeName))return o;let a=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(a=Array.isArray(t)?t[t.length-1]:t,null!==a){for(const[,e]of i)if(a=e(a,s),!a)break;a&&o.push(...Array.isArray(t)?t:[a])}null!=c.forChild&&i.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const g=(null==a||!Fo(a))&&(null!=a&&yi(a)||r);for(let e=0;e<d.length;e++)h.push(...fc(d[e],t,n,g,new Map(i),a));return null!=u&&(h=u(h)),Ho(e)&&(h=function(e,t,n){const r=e.style.textAlign,i=[];let s=[];for(let e=0;e<t.length;e++){const o=t[e];if(yi(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(s.push(o),e===t.length-1||e<t.length-1&&yi(t[e+1])){const e=n();e.setFormat(r),e.append(...s),i.push(e),s=[]}}return i}(e,h,g?()=>{const e=new fs;return n.push(e),e}:_s)),null==a?h.length>0?o=o.concat(h):Ho(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(Wo(e.nextSibling)&&Wo(e.previousSibling))}(e)&&(o=o.concat(Lr())):ss(a)&&a.append(...h),o}function mc(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yc(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return _c(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=Vi(e[n]);Gr(r)&&Xa(r),t.push(r)}return t}(e.nodes),t)}catch(e){console.error(e)}const i=e.getData("text/html"),s=e.getData("text/plain");if(i&&s!==i)try{return _c(n,dc(n,(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(i),"text/html")),t)}catch(e){console.error(e)}const o=s||e.getData("text/uri-list");if(null!=o)if(si(t)){const e=o.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=vi();if(si(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([Xr()]):n.insertText(r)}}}else t.insertRawText(o)}function _c(e,t,n){e.dispatchCommand(Xt,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(si(e)&&e.isCollapsed()){let t=null;const n=Pa(e.anchor,"previous");if(n)if(ca(n))t=n.origin;else{const e=wa(n,ba(eo(),"next").getFlipped());for(const n of e){if(Gr(n.origin)){t=n.origin;break}if(ss(n.origin)&&!n.origin.isInline())break}}if(t&&Gr(t)){const n=t.getFormat(),r=t.getStyle();e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}}}(n))}function bc(e,t,n,r=[]){let i=null===t||n.isSelected(t);const s=ss(n)&&n.excludeFromCopy("html");let o=n;null!==t&&Gr(o)&&(o=Ya(t,o,"clone"));const a=ss(o)?o.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&mc(58,n.name),ss(e)){const e=t.children;Array.isArray(e)||mc(59,n.name)}return t}(o);Gr(o)&&0===o.getTextContentSize()&&(i=!1);for(let r=0;r<a.length;r++){const s=a[r],o=bc(e,t,s,l.children);!i&&ss(n)&&o&&n.extractWithChild(s,t,"clone")&&(i=!0)}if(i&&!s)r.push(l);else if(Array.isArray(l.children))for(let e=0;e<l.children.length;e++){const t=l.children[e];r.push(t)}return i}let xc=null;async function kc(e,t,n){if(null!==xc)return!1;if(null!==t)return new Promise(((r,i)=>{e.update((()=>{r(vc(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,s=i.document,o=Do(i);if(null===r||null===o)return!1;const a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),o.removeAllRanges(),o.addRange(l),new Promise(((t,r)=>{const o=e.registerCommand(On,(r=>(gl(r,ClipboardEvent)&&(o(),null!==xc&&(i.clearTimeout(xc),xc=null),t(vc(e,r,n))),!0)),4);xc=i.setTimeout((()=>{o(),xc=null,t(!1)}),50),s.execCommand("copy"),a.remove()}))}function vc(e,t,n){if(void 0===n){const t=Do(e._window),r=vi();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=t.anchorNode,s=t.focusNode;if(null!==i&&null!==s&&!Fs(e,i,s))return!1;n=function(e=vi()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=jo();for(const[r,i]of Sc){const s=i(n,e);null!==s&&(t[r]=s)}}return t}(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const[n]of Sc)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const Sc=[["text/html",function(e,t=vi()){return null==t&&mc(166),si(t)&&t.isCollapsed()||0===t.getNodes().length?"":hc(e,t)}],["application/x-lexical-editor",function(e,t=vi()){return null==t&&mc(166),si(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=eo().getChildren();for(let i=0;i<r.length;i++)bc(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function wc(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const Cc="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Tc=Cc&&"documentMode"in document?document.documentMode:null,Ec=Cc&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Nc=!(!Cc||!("InputEvent"in window)||Tc)&&"getTargetRanges"in new window.InputEvent("input"),Ac=Cc&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Lc=Cc&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Pc=Cc&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Fc=Cc&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Ec&&!Pc,Oc=Zt("DRAG_DROP_PASTE_FILE");let Ic=class e extends is{static getType(){return"quote"}static clone(t){return new e(t.__key)}createDOM(e){const t=document.createElement("blockquote");return ll(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:$c,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Rc().updateFromJSON(e)}insertNewAfter(e,t){const n=_s(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Rc(){return Oo(new Ic)}function Mc(e){return e instanceof Ic}let Dc=class e extends is{__tag;static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){ll(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Bc,priority:0}),h2:e=>({conversion:Bc,priority:0}),h3:e=>({conversion:Bc,priority:0}),h4:e=>({conversion:Bc,priority:0}),h5:e=>({conversion:Bc,priority:0}),h6:e=>({conversion:Bc,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&zc(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>zc(e)?{conversion:e=>({node:Uc("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Bo(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Uc(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?_s():Uc(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=_s();e.select(),this.replace(e,!0)}return i}collapseAtStart(){const e=this.isEmpty()?_s():Uc(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function zc(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Bc(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=Uc(t),null!==e.style&&(Zo(e,n),n.setFormat(e.style.textAlign))),{node:n}}function $c(e){const t=Rc();return null!==e.style&&(t.setFormat(e.style.textAlign),Zo(e,t)),{node:t}}function Uc(e="h1"){return Oo(new Dc(e))}function Wc(e){return e instanceof Dc}function Hc(e){let t=null;if(gl(e,DragEvent)?t=e.dataTransfer:gl(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function Kc(e){const t=vi();if(!si(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const i=r[t],s=i.getKey();if(n.has(s))continue;const o=ea(i,(e=>ss(e)&&!e.isInline()));if(null===o)continue;const a=o.getKey();o.canIndent()&&!n.has(a)&&(n.add(a),e(o))}return n.size>0}function jc(e){return ls(Ys(e))}function qc(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Jc(e){return al(e.registerCommand(Qt,(e=>{const t=vi();return!!ai(t)&&(t.clear(),!0)}),0),e.registerCommand(en,(e=>{const t=vi();return si(t)?(t.deleteCharacter(e),!0):!!ai(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(an,(e=>{const t=vi();return!!si(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(ln,(e=>{const t=vi();return!!si(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(rn,(t=>{const n=vi();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)yc(r,n,e);else if(si(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(on,(()=>{const e=vi();return!!si(e)&&(e.removeText(),!0)}),0),e.registerCommand(cn,(e=>{const t=vi();return!!si(t)&&(t.formatText(e),!0)}),0),e.registerCommand(An,(e=>{const t=vi();if(!si(t)&&!ai(t))return!1;const n=t.getNodes();for(const t of n){const n=ea(t,(e=>ss(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(tn,(e=>{const t=vi();return!!si(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(nn,(()=>{const e=vi();return!!si(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(Cn,(()=>(Ai([Xr()]),!0)),0),e.registerCommand(Tn,(()=>Kc((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(En,(()=>Kc((e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(yn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(si(t)){const n=ko(t.focus,!0);if(!e.shiftKey&&ls(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(_n,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(si(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===eo().getChildrenSize()}(t))return e.preventDefault(),!0;const n=ko(t.focus,!1);if(!e.shiftKey&&ls(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(fn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),Za(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!si(t))return!1;if(tl(t,!0)){const n=e.shiftKey;return e.preventDefault(),rl(t,n,!0),!0}return!1}),0),e.registerCommand(gn,(e=>{const t=vi();if(ai(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),Za(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!si(t))return!1;const n=e.shiftKey;return!!tl(t,!1)&&(e.preventDefault(),rl(t,n,!1),!0)}),0),e.registerCommand(kn,(t=>{if(jc(t.target))return!1;const n=vi();if(si(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(us(n))return!1;const r=hl(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(En,void 0);if(Lc&&"ko-KR"===navigator.language)return!1}else if(!ai(n))return!1;return t.preventDefault(),e.dispatchCommand(en,!0)}),0),e.registerCommand(Sn,(t=>{if(jc(t.target))return!1;const n=vi();return!(!si(n)&&!ai(n))&&(t.preventDefault(),e.dispatchCommand(en,!1))}),0),e.registerCommand(bn,(t=>{const n=vi();if(!si(n))return!1;if(qc(n),null!==t){if((Lc||Ac||Fc)&&Nc)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(tn,!1)}return e.dispatchCommand(nn,void 0)}),0),e.registerCommand(vn,(()=>!!si(vi())&&(e.blur(),!0)),0),e.registerCommand(Nn,(t=>{const[,n]=Hc(t);if(n.length>0){const r=wc(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,s=Ys(i);if(null!==s){const e=bi();if(Gr(s))e.anchor.set(s.getKey(),t,"text"),e.focus.set(s.getKey(),t,"text");else{const t=s.getParentOrThrow().getKey(),n=s.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}no(ft(e))}e.dispatchCommand(Oc,n)}return t.preventDefault(),!0}return!!si(vi())}),0),e.registerCommand(Ln,(e=>{const[t]=Hc(e),n=vi();return!(t&&!si(n))}),0),e.registerCommand(Pn,(e=>{const[t]=Hc(e),n=vi();if(t&&!si(n))return!1;const r=wc(e.clientX,e.clientY);if(null!==r){ls(Ys(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(Rn,(()=>(function(e){const t=eo();if(si(e)){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),ft(e),e}{const e=t.select(0,t.getChildrenSize());no(ft(e))}}(),!0)),0),e.registerCommand(On,(t=>(kc(e,gl(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(In,(t=>(async function(e,t){await kc(t,gl(e,ClipboardEvent)?e:null),t.update((()=>{const e=vi();si(e)?e.removeText():ai(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(sn,(t=>{const[,n,r]=Hc(t);return n.length>0&&!r?(e.dispatchCommand(Oc,n),!0):(!$o(t.target)||!Ps(t.target))&&(null!==vi()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=vi(),r=gl(e,InputEvent)||gl(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&yc(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(xn,(e=>{const t=vi();return si(t)&&qc(t),!1}),0),e.registerCommand(wn,(e=>{const t=vi();return si(t)&&qc(t),!1}),0))}var Vc=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof s?new s(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,s;switch(n=n||{},i.util.type(t)){case"Object":if(s=i.util.objId(t),n[s])return n[s];for(var o in r={},n[s]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return s=i.util.objId(t),n[s]?n[s]:(r=[],n[s]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var s=(r=r||i.languages)[e],o={};for(var a in s)if(s.hasOwnProperty(a)){if(a==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(a)||(o[a]=s[a])}var c=r[e];return r[e]=o,i.languages.DFS(i.languages,(function(t,n){n===c&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,r,s){s=s||{};var o=i.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var l=t[a],c=i.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,e(l,n,a,s)):(s[o(l)]=!0,e(l,n,null,s))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run("before-all-elements-highlight",r);for(var s,o=0;s=r.elements[o++];)i.highlightElement(s,!0===t,r.callback)},highlightElement:function(t,n,r){var s=i.util.getLanguage(t),o=i.languages[s];i.util.setLanguage(t,s);var a=t.parentElement;a&&"pre"===a.nodeName.toLowerCase()&&i.util.setLanguage(a,s);var l={element:t,language:s,grammar:o,code:t.textContent};function c(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),r&&r.call(l.element)}if(i.hooks.run("before-sanity-check",l),(a=l.element.parentElement)&&"pre"===a.nodeName.toLowerCase()&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(r&&r.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){c(e.data)},u.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(i.highlight(l.code,l.grammar,l.language));else c(i.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run("after-tokenize",r),s.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new l;return c(i,i.head,e),a(e,i,t,i.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var r,s=0;r=n[s++];)r(t)}},Token:s};function s(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var s=i[1].length;i.index+=s,i[0]=i[0].slice(s)}return i}function a(e,t,n,r,l,d){for(var h in n)if(n.hasOwnProperty(h)&&n[h]){var g=n[h];g=Array.isArray(g)?g:[g];for(var p=0;p<g.length;++p){if(d&&d.cause==h+","+p)return;var f=g[p],m=f.inside,y=!!f.lookbehind,_=!!f.greedy,b=f.alias;if(_&&!f.pattern.global){var x=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,x+"g")}for(var k=f.pattern||f,v=r.next,S=l;v!==t.tail&&!(d&&S>=d.reach);S+=v.value.length,v=v.next){var w=v.value;if(t.length>e.length)return;if(!(w instanceof s)){var C,T=1;if(_){if(!(C=o(k,S,e,y))||C.index>=e.length)break;var E=C.index,N=C.index+C[0].length,A=S;for(A+=v.value.length;E>=A;)A+=(v=v.next).value.length;if(S=A-=v.value.length,v.value instanceof s)continue;for(var L=v;L!==t.tail&&(A<N||"string"==typeof L.value);L=L.next)T++,A+=L.value.length;T--,w=e.slice(S,A),C.index-=S}else if(!(C=o(k,0,w,y)))continue;E=C.index;var P=C[0],F=w.slice(0,E),O=w.slice(E+P.length),I=S+w.length;d&&I>d.reach&&(d.reach=I);var R=v.prev;if(F&&(R=c(t,R,F),S+=F.length),u(t,R,T),v=c(t,R,new s(h,m?i.tokenize(P,m):P,b,P)),O&&c(t,v,O),T>1){var M={cause:h+","+p,reach:I};a(e,t,n,v.prev,S,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}if(e.Prism=i,s.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var s={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),i.hooks.run("wrap",s);var a="";for(var l in s.attributes)a+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,""")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+a+">"+s.content+"</"+s.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,s=n.code,o=n.immediateClose;e.postMessage(i.highlight(s,i.languages[r],r)),o&&e.close()}),!1),i):i;var d=i.util.currentScript();function h(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var g=document.readyState;"loading"===g||"interactive"===g&&d&&d.defer?document.addEventListener("DOMContentLoaded",h):window.requestAnimationFrame?window.requestAnimationFrame(h):window.setTimeout(h,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
|
|
3
3
|
/**
|
|
4
4
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
5
5
|
*
|
|
@@ -7,4 +7,4 @@ import{DirectUpload as e}from"@rails/activestorage";
|
|
|
7
7
|
* @author Lea Verou <https://lea.verou.me>
|
|
8
8
|
* @namespace
|
|
9
9
|
* @public
|
|
10
|
-
*/function Gc(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=Vc),"undefined"!=typeof global&&(global.Prism=Vc),Vc.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Vc.languages.markup.tag.inside["attr-value"].inside.entity=Vc.languages.markup.entity,Vc.languages.markup.doctype.inside["internal-subset"].inside=Vc.languages.markup,Vc.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Vc.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Vc.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Vc.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Vc.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Vc.languages.markup.tag,"addAttribute",{value:function(e,t){Vc.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Vc.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Vc.languages.html=Vc.languages.markup,Vc.languages.mathml=Vc.languages.markup,Vc.languages.svg=Vc.languages.markup,Vc.languages.xml=Vc.languages.extend("markup",{}),Vc.languages.ssml=Vc.languages.xml,Vc.languages.atom=Vc.languages.xml,Vc.languages.rss=Vc.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Vc),Vc.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Vc.languages.javascript=Vc.languages.extend("clike",{"class-name":[Vc.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Vc.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Vc.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Vc.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Vc.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Vc.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Vc.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Vc.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Vc.languages.markup&&(Vc.languages.markup.tag.addInlined("script","javascript"),Vc.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Vc.languages.js=Vc.languages.javascript,function(){if(void 0!==Vc&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';Vc.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Vc.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}Vc.util.setLanguage(a,c),Vc.util.setLanguage(o,c);var d=Vc.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,Vc.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Vc.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Vc.highlightElement(t)}};var s=!1;Vc.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Vc.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);function Zc(e,t){for(const n of e.childNodes){if(Bo(n)&&n.tagName===t)return!0;Zc(n,t)}return!1}const Yc="data-language",Xc="data-highlight-language",Qc="data-theme";let eu=class e extends is{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");ll(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(Yc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Xc,n));const r=this.getTheme();r&&t.setAttribute(Qc,r);const i=this.getStyle();return i&&t.setAttribute("style",i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(Yc,r):i&&t.removeAttribute(Yc);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?s&&r?r!==i&&t.setAttribute(Xc,r):t.removeAttribute(Xc):s&&r&&t.setAttribute(Xc,r);const o=this.__theme,a=e.__theme;o?o!==a&&t.setAttribute(Qc,o):a&&t.removeAttribute(Qc);const l=this.__style,c=e.__style;return l?l!==c&&t.setAttribute("style",l):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");ll(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(Yc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Xc,n));const r=this.getTheme();r&&t.setAttribute(Qc,r);const i=this.getStyle();return i&&t.setAttribute("style",i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||Zc(e,"BR"))?{conversion:ru,priority:1}:null,div:()=>({conversion:iu,priority:1}),pre:()=>({conversion:ru,priority:0}),table:e=>lu(e)?{conversion:su,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&lu(n)?{conversion:ou,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&lu(t)?{conversion:ou,priority:3}:null}}}static importJSON(e){return tu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=_s();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Gr(o)){let e=pu(o);const t=[];for(;;)if(Qr(e))t.push(Xr()),e=e.getNextSibling();else{if(!hu(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(du(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[Lr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(nu(o)){const{offset:t}=e.anchor;o.splice(t,0,[Lr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function tu(e,t){return function(e){const t=jo();return $i(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}(eu).setLanguage(e).setTheme(t)}function nu(e){return e instanceof eu}function ru(e){return{node:tu(e.getAttribute(Yc))}}function iu(e){const t=e,n=au(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(au(t))return!0;t=t.parentElement}return!1}(t)?{node:n?tu():null}:{node:null}}function su(){return{node:tu()}}function ou(){return{node:null}}function au(e){return null!==e.style.fontFamily.match("monospace")}function lu(e){return e.classList.contains("js-file-line-container")}let cu=class e extends Br{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return ll(t,uu(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=uu(n.theme,e.__highlightType),s=uu(n.theme,this.__highlightType);return i!==s&&(i&&cl(t,i),s&&ll(t,s)),r}static importJSON(e){return du().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return tu()}};function uu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function du(e="",t){return Fo(new cu(e,t))}function hu(e){return e instanceof cu}function gu(e,t){let n=e;for(let r=fa(e,t);r&&(hu(r.origin)||Qr(r.origin));r=ul(r))n=r.origin;return n}function pu(e){return gu(e,"previous")}function fu(e){return gu(e,"next")}!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const mu=globalThis.Prism||window.Prism,yu={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},_u={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function bu(e){return"string"==typeof e?e:Array.isArray(e)?e.map(bu).join(""):bu(e.content)}function xu(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=mu.tokenize(r,mu.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=mu.languages[n],i={tokens:e},s=mu.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in s)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new mu.Token("prefix",s[t],t.replace(/^(\w+).*/,"$1"))),o=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),a=e.content.length-o.length,l=mu.tokenize(bu(o),r);l.unshift(i());const c=/\r\n|\n/g,u=e=>{const t=[];c.lastIndex=0;let r,s=0;for(;n<a&&(r=c.exec(e));){const n=r.index+r[0].length;t.push(e.slice(s,n)),s=n,t.push(i())}if(0!==t.length)return s<e.length&&t.push(e.slice(s)),t},d=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(l),n<a&&l.push(i()),e.content=l}return i.tokens}(i,n[1])),ku(i)}function ku(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(Lr()):"\t"===i?n.push(Xr()):i.length>0&&n.push(du(i,t))}}else{const{content:e,alias:t}=r;"string"==typeof e?n.push(...ku([e],"prefix"===r.type&&"string"==typeof t?t:r.type)):Array.isArray(e)&&n.push(...ku(e,"unchanged"===r.type?void 0:r.type))}return n}const vu={$tokenize(e,t){return xu(e,t||this.defaultLanguage)},defaultLanguage:"javascript",tokenize(e,t){return mu.tokenize(e,mu.languages[t||""]||mu.languages[this.defaultLanguage])}};function Su(e,t,n){const r=e.getParent();nu(r)?Tu(r,t,n):hu(e)&&e.replace(Vr(e.__text))}function wu(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)Pr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Cu=new Set;function Tu(e,t,n){const r=e.getKey();void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage);if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&mu.languages.hasOwnProperty(n)}catch(e){return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Cu.has(r)||(Cu.add(r),t.update((()=>{!function(e,t){const n=Vs(e);if(!nu(n)||!n.isAttached())return;const r=vi();if(!si(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&Pr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Gr(e);if(t||Pr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Vs(r);if(!nu(t)||!t.isAttached())return!1;const i=t.getLanguage()||n.defaultLanguage,s=n.$tokenize(t,i),o=function(e,t){let n=0;for(;n<e.length&&Eu(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Eu(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Cu.delete(r)},skipTransforms:!0}))}function Eu(e,t){return hu(e)&&hu(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Qr(e)&&Qr(t)||Pr(e)&&Pr(t)}function Nu(e){if(!si(e))return!1;const t=e.anchor.getNode(),n=nu(t)?t:t.getParent(),r=e.focus.getNode(),i=nu(r)?r:r.getParent();return nu(n)&&n.is(i)}function Au(e){const t=e.getNodes(),n=[];if(1===t.length&&nu(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];hu(i)||Qr(i)||Pr(i)||Gc(169),Pr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=ti(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Lu(e){const t=vi();if(!si(t)||!Nu(t))return!1;const n=Au(t),r=n.length;if(0===r&&t.isCollapsed())return e===Tn&&t.insertNodes([Xr()]),!0;if(0===r&&e===Tn&&"\n"===t.getTextContent()){const e=Xr(),n=Lr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),Fa(Ha(wa(ma(e,"next",0),$a(fa(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=pu(n)),e===Tn){const e=Xr();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=ti(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Qr(n)&&n.remove()}}return!0}function Pu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===yn;if(!Nu(n)||!hu(a)&&!Qr(a)||!hu(l)&&!Qr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=pu(a),d=fu(l)):(u=pu(l),d=fu(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!hu(t)&&!Qr(t)&&!Pr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!Pr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=hu(p)||Qr(p)||Pr(p)?c?pu(p):fu(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===yn?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Ou(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===mn;if(!Nu(n)||!hu(s)&&!Qr(s)||!hu(o)&&!Qr(o))return!1;const l=o;if("rtl"===function(e){const t=pu(e),n=fu(e);let r=t;for(;null!==r;){if(hu(r)){const e=Ms(r.getTextContent());if(null!==e)return e}if(r===n)break;r=r.getNextSibling()}const i=t.getParent();if(ss(i)){const e=i.getDirection();if("ltr"===e||"rtl"===e)return e}return null}(l)?!a:a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(hu(i)||Qr(i)||Pr(i)||Gc(167),Pr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];hu(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())hu(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();hu(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!hu(n)||r===s){if(n=n.getNextSibling(),null===n||Pr(n))return null;hu(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(hu(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(l,i.offset);if(null!==e){const{node:t,offset:r}=e;Pr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else l.getParentOrThrow().selectStart()}else(function(e){const t=fu(e);return Pr(t)&&Gc(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}const Fu=new Set(["http:","https:","mailto:","sms:","tel:"]);let Iu=class e extends is{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),ll(t,e.theme.link),t}updateLinkDOM(e,t,n){if(zo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Ru,priority:1})}}static importJSON(e){return Mu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Ku(e);try{const t=new URL(Ku(e));if(!Fu.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Mu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!si(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function Ru(e){let t=null;if(zo(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Mu(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Mu(e="",t){return Fo(new Iu(e,t))}function Du(e){return e instanceof Iu}class zu extends Iu{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new zu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Bu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(ss(n)){const e=Bu(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function Bu(e="",t){return Fo(new zu(e,t))}function $u(e){return e instanceof zu}function Uu(e,t){if("element"===e.type){const n=e.getNode();return ss(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Wu(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,s=void 0===t.rel?"noreferrer":t.rel,o=vi();if(null===o||!si(o)&&!ai(o))return;if(ai(o)){const e=o.getNodes();if(0===e.length)return;return void e.forEach((e=>{if(null===n){const t=ea(e,(e=>!$u(e)&&Du(e)));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=ea(e,(e=>!$u(e)&&Du(e)));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==s&&t.setRel(s);else{const t=Mu(n,{rel:s,target:r});e.insertBefore(t),t.append(e)}}}))}const a=o.extract();if(null===n){const e=new Set;return void a.forEach((t=>{const n=t.getParent();if(Du(n)&&!$u(n)){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter((t=>e.isParentOf(t))).map((e=>e.getKey()))),r=e.getChildren(),i=r.filter((e=>n.has(e.getKey())));if(i.length===r.length)return r.forEach((t=>e.insertBefore(t))),void e.remove();const s=r.findIndex((e=>n.has(e.getKey()))),o=r.findLastIndex((e=>n.has(e.getKey()))),a=0===s,l=o===r.length-1;if(a)i.forEach((t=>e.insertBefore(t)));else if(l)for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);else{for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);const t=r.slice(o+1);if(t.length>0){const n=Mu(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});i[i.length-1].insertAfter(n),t.forEach((e=>n.append(e)))}}}(n,a),e.add(t)}}))}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==s&&e.setRel(s),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=ea(e,Du);if(null!==t)return c(t)}!function(e){const t=vi();if(!si(t))return e();const n=ft(t),r=n.isBackward(),i=Uu(n.anchor,r?-1:0),s=Uu(n.focus,r?0:-1);if(e(),i||s){const e=vi();if(si(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}no(ft(t))}}}((()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const o=ea(t,Du);if(o){c(o);continue}if(ss(t)){if(!t.isInline())continue;if(Du(t)){if(!($u(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();Du(a)&&a.is(e)?a.append(t):(e=Mu(n,{rel:s,target:r,title:i}),t.insertAfter(e),e.append(t))}}))}const Hu=/^\+?[0-9\s()-]{5,}$/;function Ku(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Hu.test(e)?`tel:${e}`:`https://${e}`}function ju(e){let t=e;for(;null!==t;){if(Xl(t))return t;t=t.getParent()}return null}function qu(e){let t=e;for(;t;){if(sc(t))return t.getListType();t=t.getParent()}return null}class Ju extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){requestAnimationFrame((()=>this.#e())),this._resizeObserver=new ResizeObserver((()=>this.#e())),this._resizeObserver.observe(this)}disconnectedCallback(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i(),this.#s(),this.#e()}#t(){this.addEventListener("click",this.#o.bind(this))}#o({target:e}){this.#a(e,"[data-command]",this.#l.bind(this)),this.#a(e,"[data-dialog-target]",this.#c.bind(this))}#a(e,t,n){const r=e.closest(t);r&&n(r)}#l(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#c(e){const t=this.querySelector("lexxy-link-dialog .link-dialog").parentNode;t.open?t.close():t.show()}#n(){this.editorElement.addEventListener("keydown",(e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#u(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#u(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#r(){const e=parseInt(this.editorElement.editorContentElement.getAttribute("tabindex")??"0");this.#d.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#h()}))}))}#s(){this.editor.registerUpdateListener((()=>{this.#g()}))}#g(){this.editor.getEditorState().read((()=>{const e=this.editorElement.historyState;e&&(this.#p("undo",0===e.undoStack.length),this.#p("redo",0===e.redoStack.length))}))}#p(e,t){const n=this.querySelector(`[name="${e}"]`);n&&(n.disabled=t,n.setAttribute("aria-disabled",t.toString()))}#h(){const e=vi();if(!si(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=e.hasFormat("strikethrough"),o=nu(n)||e.hasFormat("code"),a=this.#f(t),l=qu(t),c=Mc(n),u=Wc(n),d=this.#m(t);this.#y("bold",r),this.#y("italic",i),this.#y("strikethrough",s),this.#y("code",o),this.#y("unordered-list",a&&"bullet"===l),this.#y("ordered-list",a&&"number"===l),this.#y("quote",c),this.#y("heading",u),this.#y("link",d),this.#g()}#f(e){let t=e;for(;t;){if(sc(t)||Xl(t))return!0;t=t.getParent()}return!1}#m(e){let t=e;for(;t;){if(Du(t))return!0;t=t.getParent()}return!1}#y(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#_(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#b(),this.#x(),this.#k.style.display=this.#v.children.length?"block":"none",this.#k.setAttribute("nonce",Ka())};get#k(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#v(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#b(){for(;this.#v.children.length>0;)this.insertBefore(this.#v.children[0],this.#k)}#x(){const e=this.#d.reverse();let t=!1;for(const n of e){if(!this.#_()){t&&this.#v.prepend(n);break}this.#v.prepend(n),t=!0}}get#d(){return Array.from(this.querySelectorAll(":scope > button, :scope > [role=separator]"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.70588 16.1591C4.81459 19.7901 7.48035 22 11.6668 22C15.9854 22 18.724 19.6296 18.724 15.8779C18.724 15.5007 18.6993 15.1427 18.6474 14.8066H14.3721C14.8637 15.2085 15.0799 15.7037 15.0799 16.3471C15.0799 17.7668 13.7532 18.7984 11.8113 18.7984C9.88053 18.7984 8.38582 17.7531 8.21659 16.1591H4.70588ZM5.23953 9.31962H9.88794C9.10723 8.88889 8.75888 8.33882 8.75888 7.57339C8.75888 6.13992 9.96576 5.18793 11.7631 5.18793C13.5852 5.18793 14.8761 6.1797 14.9959 7.81344H18.4102C18.3485 4.31824 15.8038 2 11.752 2C7.867 2 5.09129 4.35802 5.09129 7.92044C5.09129 8.41838 5.14071 8.88477 5.23953 9.31962ZM2.23529 10.6914C1.90767 10.6914 1.59347 10.8359 1.36181 11.0931C1.13015 11.3504 1 11.6993 1 12.0631C1 12.4269 1.13015 12.7758 1.36181 13.0331C1.59347 13.2903 1.90767 13.4348 2.23529 13.4348H20.7647C21.0923 13.4348 21.4065 13.2903 21.6382 13.0331C21.8699 12.7758 22 12.4269 22 12.0631C22 11.6993 21.8699 11.3504 21.6382 11.0931C21.4065 10.8359 21.0923 10.6914 20.7647 10.6914H2.23529Z"/>\n </svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="link" title="Link" data-dialog-target="link-dialog" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </button>\n\n <lexxy-link-dialog class="lexxy-link-dialog">\n <dialog class="link-dialog" closedby="any">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input" required>\n <div class="lexxy-dialog-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </dialog>\n </lexxy-link-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">\n <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 12C0 11.4477 0.447715 11 1 11H23C23.5523 11 24 11.4477 24 12C24 12.5523 23.5523 13 23 13H1C0.447716 13 0 12.5523 0 12Z"/><path d="M4 5C4 3.89543 4.89543 3 6 3H18C19.1046 3 20 3.89543 20 5C20 6.10457 19.1046 7 18 7H6C4.89543 7 4 6.10457 4 5Z"/><path d="M4 19C4 17.8954 4.89543 17 6 17H18C19.1046 17 20 17.8954 20 19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19Z"/></svg>\n </button>\n \n <div class="lexxy-editor__toolbar-spacer" role="separator"></div>\n \n <button class="lexxy-editor__toolbar-button" type="button" name="undo" data-command="undo" title="Undo" data-hotkey="cmd+z ctrl+z">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.64648 8.26531C7.93911 6.56386 10.7827 5.77629 13.624 6.05535C16.4655 6.33452 19.1018 7.66079 21.0195 9.77605C22.5839 11.5016 23.5799 13.6516 23.8936 15.9352C24.0115 16.7939 23.2974 17.4997 22.4307 17.4997C21.5641 17.4997 20.8766 16.7915 20.7148 15.9401C20.4295 14.4379 19.7348 13.0321 18.6943 11.8844C17.3 10.3464 15.3835 9.38139 13.3174 9.17839C11.2514 8.97546 9.18359 9.54856 7.5166 10.7858C6.38259 11.6275 5.48981 12.7361 4.90723 13.9997H8.5C9.3283 13.9997 9.99979 14.6714 10 15.4997C10 16.3281 9.32843 16.9997 8.5 16.9997H1.5C0.671573 16.9997 0 16.3281 0 15.4997V8.49968C0.000213656 7.67144 0.671705 6.99968 1.5 6.99968C2.3283 6.99968 2.99979 7.67144 3 8.49968V11.0212C3.7166 9.9704 4.60793 9.03613 5.64648 8.26531Z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo" data-hotkey="cmd+shift+z ctrl+shift+z ctrl+y">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.2599 8.26531C15.9672 6.56386 13.1237 5.77629 10.2823 6.05535C7.4408 6.33452 4.80455 7.66079 2.88681 9.77605C1.32245 11.5016 0.326407 13.6516 0.0127834 15.9352C-0.105117 16.7939 0.608975 17.4997 1.47567 17.4997C2.34228 17.4997 3.02969 16.7915 3.19149 15.9401C3.47682 14.4379 4.17156 13.0321 5.212 11.8844C6.60637 10.3464 8.52287 9.38139 10.589 9.17839C12.655 8.97546 14.7227 9.54856 16.3897 10.7858C17.5237 11.6275 18.4165 12.7361 18.9991 13.9997H15.4063C14.578 13.9997 13.9066 14.6714 13.9063 15.4997C13.9063 16.3281 14.5779 16.9997 15.4063 16.9997H22.4063C23.2348 16.9997 23.9063 16.3281 23.9063 15.4997V8.49968C23.9061 7.67144 23.2346 6.99968 22.4063 6.99968C21.578 6.99968 20.9066 7.67144 20.9063 8.49968V11.0212C20.1897 9.9704 19.2984 9.03613 18.2599 8.26531Z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function Vu(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",Ju);const Gu=/[!-/:-@[-`{-~\s]/;function Zu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Yu=function(e,t){return new et(e,t)}("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-"}),Xu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},Qu=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=Yl("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==Yu.parse(l)?void 0:l;if(sc(o)&&o.getListType()===e){c&&nt(o,Yu,c);const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(sc(s)&&s.getListType()===e)c&&nt(s,Yu,c),s.append(a),t.remove();else{const n=ic(e,"number"===e?Number(r[2]):void 0);c&&nt(n,Yu,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},ed=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(Xl(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(sc(e)){r.push(ed(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l=tt(e,Yu),c="number"===a?`${e.getStart()+s}. `:"check"===a?`${l} [${o.getChecked()?"x":" "}] `:l+" ";r.push(i+c+t(o)),s++}return r.join("\n")},td={dependencies:[Dc],export:(e,t)=>{if(!Wc(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:Xu((e=>Uc("h"+e[1].length))),type:"element"},nd={dependencies:[Ic],export:(e,t)=>{if(!Mc(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Mc(n))return n.splice(n.getChildrenSize(),0,[Lr(),...t]),void e.remove()}const i=Rc();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},rd={dependencies:[eu],export:e=>{if(!nu(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```([\w-]+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=tu(),a=n[1]+i[0]):(o=tu(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=tu(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Vr(a);o.append(t),e.append(o)}else t&&Xu((e=>tu(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},id={dependencies:[Ql,Vl],export:(e,t)=>sc(e)?ed(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:Qu("bullet"),type:"element"},sd={dependencies:[Ql,Vl],export:(e,t)=>sc(e)?ed(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:Qu("number"),type:"element"},od={dependencies:[Iu],export:(e,t,n)=>{if(!Du(e)||$u(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Mu(r,{title:i}),o=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(o<a)return;if(o>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=Vr(l);return u.setFormat(e.getFormat()),s.append(u),e.replace(s),c&&s.insertBefore(Vr(c)),u},trigger:")",type:"text-match"},ad=[...[td,nd,id,sd],...[rd],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[od]];function ld(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(cd(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function cd(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function ud(e,t=ad){const n=function(e){const t=Vu(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=Vu(n.textFormat,(({tag:e})=>e[e.length-1])),i=Vu(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||Zu(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!Oo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!cd(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Gu.test(l))continue;const c=e;let u=c,d=ld(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!Pr(h);)if(Gr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=ld(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!Gu.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=vi(),b=bi();no(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return si(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(wr)||t.has(vr))return;if(e.isComposing())return;const o=r.read(vi),a=i.read(vi);if(!si(a)||!si(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Gr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Gr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||nu(e)||s(e,u,o.anchor.offset)}))}))}function dd(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(vr))return r=0,n=u,2;const d=function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(si(s)&&si(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||us(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Gr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Gr(c)||!Gr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Sr))return 0;if(null===i)return 1;const p=s._selection;if(!(a.size>0||l.size>0))return null!==p?0:2;const f="number"==typeof t?t:t.peek();return!1===g&&0!==d&&d===r&&u<n+f&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(si(s)&&si(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Gr(r)||!Gr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1})();return n=u,r=d,h}}function hd(e){e.undoStack=[],e.redoStack=[],e.current=null}function gd(e,t,n){const r=dd(e,n),i=al(e.registerCommand(un,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(zn,!0)),0===r.length&&e.dispatchCommand(Bn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(dn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Bn,!0));const s=n.pop();0===n.length&&e.dispatchCommand(zn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(Mn,(()=>(hd(t),!1)),0),e.registerCommand(Dn,(()=>(hd(t),e.dispatchCommand(zn,!1),e.dispatchCommand(Bn,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(zn,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Bn,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return i}function pd(){return{current:null,redoStack:[],undoStack:[]}}var fd={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",strikethrough:"lexxy-content__strikethrough",underline:"lexxy-content__underline"},codeHighlight:{atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__property",decorator:"code-token__function",deleted:"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__variable",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",namespace:"code-token__variable",number:"code-token__property",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};const md=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote","hr"].join(","),yd=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","li","ol","p","pre","q","s","strong","ul"],_d=["alt","caption","class","content","content-type","contenteditable","data-direct-upload-id","data-sgid","filename","filesize","height","href","presentation","previewable","sgid","src","title","url","width"];function bd(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function xd(e){return(new DOMParser).parseFromString(e,"text/html")}function kd(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function vd(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Sd(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function wd(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}class Cd extends as{static getType(){return"action_text_attachment"}static clone(e){return new Cd({...e},e.__key)}static importJSON(e){return new Cd({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Cd({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Cd({src:e.getAttribute("src"),caption:e.getAttribute("alt")||"",contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),video:e=>{const t=e.getAttribute("src")||e.querySelector("source")?.src,n=t?.split("/")?.pop(),r=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{conversion:()=>({node:new Cd({src:t,fileName:n,contentType:r})}),priority:1}}}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o||"",this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#S(e)})),this.isPreviewableAttachment?(e.appendChild(this.#w()),e.appendChild(this.#C())):(e.appendChild(this.#T()),e.appendChild(this.#E())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:bd("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,bd("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#N(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#N||this.previewable}#w(){return bd("img",{src:this.src,alt:this.altText,...this.#A})}get#A(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#T(){return bd("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#E(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){const t=bd("span",{className:"attachment__size",textContent:wd(this.fileSize)});e.appendChild(t)}return e}#S(e){kd(e,"lexxy:internal:select-node",{key:this.getKey()})}#C(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#L.bind(this)),t.addEventListener("keydown",this.#P.bind(this)),e.appendChild(t),e}#L(e){const t=e.target;t.placeholder=this.fileName,this.#O(t)}#O(e){kd(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#P(e){"Enter"===e.key&&(this.#O(e.target),kd(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Td extends Cd{static getType(){return"action_text_attachment_upload"}static clone(e){return new Td({...e},e.__key)}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#w()):e.appendChild(this.#T()),e.appendChild(this.#F());const t=bd("progress",{value:this.progress,max:100});return e.appendChild(t),this.#I(e).then((()=>this.#R(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#w(){return bd("img")}#T(){return bd("span",{className:"attachment__icon",textContent:this.#M()})}#M(){return this.file.name.split(".").pop().toLowerCase()}#F(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("span",{className:"attachment__name",textContent:this.file.name||""}),n=bd("span",{className:"attachment__size",textContent:wd(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#I(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#R(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#D(n):this.#z(t,n).then((()=>{this.#B(n,t)}))}))}#D(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(bd("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#B(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Vs(this.getKey());i&&i.replace(new Cd({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Sr})}async#z(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#w();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}class Ed extends as{static getType(){return"horizontal_divider"}static clone(e){return new Ed(e.__key)}static importJSON(e){return new Ed}static importDOM(){return{hr:e=>({conversion:()=>({node:new Ed}),priority:1})}}constructor(e){super(e)}createDOM(){const e=bd("figure",{className:"horizontal-divider"}),t=bd("hr");return e.addEventListener("click",(t=>{kd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.appendChild(t),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:bd("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}}const Nd=["bold","italic","strikethrough","link","unlink","rotateHeadingFormat","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","insertHorizontalDivider","uploadAttachments","undo","redo"];class Ad{static configureFor(e){new Ad(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#$(),this.#U()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(cn,"bold")}dispatchItalic(){this.editor.dispatchCommand(cn,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(cn,"strikethrough")}dispatchLink(e){this.#W(e)}dispatchUnlink(){this.#W(null)}dispatchInsertUnorderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"bullet"===qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(ac,void 0)}dispatchInsertOrderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"number"===qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(lc,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedLines((e=>Mc(e)),(()=>Rc()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(cn,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>nu(e)),(()=>new eu("plain")))}))}dispatchInsertHorizontalDivider(){this.editor.update((()=>{this.contents.insertAtCursor(new Ed)}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Wc(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>Uc(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=bd("input",{type:"file",multiple:!0,onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});document.body.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}dispatchUndo(){this.editor.dispatchCommand(un,void 0)}dispatchRedo(){this.editor.dispatchCommand(dn,void 0)}#$(){for(const t of Nd){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#H(t,0,this[n].bind(this))}var e;this.#H(sn,1,this.dispatchPaste.bind(this))}#H(e,t,n){this.editor.registerCommand(e,n,t)}#W(e){this.editor.update((()=>{Wu(null===e?null:e)}))}#U(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#K.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#q.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#J.bind(this)))}#q(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#J(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#K(e){e.preventDefault()}#j(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}}function Ld(){return new Promise(requestAnimationFrame)}class Pd{constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#V(),this.#G(),this.#Z(),this.#Y()}clear(){this.current=null}set current(e){ai(e)?(this._current=vi(),this.#X()):this.editor.update((()=>{this.#X(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Q();if(!t)return;const n=this.#ee(t);n&&(e=this.#te(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{eo().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=vi();if(!si(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(Pr(e))return!1;return!0}get isInsideList(){const e=vi();if(!si(e))return!1;return null!==ju(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#re(e,t):ss(e)?this.#ie(e,t):this.#se(e):null}get topLevelNodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#oe(e):ss(e)?this.#ie(e,t):this.#se(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#ae(e,t):ss(e)?this.#le(e,t):this.#ce(e):null}get topLevelNodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#ue(e):ss(e)?this.#le(e,t):this.#ce(e):null}get#de(){return this.editorElement.contents}get#he(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;if(this._currentlySelectedKeys=new Set,this.current)for(const e of this.current.getNodes())this._currentlySelectedKeys.add(e.getKey());return this._currentlySelectedKeys}#G(){this.editor.registerCommand(fn,this.#ge.bind(this),1),this.editor.registerCommand(gn,this.#pe.bind(this),1),this.editor.registerCommand(yn,this.#fe.bind(this),1),this.editor.registerCommand(_n,this.#me.bind(this),1),this.editor.registerCommand(Sn,this.#ye.bind(this),1),this.editor.registerCommand(kn,this.#_e.bind(this),1),this.editor.registerCommand(Yt,(()=>{this.current=vi()}),1)}#V(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Ld();const{key:t}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e){const t=xi();t.add(e.getKey()),no(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#be()}))}#Z(){this.editor.getRootElement().addEventListener("keydown",(e=>{(function(e){return!(e.ctrlKey||e.metaKey||e.altKey||e.key.length>1&&"Enter"!==e.key&&"Space"!==e.key||1!==e.key.length)})(e)&&this.editor.update((()=>{const t=vi();if(si(t)&&t.isCollapsed()){const n=t.anchor.getNode(),r=t.anchor.offset,i=this.#xe(n,r),s=this.#ke(n,r);if(i instanceof as&&!i.isInline())return e.preventDefault(),void this.#de.createParagraphAfterNode(i,e.key);if(s instanceof as&&!s.isInline())return e.preventDefault(),void this.#de.createParagraphBeforeNode(s,e.key)}}))}),!0)}#xe(e,t){return Gr(e)&&0===t?e.getPreviousSibling():ss(e)&&t>0?e.getChildAtIndex(t-1):null}#ke(e,t){return Gr(e)&&t===e.getTextContentSize()?e.getNextSibling():ss(e)?e.getChildAtIndex(t):null}#Y(){this.editorContentElement.addEventListener("keydown",(e=>{if("ArrowUp"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.previousElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.previousElementSibling;n||e.preventDefault()}}if("ArrowDown"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.nextElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.nextElementSibling;n||e.preventDefault()}}}),!0)}#X(){this.#ve(),this.#Se(),this.previouslySelectedKeys=this.#he,this._currentlySelectedKeys=null}#ve(){for(const e of this.previouslySelectedKeys)if(!this.#he.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#Se(){for(const e of this.#he)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#ge(){this.current?await this.#we((e=>e.selectPrevious())):this.#Ce(this.nodeBeforeCursor)}async#pe(){this.current?await this.#we((e=>e.selectNext(0,0))):this.#Ce(this.nodeAfterCursor)}async#fe(){this.current?await this.#we((e=>e.selectPrevious())):this.#Ce(this.topLevelNodeBeforeCursor)}async#me(){this.current?await this.#we((e=>e.selectNext(0,0))):this.#Ce(this.topLevelNodeAfterCursor)}async#we(e){await Ld(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#be(){this.editor.update((()=>{const e=this.#Te();e&&this.#Ee(e)}))}#Te(){const e=vi();return e?ai(e)?this.#Ne(e):si(e)?this.#Ae(e):null:null}#Ne(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#Ae(e){return e.anchor.getNode().getTopLevelElement()}#Ee(e){const t=e.getNextSibling();t?t.selectStart():this.#Le()}#Le(){const e=eo(),t=_s();e.append(t),t.selectStart()}#Ce(e){e&&e instanceof as&&this.editor.update((()=>{const t=xi();t.add(e.getKey()),no(t)}))}#ye(){const e=this.nodeAfterCursor;return e instanceof as?this.#Ce(e):this.#de.deleteSelectedNodes(),!0}#_e(){const e=this.nodeBeforeCursor;return e instanceof as?this.#Ce(e):this.#de.deleteSelectedNodes(),!0}#Q(){const e=vi();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#ee(e){let t=e.getBoundingClientRect();if(this.#Pe(t)){const n=this.#Oe(e);t=n.getBoundingClientRect(),this.#Fe(n),n.remove()}return t}#Pe(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#Oe(e){const t=this.#Ie();return e.insertNode(t),t}#Ie(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",Ka()),e}#Fe(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#te(e,t){const n=this.editor.getRootElement().getBoundingClientRect(),r=e.left-n.left;let i=e.top-n.top;const s=this.#Re(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Re(e){const t=window.getSelection().anchorNode,n=this.#Me(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#Me(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#ne(){const e=vi();if(!si(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#re(e,t){return t===e.getTextContentSize()?this.#oe(e):null}#oe(e){if(e.getNextSibling()instanceof as)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#ie(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#se(e)}#ae(e,t){return 0===t?this.#ue(e):null}#ue(e){if(e.getPreviousSibling()instanceof as)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#le(e,t){return t>0?e.getChildAtIndex(t-1):this.#ce(e)}#se(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#ce(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Od extends as{static getType(){return"custom_action_text_attachment"}static clone(e){return new Od({...e},e.__key)}static importJSON(e){return new Od({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Vr(" ")),n.push(new Od({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Vr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=bd("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{kd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:bd("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class Fd{constructor(e){this.editorElement=e,this.editor=e.editor}insertHtml(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=dc(this.editor,xd(e));t.insertNodes(n)}))}insertAtCursor(e){this.editor.update((()=>{const t=vi(),n=t?.getNodes();if(si(t))Ai([e]);else if(ai(t)&&n&&n.length>0){n[n.length-1].insertAfter(e)}else{eo().append(e)}}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=vi();if(!si(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.insertNodeWrappingAllSelectedLines(t)}))}insertNodeWrappingAllSelectedLines(e){this.editor.update((()=>{const t=vi();si(t)&&(t.isCollapsed()?this.#De(t,e):this.#ze(t,e))}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=_s();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=vi();e=si(t)&&!t.isCollapsed()})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=vi();if(!si(e))return;const{listItems:t,parentLists:n}=this.#Be(e);if(t.size>0){const e=this.#$e(t);this.#Ue(n),this.#We(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Vr(e),r=Mu(e);r.append(n);const i=vi();si(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Wu(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Gr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Gr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#He();if(!n)return;const i=this.#Ke(n,r,e);-1!==i&&this.#je(n,r,i,t)}))}createParagraphAfterNode(e,t){const n=_s();e.insertAfter(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}createParagraphBeforeNode(e,t){const n=_s();e.insertBefore(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#qe(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=new Td({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});this.insertAtCursor(r)}),{tag:Sr})}async deleteSelectedNodes(){let e=null;this.editor.update((()=>{if(ai(this.#Je.current)){const t=this.#Je.current.getNodes();if(0===t.length)return;e=this.#Ve(t),this.#Ge(t)}})),await Ld(),this.editor.update((()=>{this.#Ze(e),this.#Je.clear(),this.editor.focus()}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=vi();let s=!1;if(si(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&no(null)}const o=n.attachment?this.#Ye(t,n.attachment):this.#Xe(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;let i=r;try{i=r.getTopLevelElementOrThrow()}catch{}const s=n.attachment?this.#Ye(t,n.attachment):this.#Xe(t);i.insertAfter(s)}))}get#Je(){return this.editorElement.selection}#De(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else Ai([t()])}#ze(e,t){const n=this.#Qe(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#et(n);if(0===r.size)return;const s=this.#tt(t,r);this.#nt(e,s),this.#rt(i)}#Qe(e){const t=e.extract().map((e=>this.#it(e))).filter(Boolean);return no(null),t}#it(e){return bs(e)?e:Gr(e)&&e.getParent()&&bs(e.getParent())?e.getParent():null}#et(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#tt(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Vr(e)),t<r.length-1&&n.append(Lr())})),n}#nt(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#rt(e){e.forEach((e=>e.remove()))}#Ge(e){e.forEach((e=>{const t=e.getParent();if(!ss(t))return;const n=t.getChildren().indexOf(e);n>=0&&t.splice(n,1,[])}))}#Ve(e){const t=e[0],n=e[e.length-1];return t?.getPreviousSibling()||n?.getNextSibling()}#Ze(e){const t=eo();if(0===t.getChildrenSize()){const e=_s();t.append(e),e.selectStart()}else e&&(Gr(e)||bs(e)?e.selectEnd():e.selectNext(0,0))}#Be(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=ju(e);if(t){n.add(t);const e=t.getParent();e&&sc(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#$e(e){const t=[];for(const n of e){const e=this.#st(n);e&&t.push(e)}return t}#st(e){const t=e.getParent();if(!t||!sc(t))return null;const n=_s(),r=this.#ot(e,n);return e.insertAfter(n),this.#at(n,r),e.remove(),n}#ot(e,t){const n=[];return e.getChildren().forEach((e=>{sc(e)?n.push(e):t.append(e)})),n}#at(e,t){t.forEach((t=>{e.insertAfter(t)}))}#Ue(e){for(const t of e)sc(t)&&0===t.getChildrenSize()&&t.remove()}#We(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#lt(t,n)}#lt(e,t){e.selectStart();const n=vi();n&&si(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#He(){const e=vi();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Gr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#Ke(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#je(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Vr(s),l=Vr(o||" ");e.replace(a);this.#ct(a,r).insertAfter(l),this.#ut(l.getParentOrThrow()),l.select(0,0)}#ct(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#ut(e){if(bs(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Gr(n)&&""===n.getTextContent()&&r&&!Gr(r)&&e.append(Lr())}}#Ye(e,t={}){return new Od({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#Xe(e){return dc(this.editor,xd(e))[0]||_s()}#qe(e){return vd(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Id(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rd={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Md(e){Rd=e}var Dd={exec:()=>null};function zd(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Bd.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Bd={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},$d=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ud=/(?:[*+-]|\d{1,9}[.)])/,Wd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hd=zd(Wd).replace(/bull/g,Ud).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Kd=zd(Wd).replace(/bull/g,Ud).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),jd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Jd=zd(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vd=zd(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ud).getRegex(),Gd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yd=zd("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Zd).replace("tag",Gd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xd=zd(jd).replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gd).getRegex(),Qd={blockquote:zd(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xd).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Jd,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:$d,html:Yd,lheading:Hd,list:Vd,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Xd,table:Dd,text:/^[^\n]+/},eh=zd("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gd).getRegex(),th={...Qd,lheading:Kd,table:eh,paragraph:zd(jd).replace("hr",$d).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",eh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gd).getRegex()},nh={...Qd,html:zd("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Zd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:zd(jd).replace("hr",$d).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Hd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rh=/^( {2,}|\\)\n(?!\s*$)/,ih=/[\p{P}\p{S}]/u,sh=/[\s\p{P}\p{S}]/u,oh=/[^\s\p{P}\p{S}]/u,ah=zd(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sh).getRegex(),lh=/(?!~)[\p{P}\p{S}]/u,ch=zd(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),uh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dh=zd(uh,"u").replace(/punct/g,ih).getRegex(),hh=zd(uh,"u").replace(/punct/g,lh).getRegex(),gh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ph=zd(gh,"gu").replace(/notPunctSpace/g,oh).replace(/punctSpace/g,sh).replace(/punct/g,ih).getRegex(),fh=zd(gh,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,lh).getRegex(),mh=zd("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,oh).replace(/punctSpace/g,sh).replace(/punct/g,ih).getRegex(),yh=zd(/\\(punct)/,"gu").replace(/punct/g,ih).getRegex(),_h=zd(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bh=zd(Zd).replace("(?:--\x3e|$)","--\x3e").getRegex(),xh=zd("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",bh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vh=zd(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Sh=zd(/^!?\[(label)\]\[(ref)\]/).replace("label",kh).replace("ref",qd).getRegex(),wh=zd(/^!?\[(ref)\](?:\[\])?/).replace("ref",qd).getRegex(),Ch=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Th={_backpedal:Dd,anyPunctuation:yh,autolink:_h,blockSkip:ch,br:rh,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Dd,emStrongLDelim:dh,emStrongRDelimAst:ph,emStrongRDelimUnd:mh,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:vh,nolink:wh,punctuation:ah,reflink:Sh,reflinkSearch:zd("reflink|nolink(?!\\()","g").replace("reflink",Sh).replace("nolink",wh).getRegex(),tag:xh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Dd},Eh={...Th,link:zd(/^!?\[(label)\]\((.*?)\)/).replace("label",kh).getRegex(),reflink:zd(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kh).getRegex()},Nh={...Th,emStrongRDelimAst:fh,emStrongLDelim:hh,url:zd(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ch).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:zd(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ch).getRegex()},Ah={...Nh,br:zd(rh).replace("{2,}","*").getRegex(),text:zd(Nh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Lh={normal:Qd,gfm:th,pedantic:nh},Ph={normal:Th,gfm:Nh,breaks:Ah,pedantic:Eh},Oh={"&":"&","<":"<",">":">",'"':""","'":"'"},Fh=e=>Oh[e];function Ih(e,t){if(t){if(Bd.escapeTest.test(e))return e.replace(Bd.escapeReplace,Fh)}else if(Bd.escapeTestNoEncode.test(e))return e.replace(Bd.escapeReplaceNoEncode,Fh);return e}function Rh(e){try{e=encodeURI(e).replace(Bd.percentDecode,"%")}catch{return null}return e}function Mh(e,t){let n=e.replace(Bd.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(Bd.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Bd.slashPipe,"|");return r}function Dh(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function zh(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var Bh=class{options;rules;lexer;constructor(e){this.options=e||Rd}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Dh(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Dh(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Dh(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Dh(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Mh(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Mh(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Dh(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),zh(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return zh(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},$h=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rd,this.options.tokenizer=this.options.tokenizer||new Bh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Bd,block:Lh.normal,inline:Ph.normal};this.options.pedantic?(t.block=Lh.pedantic,t.inline=Ph.pedantic):this.options.gfm&&(t.block=Lh.gfm,this.options.breaks?t.inline=Ph.breaks:t.inline=Ph.gfm),this.tokenizer.rules=t}static get rules(){return{block:Lh,inline:Ph}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Bd.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Bd.tabCharGlobal," ").replace(Bd.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Uh=class{options;parser;constructor(e){this.options=e||Rd}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Bd.notSpaceStart)?.[0],i=e.replace(Bd.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Ih(r)+'">'+(n?i:Ih(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Ih(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Ih(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ih(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Rh(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Ih(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Rh(e);if(null===i)return Ih(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Ih(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ih(e.text)}},Wh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Hh=class e{options;renderer;textRenderer;constructor(e){this.options=e||Rd,this.options.renderer=this.options.renderer||new Uh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wh}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Kh=class{options;block;constructor(e){this.options=e||Rd}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?$h.lex:$h.lexInline}provideParser(){return this.block?Hh.parse:Hh.parseInline}},jh=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Hh;Renderer=Uh;TextRenderer=Wh;Lexer=$h;Tokenizer=Bh;Hooks=Kh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Uh(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Bh(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Kh;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Kh.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Kh.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $h.lex(e,t??this.defaults)}parser(e,t){return Hh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?$h.lex:$h.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Hh.parse:Hh.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?$h.lex:$h.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Hh.parse:Hh.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Ih(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function qh(e,t){return jh.parse(e,t)}function Jh(e){try{return new URL(e),!0}catch{return!1}}function Vh(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}qh.options=qh.setOptions=function(e){return jh.setOptions(e),qh.defaults=jh.defaults,Md(qh.defaults),qh},qh.getDefaults=Id,qh.defaults=Rd,qh.use=function(...e){return jh.use(...e),qh.defaults=jh.defaults,Md(qh.defaults),qh},qh.walkTokens=function(e,t){return jh.walkTokens(e,t)},qh.parseInline=jh.parseInline,qh.Parser=Hh,qh.parser=Hh.parse,qh.Renderer=Uh,qh.TextRenderer=Wh,qh.Lexer=$h,qh.lexer=$h.lex,qh.Tokenizer=Bh,qh.Hooks=Kh,qh.parse=qh,qh.options,qh.setOptions,qh.use,qh.walkTokens,qh.parseInline,Hh.parse,$h.lex;class Gh{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#dt(t)?(this.#ht(t),e.preventDefault(),!0):void this.#gt(t))}#dt(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#ht(e){e.items[0].getAsString((e=>{if(Jh(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(Jh(e)){const t=this.contents.createLink(e);this.#pt(t,{url:e})}else this.#ft(e)}))}#pt(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};vd(this.editorElement,"lexxy:insert-link",{...t,...n})}#ft(e){const t=qh(e);this.contents.insertHtml(t)}#gt(e){if(!this.editorElement.supportsAttachments)return;e.getData("text/html")||this.#mt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#mt(e){const t=window.scrollY,n=window.scrollX;e(),await Ld(),window.scrollTo(n,t),this.editor.focus()}}class Zh extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic","strikethrough"];static observedAttributes=["connected","required"];#yt="";#_t=document.createElement("textarea");constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Sd("lexxy-editor"),this.editor=this.#bt(),this.contents=new Fd(this),this.selection=new Pd(this),this.clipboard=new Gh(this),Ad.configureFor(this),this.#xt(),requestAnimationFrame((()=>vd(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#kt()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#vt())),"required"===e&&this.isConnected&&(this.#_t.required=this.hasAttribute("required"),this.#St())}formResetCallback(){this.value=this.#yt,this.editor.dispatchCommand(Dn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#wt?(this.toolbar=this.toolbar||this.#Ct(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e,{ALLOWED_TAGS:yd,ALLOWED_ATTR:_d,SAFE_FOR_XML:!1})}(hc(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{No(Tr);const t=eo();t.clear(),""!==e&&t.append(...this.#Tt(e)),t.select(),this.#Et(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#Tt(e){e||(e="<p></p>");return dc(this.editor,xd(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof as&&!t.isInline())return t}return e}))}#xt(){this.#Nt(),this.#At(),this.#Lt(),this.#Pt(),this.#Ot(),this.#Ft(),this.#It(),this.#Rt()}#bt(){this.editorContentElement=this.editorContentElement||this.#Mt();const e=vs({namespace:"LexicalEditor",onError(e){throw e},theme:fd,nodes:this.#Dt});return e.setRootElement(this.editorContentElement),e}get#Dt(){const e=[Ic,Dc,Ql,Vl,eu,cu,Iu,zu,Ed,Od];return this.supportsAttachments&&e.push(Cd,Td),e}#Mt(){const e=bd("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#zt,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#Bt.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#zt(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#Bt(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#$t(e){const t=void 0!==this.#$t&&this.#$t!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,this.#_t.value=this.#Ut?"":e,t&&vd(this,"lexxy:change")}get#$t(){return this._internalFormValue}#It(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#yt=e}#Rt(){document.addEventListener("turbo:before-cache",this.#Wt)}#Wt=e=>{this.#kt()};#Nt(){this.#Ht(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#$t=this.value,this.#Et(),this.#St()})))}#Ht(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Kt(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#At(){Jc(this.editor),this.historyState={current:null,redoStack:[],undoStack:[]},gd(this.editor,this.historyState,20),uc(this.editor),this.#jt(),ud(this.editor,ad)}#jt(){!function(e,t){if(!e.hasNodes([eu,cu]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=vu);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(eu,(t=>{e.getEditorState().read((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Vs(n);null!==t&&wu(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(eu,(n=>Tu(n,e,t))),e.registerNodeTransform(Br,(n=>Su(n,e,t))),e.registerNodeTransform(cu,(n=>Su(n,e,t))),e.registerCommand(wn,(t=>{const n=function(e){const t=vi();if(!si(t)||!Nu(t))return null;const n=e?En:Tn,r=e?En:Cn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Au(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&Gc(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=pu(a[0]),d=fu(a[0]),h=ti(u.getKey(),0,"text"),g=ti(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(Cn,(()=>!!Nu(vi())&&(Ai([Xr()]),!0)),1),e.registerCommand(Tn,(e=>Lu(Tn)),1),e.registerCommand(En,(e=>Lu(En)),1),e.registerCommand(yn,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Nu(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&nu(r.getParentOrThrow())?(e.preventDefault(),!0):Pu(yn,e))}),1),e.registerCommand(_n,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Nu(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&nu(r.getParentOrThrow())?(e.preventDefault(),!0):Pu(_n,e))}),1),e.registerCommand(mn,(e=>Ou(mn,e)),1),e.registerCommand(pn,(e=>Ou(pn,e)),1)),al(...n)}(this.editor),this.append(bd("lexxy-code-language-picker"))}#Lt(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e instanceof Cd){const t=e.getWritable();Object.assign(t,n)}}))}))}#Pt(){this.editor.registerCommand(bn,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#Ot(){Zh.debug&&this.#Ht(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#Ft(){this.#wt&&this.toolbarElement.setEditor(this)}#Ct(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#qt()}get#wt(){return"false"!==this.getAttribute("toolbar")}#qt(){const e=bd("lexxy-toolbar");return e.innerHTML=Ju.defaultTemplate,e.setAttribute("data-attachments",this.supportsAttachments),this.prepend(e),e}#Et(){this.classList.toggle("lexxy-editor--empty",this.#Ut)}get#Ut(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(md)}#St(){this.#_t.validity.valid?this.internals.setValidity({}):this.internals.setValidity(this.#_t.validity,this.#_t.validationMessage,this.editorContentElement)}#kt(){this.#Kt(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#Wt)}#vt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Zh);class Yh extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#Jt.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Vt.bind(this)),this.addEventListener("keydown",this.#Gt.bind(this))}show(e){this.input.value=this.#Zt,this.dialog.show()}close(){this.dialog.close()}#Jt(e){const t=e.submitter?.value;this.#Yt.dispatchCommand(t,this.input.value)}#Vt(e){this.#Yt.dispatchCommand("unlink"),this.close()}#Gt(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#Zt(){let e="";return this.#Yt.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if(Du(n)){e=n.getURL();break}n=n.getParent()}})),e}get#Yt(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",Yh);class Xh{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=bd("li",{role:"option",id:Sd("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=xd(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class Qh extends Xh{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Xt(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Xt(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return Vh(e).includes(Vh(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class eg extends Qh{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class tg extends Qh{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class ng extends Xh{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#Qt(e));return this.#Xt(t)}#Qt(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Xt(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class rg extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#en(),this.#tn()}disconnectedCallback(){this.source=null,this.popoverElement=null}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get#nn(){return!this.supportsSpaceInSearches}#en(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new ng(e):new tg(e):new eg(this.querySelectorAll("lexxy-prompt-item"))}#tn(){const e=this.#Yt.registerUpdateListener((()=>{this.#Yt.read((()=>{const t=vi();if(!t)return;let n;if(si(t)?n=t.anchor.getNode():ai(t)&&([n]=t.getNodes()),n&&Gr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#rn())}}))}))}get#Yt(){return this.#in.editor}get#in(){return this.closest("lexxy-editor")}get#Je(){return this.#in.selection}async#rn(){this.popoverElement??=await this.#sn(),await this.#on(),this.#an(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#ln(),this.#in.addEventListener("keydown",this.#cn),this.#in.addEventListener("lexxy:change",this.#on),this.#un()}#un(){this.keyListeners.push(this.#Yt.registerCommand(bn,this.#dn.bind(this),3)),this.keyListeners.push(this.#Yt.registerCommand(wn,this.#dn.bind(this),3)),this.#nn&&this.keyListeners.push(this.#Yt.registerCommand(xn,this.#dn.bind(this),3))}#ln(){const e=this.#hn[0];e&&this.#gn(e)}get#hn(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#gn(e){this.#pn(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#in.focus(),this.#fn.setAttribute("aria-controls",this.popoverElement.id),this.#fn.setAttribute("aria-activedescendant",e.id),this.#fn.setAttribute("aria-haspopup","listbox")}#pn(){this.#hn.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#fn.removeAttribute("aria-controls"),this.#fn.removeAttribute("aria-activedescendant"),this.#fn.removeAttribute("aria-haspopup")}#an(){const{x:e,y:t,fontSize:n}=this.#Je.cursorPosition,r=this.#in.getBoundingClientRect(),i=this.#fn.getBoundingClientRect().top-r.top;this.popoverElement.style.left=`${e}px`,this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";this.popoverElement.getBoundingClientRect().bottom>window.innerHeight&&(this.popoverElement.style.bottom=`${t-i+n}px`,this.popoverElement.style.top="auto")}async#mn(){this.#pn(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#in.removeEventListener("lexxy:change",this.#on),this.#in.removeEventListener("keydown",this.#cn),this.#yn(),await Ld(),this.#tn()}#yn(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#on=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#_n.containsTextBackUntil(this.trigger)?await this.#bn():this.#mn()};async#bn(){const e=this.#_n.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#xn(t):this.#kn(),this.#ln()}#xn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#kn(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=bd("li",{innerHTML:this.#vn});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#vn(){return this.getAttribute("empty-results")||"Nothing found"}#cn=e=>{"Escape"===e.key?(this.#mn(),this.#in.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#Sn(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#wn(),e.preventDefault(),e.stopPropagation())};#Sn(){const e=this.#Cn+1;e<this.#hn.length&&this.#gn(this.#hn[e])}#wn(){const e=this.#Cn-1;e>=0&&this.#gn(this.#hn[e])}get#Cn(){return this.#hn.findIndex((e=>e.hasAttribute("aria-selected")))}get#Tn(){return this.#hn[this.#Cn]}#dn(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#En(),!0}#En(){this.#Nn(),this.#mn(),this.#in.focus()}#Nn(){const e=this.source.promptItemFor(this.#Tn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#_n.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#An(t,n):this.#Ln(e,t,n)}#An(e,t){this.#Yt.update((()=>{const n=dc(this.#Yt,xd(`${e.innerHTML}`));this.#_n.replaceTextBackUntil(t,n)}))}#Ln(e,t,n){this.#Yt.update((()=>{const r=new Od({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#_n.replaceTextBackUntil(n,r)}))}get#_n(){return this.#in.contents}get#fn(){return this.#in.editorContentElement}async#sn(){const e=bd("ul",{role:"listbox",id:Sd("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",Ka()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#Pn),this.#in.appendChild(e),e}#Pn=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#gn(t),this.#En())}}customElements.define("lexxy-prompt",rg);class ig extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#On(),this.#Fn()}#On(){this.languagePickerElement=this.#In(),this.languagePickerElement.addEventListener("change",(()=>{this.#Rn(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",Ka()),this.editorElement.appendChild(this.languagePickerElement)}#In(){const e=bd("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#Mn)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#Mn(){const e={...yu};e.ruby||(e.ruby="Ruby");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#Rn(e){this.editor.update((()=>{const t=this.#Dn();t&&t.setLanguage(e)}))}#Fn(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Dn();e?this.#zn(e):this.#Bn()}))}))}#Dn(){const e=vi();if(!si(e))return null;const t=e.anchor.getNode(),n=t.getParent();return nu(t)?t:nu(n)?n:null}#zn(e){const t=e.getLanguage();this.#$n(t),this.#Un(),this.#Wn(e)}#$n(e){if(this.languagePickerElement&&e){const t=function(e){return _u[e]||e}(e);this.languagePickerElement.value=t}}#Wn(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#Un(){this.languagePickerElement.hidden=!1}#Bn(){this.languagePickerElement.hidden=!0}}function sg(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=bd("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",ig),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),window.Prism=window.Prism||{},Prism.manual=!0;export{sg as highlightAll};
|
|
10
|
+
*/function Gc(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=Vc),"undefined"!=typeof global&&(global.Prism=Vc),Vc.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Vc.languages.markup.tag.inside["attr-value"].inside.entity=Vc.languages.markup.entity,Vc.languages.markup.doctype.inside["internal-subset"].inside=Vc.languages.markup,Vc.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Vc.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Vc.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Vc.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Vc.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Vc.languages.markup.tag,"addAttribute",{value:function(e,t){Vc.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Vc.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Vc.languages.html=Vc.languages.markup,Vc.languages.mathml=Vc.languages.markup,Vc.languages.svg=Vc.languages.markup,Vc.languages.xml=Vc.languages.extend("markup",{}),Vc.languages.ssml=Vc.languages.xml,Vc.languages.atom=Vc.languages.xml,Vc.languages.rss=Vc.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Vc),Vc.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Vc.languages.javascript=Vc.languages.extend("clike",{"class-name":[Vc.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Vc.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Vc.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Vc.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Vc.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Vc.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Vc.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Vc.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Vc.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Vc.languages.markup&&(Vc.languages.markup.tag.addInlined("script","javascript"),Vc.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Vc.languages.js=Vc.languages.javascript,function(){if(void 0!==Vc&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';Vc.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Vc.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}Vc.util.setLanguage(a,c),Vc.util.setLanguage(o,c);var d=Vc.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,Vc.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Vc.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Vc.highlightElement(t)}};var s=!1;Vc.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Vc.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);function Zc(e,t){for(const n of e.childNodes){if(Bo(n)&&n.tagName===t)return!0;Zc(n,t)}return!1}const Yc="data-language",Xc="data-highlight-language",Qc="data-theme";let eu=class e extends is{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");ll(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(Yc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Xc,n));const r=this.getTheme();r&&t.setAttribute(Qc,r);const i=this.getStyle();return i&&t.setAttribute("style",i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(Yc,r):i&&t.removeAttribute(Yc);const s=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?s&&r?r!==i&&t.setAttribute(Xc,r):t.removeAttribute(Xc):s&&r&&t.setAttribute(Xc,r);const o=this.__theme,a=e.__theme;o?o!==a&&t.setAttribute(Qc,o):a&&t.removeAttribute(Qc);const l=this.__style,c=e.__style;return l?l!==c&&t.setAttribute("style",l):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");ll(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(Yc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Xc,n));const r=this.getTheme();r&&t.setAttribute(Qc,r);const i=this.getStyle();return i&&t.setAttribute("style",i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||Zc(e,"BR"))?{conversion:ru,priority:1}:null,div:()=>({conversion:iu,priority:1}),pre:()=>({conversion:ru,priority:0}),table:e=>lu(e)?{conversion:su,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&lu(n)?{conversion:ou,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&lu(t)?{conversion:ou,priority:3}:null}}}static importJSON(e){return tu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=_s();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Gr(o)){let e=pu(o);const t=[];for(;;)if(Qr(e))t.push(Xr()),e=e.getNextSibling();else{if(!hu(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(du(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[Lr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(nu(o)){const{offset:t}=e.anchor;o.splice(t,0,[Lr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=_s();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function tu(e,t){return function(e){const t=jo();return $i(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}(eu).setLanguage(e).setTheme(t)}function nu(e){return e instanceof eu}function ru(e){return{node:tu(e.getAttribute(Yc))}}function iu(e){const t=e,n=au(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(au(t))return!0;t=t.parentElement}return!1}(t)?{node:n?tu():null}:{node:null}}function su(){return{node:tu()}}function ou(){return{node:null}}function au(e){return null!==e.style.fontFamily.match("monospace")}function lu(e){return e.classList.contains("js-file-line-container")}let cu=class e extends Br{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return ll(t,uu(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=uu(n.theme,e.__highlightType),s=uu(n.theme,this.__highlightType);return i!==s&&(i&&cl(t,i),s&&ll(t,s)),r}static importJSON(e){return du().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return tu()}};function uu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function du(e="",t){return Oo(new cu(e,t))}function hu(e){return e instanceof cu}function gu(e,t){let n=e;for(let r=fa(e,t);r&&(hu(r.origin)||Qr(r.origin));r=ul(r))n=r.origin;return n}function pu(e){return gu(e,"previous")}function fu(e){return gu(e,"next")}!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const mu=globalThis.Prism||window.Prism,yu={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},_u={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function bu(e){return"string"==typeof e?e:Array.isArray(e)?e.map(bu).join(""):bu(e.content)}function xu(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=mu.tokenize(r,mu.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=mu.languages[n],i={tokens:e},s=mu.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in s)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new mu.Token("prefix",s[t],t.replace(/^(\w+).*/,"$1"))),o=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),a=e.content.length-o.length,l=mu.tokenize(bu(o),r);l.unshift(i());const c=/\r\n|\n/g,u=e=>{const t=[];c.lastIndex=0;let r,s=0;for(;n<a&&(r=c.exec(e));){const n=r.index+r[0].length;t.push(e.slice(s,n)),s=n,t.push(i())}if(0!==t.length)return s<e.length&&t.push(e.slice(s)),t},d=e=>{for(let t=0;t<e.length&&n<a;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(l),n<a&&l.push(i()),e.content=l}return i.tokens}(i,n[1])),ku(i)}function ku(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(Lr()):"\t"===i?n.push(Xr()):i.length>0&&n.push(du(i,t))}}else{const{content:e,alias:t}=r;"string"==typeof e?n.push(...ku([e],"prefix"===r.type&&"string"==typeof t?t:r.type)):Array.isArray(e)&&n.push(...ku(e,"unchanged"===r.type?void 0:r.type))}return n}const vu={$tokenize(e,t){return xu(e,t||this.defaultLanguage)},defaultLanguage:"javascript",tokenize(e,t){return mu.tokenize(e,mu.languages[t||""]||mu.languages[this.defaultLanguage])}};function Su(e,t,n){const r=e.getParent();nu(r)?Tu(r,t,n):hu(e)&&e.replace(Vr(e.__text))}function wu(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)Pr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Cu=new Set;function Tu(e,t,n){const r=e.getKey();void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage);if(!function(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&mu.languages.hasOwnProperty(n)}catch(e){return!1}}(e.getLanguage()||n.defaultLanguage))return e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!1),void async function(){}();e.getIsSyntaxHighlightSupported()||e.setIsSyntaxHighlightSupported(!0),Cu.has(r)||(Cu.add(r),t.update((()=>{!function(e,t){const n=Vs(e);if(!nu(n)||!n.isAttached())return;const r=vi();if(!si(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&Pr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Gr(e);if(t||Pr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Vs(r);if(!nu(t)||!t.isAttached())return!1;const i=t.getLanguage()||n.defaultLanguage,s=n.$tokenize(t,i),o=function(e,t){let n=0;for(;n<e.length&&Eu(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Eu(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Cu.delete(r)},skipTransforms:!0}))}function Eu(e,t){return hu(e)&&hu(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Qr(e)&&Qr(t)||Pr(e)&&Pr(t)}function Nu(e){if(!si(e))return!1;const t=e.anchor.getNode(),n=nu(t)?t:t.getParent(),r=e.focus.getNode(),i=nu(r)?r:r.getParent();return nu(n)&&n.is(i)}function Au(e){const t=e.getNodes(),n=[];if(1===t.length&&nu(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];hu(i)||Qr(i)||Pr(i)||Gc(169),Pr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=ti(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Lu(e){const t=vi();if(!si(t)||!Nu(t))return!1;const n=Au(t),r=n.length;if(0===r&&t.isCollapsed())return e===Tn&&t.insertNodes([Xr()]),!0;if(0===r&&e===Tn&&"\n"===t.getTextContent()){const e=Xr(),n=Lr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),Oa(Ha(wa(ma(e,"next",0),$a(fa(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=pu(n)),e===Tn){const e=Xr();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=ti(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Qr(n)&&n.remove()}}return!0}function Pu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===yn;if(!Nu(n)||!hu(a)&&!Qr(a)||!hu(l)&&!Qr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=pu(a),d=fu(l)):(u=pu(l),d=fu(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!hu(t)&&!Qr(t)&&!Pr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!Pr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=hu(p)||Qr(p)||Pr(p)?c?pu(p):fu(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===yn?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Fu(e,t){const n=vi();if(!si(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===mn;if(!Nu(n)||!hu(s)&&!Qr(s)||!hu(o)&&!Qr(o))return!1;const l=o;if("rtl"===function(e){const t=pu(e),n=fu(e);let r=t;for(;null!==r;){if(hu(r)){const e=Ms(r.getTextContent());if(null!==e)return e}if(r===n)break;r=r.getNextSibling()}const i=t.getParent();if(ss(i)){const e=i.getDirection();if("ltr"===e||"rtl"===e)return e}return null}(l)?!a:a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(hu(i)||Qr(i)||Pr(i)||Gc(167),Pr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];hu(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())hu(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();hu(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!hu(n)||r===s){if(n=n.getNextSibling(),null===n||Pr(n))return null;hu(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(hu(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(l,i.offset);if(null!==e){const{node:t,offset:r}=e;Pr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else l.getParentOrThrow().selectStart()}else(function(e){const t=fu(e);return Pr(t)&&Gc(168),t})(l).select();return t.preventDefault(),t.stopPropagation(),!0}const Ou=new Set(["http:","https:","mailto:","sms:","tel:"]);let Iu=class e extends is{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),ll(t,e.theme.link),t}updateLinkDOM(e,t,n){if(zo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Ru,priority:1})}}static importJSON(e){return Mu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Ku(e);try{const t=new URL(Ku(e));if(!Ou.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Mu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!si(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function Ru(e){let t=null;if(zo(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Mu(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Mu(e="",t){return Oo(new Iu(e,t))}function Du(e){return e instanceof Iu}class zu extends Iu{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new zu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Bu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(ss(n)){const e=Bu(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}}function Bu(e="",t){return Oo(new zu(e,t))}function $u(e){return e instanceof zu}function Uu(e,t){if("element"===e.type){const n=e.getNode();return ss(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Wu(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,s=void 0===t.rel?"noreferrer":t.rel,o=vi();if(null===o||!si(o)&&!ai(o))return;if(ai(o)){const e=o.getNodes();if(0===e.length)return;return void e.forEach((e=>{if(null===n){const t=ea(e,(e=>!$u(e)&&Du(e)));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=ea(e,(e=>!$u(e)&&Du(e)));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==s&&t.setRel(s);else{const t=Mu(n,{rel:s,target:r});e.insertBefore(t),t.append(e)}}}))}const a=o.extract();if(null===n){const e=new Set;return void a.forEach((t=>{const n=t.getParent();if(Du(n)&&!$u(n)){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter((t=>e.isParentOf(t))).map((e=>e.getKey()))),r=e.getChildren(),i=r.filter((e=>n.has(e.getKey())));if(i.length===r.length)return r.forEach((t=>e.insertBefore(t))),void e.remove();const s=r.findIndex((e=>n.has(e.getKey()))),o=r.findLastIndex((e=>n.has(e.getKey()))),a=0===s,l=o===r.length-1;if(a)i.forEach((t=>e.insertBefore(t)));else if(l)for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);else{for(let t=i.length-1;t>=0;t--)e.insertAfter(i[t]);const t=r.slice(o+1);if(t.length>0){const n=Mu(e.getURL(),{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()});i[i.length-1].insertAfter(n),t.forEach((e=>n.append(e)))}}}(n,a),e.add(t)}}))}const l=new Set,c=e=>{l.has(e.getKey())||(l.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==s&&e.setRel(s),void 0!==i&&e.setTitle(i))};if(1===a.length){const e=a[0],t=ea(e,Du);if(null!==t)return c(t)}!function(e){const t=vi();if(!si(t))return e();const n=ft(t),r=n.isBackward(),i=Uu(n.anchor,r?-1:0),s=Uu(n.focus,r?0:-1);if(e(),i||s){const e=vi();if(si(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}no(ft(t))}}}((()=>{let e=null;for(const t of a){if(!t.isAttached())continue;const o=ea(t,Du);if(o){c(o);continue}if(ss(t)){if(!t.isInline())continue;if(Du(t)){if(!($u(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const a=t.getPreviousSibling();Du(a)&&a.is(e)?a.append(t):(e=Mu(n,{rel:s,target:r,title:i}),t.insertAfter(e),e.append(t))}}))}const Hu=/^\+?[0-9\s()-]{5,}$/;function Ku(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Hu.test(e)?`tel:${e}`:`https://${e}`}function ju(e){let t=e;for(;null!==t;){if(Xl(t))return t;t=t.getParent()}return null}function qu(e){let t=e;for(;t;){if(sc(t))return t.getListType();t=t.getParent()}return null}class Ju extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){requestAnimationFrame((()=>this.#e())),this._resizeObserver=new ResizeObserver((()=>this.#e())),this._resizeObserver.observe(this)}disconnectedCallback(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i(),this.#s(),this.#e()}#t(){this.addEventListener("click",this.#o.bind(this))}#o({target:e}){this.#a(e,"[data-command]",this.#l.bind(this)),this.#a(e,"[data-dialog-target]",this.#c.bind(this))}#a(e,t,n){const r=e.closest(t);r&&n(r)}#l(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#c(e){const t=this.querySelector("lexxy-link-dialog .link-dialog").parentNode;t.open?t.close():t.show()}#n(){this.editorElement.addEventListener("keydown",(e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#u(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#u(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#r(){const e=parseInt(this.editorElement.editorContentElement.getAttribute("tabindex")??"0");this.#d.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#h()}))}))}#s(){this.editor.registerUpdateListener((()=>{this.#g()}))}#g(){this.editor.getEditorState().read((()=>{const e=this.editorElement.historyState;e&&(this.#p("undo",0===e.undoStack.length),this.#p("redo",0===e.redoStack.length))}))}#p(e,t){const n=this.querySelector(`[name="${e}"]`);n&&(n.disabled=t,n.setAttribute("aria-disabled",t.toString()))}#h(){const e=vi();if(!si(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=e.hasFormat("strikethrough"),o=nu(n)||e.hasFormat("code"),a=this.#f(t),l=qu(t),c=Mc(n),u=Wc(n),d=this.#m(t);this.#y("bold",r),this.#y("italic",i),this.#y("strikethrough",s),this.#y("code",o),this.#y("unordered-list",a&&"bullet"===l),this.#y("ordered-list",a&&"number"===l),this.#y("quote",c),this.#y("heading",u),this.#y("link",d),this.#g()}#f(e){let t=e;for(;t;){if(sc(t)||Xl(t))return!0;t=t.getParent()}return!1}#m(e){let t=e;for(;t;){if(Du(t))return!0;t=t.getParent()}return!1}#y(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#_(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#b(),this.#x(),this.#k.style.display=this.#v.children.length?"block":"none",this.#k.setAttribute("nonce",Ka())};get#k(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#v(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#b(){for(;this.#v.children.length>0;)this.insertBefore(this.#v.children[0],this.#k)}#x(){const e=this.#d.reverse();let t=!1;for(const n of e){if(!this.#_()){t&&this.#v.prepend(n);break}this.#v.prepend(n),t=!0}}get#d(){return Array.from(this.querySelectorAll(":scope > button, :scope > [role=separator]"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.70588 16.1591C4.81459 19.7901 7.48035 22 11.6668 22C15.9854 22 18.724 19.6296 18.724 15.8779C18.724 15.5007 18.6993 15.1427 18.6474 14.8066H14.3721C14.8637 15.2085 15.0799 15.7037 15.0799 16.3471C15.0799 17.7668 13.7532 18.7984 11.8113 18.7984C9.88053 18.7984 8.38582 17.7531 8.21659 16.1591H4.70588ZM5.23953 9.31962H9.88794C9.10723 8.88889 8.75888 8.33882 8.75888 7.57339C8.75888 6.13992 9.96576 5.18793 11.7631 5.18793C13.5852 5.18793 14.8761 6.1797 14.9959 7.81344H18.4102C18.3485 4.31824 15.8038 2 11.752 2C7.867 2 5.09129 4.35802 5.09129 7.92044C5.09129 8.41838 5.14071 8.88477 5.23953 9.31962ZM2.23529 10.6914C1.90767 10.6914 1.59347 10.8359 1.36181 11.0931C1.13015 11.3504 1 11.6993 1 12.0631C1 12.4269 1.13015 12.7758 1.36181 13.0331C1.59347 13.2903 1.90767 13.4348 2.23529 13.4348H20.7647C21.0923 13.4348 21.4065 13.2903 21.6382 13.0331C21.8699 12.7758 22 12.4269 22 12.0631C22 11.6993 21.8699 11.3504 21.6382 11.0931C21.4065 10.8359 21.0923 10.6914 20.7647 10.6914H2.23529Z"/>\n </svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="link" title="Link" data-dialog-target="link-dialog" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </button>\n\n <lexxy-link-dialog class="lexxy-link-dialog">\n <dialog class="link-dialog" closedby="any">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input" required>\n <div class="lexxy-dialog-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </dialog>\n </lexxy-link-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">\n <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 12C0 11.4477 0.447715 11 1 11H23C23.5523 11 24 11.4477 24 12C24 12.5523 23.5523 13 23 13H1C0.447716 13 0 12.5523 0 12Z"/><path d="M4 5C4 3.89543 4.89543 3 6 3H18C19.1046 3 20 3.89543 20 5C20 6.10457 19.1046 7 18 7H6C4.89543 7 4 6.10457 4 5Z"/><path d="M4 19C4 17.8954 4.89543 17 6 17H18C19.1046 17 20 17.8954 20 19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19Z"/></svg>\n </button>\n \n <div class="lexxy-editor__toolbar-spacer" role="separator"></div>\n \n <button class="lexxy-editor__toolbar-button" type="button" name="undo" data-command="undo" title="Undo" data-hotkey="cmd+z ctrl+z">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5.64648 8.26531C7.93911 6.56386 10.7827 5.77629 13.624 6.05535C16.4655 6.33452 19.1018 7.66079 21.0195 9.77605C22.5839 11.5016 23.5799 13.6516 23.8936 15.9352C24.0115 16.7939 23.2974 17.4997 22.4307 17.4997C21.5641 17.4997 20.8766 16.7915 20.7148 15.9401C20.4295 14.4379 19.7348 13.0321 18.6943 11.8844C17.3 10.3464 15.3835 9.38139 13.3174 9.17839C11.2514 8.97546 9.18359 9.54856 7.5166 10.7858C6.38259 11.6275 5.48981 12.7361 4.90723 13.9997H8.5C9.3283 13.9997 9.99979 14.6714 10 15.4997C10 16.3281 9.32843 16.9997 8.5 16.9997H1.5C0.671573 16.9997 0 16.3281 0 15.4997V8.49968C0.000213656 7.67144 0.671705 6.99968 1.5 6.99968C2.3283 6.99968 2.99979 7.67144 3 8.49968V11.0212C3.7166 9.9704 4.60793 9.03613 5.64648 8.26531Z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo" data-hotkey="cmd+shift+z ctrl+shift+z ctrl+y">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.2599 8.26531C15.9672 6.56386 13.1237 5.77629 10.2823 6.05535C7.4408 6.33452 4.80455 7.66079 2.88681 9.77605C1.32245 11.5016 0.326407 13.6516 0.0127834 15.9352C-0.105117 16.7939 0.608975 17.4997 1.47567 17.4997C2.34228 17.4997 3.02969 16.7915 3.19149 15.9401C3.47682 14.4379 4.17156 13.0321 5.212 11.8844C6.60637 10.3464 8.52287 9.38139 10.589 9.17839C12.655 8.97546 14.7227 9.54856 16.3897 10.7858C17.5237 11.6275 18.4165 12.7361 18.9991 13.9997H15.4063C14.578 13.9997 13.9066 14.6714 13.9063 15.4997C13.9063 16.3281 14.5779 16.9997 15.4063 16.9997H22.4063C23.2348 16.9997 23.9063 16.3281 23.9063 15.4997V8.49968C23.9061 7.67144 23.2346 6.99968 22.4063 6.99968C21.578 6.99968 20.9066 7.67144 20.9063 8.49968V11.0212C20.1897 9.9704 19.2984 9.03613 18.2599 8.26531Z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function Vu(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",Ju);const Gu=/[!-/:-@[-`{-~\s]/;function Zu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Yu=function(e,t){return new et(e,t)}("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-"}),Xu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},Qu=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=Yl("check"===e?"x"===r[3]:void 0),l=r[0].trim()[0],c="bullet"!==e&&"check"!==e||l!==Yu.parse(l)?void 0:l;if(sc(o)&&o.getListType()===e){c&&nt(o,Yu,c);const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(sc(s)&&s.getListType()===e)c&&nt(s,Yu,c),s.append(a),t.remove();else{const n=ic(e,"number"===e?Number(r[2]):void 0);c&&nt(n,Yu,c),n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const u=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&a.setIndent(u)},ed=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(Xl(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(sc(e)){r.push(ed(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l=tt(e,Yu),c="number"===a?`${e.getStart()+s}. `:"check"===a?`${l} [${o.getChecked()?"x":" "}] `:l+" ";r.push(i+c+t(o)),s++}return r.join("\n")},td={dependencies:[Dc],export:(e,t)=>{if(!Wc(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:Xu((e=>Uc("h"+e[1].length))),type:"element"},nd={dependencies:[Ic],export:(e,t)=>{if(!Mc(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Mc(n))return n.splice(n.getChildrenSize(),0,[Lr(),...t]),void e.remove()}const i=Rc();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},rd={dependencies:[eu],export:e=>{if(!nu(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```([\w-]+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=tu(),a=n[1]+i[0]):(o=tu(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=tu(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Vr(a);o.append(t),e.append(o)}else t&&Xu((e=>tu(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},id={dependencies:[Ql,Vl],export:(e,t)=>sc(e)?ed(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:Qu("bullet"),type:"element"},sd={dependencies:[Ql,Vl],export:(e,t)=>sc(e)?ed(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:Qu("number"),type:"element"},od={dependencies:[Iu],export:(e,t,n)=>{if(!Du(e)||$u(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Mu(r,{title:i}),o=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(o<a)return;if(o>a){const e=n.split("[");c="["+e[0],l=e.slice(1).join("[")}const u=Vr(l);return u.setFormat(e.getFormat()),s.append(u),e.replace(s),c&&s.insertBefore(Vr(c)),u},trigger:")",type:"text-match"},ad=[...[td,nd,id,sd],...[rd],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[od]];function ld(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(cd(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function cd(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function ud(e,t=ad){const n=function(e){const t=Vu(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=Vu(n.textFormat,(({tag:e})=>e[e.length-1])),i=Vu(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||Zu(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!Fo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!Fo(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!cd(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Gu.test(l))continue;const c=e;let u=c,d=ld(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!Pr(h);)if(Gr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=ld(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!Gu.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=vi(),b=bi();no(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return si(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(wr)||t.has(vr))return;if(e.isComposing())return;const o=r.read(vi),a=i.read(vi);if(!si(a)||!si(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Gr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Gr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||nu(e)||s(e,u,o.anchor.offset)}))}))}function dd(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(vr))return r=0,n=u,2;const d=function(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(si(s)&&si(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||us(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Gr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Gr(c)||!Gr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Sr))return 0;if(null===i)return 1;const p=s._selection;if(!(a.size>0||l.size>0))return null!==p?0:2;const f="number"==typeof t?t:t.peek();return!1===g&&0!==d&&d===r&&u<n+f&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(si(s)&&si(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Gr(r)||!Gr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1})();return n=u,r=d,h}}function hd(e){e.undoStack=[],e.redoStack=[],e.current=null}function gd(e,t,n){const r=dd(e,n),i=al(e.registerCommand(un,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(zn,!0)),0===r.length&&e.dispatchCommand(Bn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(dn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Bn,!0));const s=n.pop();0===n.length&&e.dispatchCommand(zn,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:vr})}}(e,t),!0)),0),e.registerCommand(Mn,(()=>(hd(t),!1)),0),e.registerCommand(Dn,(()=>(hd(t),e.dispatchCommand(zn,!1),e.dispatchCommand(Bn,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(zn,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Bn,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return i}function pd(){return{current:null,redoStack:[],undoStack:[]}}var fd={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",strikethrough:"lexxy-content__strikethrough",underline:"lexxy-content__underline"},codeHighlight:{atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__property",decorator:"code-token__function",deleted:"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__variable",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",namespace:"code-token__variable",number:"code-token__property",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};const md=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote","hr"].join(","),yd=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","li","ol","p","pre","q","s","strong","ul"],_d=["alt","caption","class","content","content-type","contenteditable","data-direct-upload-id","data-sgid","filename","filesize","height","href","presentation","previewable","sgid","src","title","url","width"];function bd(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function xd(e){return(new DOMParser).parseFromString(e,"text/html")}function kd(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function vd(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Sd(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function wd(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}class Cd extends as{static getType(){return"action_text_attachment"}static clone(e){return new Cd({...e},e.__key)}static importJSON(e){return new Cd({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Cd({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Cd({src:e.getAttribute("src"),caption:e.getAttribute("alt")||"",contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),video:e=>{const t=e.getAttribute("src")||e.querySelector("source")?.src,n=t?.split("/")?.pop(),r=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{conversion:()=>({node:new Cd({src:t,fileName:n,contentType:r})}),priority:1}}}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o||"",this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#S(e)})),this.isPreviewableAttachment?(e.appendChild(this.#w()),e.appendChild(this.#C())):(e.appendChild(this.#T()),e.appendChild(this.#E())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:bd("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,bd("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#N(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#N||this.previewable}#w(){return bd("img",{src:this.src,alt:this.altText,...this.#A})}get#A(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#T(){return bd("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#E(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){const t=bd("span",{className:"attachment__size",textContent:wd(this.fileSize)});e.appendChild(t)}return e}#S(e){kd(e,"lexxy:internal:select-node",{key:this.getKey()})}#C(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#L.bind(this)),t.addEventListener("keydown",this.#P.bind(this)),e.appendChild(t),e}#L(e){const t=e.target;t.placeholder=this.fileName,this.#F(t)}#F(e){kd(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#P(e){"Enter"===e.key&&(this.#F(e.target),kd(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Td extends Cd{static getType(){return"action_text_attachment_upload"}static clone(e){return new Td({...e},e.__key)}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#w()):e.appendChild(this.#T()),e.appendChild(this.#O());const t=bd("progress",{value:this.progress,max:100});return e.appendChild(t),this.#I(e).then((()=>this.#R(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#w(){return bd("img")}#T(){return bd("span",{className:"attachment__icon",textContent:this.#M()})}#M(){return this.file.name.split(".").pop().toLowerCase()}#O(){const e=bd("figcaption",{className:"attachment__caption"}),t=bd("span",{className:"attachment__name",textContent:this.file.name||""}),n=bd("span",{className:"attachment__size",textContent:wd(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#I(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#R(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#D(n):this.#z(t,n).then((()=>{this.#B(n,t)}))}))}#D(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(bd("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#B(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Vs(this.getKey());i&&i.replace(new Cd({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Sr})}async#z(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#w();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}class Ed extends as{static getType(){return"horizontal_divider"}static clone(e){return new Ed(e.__key)}static importJSON(e){return new Ed}static importDOM(){return{hr:e=>({conversion:()=>({node:new Ed}),priority:1})}}constructor(e){super(e)}createDOM(){const e=bd("figure",{className:"horizontal-divider"}),t=bd("hr");return e.addEventListener("click",(t=>{kd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.appendChild(t),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:bd("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}}const Nd=["bold","italic","strikethrough","link","unlink","rotateHeadingFormat","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","insertHorizontalDivider","uploadAttachments","undo","redo"];class Ad{static configureFor(e){new Ad(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#$(),this.#U()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(cn,"bold")}dispatchItalic(){this.editor.dispatchCommand(cn,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(cn,"strikethrough")}dispatchLink(e){this.#W(e)}dispatchUnlink(){this.#W(null)}dispatchInsertUnorderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"bullet"===qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(ac,void 0)}dispatchInsertOrderedList(){const e=vi();if(!e)return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"number"===qu(t)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(lc,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedNodes((e=>Mc(e)),(()=>Rc()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(cn,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>nu(e)),(()=>new eu("plain")))}))}dispatchInsertHorizontalDivider(){this.editor.update((()=>{this.contents.insertAtCursor(new Ed)}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Wc(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>Uc(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=bd("input",{type:"file",multiple:!0,onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});document.body.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}dispatchUndo(){this.editor.dispatchCommand(un,void 0)}dispatchRedo(){this.editor.dispatchCommand(dn,void 0)}#$(){for(const t of Nd){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#H(t,0,this[n].bind(this))}var e;this.#H(sn,1,this.dispatchPaste.bind(this))}#H(e,t,n){this.editor.registerCommand(e,n,t)}#W(e){this.editor.update((()=>{Wu(null===e?null:e)}))}#U(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#K.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#q.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#J.bind(this)))}#q(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#J(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#K(e){e.preventDefault()}#j(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}}function Ld(){return new Promise(requestAnimationFrame)}class Pd{constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#V(),this.#G(),this.#Z(),this.#Y()}clear(){this.current=null}set current(e){ai(e)?(this._current=vi(),this.#X()):this.editor.update((()=>{this.#X(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Q();if(!t)return;const n=this.#ee(t);n&&(e=this.#te(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{eo().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=vi();if(!si(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(Pr(e))return!1;return!0}get isInsideList(){const e=vi();if(!si(e))return!1;return null!==ju(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#re(e,t):ss(e)?this.#ie(e,t):this.#se(e):null}get topLevelNodeAfterCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#oe(e):ss(e)?this.#ie(e,t):this.#se(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#ae(e,t):ss(e)?this.#le(e,t):this.#ce(e):null}get topLevelNodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#ne();return e?Gr(e)?this.#ue(e):ss(e)?this.#le(e,t):this.#ce(e):null}get#de(){return this.editorElement.contents}get#he(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;if(this._currentlySelectedKeys=new Set,this.current)for(const e of this.current.getNodes())this._currentlySelectedKeys.add(e.getKey());return this._currentlySelectedKeys}#G(){this.editor.registerCommand(fn,this.#ge.bind(this),1),this.editor.registerCommand(gn,this.#pe.bind(this),1),this.editor.registerCommand(yn,this.#fe.bind(this),1),this.editor.registerCommand(_n,this.#me.bind(this),1),this.editor.registerCommand(Sn,this.#ye.bind(this),1),this.editor.registerCommand(kn,this.#_e.bind(this),1),this.editor.registerCommand(Yt,(()=>{this.current=vi()}),1)}#V(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Ld();const{key:t}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e){const t=xi();t.add(e.getKey()),no(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#be()}))}#Z(){this.editor.getRootElement().addEventListener("keydown",(e=>{(function(e){return!(e.ctrlKey||e.metaKey||e.altKey||e.key.length>1&&"Enter"!==e.key&&"Space"!==e.key||1!==e.key.length)})(e)&&this.editor.update((()=>{const t=vi();if(si(t)&&t.isCollapsed()){const n=t.anchor.getNode(),r=t.anchor.offset,i=this.#xe(n,r),s=this.#ke(n,r);if(i instanceof as&&!i.isInline())return e.preventDefault(),void this.#de.createParagraphAfterNode(i,e.key);if(s instanceof as&&!s.isInline())return e.preventDefault(),void this.#de.createParagraphBeforeNode(s,e.key)}}))}),!0)}#xe(e,t){return Gr(e)&&0===t?e.getPreviousSibling():ss(e)&&t>0?e.getChildAtIndex(t-1):null}#ke(e,t){return Gr(e)&&t===e.getTextContentSize()?e.getNextSibling():ss(e)?e.getChildAtIndex(t):null}#Y(){this.editorContentElement.addEventListener("keydown",(e=>{if("ArrowUp"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.previousElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.previousElementSibling;n||e.preventDefault()}}if("ArrowDown"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.nextElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.nextElementSibling;n||e.preventDefault()}}}),!0)}#X(){this.#ve(),this.#Se(),this.previouslySelectedKeys=this.#he,this._currentlySelectedKeys=null}#ve(){for(const e of this.previouslySelectedKeys)if(!this.#he.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#Se(){for(const e of this.#he)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#ge(){this.current?await this.#we((e=>e.selectPrevious())):this.#Ce(this.nodeBeforeCursor)}async#pe(){this.current?await this.#we((e=>e.selectNext(0,0))):this.#Ce(this.nodeAfterCursor)}async#fe(){this.current?await this.#we((e=>e.selectPrevious())):this.#Ce(this.topLevelNodeBeforeCursor)}async#me(){this.current?await this.#we((e=>e.selectNext(0,0))):this.#Ce(this.topLevelNodeAfterCursor)}async#we(e){await Ld(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#be(){this.editor.update((()=>{const e=this.#Te();e&&this.#Ee(e)}))}#Te(){const e=vi();return e?ai(e)?this.#Ne(e):si(e)?this.#Ae(e):null:null}#Ne(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#Ae(e){return e.anchor.getNode().getTopLevelElement()}#Ee(e){const t=e.getNextSibling();t?t.selectStart():this.#Le()}#Le(){const e=eo(),t=_s();e.append(t),t.selectStart()}#Ce(e){e&&e instanceof as&&this.editor.update((()=>{const t=xi();t.add(e.getKey()),no(t)}))}#ye(){const e=this.nodeAfterCursor;return e instanceof as?this.#Ce(e):this.#de.deleteSelectedNodes(),!0}#_e(){const e=this.nodeBeforeCursor;return e instanceof as?this.#Ce(e):this.#de.deleteSelectedNodes(),!0}#Q(){const e=vi();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#ee(e){let t=e.getBoundingClientRect();if(this.#Pe(t)){const n=this.#Fe(e);t=n.getBoundingClientRect(),this.#Oe(n),n.remove()}return t}#Pe(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#Fe(e){const t=this.#Ie();return e.insertNode(t),t}#Ie(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",Ka()),e}#Oe(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#te(e,t){const n=this.editor.getRootElement().getBoundingClientRect(),r=e.left-n.left;let i=e.top-n.top;const s=this.#Re(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Re(e){const t=window.getSelection().anchorNode,n=this.#Me(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#Me(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#ne(){const e=vi();if(!si(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#re(e,t){return t===e.getTextContentSize()?this.#oe(e):null}#oe(e){if(e.getNextSibling()instanceof as)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#ie(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#se(e)}#ae(e,t){return 0===t?this.#ue(e):null}#ue(e){if(e.getPreviousSibling()instanceof as)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#le(e,t){return t>0?e.getChildAtIndex(t-1):this.#ce(e)}#se(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#ce(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Fd extends as{static getType(){return"custom_action_text_attachment"}static clone(e){return new Fd({...e},e.__key)}static importJSON(e){return new Fd({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Vr(" ")),n.push(new Fd({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Vr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=bd("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{kd(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:bd("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class Od{constructor(e){this.editorElement=e,this.editor=e.editor}monitor(){this.editor.registerCommand(bn,(e=>this.#De(e)),3)}#De(e){const t=vi();if(!si(t))return!1;const n=t.anchor.getNode();return this.#ze(e,n)||this.#Be(e,n)}#ze(e,t){return!(!this.#$e(t)&&!this.#Ue(t))&&(e.preventDefault(),this.#We(t),!0)}#Be(e,t){return!!this.#He(t)&&(e.preventDefault(),this.#Ke(t),!0)}#$e(e){const t=this.#je(e);return!!t&&this.#qe(t)}#Ue(e){const t=this.#Je(e);if(!t)return!1;if(!this.#qe(t))return!1;const n=t.getParent();return n&&Xl(n)}#qe(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>!!Pr(e)||this.#qe(e)))}#je(e){let t=e;for(;t;){if(Xl(t))return t;t=t.getParent()}return null}#We(e){const t=this.#je(e);if(!t)return;const n=t.getParent();if(!n||!sc(n))return;const r=n.getParent();if(r&&Mc(r)){const e=this.#Ve(t).filter((e=>!this.#qe(e)));if(e.length>0)return void this.#Ge(r,n,t,e)}const i=_s();n.insertAfter(i),t.remove(),i.selectStart()}#He(e){const t=this.#Je(e);if(!t)return!1;if(!this.#qe(t))return!1;const n=t.getParent();return n&&Mc(n)}#Je(e){let t=e;for(;t;){if(bs(t))return t;t=t.getParent()}return null}#Ke(e){const t=this.#Je(e);if(!t)return;const n=t.getParent();if(!n||!Mc(n))return;const r=this.#Ze(t).filter((e=>!this.#qe(e)));if(r.length>0)this.#Ye(n,t,r);else{const e=_s();n.insertAfter(e),t.remove(),e.selectStart()}}#Ze(e){const t=[];let n=e.getNextSibling();for(;n;)t.push(n),n=n.getNextSibling();return t}#Ve(e){const t=[];let n=e.getNextSibling();for(;n;)Xl(n)&&t.push(n),n=n.getNextSibling();return t}#Ge(e,t,n,r){const i=this.#Ze(t).filter((e=>!this.#qe(e))),s=_s();e.insertAfter(s);const o=ic(t.getListType()),a=Rc();s.insertAfter(a),a.append(o),r.forEach((e=>{o.append(e)})),i.forEach((e=>{a.append(e)})),n.remove(),this.#Xe(t),this.#Qe(a),0===t.getChildrenSize()?(t.remove(),0===e.getChildrenSize()&&e.remove()):this.#Qe(e),s.selectStart()}#Xe(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!Xl(n)||!this.#qe(n))break;n.remove()}}#Qe(e){const t=e.getChildren();for(let e=t.length-1;e>=0;e--){const n=t[e];if(!this.#qe(n))break;n.remove()}}#Ye(e,t,n){const r=_s();e.insertAfter(r);const i=Rc();r.insertAfter(i),n.forEach((e=>{i.append(e)})),t.remove(),this.#Qe(e),this.#Qe(i),r.selectStart()}}class Id{constructor(e){this.editorElement=e,this.editor=e.editor,new Od(e).monitor()}insertHtml(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=dc(this.editor,xd(e));t.insertNodes(n)}))}insertAtCursor(e){this.editor.update((()=>{const t=vi(),n=t?.getNodes();if(si(t))Ai([e]);else if(ai(t)&&n&&n.length>0){n[n.length-1].insertAfter(e)}else{eo().append(e)}}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=vi();if(!si(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.#et(t)}))}toggleNodeWrappingAllSelectedNodes(e,t){this.editor.update((()=>{const n=vi();if(!si(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.#tt(r):this.#nt(t)}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=vi();if(!si(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=_s();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=vi();e=si(t)&&!t.isCollapsed()})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=vi();if(!si(e))return;const{listItems:t,parentLists:n}=this.#rt(e);if(t.size>0){const e=this.#it(t);this.#st(n),this.#ot(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Vr(e),r=Mu(e);r.append(n);const i=vi();si(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Wu(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Gr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=vi();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Gr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#at();if(!n)return;const i=this.#lt(n,r,e);-1!==i&&this.#ct(n,r,i,t)}))}createParagraphAfterNode(e,t){const n=_s();e.insertAfter(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}createParagraphBeforeNode(e,t){const n=_s();e.insertBefore(n),n.selectStart(),t&&(n.append(Vr(t)),n.select(1,1))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#ut(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=new Td({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});this.insertAtCursor(r)}),{tag:Sr})}async deleteSelectedNodes(){let e=null;this.editor.update((()=>{if(ai(this.#dt.current)){const t=this.#dt.current.getNodes();if(0===t.length)return;e=this.#ht(t),this.#gt(t)}})),await Ld(),this.editor.update((()=>{this.#pt(e),this.#dt.clear(),this.editor.focus()}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;const i=vi();let s=!1;if(si(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&no(null)}const o=n.attachment?this.#ft(t,n.attachment):this.#mt(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Vs(e);if(!r)return;let i=r;try{i=r.getTopLevelElementOrThrow()}catch{}const s=n.attachment?this.#ft(t,n.attachment):this.#mt(t);i.insertAfter(s)}))}get#dt(){return this.editorElement.selection}#tt(e){e.getChildren().forEach((t=>{e.insertBefore(t)})),e.remove()}#nt(e){this.editor.update((()=>{const t=vi();if(!si(t))return;const n=t.extract();if(0===n.length)return;const r=new Set;n.forEach((e=>{const t=e.getTopLevelElementOrThrow();r.add(t)}));const i=this.#yt(Array.from(r));if(0===i.length)return;const s=e();i[0].insertBefore(s),i.forEach((e=>{s.append(e)})),no(null)}))}#yt(e){let t=e.length-1;for(;t>=0;){const n=e[t];if(!bs(n)||!this.#_t(n))break;t--}return e.slice(0,t+1)}#_t(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren();return 0===t.length||t.every((e=>Pr(e)))}#et(e){this.editor.update((()=>{const t=vi();si(t)&&(t.isCollapsed()?this.#bt(t,e):this.#xt(t,e))}))}#bt(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else Ai([t()])}#xt(e,t){const n=this.#kt(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#vt(n);if(0===r.size)return;const s=this.#St(t,r);this.#wt(e,s),this.#Ct(i)}#kt(e){const t=e.extract().map((e=>this.#Tt(e))).filter(Boolean);return no(null),t}#Tt(e){return bs(e)?e:Gr(e)&&e.getParent()&&bs(e.getParent())?e.getParent():null}#vt(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#St(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Vr(e)),t<r.length-1&&n.append(Lr())})),n}#wt(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#Ct(e){e.forEach((e=>e.remove()))}#gt(e){e.forEach((e=>{const t=e.getParent();if(!ss(t))return;const n=t.getChildren().indexOf(e);n>=0&&t.splice(n,1,[])}))}#ht(e){const t=e[0],n=e[e.length-1];return t?.getPreviousSibling()||n?.getNextSibling()}#pt(e){const t=eo();if(0===t.getChildrenSize()){const e=_s();t.append(e),e.selectStart()}else e&&(Gr(e)||bs(e)?e.selectEnd():e.selectNext(0,0))}#rt(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=ju(e);if(t){n.add(t);const e=t.getParent();e&&sc(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#it(e){const t=[];for(const n of e){const e=this.#Et(n);e&&t.push(e)}return t}#Et(e){const t=e.getParent();if(!t||!sc(t))return null;const n=_s(),r=this.#Nt(e,n);return e.insertAfter(n),this.#At(n,r),e.remove(),n}#Nt(e,t){const n=[];return e.getChildren().forEach((e=>{sc(e)?n.push(e):t.append(e)})),n}#At(e,t){t.forEach((t=>{e.insertAfter(t)}))}#st(e){for(const t of e)sc(t)&&0===t.getChildrenSize()&&t.remove()}#ot(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Lt(t,n)}#Lt(e,t){e.selectStart();const n=vi();n&&si(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#at(){const e=vi();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Gr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#lt(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#ct(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Vr(s),l=Vr(o||" ");e.replace(a);this.#Pt(a,r).insertAfter(l),this.#Ft(l.getParentOrThrow()),l.select(0,0)}#Pt(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#Ft(e){if(bs(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Gr(n)&&""===n.getTextContent()&&r&&!Gr(r)&&e.append(Lr())}}#ft(e,t={}){return new Fd({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#mt(e){return dc(this.editor,xd(e))[0]||_s()}#ut(e){return vd(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Rd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Md={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Dd(e){Md=e}var zd={exec:()=>null};function Bd(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace($d.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var $d={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Ud=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wd=/(?:[*+-]|\d{1,9}[.)])/,Hd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kd=Bd(Hd).replace(/bull/g,Wd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),jd=Bd(Hd).replace(/bull/g,Wd).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Vd=Bd(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gd=Bd(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wd).getRegex(),Zd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Yd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xd=Bd("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Yd).replace("tag",Zd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qd=Bd(qd).replace("hr",Ud).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zd).getRegex(),eh={blockquote:Bd(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qd).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Vd,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Ud,html:Xd,lheading:Kd,list:Gd,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Qd,table:zd,text:/^[^\n]+/},th=Bd("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ud).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zd).getRegex(),nh={...eh,lheading:jd,table:th,paragraph:Bd(qd).replace("hr",Ud).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",th).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zd).getRegex()},rh={...eh,html:Bd("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Yd).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bd(qd).replace("hr",Ud).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Kd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ih=/^( {2,}|\\)\n(?!\s*$)/,sh=/[\p{P}\p{S}]/u,oh=/[\s\p{P}\p{S}]/u,ah=/[^\s\p{P}\p{S}]/u,lh=Bd(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oh).getRegex(),ch=/(?!~)[\p{P}\p{S}]/u,uh=Bd(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),dh=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,hh=Bd(dh,"u").replace(/punct/g,sh).getRegex(),gh=Bd(dh,"u").replace(/punct/g,ch).getRegex(),ph="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",fh=Bd(ph,"gu").replace(/notPunctSpace/g,ah).replace(/punctSpace/g,oh).replace(/punct/g,sh).getRegex(),mh=Bd(ph,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ch).getRegex(),yh=Bd("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ah).replace(/punctSpace/g,oh).replace(/punct/g,sh).getRegex(),_h=Bd(/\\(punct)/,"gu").replace(/punct/g,sh).getRegex(),bh=Bd(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xh=Bd(Yd).replace("(?:--\x3e|$)","--\x3e").getRegex(),kh=Bd("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Sh=Bd(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wh=Bd(/^!?\[(label)\]\[(ref)\]/).replace("label",vh).replace("ref",Jd).getRegex(),Ch=Bd(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jd).getRegex(),Th=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Eh={_backpedal:zd,anyPunctuation:_h,autolink:bh,blockSkip:uh,br:ih,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:zd,emStrongLDelim:hh,emStrongRDelimAst:fh,emStrongRDelimUnd:yh,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Sh,nolink:Ch,punctuation:lh,reflink:wh,reflinkSearch:Bd("reflink|nolink(?!\\()","g").replace("reflink",wh).replace("nolink",Ch).getRegex(),tag:kh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:zd},Nh={...Eh,link:Bd(/^!?\[(label)\]\((.*?)\)/).replace("label",vh).getRegex(),reflink:Bd(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vh).getRegex()},Ah={...Eh,emStrongRDelimAst:mh,emStrongLDelim:gh,url:Bd(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Th).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Bd(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Th).getRegex()},Lh={...Ah,br:Bd(ih).replace("{2,}","*").getRegex(),text:Bd(Ah.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ph={normal:eh,gfm:nh,pedantic:rh},Fh={normal:Eh,gfm:Ah,breaks:Lh,pedantic:Nh},Oh={"&":"&","<":"<",">":">",'"':""","'":"'"},Ih=e=>Oh[e];function Rh(e,t){if(t){if($d.escapeTest.test(e))return e.replace($d.escapeReplace,Ih)}else if($d.escapeTestNoEncode.test(e))return e.replace($d.escapeReplaceNoEncode,Ih);return e}function Mh(e){try{e=encodeURI(e).replace($d.percentDecode,"%")}catch{return null}return e}function Dh(e,t){let n=e.replace($d.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split($d.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace($d.slashPipe,"|");return r}function zh(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function Bh(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var $h=class{options;rules;lexer;constructor(e){this.options=e||Md}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:zh(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=zh(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:zh(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=zh(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Dh(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Dh(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=zh(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Bh(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Bh(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Uh=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Md,this.options.tokenizer=this.options.tokenizer||new $h,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:$d,block:Ph.normal,inline:Fh.normal};this.options.pedantic?(t.block=Ph.pedantic,t.inline=Fh.pedantic):this.options.gfm&&(t.block=Ph.gfm,this.options.breaks?t.inline=Fh.breaks:t.inline=Fh.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ph,inline:Fh}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace($d.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace($d.tabCharGlobal," ").replace($d.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Wh=class{options;parser;constructor(e){this.options=e||Md}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match($d.notSpaceStart)?.[0],i=e.replace($d.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Rh(r)+'">'+(n?i:Rh(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Rh(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Rh(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Rh(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Mh(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Rh(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Mh(e);if(null===i)return Rh(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Rh(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Rh(e.text)}},Hh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Kh=class e{options;renderer;textRenderer;constructor(e){this.options=e||Md,this.options.renderer=this.options.renderer||new Wh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Hh}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},jh=class{options;block;constructor(e){this.options=e||Md}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Uh.lex:Uh.lexInline}provideParser(){return this.block?Kh.parse:Kh.parseInline}},qh=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Kh;Renderer=Wh;TextRenderer=Hh;Lexer=Uh;Tokenizer=$h;Hooks=jh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Wh(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new $h(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new jh;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];jh.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&jh.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return s.call(t,n)})();let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await s.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Uh.lex(e,t??this.defaults)}parser(e,t){return Kh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?Uh.lex:Uh.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?Kh.parse:Kh.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?Uh.lex:Uh.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?Kh.parse:Kh.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Rh(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Jh(e,t){return qh.parse(e,t)}function Vh(e){try{return new URL(e),!0}catch{return!1}}function Gh(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}Jh.options=Jh.setOptions=function(e){return qh.setOptions(e),Jh.defaults=qh.defaults,Dd(Jh.defaults),Jh},Jh.getDefaults=Rd,Jh.defaults=Md,Jh.use=function(...e){return qh.use(...e),Jh.defaults=qh.defaults,Dd(Jh.defaults),Jh},Jh.walkTokens=function(e,t){return qh.walkTokens(e,t)},Jh.parseInline=qh.parseInline,Jh.Parser=Kh,Jh.parser=Kh.parse,Jh.Renderer=Wh,Jh.TextRenderer=Hh,Jh.Lexer=Uh,Jh.lexer=Uh.lex,Jh.Tokenizer=$h,Jh.Hooks=jh,Jh.parse=Jh,Jh.options,Jh.setOptions,Jh.use,Jh.walkTokens,Jh.parseInline,Kh.parse,Uh.lex;class Zh{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#Ot(t)&&!this.#It()?(this.#Rt(t),e.preventDefault(),!0):void this.#Mt(t))}#Ot(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#It(){let e=!1;return this.editor.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.anchor.getNode();for(;n;){if(nu(n))return void(e=!0);n=n.getParent()}})),e}#Rt(e){e.items[0].getAsString((e=>{if(Vh(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(Vh(e)){const t=this.contents.createLink(e);this.#Dt(t,{url:e})}else this.#zt(e)}))}#Dt(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};vd(this.editorElement,"lexxy:insert-link",{...t,...n})}#zt(e){const t=Jh(e);this.contents.insertHtml(t)}#Mt(e){if(!this.editorElement.supportsAttachments)return;e.getData("text/html")||this.#Bt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#Bt(e){const t=window.scrollY,n=window.scrollX;e(),await Ld(),window.scrollTo(n,t),this.editor.focus()}}class Yh extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic","strikethrough"];static observedAttributes=["connected","required"];#$t="";#Ut=document.createElement("textarea");constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Sd("lexxy-editor"),this.editor=this.#Wt(),this.contents=new Id(this),this.selection=new Pd(this),this.clipboard=new Zh(this),Ad.configureFor(this),this.#Ht(),requestAnimationFrame((()=>vd(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#Kt()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#jt())),"required"===e&&this.isConnected&&(this.#Ut.required=this.hasAttribute("required"),this.#qt())}formResetCallback(){this.value=this.#$t,this.editor.dispatchCommand(Dn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#Jt?(this.toolbar=this.toolbar||this.#Vt(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e,{ALLOWED_TAGS:yd,ALLOWED_ATTR:_d,SAFE_FOR_XML:!1})}(hc(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{No(Tr);const t=eo();t.clear(),""!==e&&t.append(...this.#Gt(e)),t.select(),this.#Zt(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#Gt(e){e||(e="<p></p>");return dc(this.editor,xd(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof as&&!t.isInline())return t}return e}))}#Ht(){this.#Yt(),this.#Xt(),this.#Qt(),this.#en(),this.#tn(),this.#nn(),this.#rn(),this.#in()}#Wt(){this.editorContentElement=this.editorContentElement||this.#sn();const e=vs({namespace:"LexicalEditor",onError(e){throw e},theme:fd,nodes:this.#on});return e.setRootElement(this.editorContentElement),e}get#on(){const e=[Ic,Dc,Ql,Vl,eu,cu,Iu,zu,Ed,Fd];return this.supportsAttachments&&e.push(Cd,Td),e}#sn(){const e=bd("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#an,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#ln.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#an(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#ln(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#cn(e){const t=void 0!==this.#cn&&this.#cn!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,this.#Ut.value=this.#un?"":e,t&&vd(this,"lexxy:change")}get#cn(){return this._internalFormValue}#rn(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#$t=e}#in(){document.addEventListener("turbo:before-cache",this.#dn)}#dn=e=>{this.#Kt()};#Yt(){this.#hn(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#cn=this.value,this.#Zt(),this.#qt()})))}#hn(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#gn(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#Xt(){Jc(this.editor),this.historyState={current:null,redoStack:[],undoStack:[]},gd(this.editor,this.historyState,20),uc(this.editor),this.#pn(),ud(this.editor,ad)}#pn(){!function(e,t){if(!e.hasNodes([eu,cu]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=vu);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(eu,(t=>{e.getEditorState().read((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Vs(n);null!==t&&wu(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(eu,(n=>Tu(n,e,t))),e.registerNodeTransform(Br,(n=>Su(n,e,t))),e.registerNodeTransform(cu,(n=>Su(n,e,t))),e.registerCommand(wn,(t=>{const n=function(e){const t=vi();if(!si(t)||!Nu(t))return null;const n=e?En:Tn,r=e?En:Cn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Au(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&Gc(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=pu(a[0]),d=fu(a[0]),h=ti(u.getKey(),0,"text"),g=ti(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(Cn,(()=>!!Nu(vi())&&(Ai([Xr()]),!0)),1),e.registerCommand(Tn,(e=>Lu(Tn)),1),e.registerCommand(En,(e=>Lu(En)),1),e.registerCommand(yn,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Nu(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&nu(r.getParentOrThrow())?(e.preventDefault(),!0):Pu(yn,e))}),1),e.registerCommand(_n,(e=>{const t=vi();if(!si(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Nu(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&nu(r.getParentOrThrow())?(e.preventDefault(),!0):Pu(_n,e))}),1),e.registerCommand(mn,(e=>Fu(mn,e)),1),e.registerCommand(pn,(e=>Fu(pn,e)),1)),al(...n)}(this.editor),this.append(bd("lexxy-code-language-picker"))}#Qt(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Vs(t);if(e instanceof Cd){const t=e.getWritable();Object.assign(t,n)}}))}))}#en(){this.editor.registerCommand(bn,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#tn(){Yh.debug&&this.#hn(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#nn(){this.#Jt&&this.toolbarElement.setEditor(this)}#Vt(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#fn()}get#Jt(){return"false"!==this.getAttribute("toolbar")}#fn(){const e=bd("lexxy-toolbar");return e.innerHTML=Ju.defaultTemplate,e.setAttribute("data-attachments",this.supportsAttachments),this.prepend(e),e}#Zt(){this.classList.toggle("lexxy-editor--empty",this.#un)}get#un(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(md)}#qt(){this.#Ut.validity.valid?this.internals.setValidity({}):this.internals.setValidity(this.#Ut.validity,this.#Ut.validationMessage,this.editorContentElement)}#Kt(){this.#gn(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#dn)}#jt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Yh);class Xh extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#mn.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#yn.bind(this)),this.addEventListener("keydown",this.#_n.bind(this))}show(e){this.input.value=this.#bn,this.dialog.show()}close(){this.dialog.close()}#mn(e){const t=e.submitter?.value;this.#xn.dispatchCommand(t,this.input.value)}#yn(e){this.#xn.dispatchCommand("unlink"),this.close()}#_n(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#bn(){let e="";return this.#xn.getEditorState().read((()=>{const t=vi();if(!si(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if(Du(n)){e=n.getURL();break}n=n.getParent()}})),e}get#xn(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",Xh);class Qh{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=bd("li",{role:"option",id:Sd("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=xd(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class eg extends Qh{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#kn(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#kn(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return Gh(e).includes(Gh(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class tg extends eg{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class ng extends eg{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class rg extends Qh{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#vn(e));return this.#kn(t)}#vn(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#kn(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class ig extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#Sn(),this.#wn()}disconnectedCallback(){this.source=null,this.popoverElement=null}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get#Cn(){return!this.supportsSpaceInSearches}#Sn(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new rg(e):new ng(e):new tg(this.querySelectorAll("lexxy-prompt-item"))}#wn(){const e=this.#xn.registerUpdateListener((()=>{this.#xn.read((()=>{const t=vi();if(!t)return;let n;if(si(t)?n=t.anchor.getNode():ai(t)&&([n]=t.getNodes()),n&&Gr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#Tn())}}))}))}get#xn(){return this.#En.editor}get#En(){return this.closest("lexxy-editor")}get#dt(){return this.#En.selection}async#Tn(){this.popoverElement??=await this.#Nn(),this.#An(),await this.#Ln(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#Pn(),this.#En.addEventListener("keydown",this.#Fn),this.#En.addEventListener("lexxy:change",this.#Ln),this.#On()}#On(){this.keyListeners.push(this.#xn.registerCommand(bn,this.#In.bind(this),3)),this.keyListeners.push(this.#xn.registerCommand(wn,this.#In.bind(this),3)),this.#Cn&&this.keyListeners.push(this.#xn.registerCommand(xn,this.#In.bind(this),3))}#Pn(){const e=this.#Rn[0];e&&this.#Mn(e)}get#Rn(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#Mn(e){this.#Dn(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#En.focus(),this.#zn.setAttribute("aria-controls",this.popoverElement.id),this.#zn.setAttribute("aria-activedescendant",e.id),this.#zn.setAttribute("aria-haspopup","listbox")}#Dn(){this.#Rn.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#zn.removeAttribute("aria-controls"),this.#zn.removeAttribute("aria-activedescendant"),this.#zn.removeAttribute("aria-haspopup")}#Bn(){const{x:e,y:t,fontSize:n}=this.#dt.cursorPosition,r=this.#En.getBoundingClientRect(),i=this.#zn.getBoundingClientRect().top-r.top;this.popoverElement.hasAttribute("data-anchored")||(this.popoverElement.style.left=`${e}px`,this.popoverElement.toggleAttribute("data-anchored",!0)),this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";const s=this.popoverElement.getBoundingClientRect();(s.bottom>window.innerHeight||this.popoverElement.hasAttribute("data-clipped-at-bottom"))&&(this.popoverElement.style.top=t+i-s.height-n+"px",this.popoverElement.style.bottom="auto",this.popoverElement.toggleAttribute("data-clipped-at-bottom",!0))}#An(){this.popoverElement.removeAttribute("data-clipped-at-bottom"),this.popoverElement.removeAttribute("data-anchored")}async#$n(){this.#Dn(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#En.removeEventListener("lexxy:change",this.#Ln),this.#En.removeEventListener("keydown",this.#Fn),this.#Un(),await Ld(),this.#wn()}#Un(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#Ln=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#Wn.containsTextBackUntil(this.trigger)?(await this.#Hn(),this.#Bn()):this.#$n()};async#Hn(){const e=this.#Wn.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#Kn(t):this.#jn(),this.#Pn()}#Kn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#jn(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=bd("li",{innerHTML:this.#qn});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#qn(){return this.getAttribute("empty-results")||"Nothing found"}#Fn=e=>{"Escape"===e.key?(this.#$n(),this.#En.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#Jn(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#Vn(),e.preventDefault(),e.stopPropagation())};#Jn(){const e=this.#Gn+1;e<this.#Rn.length&&this.#Mn(this.#Rn[e])}#Vn(){const e=this.#Gn-1;e>=0&&this.#Mn(this.#Rn[e])}get#Gn(){return this.#Rn.findIndex((e=>e.hasAttribute("aria-selected")))}get#Zn(){return this.#Rn[this.#Gn]}#In(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#Yn(),!0}#Yn(){this.#Xn(),this.#$n(),this.#En.focus()}#Xn(){const e=this.source.promptItemFor(this.#Zn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#Wn.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#Qn(t,n):this.#er(e,t,n)}#Qn(e,t){this.#xn.update((()=>{const n=dc(this.#xn,xd(`${e.innerHTML}`));this.#Wn.replaceTextBackUntil(t,n)}))}#er(e,t,n){this.#xn.update((()=>{const r=new Fd({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#Wn.replaceTextBackUntil(n,r)}))}get#Wn(){return this.#En.contents}get#zn(){return this.#En.editorContentElement}async#Nn(){const e=bd("ul",{role:"listbox",id:Sd("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",Ka()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#tr),this.#En.appendChild(e),e}#tr=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#Mn(t),this.#Yn())}}customElements.define("lexxy-prompt",ig);class sg extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#nr(),this.#rr()}#nr(){this.languagePickerElement=this.#ir(),this.languagePickerElement.addEventListener("change",(()=>{this.#sr(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",Ka()),this.editorElement.appendChild(this.languagePickerElement)}#ir(){const e=bd("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#or)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#or(){const e={...yu};e.ruby||(e.ruby="Ruby");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#sr(e){this.editor.update((()=>{const t=this.#ar();t&&t.setLanguage(e)}))}#rr(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#ar();e?this.#lr(e):this.#cr()}))}))}#ar(){const e=vi();if(!si(e))return null;const t=e.anchor.getNode(),n=t.getParent();return nu(t)?t:nu(n)?n:null}#lr(e){const t=e.getLanguage();this.#ur(t),this.#dr(),this.#hr(e)}#ur(e){if(this.languagePickerElement&&e){const t=function(e){return _u[e]||e}(e);this.languagePickerElement.value=t}}#hr(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#dr(){this.languagePickerElement.hidden=!1}#cr(){this.languagePickerElement.hidden=!0}}function og(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=bd("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",sg),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),window.Prism=window.Prism||{},Prism.manual=!0;export{og as highlightAll};
|