lexxy 0.1.8.beta → 0.1.10.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.
@@ -1,5 +1,5 @@
1
1
  import{DirectUpload as e}from"@rails/activestorage";
2
- /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/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,n){return e.apply(t,n)}),u||(u=function(e,t){return new e(...t)});const d=w(Array.prototype.forEach),h=w(Array.prototype.lastIndexOf),g=w(Array.prototype.pop),f=w(Array.prototype.push),p=w(Array.prototype.splice),m=w(String.prototype.toLowerCase),y=w(String.prototype.toString),_=w(String.prototype.match),b=w(String.prototype.replace),x=w(String.prototype.indexOf),v=w(String.prototype.trim),S=w(Object.prototype.hasOwnProperty),C=w(RegExp.prototype.test),T=(E=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(E,t)});var E;function w(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 k(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++){S(e,t)||(e[t]=null)}return e}function A(e){const n=l(null);for(const[r,i]of t(e)){S(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 w(n.get);if("function"==typeof n.value)return w(n.value)}e=i(e)}return function(){return null}}const F=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","section","select","shadow","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","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=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"]),M=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"]),D=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R=o(["#text"]),B=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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),z=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","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"]),U=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"]),$=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),W=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=a(/<%[\w\W]*|[\w\W]*%>/gm),H=a(/\$\{[\w\W]*/gm),j=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),J=a(/^aria-[\-\w]+$/),V=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=a(/^(?:\w+script|data):/i),q=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=a(/^html$/i),Z=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var X=Object.freeze({__proto__:null,ARIA_ATTR:J,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:Z,DATA_ATTR:j,DOCTYPE_NAME:Y,ERB_EXPR:K,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:G,MUSTACHE_EXPR:W,TMPLIT_EXPR:H});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.2.6",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:E,Element:w,NodeFilter:N,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:K,DOMParser:H,trustedTypes:j}=n,J=w.prototype,G=L(J,"cloneNode"),q=L(J,"remove"),Z=L(J,"nextSibling"),se=L(J,"childNodes"),oe=L(J,"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 fe={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:pe,ERB_EXPR:me,TMPLIT_EXPR:ye,DATA_ATTR:_e,ARIA_ATTR:be,IS_SCRIPT_OR_DATA:xe,ATTR_WHITESPACE:ve,CUSTOM_ELEMENT:Se}=X;let{IS_ALLOWED_URI:Ce}=X,Te=null;const Ee=k({},[...F,...O,...P,...M,...R]);let we=null;const ke=k({},[...B,...z,...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,Fe=!0,Oe=!0,Pe=!1,Ie=!0,Me=!1,De=!0,Re=!1,Be=!1,ze=!1,Ue=!1,$e=!1,We=!1,Ke=!0,He=!1,je=!0,Je=!1,Ve={},Ge=null;const qe=k({},["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 Ze=k({},["audio","video","img","source","image","track"]);let Xe=null;const Qe=k({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let rt=nt,it=!1,st=null;const ot=k({},[et,tt,nt],y);let at=k({},["mi","mo","mn","ms","mtext"]),lt=k({},["annotation-xml"]);const ct=k({},["title","style","font","a","script"]);let ut=null;const dt=["application/xhtml+xml","text/html"];let ht=null,gt=null;const ft=i.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!gt||gt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),ut=-1===dt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ht="application/xhtml+xml"===ut?y:m,Te=S(e,"ALLOWED_TAGS")?k({},e.ALLOWED_TAGS,ht):Ee,we=S(e,"ALLOWED_ATTR")?k({},e.ALLOWED_ATTR,ht):ke,st=S(e,"ALLOWED_NAMESPACES")?k({},e.ALLOWED_NAMESPACES,y):ot,Xe=S(e,"ADD_URI_SAFE_ATTR")?k(A(Qe),e.ADD_URI_SAFE_ATTR,ht):Qe,Ye=S(e,"ADD_DATA_URI_TAGS")?k(A(Ze),e.ADD_DATA_URI_TAGS,ht):Ze,Ge=S(e,"FORBID_CONTENTS")?k({},e.FORBID_CONTENTS,ht):qe,Ae=S(e,"FORBID_TAGS")?k({},e.FORBID_TAGS,ht):A({}),Le=S(e,"FORBID_ATTR")?k({},e.FORBID_ATTR,ht):A({}),Ve=!!S(e,"USE_PROFILES")&&e.USE_PROFILES,Fe=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,Pe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,De=!1!==e.SAFE_FOR_XML,Re=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,$e=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,Ke=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Je=e.IN_PLACE||!1,Ce=e.ALLOWED_URI_REGEXP||V,rt=e.NAMESPACE||nt,at=e.MATHML_TEXT_INTEGRATION_POINTS||at,lt=e.HTML_INTEGRATION_POINTS||lt,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&pt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&pt(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),$e&&(Ue=!0),Ve&&(Te=k({},R),we=[],!0===Ve.html&&(k(Te,F),k(we,B)),!0===Ve.svg&&(k(Te,O),k(we,z),k(we,$)),!0===Ve.svgFilters&&(k(Te,P),k(we,z),k(we,$)),!0===Ve.mathMl&&(k(Te,M),k(we,U),k(we,$))),e.ADD_TAGS&&(Te===Ee&&(Te=A(Te)),k(Te,e.ADD_TAGS,ht)),e.ADD_ATTR&&(we===ke&&(we=A(we)),k(we,e.ADD_ATTR,ht)),e.ADD_URI_SAFE_ATTR&&k(Xe,e.ADD_URI_SAFE_ATTR,ht),e.FORBID_CONTENTS&&(Ge===qe&&(Ge=A(Ge)),k(Ge,e.FORBID_CONTENTS,ht)),je&&(Te["#text"]=!0),Re&&k(Te,["html","head","body"]),Te.table&&(k(Te,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw T('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),gt=e}},yt=k({},[...O,...P,...I]),_t=k({},[...M,...D]),bt=function(e){f(r.removed,{element:e});try{oe(e).removeChild(e)}catch(t){q(e)}},xt=function(e,t){try{f(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Ue||$e)try{bt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){let t=null,n=null;if(ze)e="<remove></remove>"+e;else{const t=_(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ae?ae.createHTML(e):e;if(rt===nt)try{t=(new H).parseFromString(r,ut)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?le:r}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),rt===nt?he.call(t,Re?"html":"body")[0]:Re?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)},Ct=function(e){return e instanceof K&&("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)},Tt=function(e){return"function"==typeof E&&e instanceof E};function Et(e,t,n){d(e,(e=>{e.call(r,t,n,gt)}))}const wt=function(e){let t=null;if(Et(fe.beforeSanitizeElements,e,null),Ct(e))return bt(e),!0;const n=ht(e.nodeName);if(Et(fe.uponSanitizeElement,e,{tagName:n,allowedTags:Te}),De&&e.hasChildNodes()&&!Tt(e.firstElementChild)&&C(/<[/\w!]/g,e.innerHTML)&&C(/<[/\w!]/g,e.textContent))return bt(e),!0;if(e.nodeType===te)return bt(e),!0;if(De&&e.nodeType===ne&&C(/<[/\w]/g,e.data))return bt(e),!0;if(!Te[n]||Ae[n]){if(!Ae[n]&&Nt(n)){if(Ne.tagNameCheck instanceof RegExp&&C(Ne.tagNameCheck,n))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))return!1}if(je&&!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=G(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Z(e))}}}return bt(e),!0}return e instanceof w&&!function(e){let t=oe(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=m(e.tagName),r=m(t.tagName);return!!st[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(yt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&lt[r]:Boolean(_t[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!lt[r])&&!(t.namespaceURI===et&&!at[r])&&!_t[n]&&(ct[n]||!yt[n]):!("application/xhtml+xml"!==ut||!st[e.namespaceURI]))}(e)?(bt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!C(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===ee&&(t=e.textContent,d([pe,me,ye],(e=>{t=b(t,e," ")})),e.textContent!==t&&(f(r.removed,{element:e.cloneNode()}),e.textContent=t)),Et(fe.afterSanitizeElements,e,null),!1):(bt(e),!0)},kt=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in i||n in ft))return!1;if(Oe&&!Le[t]&&C(_e,t));else if(Fe&&C(be,t));else if(!we[t]||Le[t]){if(!(Nt(e)&&(Ne.tagNameCheck instanceof RegExp&&C(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&C(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&C(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Xe[t]);else if(C(Ce,b(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Ye[e]){if(Pe&&!C(xe,b(n,ve,"")));else if(n)return!1}else;return!0},Nt=function(e){return"annotation-xml"!==e&&_(e,Se)},At=function(e){Et(fe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Ct(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let i=t.length;for(;i--;){const s=t[i],{name:o,namespaceURI:a,value:l}=s,c=ht(o),u=l;let h="value"===o?u:v(u);if(n.attrName=c,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,Et(fe.uponSanitizeAttribute,e,n),h=n.attrValue,!He||"id"!==c&&"name"!==c||(xt(o,e),h="user-content-"+h),De&&C(/((--!?|])>)|<\/(style|title)/i,h)){xt(o,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){xt(o,e);continue}if(!Ie&&C(/\/>/i,h)){xt(o,e);continue}Me&&d([pe,me,ye],(e=>{h=b(h,e," ")}));const f=ht(e.nodeName);if(kt(f,c,h)){if(ae&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(a);else switch(j.getAttributeType(f,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),Ct(e)?bt(e):g(r.removed)}catch(t){xt(o,e)}}else xt(o,e)}Et(fe.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const r=St(t);for(Et(fe.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Et(fe.uponSanitizeShadowNode,n,null),wt(n),At(n),n.content instanceof c&&e(n.content);Et(fe.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(it=!e,it&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Tt(e)){if("function"!=typeof e.toString)throw T("toString is not a function");if("string"!=typeof(e=e.toString()))throw T("dirty is not a string, aborting")}if(!r.isSupported)return e;if(Be||mt(t),r.removed=[],"string"==typeof e&&(Je=!1),Je){if(e.nodeName){const t=ht(e.nodeName);if(!Te[t]||Ae[t])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof E)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&&!Re&&-1===e.indexOf("<"))return ae&&We?ae.createHTML(e):e;if(n=vt(e),!n)return Ue?null:We?le:""}n&&ze&&bt(n.firstChild);const l=St(Je?e:n);for(;o=l.nextNode();)wt(o),At(o),o.content instanceof c&&Lt(o.content);if(Je)return e;if(Ue){if($e)for(a=de.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(we.shadowroot||we.shadowrootmode)&&(a=ge.call(s,a,!0)),a}let u=Re?n.outerHTML:n.innerHTML;return Re&&Te["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&C(Y,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Me&&d([pe,me,ye],(e=>{u=b(u,e," ")})),ae&&We?ae.createHTML(u):u},r.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Be=!0},r.clearConfig=function(){gt=null,Be=!1},r.isValidAttribute=function(e,t,n){gt||mt({});const r=ht(e),i=ht(t);return kt(r,i,n)},r.addHook=function(e,t){"function"==typeof t&&f(fe[e],t)},r.removeHook=function(e,t){if(void 0!==t){const n=h(fe[e],t);return-1===n?void 0:p(fe[e],n,1)[0]}return g(fe[e])},r.removeHooks=function(e){fe[e]=[]},r.removeAllHooks=function(){fe={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.`)}se.addHook("uponSanitizeElement",((e,t)=>{"strong"!==t.tagName&&"em"!==t.tagName||e.removeAttribute("class")}));const ae="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,le=ae&&"documentMode"in document?document.documentMode:null,ce=ae&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ue=ae&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),de=!(!ae||!("InputEvent"in window)||le)&&"getTargetRanges"in new window.InputEvent("input"),he=ae&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ge=ae&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,fe=ae&&/Android/.test(navigator.userAgent),pe=ae&&/^(?=.*Chrome).*/i.test(navigator.userAgent),me=ae&&fe&&pe,ye=ae&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!pe;function _e(...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 be=0,xe=1,ve=2,Se=1,Ce=2,Te=3,Ee=4,we=5,ke=6,Ne=he||ge||ye?" ":"​",Ae="\n\n",Le=ue?" ":Ne,Fe="֑-߿יִ-﷽ﹰ-ﻼ",Oe="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Pe=new RegExp("^[^"+Oe+"]*["+Fe+"]"),Ie=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},Re={center:2,end:6,justify:4,left:1,right:3,start:5},Be={[Ce]:"center",[ke]:"end",[Ee]:"justify",[Se]:"left",[Te]:"right",[we]:"start"},ze={normal:0,segmented:2,token:1},Ue={[be]:"normal",[ve]:"segmented",[xe]:"token"},$e="$";function We(e,t,n,r,i,s){let o=e.getFirstChild();for(;null!==o;){const e=o.__key;o.__parent===t&&($i(o)&&We(o,e,n,r,i,s),n.has(e)||s.delete(e),i.push(e)),o=o.getNextSibling()}}let Ke=!1,He=0;function je(e){He=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!==Ls(e,n)}function Ve(e,t,n){const r=yo(uo(n));let i=null,s=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,s=r.focusOffset);const o=e.nodeValue;null!==o&&Hs(t,o,i,s,!1)}function Ge(e,t,n){if($r(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return xs(t)&&n.isAttached()}function qe(e,t,n,r){for(let i=e;i&&!Oo(i);i=so(i)){const e=Ls(i,t);if(void 0!==e){const t=Ns(e,n);if(t)return Hi(t)||!bo(i)?void 0:[i,t]}else if(i===r)return[r,Ms(n)]}}function Ye(e,t,n){Ke=!0;const r=performance.now()-He>100;try{Ri(e,(()=>{const i=ii()||function(e){return e.getEditorState().read((()=>{const e=ii();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,f=qe(g,e,a,o);if(!f)continue;const[p,m]=f;if("characterData"===h)r&&Fr(m)&&xs(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=As(r),s=r.parentNode;if(null!=s&&r!==l&&null===i&&!Je(r,s,e)){if(ue){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(p,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&&Ds(i),ue&&to(e)&&i.insertRawText(u))}))}finally{Ke=!1}}function Ze(e){const t=e._observer;null!==t&&Ye(e,t.takeRecords(),t)}function Xe(e){!function(e){0===He&&uo(e).addEventListener("textInput",je,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ye(e,t,n)}))}let Qe=class e{constructor(e,t=new Map,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedConfigMap=t,this.unknownState=n,this.knownState=r;const s=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}(t,n,r);this.size=s}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.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};for(const[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);return et(e)?{[$e]:e}:{}}getWritable(t){if(this.node===t)return this;const n=new Map(this.knownState),r=et(i=this.unknownState)&&{...i};var i;if(r)for(const e of n.keys())delete r[e.key];return new e(t,this.sharedConfigMap,et(r),n,this.size)}updateFromKnown(e,t){const n=e.key;this.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||this.size++,r.set(e,t)}updateFromUnknown(e,t){const n=this.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={},e)for(const[t,n]of Object.entries(e))this.updateFromUnknown(t,n);this.unknownState=et(this.unknownState)}};function et(e){if(e)for(const t in e)return e}function tt(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,r=(e,t)=>{for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const e=t?t.getValue(r):r.defaultValue;if(e!==i&&!r.isEqual(e,i))return!0}return!1},i=(e,t)=>{const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r)for(const[e,t]of Object.entries(r))if(!n.has(e)&&(n.add(e),t!==(i?i[e]:void 0)))return!0;return!1};return!(e&&r(e,t)||t&&r(t,e)||e&&i(e,t)||t&&i(t,e))}(l,c))}function nt(e,t){const n=e.mergeWithSibling(t),r=Ei()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function rt(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Fr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(tt(t,r)){r=nt(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Fr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(tt(r,n)){r=nt(r,n);break}break}n.remove()}}else r.remove()}function it(e){return st(e.anchor),st(e.focus),e}function st(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),Fr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!$i(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let ot,at,lt,ct,ut,dt,ht,gt,ft,pt,mt="",yt="",_t=null,bt="",xt="",vt=!1,St=!1,Ct=null;function Tt(e,t){const n=ht.get(e);if(null!==t){const n=Ut(e);n.parentNode===t&&t.removeChild(n)}if(gt.has(e)||at._keyToDOMMap.delete(e),$i(n)){const e=Dt(n,ht);Et(e,0,e.length-1,null)}void 0!==n&&Xs(pt,lt,ct,n,"destroyed")}function Et(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&Tt(t,r)}}function wt(e,t){e.setProperty("text-align",t)}const kt="40px";function Nt(e,t){const n=ot.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")||kt;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function At(e,t){const n=e.style;0===t?wt(n,""):1===t?wt(n,"left"):2===t?wt(n,"center"):3===t?wt(n,"right"):4===t?wt(n,"justify"):5===t?wt(n,"start"):6===t&&wt(n,"end")}function Lt(e,t){const n=gt.get(e);void 0===n&&oe(60);const r=n.createDOM(ot,at);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,at),Fr(n)?r.setAttribute("data-lexical-text","true"):Hi(n)&&r.setAttribute("data-lexical-decorator","true"),$i(n)){const e=n.__indent,t=n.__size;if(0!==e&&Nt(r,e),0!==t){const e=t-1;!function(e,t,n,r){const i=yt;yt="",Ft(e,n,0,t,n.getDOMSlot(r)),It(n,r),yt=i}(Dt(n,gt),e,n,r)}const i=n.__format;0!==i&&At(r,i),n.isInline()||Pt(null,n,r),ro(n)&&(mt+=Ae,xt+=Ae)}else{const t=n.getTextContent();if(Hi(n)){const t=n.decorate(at,ot);null!==t&&Bt(e,t),r.contentEditable="false"}else Fr(n)&&(n.isDirectionless()||(yt+=t));mt+=t,xt+=t}return null!==t&&t.insertChild(r),Xs(pt,lt,ct,n,"created"),r}function Ft(e,t,n,r,i){const s=mt;mt="";let o=n;for(;o<=r;++o){Lt(e[o],i);const t=gt.get(e[o]);null!==t&&Fr(t)&&(null===_t&&(_t=t.getFormat()),""===bt&&(bt=t.getStyle()))}ro(t)&&(mt+=Ae),i.element.__lexicalTextContent=mt,mt=s+mt}function Ot(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return gr(e)?"line-break":Hi(e)&&e.isInline()?"decorator":null}return"empty"}return null}function Pt(e,t,n){const r=Ot(e,ht),i=Ot(t,gt);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function It(e,t){const n=t.__lexicalDirTextContent||"",r=t.__lexicalDir||"";if(n!==yt||r!==Ct){const n=""===yt,i=n?Ct:function(e){return Pe.test(e)?"rtl":Ie.test(e)?"ltr":null}(yt);if(i!==r){const s=t.classList,o=ot.theme;let a=null!==r?o[r]:void 0,l=null!==i?o[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=_e(a);a=o[r]=e}s.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=_e(l);l=o[i]=e}void 0!==l&&s.add(...l)}t.dir=i}St||(e.getWritable().__dir=i)}Ct=i,t.__lexicalDirTextContent=yt,t.__lexicalDir=i}}function Mt(e,t,n){const r=yt;var i;yt="",_t=null,bt="",function(e,t,n){const r=mt,i=e.__size,s=t.__size;mt="";const o=n.element;if(1===i&&1===s){const n=e.__first,i=t.__first;if(n===i)Rt(n,o);else{const e=Ut(n),t=Lt(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}Tt(n,null)}const s=gt.get(i);Fr(s)&&(null===_t&&(_t=s.getFormat()),""===bt&&(bt=s.getStyle()))}else{const r=Dt(e,ht),a=Dt(t,gt);if(r.length!==i&&oe(227),a.length!==s&&oe(228),0===i)0!==s&&Ft(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;Et(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=zt(Rt(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=io(at,r);e===u?u=zt(Rt(r,s.element)):(s.withBefore(u).insertChild(e),Rt(r,s.element)),d++,h++}else Lt(r,s.withBefore(u)),h++;else u=zt(Ut(e)),Tt(e,s.element),d++}const i=gt.get(r);null!==i&&Fr(i)&&(null===_t&&(_t=i.getFormat()),""===bt&&(bt=i.getStyle()))}const g=d>o,f=h>a;if(g&&!f){const t=n[a+1],r=void 0===t?null:at.getElementByKey(t);Ft(n,e,h,a,s.withBefore(r))}else f&&!g&&Et(t,d,o,s.element)}(t,r,a,i,s,n)}ro(t)&&(mt+=Ae),o.__lexicalTextContent=mt,mt=r+mt}(e,t,t.getDOMSlot(n)),It(t,n),i=t,null==_t||_t===i.__textFormat||St||i.setTextFormat(_t),function(e){""===bt||bt===e.__textStyle||St||e.setTextStyle(bt)}(t),yt=r}function Dt(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 Rt(e,t){const n=ht.get(e);let r=gt.get(e);void 0!==n&&void 0!==r||oe(61);const i=vt||dt.has(e)||ut.has(e),s=io(at,e);if(n===r&&!i){if($i(n)){const e=s.__lexicalTextContent;void 0!==e&&(mt+=e,xt+=e);const t=s.__lexicalDirTextContent;void 0!==t&&(yt+=t)}else{const e=n.getTextContent();Fr(n)&&!n.isDirectionless()&&(yt+=e),xt+=e,mt+=e}return s}if(n!==r&&i&&Xs(pt,lt,ct,r,"updated"),r.updateDOM(n,s,ot)){const n=Lt(e,null);return null===t&&oe(62),t.replaceChild(n,s),Tt(e,null),n}if($i(n)&&$i(r)){const e=r.__indent;e!==n.__indent&&Nt(s,e);const t=r.__format;t!==n.__format&&At(s,t),i&&(Mt(n,r,s),Ji(r)||r.isInline()||Pt(n,r,s)),ro(r)&&(mt+=Ae,xt+=Ae)}else{const t=r.getTextContent();if(Hi(r)){const t=r.decorate(at,ot);null!==t&&Bt(e,t)}else Fr(r)&&!r.isDirectionless()&&(yt+=t);mt+=t,xt+=t}if(!St&&Ji(r)&&r.__cachedText!==xt){const e=r.getWritable();e.__cachedText=xt,r=e}return s}function Bt(e,t){let n=at._pendingDecorators;const r=at._decorators;if(null===n){if(r[e]===t)return;n=Os(at)}n[e]=t}function zt(e){let t=e.nextSibling;return null!==t&&t===at._blockCursorElement&&(t=t.nextSibling),t}function Ut(e){const t=ft.get(e);return void 0===t&&oe(75,e),t}function $t(e){return{type:e}}const Wt=$t("SELECTION_CHANGE_COMMAND"),Kt=$t("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ht=$t("CLICK_COMMAND"),jt=$t("DELETE_CHARACTER_COMMAND"),Jt=$t("INSERT_LINE_BREAK_COMMAND"),Vt=$t("INSERT_PARAGRAPH_COMMAND"),Gt=$t("CONTROLLED_TEXT_INSERTION_COMMAND"),qt=$t("PASTE_COMMAND"),Yt=$t("REMOVE_TEXT_COMMAND"),Zt=$t("DELETE_WORD_COMMAND"),Xt=$t("DELETE_LINE_COMMAND"),Qt=$t("FORMAT_TEXT_COMMAND"),en=$t("UNDO_COMMAND"),tn=$t("REDO_COMMAND"),nn=$t("KEYDOWN_COMMAND"),rn=$t("KEY_ARROW_RIGHT_COMMAND"),sn=$t("MOVE_TO_END"),on=$t("KEY_ARROW_LEFT_COMMAND"),an=$t("MOVE_TO_START"),ln=$t("KEY_ARROW_UP_COMMAND"),cn=$t("KEY_ARROW_DOWN_COMMAND"),un=$t("KEY_ENTER_COMMAND"),dn=$t("KEY_SPACE_COMMAND"),hn=$t("KEY_BACKSPACE_COMMAND"),gn=$t("KEY_ESCAPE_COMMAND"),fn=$t("KEY_DELETE_COMMAND"),pn=$t("KEY_TAB_COMMAND"),mn=$t("INSERT_TAB_COMMAND"),yn=$t("INDENT_CONTENT_COMMAND"),_n=$t("OUTDENT_CONTENT_COMMAND"),bn=$t("DROP_COMMAND"),xn=$t("FORMAT_ELEMENT_COMMAND"),vn=$t("DRAGSTART_COMMAND"),Sn=$t("DRAGOVER_COMMAND"),Cn=$t("DRAGEND_COMMAND"),Tn=$t("COPY_COMMAND"),En=$t("CUT_COMMAND"),wn=$t("SELECT_ALL_COMMAND"),kn=$t("CLEAR_EDITOR_COMMAND"),Nn=$t("CLEAR_HISTORY_COMMAND"),An=$t("CAN_REDO_COMMAND"),Ln=$t("CAN_UNDO_COMMAND"),Fn=$t("FOCUS_COMMAND"),On=$t("BLUR_COMMAND"),Pn=$t("KEY_MODIFIER_COMMAND"),In=Object.freeze({}),Mn=[["keydown",function(e,t){if(!(Dn=e.timeStamp,Rn=e.key,t.isComposing()||no(t,nn,e)||null==e.key)){if(jn&&qs(e))return Ri(t,(()=>{tr(t,Jn)})),jn=!1,void(Jn="");if(function(e){return Js(e,"ArrowRight",{shiftKey:"any"})}(e))no(t,rn,e);else if(function(e){return Js(e,"ArrowRight",Vs)}(e))no(t,sn,e);else if(function(e){return Js(e,"ArrowLeft",{shiftKey:"any"})}(e))no(t,on,e);else if(function(e){return Js(e,"ArrowLeft",Vs)}(e))no(t,an,e);else if(function(e){return Js(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))no(t,ln,e);else if(function(e){return Js(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))no(t,cn,e);else if(function(e){return Js(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))Kn=!0,no(t,un,e);else if(function(e){return" "===e.key}(e))no(t,dn,e);else if(function(e){return ce&&Js(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),Kn=!0,no(t,Jt,!0);else if(function(e){return Js(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))Kn=!1,no(t,un,e);else if(function(e){return Js(e,"Backspace",{shiftKey:"any"})||ce&&Js(e,"h",{ctrlKey:!0})}(e))qs(e)?no(t,hn,e):(e.preventDefault(),no(t,jt,!0));else if(function(e){return"Escape"===e.key}(e))no(t,gn,e);else if(function(e){return Js(e,"Delete",{})||ce&&Js(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),no(t,jt,!1)):no(t,fn,e);else if(function(e){return Js(e,"Backspace",Gs)}(e))e.preventDefault(),no(t,Zt,!0);else if(function(e){return Js(e,"Delete",Gs)}(e))e.preventDefault(),no(t,Zt,!1);else if(function(e){return ce&&Js(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),no(t,Xt,!0);else if(function(e){return ce&&(Js(e,"Delete",{metaKey:!0})||Js(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),no(t,Xt,!1);else if(function(e){return Js(e,"b",Vs)}(e))e.preventDefault(),no(t,Qt,"bold");else if(function(e){return Js(e,"u",Vs)}(e))e.preventDefault(),no(t,Qt,"underline");else if(function(e){return Js(e,"i",Vs)}(e))e.preventDefault(),no(t,Qt,"italic");else if(function(e){return Js(e,"Tab",{shiftKey:"any"})}(e))no(t,pn,e);else if(function(e){return Js(e,"z",Vs)}(e))e.preventDefault(),no(t,en,void 0);else if(function(e){return ce?Js(e,"z",{metaKey:!0,shiftKey:!0}):Js(e,"y",{ctrlKey:!0})||Js(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),no(t,tn,void 0);else{const n=t._editorState._selection;null===n||$r(n)?Ys(e)&&(e.preventDefault(),no(t,wn,e)):function(e){return Js(e,"c",Vs)}(e)?(e.preventDefault(),no(t,Tn,e)):function(e){return Js(e,"x",Vs)}(e)?(e.preventDefault(),no(t,En,e)):Ys(e)&&(e.preventDefault(),no(t,wn,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&no(t,Pn,e)}}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;xo(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&Ri(t,(()=>{hs(n)||(Wn=!0)}))}],["compositionstart",function(e,t){Ri(t,(()=>{const n=ii();if($r(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();ws(r.key),(e.timeStamp<Dn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Fr(i)&&i.getStyle()!==n.style)&&no(t,Gt,Le)}}))}],["compositionend",function(e,t){ue?Hn=!0:ge||!he&&!ye?Ri(t,(()=>{tr(t,e.data)})):(jn=!0,Jn=e.data)}],["input",function(e,t){e.stopPropagation(),Ri(t,(()=>{if(bo(e.target)&&hs(e.target))return;const n=ii(),r=e.data,i=er(e);if(null!=r&&$r(n)&&qn(n,i,r,e.timeStamp,!1)){Hn&&(tr(t,r),Hn=!1);const i=n.anchor.getNode(),s=yo(uo(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;de&&!n.isCollapsed()&&Fr(i)&&null!==s.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===Ws(s.anchorNode)||no(t,Gt,r);const c=r.length;ue&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),he||ge||ye||!t.isComposing()||(Dn=0,ws(null))}else Ks(!1,t,null!==r?r:void 0),Hn&&(tr(t,r||void 0),Hn=!1);!function(){Si();Ze(Ei())}()}),{event:e}),zn=null}],["click",function(e,t){Ri(t,(()=>{const n=ii(),r=yo(uo(t)),i=si();if(r)if($r(n)){const t=n.anchor,s=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!Ji(s)&&1===Is().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=function(e,t){let n=e;for(;n!==Is()&&null!=n;){if(t(n))return n;n=n.getParent()}return null}(s,(e=>$i(e)&&!e.isInline()));$i(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=r.anchorNode;(bo(n)||xs(n))&&Ds(ri(i,r,t,e))}no(t,Ht,e)}))}],["cut",In],["copy",In],["dragstart",In],["dragover",In],["dragend",In],["paste",In],["focus",In],["blur",In],["drop",In]];de&&Mn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=er(e);"deleteCompositionText"===n||ue&&to(t)||"insertCompositionText"!==n&&Ri(t,(()=>{const i=ii();if("deleteContentBackward"===n){if(null===i){const e=si();if(!$r(e))return;Ds(e.clone())}if($r(i)){const n=i.anchor.key===i.focus.key;if(s=e.timeStamp,"MediaLast"===Rn&&s<Dn+30&&t.isComposing()&&n){if(ws(null),Dn=0,setTimeout((()=>{Ri(t,(()=>{ws(null)}))}),30),$r(i)){const e=i.anchor.getNode();e.markDirty(),Fr(e)||oe(142),Qn(i,e)}}else{ws(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=me&&n&&!a&&o;if(l&&i.isCollapsed()&&(l=!Hi(eo(i.anchor,!0))),!l){no(t,jt,!0);const e=ii();me&&$r(e)&&e.isCollapsed()&&(Vn=e,setTimeout((()=>Vn=null)))}}return}}var s;if(!$r(i))return;const o=e.data;null!==zn&&Ks(!1,t,zn),i.dirty&&null===zn||!i.isCollapsed()||Ji(i.anchor.getNode())||null===r||i.applyDOMRange(r),zn=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":no(t,Gt,e);break;case"insertFromComposition":ws(null),no(t,Gt,e);break;case"insertLineBreak":ws(null),no(t,Jt,!1);break;case"insertParagraph":ws(null),Kn&&!ge?(Kn=!1,no(t,Jt,!1)):no(t,Vt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":no(t,qt,e);break;case"deleteByComposition":(function(e,t){return e!==t||$i(e)||$i(t)||!_s(e)||!_s(t)})(c,u)&&no(t,Yt,e);break;case"deleteByDrag":case"deleteByCut":no(t,Yt,e);break;case"deleteContent":no(t,jt,!1);break;case"deleteWordBackward":no(t,Zt,!0);break;case"deleteWordForward":no(t,Zt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":no(t,Xt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":no(t,Xt,!1);break;case"formatStrikeThrough":no(t,Qt,"strikethrough");break;case"formatBold":no(t,Qt,"bold");break;case"formatItalic":no(t,Qt,"italic");break;case"formatUnderline":no(t,Qt,"underline");break;case"historyUndo":no(t,en,void 0);break;case"historyRedo":no(t,tn,void 0)}else{if("\n"===o)e.preventDefault(),no(t,Jt,!1);else if(o===Ae)e.preventDefault(),no(t,Vt,void 0);else if(null==o&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=o&&qn(i,r,o,e.timeStamp,!0)?(e.preventDefault(),no(t,Gt,o)):zn=o;Bn=e.timeStamp}}))}(e,t)]);let Dn=0,Rn=null,Bn=0,zn=null;const Un=new WeakMap;let $n=!1,Wn=!1,Kn=!1,Hn=!1,jn=!1,Jn="",Vn=null,Gn=[0,"",0,"root",0];function qn(e,t,n,r,i){const s=e.anchor,o=e.focus,a=s.getNode(),l=Ei(),c=yo(uo(l)),u=null!==c?c.anchorNode:null,d=s.key,h=l.getElementByKey(d),g=n.length;return d!==o.key||!Fr(a)||(!i&&(!de||Bn<r+50)||a.isDirty()&&g<2||zs(n))&&s.offset!==o.offset&&!a.isComposing()||bs(a)||a.isDirty()&&g>1||(i||!de)&&null!==h&&!a.isComposing()&&u!==vs(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=_s(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Fr(t)||$i(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function Yn(e,t){return xs(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function Zn(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=e;$n&&($n=!1,Yn(r,i)&&Yn(s,o)&&!Vn)||Ri(t,(()=>{if(!n)return void Ds(null);if(!fs(t,r,s))return;let a=ii();if(Vn&&$r(a)&&a.isCollapsed()){const e=a.anchor,t=Vn.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(a=Vn.clone(),Ds(a))}if(Vn=null,$r(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const i=uo(t).event,s=i?i.timeStamp:performance.now(),[o,l,c,u,d]=Gn,h=Is(),g=!1===t.isComposing()&&""===h.getTextContent();if(s<d+200&&n.offset===c&&n.key===u)Xn(a,o,l);else if("text"===n.type)Fr(r)||oe(141),Qn(a,r);else if("element"===n.type&&!g){$i(r)||oe(259);const e=n.getNode();e.isEmpty()?function(e,t){Xn(e,t.getTextFormat(),t.getTextStyle())}(a,e):Xn(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,f=!1;for(let e=0;e<s;e++){const t=r[e],n=t.getTextContentSize();if(Fr(t)&&0!==n&&!(0===e&&t.__key===d&&c===n||e===s-1&&t.__key===h&&0===u)&&(f=!0,g&=t.getFormat(),0===g))break}a.format=f?g:0}}no(t,Wt,void 0)}))}function Xn(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Qn(e,t){Xn(e,t.getFormat(),t.getStyle())}function er(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function tr(e,t){const n=e._compositionKey;if(ws(null),null!==n&&null!=t){if(""===t){const t=Ns(n),r=vs(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Fr(t)&&Hs(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=ii();if($r(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void no(e,un,null)}}}Ks(!0,e,t)}function nr(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const rr=new Map;function ir(e){const t=function(e){const t=co(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=ms(t.anchorNode);if(null===n)return;Wn&&(Wn=!1,Ri(n,(()=>{const r=si(),i=t.anchorNode;(bo(i)||xs(i))&&Ds(ri(r,t,n,e))})));const r=Us(n),i=r[r.length-1],s=i._key,o=rr.get(s),a=o||i;a!==n&&Zn(t,a,!1),Zn(t,n,!0),n!==i?rr.set(s,n):o&&rr.delete(s)}function sr(e){e._lexicalHandled=!0}function or(e){return!0===e._lexicalHandled}function ar(e){const t=e.ownerDocument,n=Un.get(t);if(void 0===n)return;const r=n-1;r>=0||oe(164),Un.set(t,r),0===r&&t.removeEventListener("selectionchange",ir);const i=ys(e);ps(i)?(function(e){if(null!==e._parentEditor){const t=Us(e),n=t[t.length-1]._key;rr.get(n)===e&&rr.delete(n)}else rr.delete(e._key)}(i),e.__lexicalEditor=null):i&&oe(198);const s=nr(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}function lr(e,t,n){Si();const r=e.__key,i=e.getParent();if(null===i)return;const s=function(e){const t=ii();if(!$r(t)||!$i(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),s=r.getNode();return lo(i,e)&&n.set(e.__key,0,"element"),lo(s,e)&&r.set(e.__key,0,"element"),t}(e);let o=!1;if($r(s)&&t){const t=s.anchor,n=s.focus;t.key===r&&(li(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(li(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Kr(s)&&t&&e.isSelected()&&e.selectPrevious();if($r(s)&&t&&!o){const t=e.getIndexWithinParent();Ts(e),oi(s,i,t,-1)}else Ts(e);n||ho(i)||i.canBeEmpty()||!i.isEmpty()||lr(i,t),t&&s&&Ji(i)&&i.isEmpty()&&i.selectEnd()}class cr{static getType(){oe(64,this.name)}static clone(e){oe(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state}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){if(null!=t)return void(e.__key=t);Si(),Ci();const n=Ei(),r=Ti(),i=""+us++;r._nodeMap.set(i,e),$i(e)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=1,e.__key=i}(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=Ns(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||ii();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Fr(this))return n;if($r(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Hi(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:Ns(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(ho(t))return $i(e)||e===this&&Hi(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:Ns(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:Ns(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=$i(this)?this:this.getParent(),n=$i(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===sa(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=$i(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=Ei()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=Ns(this.__key);return null===e&&oe(113),e}getWritable(){Si();const e=Ti(),t=Ei(),n=e._nodeMap,r=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,o=ii();if(null!==o&&o.setCachedNodes(null),s.has(r))return Es(i),i;const a=Lo(i);return s.add(r),Es(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();return(t||n.__state)&&function(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Qe(t);return t.__state=n,n}(e).updateFromJSON(t),n}(this,e.$)}static transform(){return null}remove(e){lr(this,!0,e)}replace(e,t){Si();let n=ii();null!==n&&(n=n.clone()),fo(this,e);const r=this.getLatest(),i=this.__key,s=e.__key,o=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;Ts(o);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,g=r.__parent;if(lr(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&&($i(this)&&$i(o)||oe(139),this.getChildren().forEach((e=>{o.append(e)}))),$r(n)){Ds(n);const e=n.anchor,t=n.focus;e.key===i&&zr(e,o),t.key===i&&zr(t,o)}return ks()===i&&ws(s),o}insertAfter(e,t=!0){Si(),fo(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),s=ii();let o=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(Ts(r),$r(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&&$r(s)){const e=this.getIndexWithinParent();oi(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){Si(),fo(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;Ts(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=ii();return t&&$r(c)&&oi(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return ss()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Si();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if($i(n))return n.select();if(!Fr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Si();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if($i(n))return n.select(0,0);if(!Fr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class ur extends cr{static getType(){return"linebreak"}static clone(e){return new ur(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&&Co(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&&Co(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:dr,priority:0}}}static importJSON(e){return hr().updateFromJSON(e)}}function dr(e){return{node:hr()}}function hr(){return go(new ur)}function gr(e){return e instanceof ur}function fr(e){return xs(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function pr(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function mr(e,t){return 1&t?"strong":2&t?"em":"span"}function yr(e,t,n,r,i){const s=r.classList;let o=Zs(i,"base");void 0!==o&&s.add(...o),o=Zs(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=Zs(i,e),void 0!==o)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&s.remove(...o);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||s.add(...o)}else t&r&&s.remove(...o)}}function _r(e,t,n){const r=t.firstChild,i=n.isComposing(),s=e+(i?Ne:"");if(null==r)t.textContent=s;else{const e=r.nodeValue;if(e!==s)if(i||ue){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 br(e,t,n,r,i,s){_r(i,e,t);const o=s.theme.text;void 0!==o&&yr(0,0,r,e,o)}function xr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class vr extends cr{static getType(){return"text"}static clone(e){return new vr(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===ks()}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!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Ss(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=pr(0,n),i=mr(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)),br(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=pr(0,i),a=pr(0,s),l=mr(0,i),c=mr(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 br(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)),_r(r,u,this);const d=n.theme.text;void 0!==d&&i!==s&&yr(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:wr,priority:0}),b:()=>({conversion:Cr,priority:0}),code:()=>({conversion:Ar,priority:0}),em:()=>({conversion:Ar,priority:0}),i:()=>({conversion:Ar,priority:0}),mark:()=>({conversion:Ar,priority:0}),s:()=>({conversion:Ar,priority:0}),span:()=>({conversion:Sr,priority:0}),strong:()=>({conversion:Ar,priority:0}),sub:()=>({conversion:Ar,priority:0}),sup:()=>({conversion:Ar,priority:0}),u:()=>({conversion:Ar,priority:0})}}static importJSON(e){return Lr().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=xr(t,"b")),this.hasFormat("italic")&&(t=xr(t,"i")),this.hasFormat("strikethrough")&&(t=xr(t,"s")),this.hasFormat("underline")&&(t=xr(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=Ss(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=ze[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){Si();let n=e,r=t;const i=ii(),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(!$r(i))return ei(o,n,o,r,"text","text");{const e=ks();e!==i.anchor.key&&e!==i.focus.key||ws(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=ii();if(r&&$r(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){Si();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=ks(),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(),f=t.__detail;let p=!1,m=null,y=null;const _=ii();if($r(_)){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=Lr(c),d.__format=h,d.__style=g,d.__detail=f,p=!0):d=t.setTextContent(c);const b=[d];for(let e=1;e<l;e++){const t=Lr(o[e]);t.__format=h,t.__style=g,t.__detail=f;const n=t.__key;i===r&&ws(n),b.push(t)}const x=m?m.offset:null,v=y?y.offset:null;let S=0;for(const e of b){if(!m&&!y)break;const t=S+e.getTextContentSize();if(null!==m&&null!==x&&x<=t&&x>=S&&(m.set(e.getKey(),x-S,"text"),x<t&&(m=null)),null!==y&&null!==v&&v<=t&&v>=S){y.set(e.getKey(),v-S,"text");break}S=t}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Es(t),null!==n&&Es(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();p?(e.splice(t,0,b),this.remove()):e.splice(t,1,b),$r(_)&&oi(_,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;ks()===r&&ws(n);const o=ii();if($r(o)){const i=o.anchor,a=o.focus;null!==i&&i.key===r&&ci(i,t,n,e,s),null!==a&&a.key===r&&ci(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 Sr(e){return{forChild:Or(e.style),node:null}}function Cr(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Or(t.style,n?void 0:"bold"),node:null}}const Tr=new WeakMap;function Er(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 wr(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=Tr.get(n))&&!Er(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)Tr.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(hr()):"\t"===r?t.push(Ir()):""!==r&&t.push(Lr(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=kr(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=kr(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:Lr(n)}}function kr(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&&!So(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(xs(n))return n;if("BR"===n.nodeName)return null}}const Nr={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ar(e){const t=Nr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Or(e.style,t),node:null}}function Lr(e=""){return go(new vr(e))}function Fr(e){return e instanceof vr}function Or(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=>Fr(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 Pr extends vr{static getType(){return"tab"}static clone(e){return new Pr(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=Zs(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Ir().updateFromJSON(e)}setTextContent(e){return"\t"!==e&&""!==e&&oe(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 Ir(){return go(new Pr)}function Mr(e){return e instanceof Pr}class Dr{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:ia(_a(ca(this,"next")),_a(ca(e,"next")))<0}getNode(){const e=Ns(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,vi()||(ks()===s&&ws(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function Rr(e,t,n){return new Dr(e,t,n)}function Br(e,t){let n=t.__key,r=e.offset,i="element";if(Fr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!$i(t)){const e=t.getNextSibling();if(Fr(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 zr(e,t){if($i(t)){const n=t.getLastDescendant();$i(n)||Fr(n)?Br(e,n):Br(e,t)}else Br(e,t)}class Ur{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Kr(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 Ur(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(Fr(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=Ns(e);null!==t&&n.push(t)}return vi()||(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((ii()||si())===this&&e[0]){const t=Vo(e[0],"next");da(na(t,t))}for(const t of e)t.remove()}}function $r(e){return e instanceof Wr}class Wr{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!!$r(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(Ko(n)){const{origin:e}=n;0===t.length?i.add(e):(s.add(e),t.push(e))}else{const{origin:e}=n;$i(e)&&s.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Wo(e.focus)&&$i(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=Zo(e.focus.origin,"previous");Ko(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Xo(n))i.delete(n.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!$i(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=>$o(e)?e.origin:e.getNodeAtCaret(),s=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(s)}return t}(va(ga(this),"next"));return vi()||(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]=jr(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if($i(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Fr(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!Hi(d)&&!gr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Ei(),n=t.getEditorState()._selection,r=Xr(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),it(this)}clone(){const e=this.anchor,t=this.focus;return new Wr(Rr(e.key,e.offset,e.type),Rr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Ss(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Me[e];return!!(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(hr()):"\t"===r?n.push(Ir()):n.push(Lr(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=Lr(),a=Ji(i)?ss().append(o):o;o.setFormat(n),o.setStyle(r),null===s?i.append(a):s.insertBefore(a),e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(s,o,r,i),"element"===o.type&&ua(o,_a(ca(o,"next")));const a=s.offset;let l=o.offset;const c=this.getNodes(),u=c.length;let d=c[0];Fr(d)||oe(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let f=c[u-1];if(1===u&&"element"===o.type&&(l=h,o.set(s.key,l,"text")),this.isCollapsed()&&a===h&&(bs(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Fr(t)&&t.canInsertTextBefore()&&!bs(t)||(t=Lr(),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&&(bs(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Fr(t)&&!bs(t)||(t=Lr(),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=Lr(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||$i(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Zr(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(_s(d)){const t=Lr(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Mr(d)){const t=Lr(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Lr(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(),...f.getParentKeys()]),n=$i(d)?d:d.getParentOrThrow();let r=$i(f)?f:f.getParentOrThrow(),i=f;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===o.type&&(0!==l||""===f.getTextContent())||"element"===o.type&&f.getIndexWithinParent()<l)if(Fr(f)&&!_s(f)&&l!==f.getTextContentSize()){if(f.isSegmented()){const e=Lr(f.getTextContent());f.replace(e),f=e}Ji(o.getNode())||"text"!==o.type||(f=f.spliceText(0,l,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const s=r.getChildren(),g=new Set(c),p=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)||$i(t)&&t.isParentOf(d))break;t.isAttached()&&(!g.has(t)||t.is(i)?p||m.insertAfter(t,!1):t.remove())}if(!p){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(_s(d))if(a===h)d.select();else{const t=Lr(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=ii()===this;ha(this,ya(ga(this))),e&&ii()!==this&&Ds(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void ws(null);const n=this.getNodes(),r=[];for(const e of n)Fr(e)&&r.push(e);const i=t=>{n.forEach((n=>{if($i(n)){const r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},s=r.length;if(0===s)return this.toggleFormat(e),ws(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 f=h.getFormatFlags(e,t);i(f);const p=s-1;let m=r[p];const y="text"===u.type?u.offset:m.getTextContentSize();if(h.is(m)){if(g===y)return;if(bs(h)||0===g&&y===h.getTextContentSize())h.setFormat(f);else{const e=h.splitText(g,y),t=0===g?e[0]:e[1];t.setFormat(f),"text"===c.type&&c.set(t.__key,0,"text"),"text"===u.type&&u.set(t.__key,y-g,"text")}return void(this.format=f)}0===g||bs(h)||([,h]=h.splitText(g),g=0),h.setFormat(f);const _=m.getFormatFlags(e,f);y>0&&(y===m.getTextContentSize()||bs(m)||([m]=m.splitText(y)),m.setFormat(_));for(let t=d+1;t<p;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=f|_}insertNodes(e){if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const t=ii();return $r(t)||oe(134),t.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=Eo(t,To),r=e[e.length-1];if($i(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=hi(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>($i(e)||Hi(e))&&!e.isInline()))){$i(n)||oe(211,t.constructor.name,t.getType());const i=hi(this);return n.splice(i,0,e),void r.selectEnd()}const i=function(e){const t=ss();let n=null;for(let r=0;r<e.length;r++){const i=e[r],s=gr(i);if(s||Hi(i)&&i.isInline()||$i(i)&&i.isInline()||Fr(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=$i(n)&&n.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;$i(u=c)&&To(u)&&!u.isEmpty()&&$i(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&($i(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=Eo(s,To);a&&$i(d)&&(a.canMergeWhenEmpty()||To(l))&&(d.append(...a.getChildren()),a.remove()),$i(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=$i(n)?n.getLastChild():null;gr(h)&&d!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=ss();return Is().splice(this.anchor.offset,0,[e]),e.select(),e}const e=hi(this),t=Eo(this.anchor.getNode(),To);$i(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=hr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus;let s=e[0],o=e[n];const[a,l]=jr(this);if(0===t)return[];if(1===t){if(Fr(s)&&!this.isCollapsed()){const e=a>l?l:a,t=a>l?a:l,n=s.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[s]}const c=r.isBefore(i);if(Fr(s)){const t=c?a:l;t===s.getTextContentSize()?e.shift():0!==t&&([,s]=s.splitText(t),e[0]=s)}if(Fr(o)){const t=o.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([o]=o.splitText(r),e[n]=o)}return e}modify(e,t,n){if(fi(this,e,t,n))return;const r="move"===e,i=Ei(),s=yo(uo(i));if(!s)return;const o=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();if(null===a||null===o||!$i(l)||l.isInline()||l.canBeEmpty()||mo(o,i,a),this.dirty){let e=io(i,this.anchor.key),t=io(i,this.focus.key);"text"===this.anchor.type&&(e=vs(e)),"text"===this.focus.type&&(t=vs(t)),e&&t&&ui(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=Ji(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(ho(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];lo(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){const e=r[0];$i(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=r[r.length-1];$i(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&&$i(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($i(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=ta(ca(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(Ko(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if($i(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=_a(t);ha(this,na(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(Wo(t)){if($i(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(Hi(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&$i(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=ni();e.add(t.origin.getKey()),Ds(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;return ha(this,na(!t.origin.isEmpty()&&n.isEmpty()?fa(Vo(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&&Jr(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 Gr(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 Gr(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!(zs(e)||Vr(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()&&Ji(e.getParent())&&null===e.getPreviousSibling()&&Jr(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 Kr(e){return e instanceof Ur}function Hr(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function jr(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]:[Hr(n),Hr(r)]}function Jr(e,t){for(let n=t;n;n=n.getParent()){if($i(n)){if(n.collapseAtStart(e))return!0;if(ho(n))break}if(n.getPreviousSibling())break}return!1}const Vr=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function Gr(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 qr(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=Rs(u),Fr(i))s=Bs(i,o);else{let a=Rs(e);if(null===a)return null;if($i(a)){const l=r.getElementByKey(a.getKey());null===l&&oe(214);const c=a.getDOMSlot(l);[a,s]=c.resolveChildIndex(a,l,e,t),$i(a)||oe(215),o&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let u=a.getChildAtIndex(s);if($i(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=$i(u)?u:u.getParentOrThrow()),s=0}Fr(u)?(i=u,a=null,s=Bs(u,o)):u!==a&&o&&!d&&($i(a)||oe(216),s=Math.min(a.getChildrenSize(),s+1))}else{const n=a.getIndexWithinParent();s=0===t&&Hi(a)&&Rs(e)===a?n:n+1,a=a.getParentOrThrow()}if($i(a))return Rr(a.__key,s,"element")}}else i=Rs(e);return Fr(i)?Rr(i.__key,s,"text"):null}function Yr(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&&$i(s)&&s.isInline()){const t=s.getPreviousSibling();Fr(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else $i(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Fr(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(t&&$i(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&$i(s)&&s.isInline()&&!s.canInsertTextAfter()){const t=s.getNextSibling();Fr(t)&&e.set(t.__key,0,"text")}}}function Zr(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);Yr(e,r,i),Yr(t,!r,i),i&&t.set(e.key,e.offset,e.type);const s=Ei();if(s.isComposing()&&s._compositionKey!==e.key&&$r(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 Xr(e,t,n,r,i,s){if(null===e||null===n||!fs(i,e,n))return null;const o=qr(e,t,$r(s)?s.anchor:null,i);if(null===o)return null;const a=qr(n,r,$r(s)?s.focus:null,i);if(null===a)return null;if("element"===o.type&&"element"===a.type){const t=Rs(e),r=Rs(n);if(Hi(t)&&Hi(r))return null}return Zr(o,a,s),[o,a]}function Qr(e){return $i(e)&&!e.isInline()}function ei(e,t,n,r,i,s){const o=Ti(),a=new Wr(Rr(e,t,i),Rr(n,r,s),0,"");return a.dirty=!0,o._selection=a,a}function ti(){const e=Rr("root",0,"element"),t=Rr("root",0,"element");return new Wr(e,t,0,"")}function ni(){return new Ur(new Set)}function ri(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($r(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,a&&$r(e)&&!fs(n,c,u))return e.clone();const g=Xr(c,d,u,h,n,e);if(null===g)return null;const[f,p]=g;return new Wr(f,p,$r(e)?e.format:0,$r(e)?e.style:"")}function ii(){return Ti()._selection}function si(){return Ei()._editorState._selection}function oi(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"),ai(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")}}ai(e)}function ai(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,s=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!$i(s))return;const e=s.getChildrenSize(),i=n>=e,o=i?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Fr(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}}else{if($i(s)){const e=s.getChildrenSize(),r=n>=e,i=r?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Fr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if($i(o)){const e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(Fr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function li(e,t,n,r,i){let s=null,o=0,a=null;null!==r?(s=r.__key,Fr(r)?(o=r.getTextContentSize(),a="text"):$i(r)&&(o=r.getChildrenSize(),a="element")):null!==i&&(s=i.__key,Fr(i)?a="text":$i(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 ci(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 ui(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function di(e){let t=ii()||si();null===t&&(t=Is().selectEnd()),t.insertNodes(e)}function hi(e){let t=e;e.isCollapsed()||t.removeText();const n=ii();$r(n)&&(t=n),$r(t)||oe(161);const r=t.anchor;let i=r.getNode(),s=r.offset;for(;!To(i);){const e=i;if([i,s]=gi(i,s),e.is(i))break}return s}function gi(e,t){const n=e.getParent();if(!n){const e=ss();return Is().append(e),e.select(),[Is(),0]}if(Fr(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(!$i(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Wr(Rr(e.__key,t,"element"),Rr(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=ca(e.focus,n?"previous":"next"),o="lineboundary"===r,a="move"===t;let l=s,c="decorators-and-blocks"===i;if(!ba(l)){for(const e of l){c=!1;const{origin:t}=e;if(!Hi(t)||t.isIsolated()||(l=e,!o||!t.isInline()))break}if(c)for(const e of ta(s).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(Ko(e))e.origin.isInline()||(l=e);else{if($i(e.origin))continue;Hi(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===s)return!1;if(a&&!o&&Hi(l.origin)&&l.origin.isKeyboardSelectable()){const e=ni();return e.add(l.origin.getKey()),Ds(e),!0}return l=_a(l),a&&ua(e.anchor,l),ua(e.focus,l),c||!o}let pi=null,mi=null,yi=!1,_i=!1,bi=0;const xi={characterData:!0,childList:!0,subtree:!0};function vi(){return yi||null!==pi&&pi._readOnly}function Si(){yi&&oe(13)}function Ci(){bi>99&&oe(14)}function Ti(){return null===pi&&oe(195,wi()),pi}function Ei(){return null===mi&&oe(196,wi()),mi}function wi(){let e=0;const t=new Set,n=cs.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=ys(r);if(ps(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 ki(e,t,n){const r=t.__type,i=function(e,t){const n=e._nodes.get(t);return void 0===n&&oe(30,t),n}(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 Ni(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Ai(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 Li(e){return Fi(e,Ei()._nodes)}function Fi(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($i(s)&&Array.isArray(o))for(let e=0;e<o.length;e++){const n=Fi(o[e],t);s.append(n)}return s}function Oi(e,t,n){const r=pi,i=yi,s=mi;pi=t,yi=!0,mi=e;try{return n()}finally{pi=r,yi=i,mi=s}}function Pi(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=pi,u=yi,d=mi,h=e._updating,g=e._observer;let f=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==g){mi=e,pi=n,yi=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;g.disconnect(),f=function(e,t,n,r,i,s){mt="",xt="",yt="",vt=2===r,Ct=null,at=n,ot=n._config,lt=n._nodes,ct=at._listeners.mutation,ut=i,dt=s,ht=e._nodeMap,gt=t._nodeMap,St=t._readOnly,ft=new Map(n._keyToDOMMap);const o=new Map;return pt=o,Rt("root",null),at=void 0,lt=void 0,ut=void 0,dt=void 0,ht=void 0,gt=void 0,ot=void 0,ft=void 0,pt=void 0,o}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),_i)throw t;return as(e,null,r,n),Xe(e),e._dirtyType=2,_i=!0,Pi(e,s),void(_i=!1)}finally{g.observe(r,xi),e._updating=h,pi=c,yi=u,mi=d}}n._readOnly||(n._readOnly=!0);const p=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=Os(e)),delete r[s])}(e,n);const x=i?null:yo(uo(e));if(e._editable&&null!==x&&(l||null===a||a.dirty)&&null!==r&&!_.has(ts)){mi=e,pi=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(Qi)&&u!==s||null!==u&&gs(u))return;if(!$r(t))return void(null!==e&&fs(n,o,a)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,f=h.key,p=io(n,g),m=io(n,f),y=d.offset,_=h.offset,b=t.format,x=t.style,v=t.isCollapsed();let S=p,C=m,T=!1;if("text"===d.type){S=vs(p);const e=d.getNode();T=e.getFormat()!==b||e.getStyle()!==x}else $r(e)&&"text"===e.anchor.type&&(T=!0);var E,w,k,N,A;if("text"===h.type&&(C=vs(m)),null!==S&&null!==C&&(v&&(null===e||T||$r(e)&&(e.format!==b||e.style!==x))&&(E=b,w=x,k=y,N=g,A=performance.now(),Gn=[E,w,k,N,A]),l!==y||c!==_||o!==S||a!==C||"Range"===r.type&&v||(null!==u&&s.contains(u)||s.focus({preventScroll:!0}),"element"===d.type))){if(ui(r,S,y,C,_),!i.has(es)&&t.isCollapsed()&&null!==s&&s===document.activeElement){const e=$r(t)&&"element"===t.anchor.type?S.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=oo(n),i=co(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=uo(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=so(c)}}(n,t,s)}}$n=!0}}(o,a,e,x,_,r)}!function(e,t,n){let r=e._blockCursorElement;if($r(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())po(s.getChildAtIndex(o-1))&&(a=!0);else{const t=s.getChildAtIndex(o);if(null!==t&&po(t)){const n=t.getPreviousSibling();(null===n||po(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=_e(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,xi),mi=d,pi=c}}null!==f&&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],l=t.get(a);void 0!==l&&o(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(e,f,_,p,s),$r(a)||null===a||null!==o&&o.is(a)||e.dispatchCommand(Wt,void 0);const v=e._pendingDecorators;null!==v&&(e._decorators=v,e._pendingDecorators=null,Ii("decorator",e,!0,v)),function(e,t,n){const r=Ps(t),i=Ps(n);r!==i&&Ii("textcontent",e,!0,i)}(e,t||s,n),Ii("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:f,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;Di(e,t,r)}}}(e)}function Ii(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 Mi(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t;let s;if(void 0!==i){if(s=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete){const t=e._pendingEditorState;null===t&&oe(191),t._flushSync=!0}s&&e._deferred.push(s),Ai(e,i.tag)}n()}}return r}function Di(e,t,n){const r=e._updateTags;let i,s=!1,o=!1;void 0!==n&&(i=n.onUpdate,Ai(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=Vi(l||a),c=!0),l._flushSync=o;const u=pi,d=yi,h=mi,g=e._updating;pi=l,yi=!1,e._updating=!0,mi=e;const f=e._headless||null===e.getRootElement();try{c&&(f?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=yo(uo(e));return $r(n)||null==n?ri(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),s=Mi(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if($r(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);Fr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&rt(t)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,s=ks(),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);Fr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&rt(r),void 0!==r&&Ni(r,s)&&ki(t,r,o),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){bi++;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&&Ni(l,s)&&ki(t,l,o)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,bi++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Mi(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()||($i(t)&&We(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($r(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 Kr(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 Pi(e)}finally{pi=u,yi=d,mi=h,e._updating=g,bi=0}const p=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);p?l._flushSync?(l._flushSync=!1,Pi(e)):c&&ds((()=>{Pi(e)})):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Ri(e,t,n){mi===e&&void 0===n?t():Di(e,t,n)}class Bi{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new Bi(this.element,e,this.after)}withAfter(e){return new Bi(this.element,this.before,e)}withElement(e){return this.element===e?this:new Bi(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&&(ge||he);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=zi(t,n);i.push(r);const s=zi(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 zi(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 Ui extends cr{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.__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=Ei()._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(Fr(t)&&e.push(t),$i(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;$i(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;$i(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 $i(e)&&e.getLastDescendant()||e||null}const r=t[e];return $i(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Ns(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&oe(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Ns(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(),$i(i)&&r!==n-1&&!i.isInline()&&(e+=Ae)}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(),$i(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=Re[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){const t=Me[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return Ss(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Si();const n=ii();let r=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Fr(e)||$i(e))return e.select(0,0)}else if(!(void 0!==e&&e!==s||void 0!==t&&t!==s)){const e=this.getLastChild();if(Fr(e)||$i(e))return e.select()}void 0===r&&(r=s),void 0===i&&(i=s);const o=this.__key;return $r(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):ei(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?Re[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){const r=n.length,i=this.getChildrenSize(),s=this.getWritable();e+t<=i||oe(226,String(e),String(t),String(i));const o=s.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r;if(0!==e)if(e===i)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&oe(100);const t=e.getNextSibling(),n=e.__key;Ts(e.getWritable()),l.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===o&&d--,Ts(r);const i=t.__key;if(null===h)s.__first=i,r.__prev=null;else{const e=h.getWritable();e.__next=i,r.__prev=e.__key}t.__key===o&&oe(76),r.__parent=o,a.push(i),h=t}if(e+t===i)null!==h&&(h.getWritable().__next=null,s.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(s.__size=d,l.length){const e=ii();if($r(e)){const t=new Set(l),n=new Set(a),{anchor:r,focus:i}=e;Wi(r,t,n)&&li(r,r.getNode(),this,u,c),Wi(i,t,n)&&li(i,i.getNode(),this,u,c),0!==d||this.canBeEmpty()||ho(this)||this.remove()}}return s}getDOMSlot(e){return new Bi(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 $i(e){return e instanceof Ui}function Wi(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 Ki extends cr{decorate(e,t){oe(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Hi(e){return e instanceof Ki}class ji extends Ui{static getType(){return"root"}static clone(){return new ji}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){oe(51)}getTextContent(){const e=this.__cachedText;return!vi()&&0!==Ei()._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)$i(e)||Hi(e)||oe(282);return super.splice(e,t,n)}static importJSON(e){return Is().updateFromJSON(e)}collapseAtStart(){return!0}}function Ji(e){return e instanceof ji}function Vi(e){return new Yi(new Map(e._nodeMap))}function Gi(){return new Yi(new Map([["root",new ji]]))}function qi(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&oe(130,n.name),$i(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=qi(i[e]);r.push(t)}}return t}class Yi{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 Oi(t&&t.editor||null,this,e)}clone(e){const t=new Yi(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Oi(null,this,(()=>({root:qi(Is())})))}}const Zi="historic",Xi="history-merge",Qi="collaboration",es="skip-scroll-into-view",ts="skip-dom-selection";class ns extends Ui{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rs extends Ui{static getType(){return"paragraph"}static clone(e){return new rs(e.__key)}createDOM(e){const t=document.createElement("p"),n=Zs(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:is,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 ss().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){const n=ss();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||Fr(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 is(e){const t=ss();return e.style&&(t.setFormat(e.style.textAlign),Fo(e,t)),{node:t}}function ss(){return go(new rs)}function os(e){return e instanceof rs}function as(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=Gi(),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 ls(e){const t=e||{},n=mi,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,s=t.disableEvents||!1,o=Gi(),a=t.namespace||(null!==i?i._config.namespace:$s()),l=t.editorState,c=[ji,vr,ur,Pr,rs,ns,...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}const i=t.getType(),s=t.transform(),o=new Set;null!==s&&o.add(s),g.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:o})}}const f=new cs(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&&(f._pendingEditorState=l,f._dirtyType=2),f}class cs{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=$s(),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;i.set(t,r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{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=Ao(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=Ao(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=Ns(t);e&&e.markDirty()}}),null===e._pendingEditorState?{tag:Xi}: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 no(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=Zs(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,as(this,t,e,r),null!==t&&(this._config.disableEvents||ar(t),null!=n&&t.classList.remove(...n)),null!==e){const t=co(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,Xe(this),this._updateTags.add(Xi),Pi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=Un.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",ir),Un.set(n,(r||0)+1),e.__lexicalEditor=t;const i=nr(e);for(let n=0;n<Mn.length;n++){const[r,s]=Mn[n],o="function"==typeof s?e=>{or(e)||(sr(e),(t.isEditable()||"click"===r)&&s(e,t))}:e=>{if(or(e))return;sr(e);const n=t.isEditable();switch(r){case"cut":return n&&no(t,En,e);case"copy":return no(t,Tn,e);case"paste":return n&&no(t,qt,e);case"dragstart":return n&&no(t,vn,e);case"dragover":return n&&no(t,Sn,e);case"dragend":return n&&no(t,Cn,e);case"focus":return n&&no(t,Fn,e);case"blur":return n&&no(t,On,e);case"drop":return n&&no(t,bn,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(Xi),Pi(this);Ii("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=Vi(e),n._selection=e._selection?e._selection.clone():null),Ze(this);const r=this._pendingEditorState,i=this._updateTags,s=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=s&&i.add(s),Pi(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&i.add(s),this._updating||Pi(this)}parseEditorState(e,t){return function(e,t,n){const r=Gi(),i=pi,s=yi,o=mi,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,pi=r,yi=!1,mi=t;try{const i=t._nodes;Fi(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,pi=i,yi=s,mi=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Pi(this),this.getEditorState().read(e,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):Di(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Ri(this,(()=>{const r=ii(),i=Is();null!==r?r.dirty||Ds(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),ao("focus"),function(e){Si(),Ei()._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=yo(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ii("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}cs.version="0.32.1+prod.esm";let us=1;const ds="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function hs(e){return Hi(Fs(e))}function gs(e){const t=document.activeElement;if(!bo(t))return!1;const n=t.nodeName;return Hi(Fs(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==ys(t))}function fs(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!gs(t)&&ms(t)===e}catch(e){return!1}}function ps(e){return e instanceof cs}function ms(e){let t=e;for(;null!=t;){const e=ys(t);if(ps(e))return e;t=so(t)}return null}function ys(e){return e?e.__lexicalEditor:null}function _s(e){return Mr(e)||e.isToken()}function bs(e){return _s(e)||e.isSegmented()}function xs(e){return xo(e)&&3===e.nodeType}function vs(e){let t=e;for(;null!=t;){if(xs(t))return t;t=t.firstChild}return null}function Ss(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 Cs(e){return Fr(e)||gr(e)||Hi(e)}function Ts(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 Es(e){Ci();const t=e.getLatest(),n=t.__parent,r=Ti(),i=Ei(),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,$i(e)?o.set(a,!0):i._dirtyLeaves.add(a)}function ws(e){Si();const t=Ei(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Ns(n);null!==e&&e.getWritable()}if(null!==e){const t=Ns(e);null!==t&&t.getWritable()}}}function ks(){return vi()?null:Ei()._compositionKey}function Ns(e,t){const n=(t||Ti())._nodeMap.get(e);return void 0===n?null:n}function As(e,t){const n=Ls(e,Ei());return void 0!==n?Ns(n,t):null}function Ls(e,t){return e[`__lexicalKey_${t._key}`]}function Fs(e,t){let n=e;for(;null!=n;){const e=As(n,t);if(null!==e)return e;n=so(n)}return null}function Os(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Ps(e){return e.read((()=>Is().getTextContent()))}function Is(){return Ms(Ti())}function Ms(e){return e._nodeMap.get("root")}function Ds(e){Si();const t=Ti();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Rs(e){const t=Ei(),n=function(e,t){let n=e;for(;null!=n;){const e=Ls(n,t);if(void 0!==e)return e;n=so(n)}return null}(e,t);return null===n?e===t.getRootElement()?Ns("root"):null:Ns(n)}function Bs(e,t){return t?e.getTextContentSize():0}function zs(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Us(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function $s(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ws(e){return xs(e)?e.nodeValue:null}function Ks(e,t,n){const r=yo(uo(t));if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let t=Ws(i);const r=Fs(i);if(null!==t&&Fr(r)){if(t===Ne&&n){const e=n.length;t=n,s=e,o=e}null!==t&&Hs(r,t,s,o,e)}}}function Hs(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]===Ne&&(a=t.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(""===a){if(ws(null),he||ge||ye)s.remove();else{const e=Ei();setTimeout((()=>{e.update((()=>{s.isAttached()&&s.remove()}))}),20)}return}const t=s.getParent(),i=si(),l=s.getTextContentSize(),c=ks(),u=s.getKey();if(s.isToken()||null!==c&&u===c&&!o||$r(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=ii();if(!$r(d)||null===n||null===r)return void s.setTextContent(a);if(d.setTextNodeRange(s,n,s,r),s.isSegmented()){const e=Lr(s.getTextContent());s.replace(e),s=e}s.setTextContent(a)}}}function js(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function Js(e,t,n){return function(e,t){return js(e,t,"altKey")&&js(e,t,"ctrlKey")&&js(e,t,"shiftKey")&&js(e,t,"metaKey")}(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const Vs={ctrlKey:!ce,metaKey:ce},Gs={altKey:ce,ctrlKey:!ce};function qs(e){return"Backspace"===e.key}function Ys(e){return Js(e,"a",Vs)}function Zs(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=_e(i);return n[t]=e,e}return i}function Xs(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 Qs(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 eo(e,t){const n=e.offset;if("element"===e.type)return Qs(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?Qs(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function to(e){const t=uo(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function no(e,t,n){return function(e,t,n){const r=Us(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(Ri(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 ro(e){return!Ji(e)&&!e.isLastChild()&&!e.isInline()}function io(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&oe(75,t),n}function so(e){const t=e.assignedSlot||e.parentElement;return vo(t)?t.host:t}function oo(e){return function(e){return xo(e)&&9===e.nodeType}(e)?e:bo(e)?e.ownerDocument:null}function ao(e){Si(),Ei()._updateTags.add(e)}function lo(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function co(e){const t=oo(e);return t?t.defaultView:null}function uo(e){const t=e._window;return null===t&&oe(78),t}function ho(e){return Ji(e)||$i(e)&&e.isShadowRoot()}function go(e){const t=Ei(),n=e.constructor.getType(),r=t._nodes.get(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 fo(e,t){!Ji(e.getParent())||$i(t)||Hi(t)||oe(99)}function po(e){return(Hi(e)||$i(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 yo(e){return ae?(e||window).getSelection():null}function _o(e){return bo(e)&&"A"===e.tagName}function bo(e){return xo(e)&&1===e.nodeType}function xo(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function vo(e){return xo(e)&&11===e.nodeType}function So(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 Co(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 To(e){if(Hi(e)&&!e.isInline())return!0;if(!$i(e)||ho(e))return!1;const t=e.getFirstChild(),n=null===t||gr(t)||Fr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Eo(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function wo(){return Ei()}const ko=new WeakMap,No=new Map;function Ao(e){if(!e._readOnly&&e.isEmpty())return No;e._readOnly||oe(192);let t=ko.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),ko.set(e,t)),t}function Lo(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Fo(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Oo(e){return!0===e.__lexicalUnmanaged}const Po={next:"previous",previous:"next"};class Io{constructor(e){this.origin=e}[Symbol.iterator](){return ra({hasNext:Wo,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Vo(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Vo(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=Vo(e,this.direction)}for(const e of o.values())e.remove();return this}}class Mo extends Io{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Zo(e,this.direction)}getParentCaret(e="root"){return Vo(Bo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Ro(this.direction);return Vo(this.getNodeAtCaret(),e)||Zo(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Mo&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Do={root:Ji,shadowRoot:ho};function Ro(e){return Po[e]}function Bo(e,t="root"){return Do[t](e)?null:e}class zo extends Io{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Vo(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return $i(this.origin)?Zo(this.origin,this.direction):null}getParentCaret(e="root"){return Vo(Bo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Ro(this.direction);return Vo(this.getNodeAtCaret(),e)||Zo(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof zo&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof zo||e instanceof Uo)&&this.direction===e.direction&&this.origin.is(e.origin)}}class Uo extends Io{type="text";constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Go(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Vo(Bo(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Go(this.origin,Ro(this.direction),this.offset)}isSamePointCaret(e){return e instanceof Uo&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof zo||e instanceof Uo)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Vo(this.origin,this.direction)}}function $o(e){return e instanceof Uo}function Wo(e){return e instanceof zo}function Ko(e){return e instanceof Mo}const Ho={next:class extends Uo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Uo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},jo={next:class extends zo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends zo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Jo={next:class extends Mo{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Mo{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Vo(e,t){return e?new jo[t](e):null}function Go(e,t,n){return e?new Ho[t](e,qo(e,n)):null}function qo(e,t){const n=e.getTextContentSize();let r="next"===t?n:"previous"===t?0:t;return(r<0||r>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);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.`)}(284,String(t),String(n),e.getKey()),r=r<0?0:n),r}function Yo(e,t){return new ea(e,t)}function Zo(e,t){return $i(e)?new Jo[t](e):null}function Xo(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class Qo{type="node-caret-range";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 Qo(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return $o(t)?function(e,t){const{direction:n,origin:r}=e;return Yo(e,qo(r,"focus"===t?Ro(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[Yo(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=$o(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=$o(n),i=t=>t.isSameNodeCaret(n)?null:Xo(t)||t.getParentCaret(e);return ra({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 ea{type="slice";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 Go(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function ta(e){return na(e,Vo(Is(),e.direction))}function na(e,t){return e.direction!==t.direction&&oe(265),new Qo(e,t,e.direction)}function ra(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 ia(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 sa(n)}}function sa(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 oa(e,t){return t.is(e)}function aa(e){return $i(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?(oa(e,r)||oe(276),{commonAncestor:r,type:"ancestor"}):null===i?(oa(t,r)||oe(277),{commonAncestor:r,type:"descendant"}):(($i(s)||oa(e,s))&&($i(i)||oa(t,i))&&r.is(s.getParent())&&r.is(i.getParent())||oe(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function ca(e,t){const{type:n,key:r,offset:i}=e,s=function(e){const t=Ns(e);return null===t&&oe(63,e),t}(e.key);return"text"===n?(Fr(s)||oe(266,s.getType(),r),Go(s,t,i)):($i(s)||oe(267,s.getType(),r),function(e,t,n){let r=Zo(e,"next");for(let e=0;e<t;e++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return xa(r,n)}(s,e.offset,t))}function ua(e,t){const{origin:n,direction:r}=t,i="next"===r;$o(t)?e.set(n.getKey(),t.offset,"text"):Wo(t)?Fr(n)?e.set(n.getKey(),qo(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(Ko(t)&&$i(n)||oe(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function da(e){const t=ii(),n=$r(t)?t:ti();return ha(n,e),Ds(n),n}function ha(e,t){ua(e.anchor,t.anchor),ua(e.focus,t.focus)}function ga(e){const{anchor:t,focus:n}=e,r=ca(t,"next"),i=ca(n,"next"),s=ia(r,i)<=0?"next":"previous";return na(xa(r,s),xa(i,s))}function fa(e){const{direction:t,origin:n}=e,r=Vo(n,Ro(t)).getNodeAtCaret();return r?Vo(r,t):Zo(n.getParentOrThrow(),t)}function pa(e,t="root"){const n=[e];for(let r=Ko(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(fa(r));return n}function ma(e){return!!e&&e.origin.isAttached()}function ya(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const s=va(e,r),o=pa(s.anchor,n),a=pa(s.focus.getFlipped(),n),l=new Set,c=[];for(const e of s.iterNodeCarets(n))if(Ko(e))l.add(e.origin.getKey());else if(Wo(e)){const{origin:t}=e;$i(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=fa(Vo(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=Lr(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());s.replaceOrInsert(n),t=Go(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(ma(e)){u=_a(e);break}for(const e of a)if(ma(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(ho(i))return;!n&&t(i)&&(n=i)}return n},u=c(s,To),d=u&&c(o,(e=>n.has(e.getKey())&&To(e)));return u&&d?[u,d]:null}(u,d,l);if(h){const[e,t]=h;Zo(e,"previous").splice(0,t.getChildren()),t.remove()}const g=[u,d,...o,...a].find(ma);if(g)return function(e){return na(e,e)}(xa(_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(;Ko(t);){const e=Xo(t);if(!Ko(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Fr(t.origin))return $o(t)?t:Go(t.origin,n,n);const r=t.getAdjacentCaret();return Wo(r)&&Fr(r.origin)?Go(r.origin,n,Ro(n)):t}function ba(e){return $o(e)&&e.offset!==qo(e.origin,e.direction)}function xa(e,t){return e.direction===t?e:e.getFlipped()}function va(e,t){return e.direction===t?e:na(xa(e.focus,t),xa(e.anchor,t))}const Sa=new Map;function Ca(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 Ta(e){let t=Sa.get(e);return void 0===t&&(t=Ca(e),Sa.set(e,t)),t}function Ea(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!bs(t)&&null!==n){const[r,i]=n,s=e.isBackward(),o=r.getNode(),a=i.getNode(),l=t.is(o),c=t.is(a);if(l||c){const[n,r]=jr(e),i=o.is(a),l=t.is(s?a:o),c=t.is(s?o:a);let u,d=0;i?(d=n>r?r:n,u=n>r?n:r):l?(d=s?r:n,u=void 0):c&&(d=0,u=s?n:r),t.__text=t.__text.slice(d,u)}}return t}function wa(e){const t=e.getStyle(),n=Ca(t);Sa.set(t,n)}function ka(e){const t=e.anchor.getNode(),n=Ji(t)?t:t.getParentOrThrow(),r=wo().getElementByKey(n.getKey());if(null===r)return!1;const i=r.ownerDocument.defaultView;return null!==i&&"vertical-rl"===i.getComputedStyle(r).writingMode}function Na(e,t){const n=ka(e)?!t:t,r=ca(e.focus,n?"previous":"next");if(ba(r))return!1;for(const e of ta(r)){if(Ko(e))return!e.origin.isInline();if(!$i(e.origin)){if(Hi(e.origin))return!0;break}}return!1}function Aa(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(Ji(t)?t:t.getParentOrThrow()).getDirection()}(e);let i;i=ka(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}const La="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Fa=La&&"documentMode"in document?document.documentMode:null;function Oa(...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 Pa(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Ia(e,...t){const n=Oa(...t);n.length>0&&e.classList.add(...n)}function Ma(e,...t){const n=Oa(...t);n.length>0&&e.classList.remove(...n)}function Da(e){return e?e.getAdjacentCaret():null}function Ra(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function Ba(e){const t=za(e,(e=>$i(e)&&!e.isInline()));return $i(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}La&&"InputEvent"in window&&!Fa&&new window.InputEvent("input");const za=(e,t)=>{let n=e;for(;n!==Is()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function Ua(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function $a(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 Wa(e){let t=e.getParent();dl(t)||$a(40);let n=t;for(;null!==n;)n=n.getParent(),dl(n)&&(t=n);return t}function Ka(e){let t=[];const n=e.getChildren().filter(il);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();dl(i)?t=t.concat(Ka(i)):t.push(r)}return t}function Ha(e){return il(e)&&dl(e.getFirstChild())}function ja(e){return rl().append(e)}function Ja(e,t){return il(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function Va(e){const t=ii();if(null!==t){let n=t.getNodes();if($r(t)){const r=t.getStartEndPoints();null===r&&$a(143);const[i]=r,s=i.getNode(),o=s.getParent();if(ho(s)){const e=s.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=ss();s.append(e),n=e.select().getNodes()}}else if(Ja(s,n)){const t=ul(e);if(ho(o)){s.replace(t);const e=rl();$i(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(il(s)){const e=s.getParentOrThrow();Ga(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if($i(i)&&i.isEmpty()&&!il(i)&&!r.has(i.getKey())){qa(i,e);continue}let s=Cs(i)?i.getParent():il(i)&&i.isEmpty()?i:null;for(;null!=s;){const t=s.getKey();if(dl(s)){if(!r.has(t)){const n=ul(e);Ga(n,s.getChildren()),s.replace(n),r.add(t)}break}{const n=s.getParent();if(ho(n)&&!r.has(t)){r.add(t),qa(s,e);break}s=n}}}}}function Ga(e,t){e.splice(e.getChildrenSize(),0,t)}function qa(e,t){if(dl(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=rl();let s;if(Ga(i,e.getChildren()),dl(n)&&t===n.getListType())n.append(i),dl(r)&&t===r.getListType()&&(Ga(n,r.getChildren()),r.remove()),s=n;else if(dl(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const n=ul(t);n.append(i),e.replace(n),s=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),s}function Ya(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Ha(n)&&Ha(r)&&(Ya(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Za(e){const t=new Set;if(Ha(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Ha(r)&&Ha(i)){const n=i.getFirstChild();if(dl(n)){n.append(e);const i=r.getFirstChild();dl(i)&&(Ga(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Ha(r)){const t=r.getFirstChild();if(dl(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(Ha(i)){const t=i.getFirstChild();dl(t)&&t.append(e)}else if(dl(n)){const t=rl().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=ul(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 Xa(e){if(Ha(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(dl(n?n.getParent():void 0)&&il(n)&&dl(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=rl(),s=ul(r);i.append(s),e.getPreviousSiblings().forEach((e=>s.append(e)));const o=rl(),a=ul(r);o.append(a),Ga(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function Qa(...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 el=class e extends Ui{static getType(){return"listitem"}static clone(t){return new e(t.__value,t.__checked,t.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){const r=this.getParent();dl(r)&&"check"===r.getListType()&&function(e,t,n){dl(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(...Qa(o)),s){const e=n.getParent(),t=dl(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=Qa(a);n.getChildren().some((e=>dl(e)))?r.push(...e):i.push(...e)}i.length>0&&Ma(e,...i),r.length>0&&Ia(e,...r)}(t,n.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(""===s?t.removeAttribute("style"):t.style.cssText=s),function(e,t,n){const r=Ta(t.__textStyle);for(const t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(const t in Ta(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}static transform(){return e=>{if(il(e)||$a(144),null==e.__checked)return;const t=e.getParent();dl(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:tl,priority:0})}}static importJSON(e){return rl().updateFromJSON(e)}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($i(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(il(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!dl(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=ul(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&&($i(e)||$a(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(dl(n)||$a(39),il(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=ul(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&&Ha(t)&&Ha(n)&&(Ya(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=rl().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=ss();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=il(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 dl(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(;il(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&$a(117),(e=Math.floor(e))>=0||$a(199);let t=this.getIndent();for(;t!==e;)t<e?(Za(this),t++):(Xa(this),t--);return this}canInsertAfter(e){return il(e)}canReplaceWith(e){return il(e)}canMergeWith(e){return il(e)||os(e)}extractWithChild(e,t){if(!$r(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 ul("bullet")}canMergeWhenEmpty(){return!0}};function tl(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return nl(t);const t=e.getAttribute("aria-checked");return{node:rl("true"===t||"false"!==t&&void 0)}}function nl(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:rl(e.hasAttribute("checked"))}}function rl(e){return go(new el(void 0,e))}function il(e){return e instanceof el}let sl=class e extends Ui{static getType(){return"list"}static clone(t){const n=t.__listType||cl[t.__tag];return new e(n,t.__start,t.__key)}constructor(e="number",t=1,n){super(n);const r=cl[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__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,ol(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(ol(t,n.theme,this),!1)}static transform(){return e=>{dl(e)||$a(163),function(e){const t=e.getNextSibling();dl(t)&&e.getListType()===t.getListType()&&Ya(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())il(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),dl(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:ll,priority:0}),ul:()=>({conversion:ll,priority:0})}}static importJSON(e){return ul().updateFromJSON(e)}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];il(t)||(r===n&&(r=[...n]),r[e]=rl().append(!$i(t)||dl(t)||t.isInline()?t:Lr(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return il(e)}};function ol(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(il(n)){const e=n.getParent();if(dl(e)){t++,n=e.getParent();continue}$a(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(...Qa(a));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(void 0!==c){const e=Qa(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&Ma(e,...i),r.length>0&&Ia(e,...r)}function al(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(il(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{dl(e)&&t.push(ja(e))}))}else t.push(ja(r))}return t}function ll(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=ul("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(bo(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?ul("check"):ul("bullet")),{after:al,node:n}}const cl={ol:"number",ul:"bullet"};function ul(e="number",t=1){return go(new sl(e,t))}function dl(e){return e instanceof sl}const hl=$t("INSERT_UNORDERED_LIST_COMMAND"),gl=$t("INSERT_ORDERED_LIST_COMMAND"),fl=$t("REMOVE_LIST_COMMAND");function pl(e){return Pa(e.registerCommand(gl,(()=>(Va("number"),!0)),1),e.registerCommand(hl,(()=>(Va("bullet"),!0)),1),e.registerCommand(fl,(()=>(function(){const e=ii();if($r(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Ja(r,n))t.add(Wa(r));else for(let e=0;e<n.length;e++){const r=n[e];if(Cs(r)){const e=Ra(r,el);null!=e&&t.add(Wa(e))}}for(const n of t){let t=n;const r=Ka(n);for(const n of r){const r=ss().setTextStyle(e.style).setTextFormat(e.format);Ga(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&ua(e.anchor,_a(Zo(r,"next"))),n.__key===e.focus.key&&ua(e.focus,_a(Zo(r,"next"))),n.remove()}n.remove()}}}(),!0)),1),e.registerCommand(Vt,(()=>function(){const e=ii();if(!$r(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!il(t)||0!==t.getChildrenSize())return!1;const n=Wa(t),r=t.getParent();dl(r)||$a(40);const i=r.getParent();let s;if(ho(i))s=ss(),n.insertAfter(s);else{if(!il(i))return!1;s=rl(),i.insertAfter(s)}s.setTextStyle(e.style).setTextFormat(e.format).select();const o=t.getNextSiblings();if(o.length>0){const e=ul(r.getListType());if(il(s)){const t=rl();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||!il(e)&&!dl(e))break;t=e}t.remove()}(t),!0}()),1),e.registerNodeTransform(el,(e=>{const t=e.getFirstChild();if(t){if(Fr(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=ii();$r(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(vr,(e=>{const t=e.getParent();if(il(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function ml(e,t){const n=t.body?t.body.childNodes:[];let r=[];const i=[];for(let t=0;t<n.length;t++){const s=n[t];if(!bl.has(s.nodeName)){const t=xl(s,e,i,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof ns&&t.insertAfter(hr());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(i),r}function yl(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=Is().getChildren();for(let i=0;i<r.length;i++)_l(e,r[i],n,t);return n.innerHTML}function _l(e,t,n,r=null){let i=null===r||t.isSelected(r);const s=$i(t)&&t.excludeFromCopy("html");let o=t;if(null!==r){let e=Lo(t);e=Fr(e)&&null!==r?Ea(r,e):e,o=e}const a=$i(o)?o.getChildren():[],l=e._nodes.get(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=_l(e,s,h,r);!i&&$i(t)&&o&&t.extractWithChild(s,r,"html")&&(i=!0)}if(i&&!s){if((bo(u)||vo(u))&&u.append(h),n.append(u),d){const e=d.call(o,u);e&&(vo(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return i}const bl=new Set(["STYLE","SCRIPT"]);function xl(e,t,n,r,i=new Map,s){let o=[];if(bl.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||!ho(a))&&(null!=a&&Qr(a)||r);for(let e=0;e<d.length;e++)h.push(...xl(d[e],t,n,g,new Map(i),a));return null!=u&&(h=u(h)),Co(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(Qr(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(s.push(o),e===t.length-1||e<t.length-1&&Qr(t[e+1])){const e=n();e.setFormat(r),e.append(...s),i.push(e),s=[]}}return i}(e,h,g?()=>{const e=new ns;return n.push(e),e}:ss)),null==a?h.length>0?o=o.concat(h):Co(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(So(e.nextSibling)&&So(e.previousSibling))}(e)&&(o=o.concat(hr())):$i(a)&&a.append(...h),o}function vl(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 Sl(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 Cl(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=Li(e[n]);Fr(r)&&wa(r),t.push(r)}return t}(e.nodes),t)}catch(e){}const i=e.getData("text/html"),s=e.getData("text/plain");if(i&&s!==i)try{return Cl(n,ml(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){}const o=s||e.getData("text/uri-list");if(null!=o)if($r(t)){const e=o.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=ii();if($r(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([Ir()]):n.insertText(r)}}}else t.insertRawText(o)}function Cl(e,t,n){e.dispatchCommand(Kt,{nodes:t,selection:n})||n.insertNodes(t)}function Tl(e,t,n,r=[]){let i=null===t||n.isSelected(t);const s=$i(n)&&n.excludeFromCopy("html");let o=n;if(null!==t){let e=Lo(n);e=Fr(e)&&null!==t?Ea(t,e):e,o=e}const a=$i(o)?o.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&vl(58,n.name),$i(e)){const e=t.children;Array.isArray(e)||vl(59,n.name)}return t}(o);if(Fr(o)){const e=o.__text;e.length>0?l.text=e:i=!1}for(let r=0;r<a.length;r++){const s=a[r],o=Tl(e,t,s,l.children);!i&&$i(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 El=null;async function wl(e,t,n){if(null!==El)return!1;if(null!==t)return new Promise(((r,i)=>{e.update((()=>{r(kl(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,s=window.document,o=yo(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 i=e.registerCommand(Tn,(r=>(Ua(r,ClipboardEvent)&&(i(),null!==El&&(window.clearTimeout(El),El=null),t(kl(e,r,n))),!0)),4);El=window.setTimeout((()=>{i(),El=null,t(!1)}),50),s.execCommand("copy"),a.remove()}))}function kl(e,t,n){if(void 0===n){const t=yo(e._window);if(!t)return!1;const r=t.anchorNode,i=t.focusNode;if(null!==r&&null!==i&&!fs(e,r,i))return!1;const s=ii();if(null===s)return!1;n=function(e=ii()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=wo();for(const[r,i]of Nl){const s=i(n,e);null!==s&&(t[r]=s)}}return t}(s)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const Nl=[["text/html",function(e,t=ii()){return null==t&&vl(166),$r(t)&&t.isCollapsed()||0===t.getNodes().length?"":yl(e,t)}],["application/x-lexical-editor",function(e,t=ii()){return null==t&&vl(166),$r(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=Is().getChildren();for(let i=0;i<r.length;i++)Tl(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function Al(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 Ll="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Fl=Ll&&"documentMode"in document?document.documentMode:null,Ol=!(!Ll||!("InputEvent"in window)||Fl)&&"getTargetRanges"in new window.InputEvent("input"),Pl=Ll&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Il=Ll&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ml=Ll&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dl=Ll&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ml,Rl=$t("DRAG_DROP_PASTE_FILE");class Bl extends Ui{static getType(){return"quote"}static clone(e){return new Bl(e.__key)}createDOM(e){const t=document.createElement("blockquote");return Ia(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Hl,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 zl().updateFromJSON(e)}insertNewAfter(e,t){const n=ss(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=ss();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function zl(){return go(new Bl)}function Ul(e){return e instanceof Bl}let $l=class e extends Ui{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){Ia(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Kl,priority:0}),h2:e=>({conversion:Kl,priority:0}),h3:e=>({conversion:Kl,priority:0}),h4:e=>({conversion:Kl,priority:0}),h5:e=>({conversion:Kl,priority:0}),h6:e=>({conversion:Kl,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Wl(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Wl(e)?{conversion:e=>({node:jl("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 jl(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?ss():jl(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=ss();e.select(),this.replace(e,!0)}return i}collapseAtStart(){const e=this.isEmpty()?ss():jl(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function Wl(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Kl(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=jl(t),null!==e.style&&(Fo(e,n),n.setFormat(e.style.textAlign))),{node:n}}function Hl(e){const t=zl();return null!==e.style&&(t.setFormat(e.style.textAlign),Fo(e,t)),{node:t}}function jl(e="h1"){return go(new $l(e))}function Jl(e){return e instanceof $l}function Vl(e){let t=null;if(Ua(e,DragEvent)?t=e.dataTransfer:Ua(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 Gl(e){const t=ii();if(!$r(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=za(i,(e=>$i(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 ql(e){return Hi(Fs(e))}function Yl(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Zl(e){return Pa(e.registerCommand(Ht,(e=>{const t=ii();return!!Kr(t)&&(t.clear(),!0)}),0),e.registerCommand(jt,(e=>{const t=ii();return $r(t)?(t.deleteCharacter(e),!0):!!Kr(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(Zt,(e=>{const t=ii();return!!$r(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(Xt,(e=>{const t=ii();return!!$r(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Gt,(t=>{const n=ii();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)Sl(r,n,e);else if($r(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(Yt,(()=>{const e=ii();return!!$r(e)&&(e.removeText(),!0)}),0),e.registerCommand(Qt,(e=>{const t=ii();return!!$r(t)&&(t.formatText(e),!0)}),0),e.registerCommand(xn,(e=>{const t=ii();if(!$r(t)&&!Kr(t))return!1;const n=t.getNodes();for(const t of n){const n=za(t,(e=>$i(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(Jt,(e=>{const t=ii();return!!$r(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Vt,(()=>{const e=ii();return!!$r(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(mn,(()=>(di([Ir()]),!0)),0),e.registerCommand(yn,(()=>Gl((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(_n,(()=>Gl((e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(ln,(e=>{const t=ii();if(Kr(t)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if($r(t)){const n=eo(t.focus,!0);if(!e.shiftKey&&Hi(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(cn,(e=>{const t=ii();if(Kr(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if($r(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===Is().getChildrenSize()}(t))return e.preventDefault(),!0;const n=eo(t.focus,!1);if(!e.shiftKey&&Hi(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(on,(e=>{const t=ii();if(Kr(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!$r(t))return!1;if(Na(t,!0)){const n=e.shiftKey;return e.preventDefault(),Aa(t,n,!0),!0}return!1}),0),e.registerCommand(rn,(e=>{const t=ii();if(Kr(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!$r(t))return!1;const n=e.shiftKey;return!!Na(t,!1)&&(e.preventDefault(),Aa(t,n,!1),!0)}),0),e.registerCommand(hn,(t=>{if(ql(t.target))return!1;const n=ii();if($r(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(Ji(n))return!1;const r=Ba(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(_n,void 0);if(Il&&"ko-KR"===navigator.language)return!1}else if(!Kr(n))return!1;return t.preventDefault(),e.dispatchCommand(jt,!0)}),0),e.registerCommand(fn,(t=>{if(ql(t.target))return!1;const n=ii();return!(!$r(n)&&!Kr(n))&&(t.preventDefault(),e.dispatchCommand(jt,!1))}),0),e.registerCommand(un,(t=>{const n=ii();if(!$r(n))return!1;if(Yl(n),null!==t){if((Il||Pl||Dl)&&Ol)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Jt,!1)}return e.dispatchCommand(Vt,void 0)}),0),e.registerCommand(gn,(()=>!!$r(ii())&&(e.blur(),!0)),0),e.registerCommand(bn,(t=>{const[,n]=Vl(t);if(n.length>0){const r=Al(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,s=Fs(i);if(null!==s){const e=ti();if(Fr(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")}Ds(it(e))}e.dispatchCommand(Rl,n)}return t.preventDefault(),!0}return!!$r(ii())}),0),e.registerCommand(vn,(e=>{const[t]=Vl(e),n=ii();return!(t&&!$r(n))}),0),e.registerCommand(Sn,(e=>{const[t]=Vl(e),n=ii();if(t&&!$r(n))return!1;const r=Al(e.clientX,e.clientY);if(null!==r){Hi(Fs(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(wn,(()=>(function(e){const t=Is();if($r(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"),it(e),e}{const e=t.select(0,t.getChildrenSize());Ds(it(e))}}(),!0)),0),e.registerCommand(Tn,(t=>(wl(e,Ua(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(En,(t=>(async function(e,t){await wl(t,Ua(e,ClipboardEvent)?e:null),t.update((()=>{const e=ii();$r(e)?e.removeText():Kr(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(qt,(t=>{const[,n,r]=Vl(t);return n.length>0&&!r?(e.dispatchCommand(Rl,n),!0):(!xo(t.target)||!gs(t.target))&&(null!==ii()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=ii(),r=Ua(e,InputEvent)||Ua(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&Sl(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(dn,(e=>{const t=ii();return $r(t)&&Yl(t),!1}),0),e.registerCommand(pn,(e=>{const t=ii();return $r(t)&&Yl(t),!1}),0))}var Xl=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,"&amp;").replace(/</g,"&lt;").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 f=0;f<g.length;++f){if(d&&d.cause==h+","+f)return;var p=g[f],m=p.inside,y=!!p.lookbehind,_=!!p.greedy,b=p.alias;if(_&&!p.pattern.global){var x=p.pattern.toString().match(/[imsuy]*$/)[0];p.pattern=RegExp(p.pattern.source,x+"g")}for(var v=p.pattern||p,S=r.next,C=l;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var T=S.value;if(t.length>e.length)return;if(!(T instanceof s)){var E,w=1;if(_){if(!(E=o(v,C,e,y))||E.index>=e.length)break;var k=E.index,N=E.index+E[0].length,A=C;for(A+=S.value.length;k>=A;)A+=(S=S.next).value.length;if(C=A-=S.value.length,S.value instanceof s)continue;for(var L=S;L!==t.tail&&(A<N||"string"==typeof L.value);L=L.next)w++,A+=L.value.length;w--,T=e.slice(C,A),E.index-=C}else if(!(E=o(v,0,T,y)))continue;k=E.index;var F=E[0],O=T.slice(0,k),P=T.slice(k+F.length),I=C+T.length;d&&I>d.reach&&(d.reach=I);var M=S.prev;if(O&&(M=c(t,M,O),C+=O.length),u(t,M,w),S=c(t,M,new s(h,m?i.tokenize(F,m):F,b,F)),P&&c(t,S,P),w>1){var D={cause:h+","+f,reach:I};a(e,t,n,S.prev,C,D),d&&D.reach>d.reach&&(d.reach=D.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,"&quot;")+'"';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.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/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,n){return e.apply(t,n)}),u||(u=function(e,t){return new e(...t)});const d=C(Array.prototype.forEach),h=C(Array.prototype.lastIndexOf),g=C(Array.prototype.pop),p=C(Array.prototype.push),f=C(Array.prototype.splice),m=C(String.prototype.toLowerCase),y=C(String.prototype.toString),_=C(String.prototype.match),b=C(String.prototype.replace),x=C(String.prototype.indexOf),k=C(String.prototype.trim),S=C(Object.prototype.hasOwnProperty),v=C(RegExp.prototype.test),w=(T=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(T,t)});var T;function C(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++){S(e,t)||(e[t]=null)}return e}function A(e){const n=l(null);for(const[r,i]of t(e)){S(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 C(n.get);if("function"==typeof n.value)return C(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","section","select","shadow","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","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","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","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),K=a(/<%[\w\W]*|[\w\W]*%>/gm),H=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),G=a(/^(?:\w+script|data):/i),V=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:V,CUSTOM_ELEMENT:Y,DATA_ATTR:j,DOCTYPE_NAME:Z,ERB_EXPR:K,IS_ALLOWED_URI:J,IS_SCRIPT_OR_DATA:G,MUSTACHE_EXPR:W,TMPLIT_EXPR:H});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.2.6",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:T,Element:C,NodeFilter:N,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:K,DOMParser:H,trustedTypes:j}=n,q=C.prototype,G=L(q,"cloneNode"),V=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:Se}=X;let{IS_ALLOWED_URI:ve}=X,we=null;const Te=E({},[...P,...F,...O,...R,...D]);let Ce=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,Pe=!0,Fe=!0,Oe=!1,Ie=!0,Re=!1,Me=!0,De=!1,ze=!1,Be=!1,$e=!1,Ue=!1,We=!1,Ke=!0,He=!1,je=!0,qe=!1,Je={},Ge=null;const Ve=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 Ze=null;const Ye=E({},["audio","video","img","source","image","track"]);let Xe=null;const Qe=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let rt=nt,it=!1,st=null;const ot=E({},[et,tt,nt],y);let at=E({},["mi","mo","mn","ms","mtext"]),lt=E({},["annotation-xml"]);const ct=E({},["title","style","font","a","script"]);let ut=null;const dt=["application/xhtml+xml","text/html"];let ht=null,gt=null;const pt=i.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!gt||gt!==e){if(e&&"object"==typeof e||(e={}),e=A(e),ut=-1===dt.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ht="application/xhtml+xml"===ut?y:m,we=S(e,"ALLOWED_TAGS")?E({},e.ALLOWED_TAGS,ht):Te,Ce=S(e,"ALLOWED_ATTR")?E({},e.ALLOWED_ATTR,ht):Ee,st=S(e,"ALLOWED_NAMESPACES")?E({},e.ALLOWED_NAMESPACES,y):ot,Xe=S(e,"ADD_URI_SAFE_ATTR")?E(A(Qe),e.ADD_URI_SAFE_ATTR,ht):Qe,Ze=S(e,"ADD_DATA_URI_TAGS")?E(A(Ye),e.ADD_DATA_URI_TAGS,ht):Ye,Ge=S(e,"FORBID_CONTENTS")?E({},e.FORBID_CONTENTS,ht):Ve,Ae=S(e,"FORBID_TAGS")?E({},e.FORBID_TAGS,ht):A({}),Le=S(e,"FORBID_ATTR")?E({},e.FORBID_ATTR,ht):A({}),Je=!!S(e,"USE_PROFILES")&&e.USE_PROFILES,Pe=!1!==e.ALLOW_ARIA_ATTR,Fe=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Re=e.SAFE_FOR_TEMPLATES||!1,Me=!1!==e.SAFE_FOR_XML,De=e.WHOLE_DOCUMENT||!1,$e=e.RETURN_DOM||!1,Ue=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,Ke=!1!==e.SANITIZE_DOM,He=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,qe=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||J,rt=e.NAMESPACE||nt,at=e.MATHML_TEXT_INTEGRATION_POINTS||at,lt=e.HTML_INTEGRATION_POINTS||lt,Ne=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ft(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ne.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ft(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),Re&&(Fe=!1),Ue&&($e=!0),Je&&(we=E({},D),Ce=[],!0===Je.html&&(E(we,P),E(Ce,z)),!0===Je.svg&&(E(we,F),E(Ce,B),E(Ce,U)),!0===Je.svgFilters&&(E(we,O),E(Ce,B),E(Ce,U)),!0===Je.mathMl&&(E(we,R),E(Ce,$),E(Ce,U))),e.ADD_TAGS&&(we===Te&&(we=A(we)),E(we,e.ADD_TAGS,ht)),e.ADD_ATTR&&(Ce===Ee&&(Ce=A(Ce)),E(Ce,e.ADD_ATTR,ht)),e.ADD_URI_SAFE_ATTR&&E(Xe,e.ADD_URI_SAFE_ATTR,ht),e.FORBID_CONTENTS&&(Ge===Ve&&(Ge=A(Ge)),E(Ge,e.FORBID_CONTENTS,ht)),je&&(we["#text"]=!0),De&&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),gt=e}},yt=E({},[...F,...O,...I]),_t=E({},[...R,...M]),bt=function(e){p(r.removed,{element:e});try{oe(e).removeChild(e)}catch(t){V(e)}},xt=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($e||Ue)try{bt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},kt=function(e){let t=null,n=null;if(Be)e="<remove></remove>"+e;else{const t=_(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ut&&rt===nt&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=ae?ae.createHTML(e):e;if(rt===nt)try{t=(new H).parseFromString(r,ut)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(rt,"template",null);try{t.documentElement.innerHTML=it?le:r}catch(e){}}const s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),rt===nt?he.call(t,De?"html":"body")[0]:De?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)},vt=function(e){return e instanceof K&&("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)},wt=function(e){return"function"==typeof T&&e instanceof T};function Tt(e,t,n){d(e,(e=>{e.call(r,t,n,gt)}))}const Ct=function(e){let t=null;if(Tt(pe.beforeSanitizeElements,e,null),vt(e))return bt(e),!0;const n=ht(e.nodeName);if(Tt(pe.uponSanitizeElement,e,{tagName:n,allowedTags:we}),Me&&e.hasChildNodes()&&!wt(e.firstElementChild)&&v(/<[/\w!]/g,e.innerHTML)&&v(/<[/\w!]/g,e.textContent))return bt(e),!0;if(e.nodeType===te)return bt(e),!0;if(Me&&e.nodeType===ne&&v(/<[/\w]/g,e.data))return bt(e),!0;if(!we[n]||Ae[n]){if(!Ae[n]&&Nt(n)){if(Ne.tagNameCheck instanceof RegExp&&v(Ne.tagNameCheck,n))return!1;if(Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))return!1}if(je&&!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=G(n[r],!0);i.__removalCount=(e.__removalCount||0)+1,t.insertBefore(i,Y(e))}}}return bt(e),!0}return e instanceof C&&!function(e){let t=oe(e);t&&t.tagName||(t={namespaceURI:rt,tagName:"template"});const n=m(e.tagName),r=m(t.tagName);return!!st[e.namespaceURI]&&(e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(yt[n]):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&lt[r]:Boolean(_t[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!lt[r])&&!(t.namespaceURI===et&&!at[r])&&!_t[n]&&(ct[n]||!yt[n]):!("application/xhtml+xml"!==ut||!st[e.namespaceURI]))}(e)?(bt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!v(/<\/no(script|embed|frames)/i,e.innerHTML)?(Re&&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):(bt(e),!0)},Et=function(e,t,n){if(Ke&&("id"===t||"name"===t)&&(n in i||n in pt))return!1;if(Fe&&!Le[t]&&v(_e,t));else if(Pe&&v(be,t));else if(!Ce[t]||Le[t]){if(!(Nt(e)&&(Ne.tagNameCheck instanceof RegExp&&v(Ne.tagNameCheck,e)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(e))&&(Ne.attributeNameCheck instanceof RegExp&&v(Ne.attributeNameCheck,t)||Ne.attributeNameCheck instanceof Function&&Ne.attributeNameCheck(t))||"is"===t&&Ne.allowCustomizedBuiltInElements&&(Ne.tagNameCheck instanceof RegExp&&v(Ne.tagNameCheck,n)||Ne.tagNameCheck instanceof Function&&Ne.tagNameCheck(n))))return!1}else if(Xe[t]);else if(v(ve,b(n,ke,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Ze[e]){if(Oe&&!v(xe,b(n,ke,"")));else if(n)return!1}else;return!0},Nt=function(e){return"annotation-xml"!==e&&_(e,Se)},At=function(e){Tt(pe.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||vt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce,forceKeepAttr:void 0};let i=t.length;for(;i--;){const s=t[i],{name:o,namespaceURI:a,value:l}=s,c=ht(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,!He||"id"!==c&&"name"!==c||(xt(o,e),h="user-content-"+h),Me&&v(/((--!?|])>)|<\/(style|title)/i,h)){xt(o,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){xt(o,e);continue}if(!Ie&&v(/\/>/i,h)){xt(o,e);continue}Re&&d([fe,me,ye],(e=>{h=b(h,e," ")}));const p=ht(e.nodeName);if(Et(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),vt(e)?bt(e):g(r.removed)}catch(t){xt(o,e)}}else xt(o,e)}Tt(pe.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const r=St(t);for(Tt(pe.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)Tt(pe.uponSanitizeShadowNode,n,null),Ct(n),At(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(it=!e,it&&(e="\x3c!--\x3e"),"string"!=typeof e&&!wt(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(ze||mt(t),r.removed=[],"string"==typeof e&&(qe=!1),qe){if(e.nodeName){const t=ht(e.nodeName);if(!we[t]||Ae[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof T)n=kt("\x3c!----\x3e"),i=n.ownerDocument.importNode(e,!0),i.nodeType===Q&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!$e&&!Re&&!De&&-1===e.indexOf("<"))return ae&&We?ae.createHTML(e):e;if(n=kt(e),!n)return $e?null:We?le:""}n&&Be&&bt(n.firstChild);const l=St(qe?e:n);for(;o=l.nextNode();)Ct(o),At(o),o.content instanceof c&&Lt(o.content);if(qe)return e;if($e){if(Ue)for(a=de.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(Ce.shadowroot||Ce.shadowrootmode)&&(a=ge.call(s,a,!0)),a}let u=De?n.outerHTML:n.innerHTML;return De&&we["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&v(Z,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Re&&d([fe,me,ye],(e=>{u=b(u,e," ")})),ae&&We?ae.createHTML(u):u},r.setConfig=function(){mt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ze=!0},r.clearConfig=function(){gt=null,ze=!1},r.isValidAttribute=function(e,t,n){gt||mt({});const r=ht(e),i=ht(t);return Et(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.`)}se.addHook("uponSanitizeElement",((e,t)=>{"strong"!==t.tagName&&"em"!==t.tagName||e.removeAttribute("class")}));const ae="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,le=ae&&"documentMode"in document?document.documentMode:null,ce=ae&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ue=ae&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),de=!(!ae||!("InputEvent"in window)||le)&&"getTargetRanges"in new window.InputEvent("input"),he=ae&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ge=ae&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,pe=ae&&/Android/.test(navigator.userAgent),fe=ae&&/^(?=.*Chrome).*/i.test(navigator.userAgent),me=ae&&pe&&fe,ye=ae&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!fe;function _e(...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 be=0,xe=1,ke=2,Se=1,ve=2,we=3,Te=4,Ce=5,Ee=6,Ne=he||ge||ye?" ":"​",Ae="\n\n",Le=ue?" ":Ne,Pe="֑-߿יִ-﷽ﹰ-ﻼ",Fe="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Oe=new RegExp("^[^"+Fe+"]*["+Pe+"]"),Ie=new RegExp("^[^"+Pe+"]*["+Fe+"]"),Re={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Me={directionless:1,unmergeable:2},De={center:2,end:6,justify:4,left:1,right:3,start:5},ze={[ve]:"center",[Ee]:"end",[Te]:"justify",[Se]:"left",[we]:"right",[Ce]:"start"},Be={normal:0,segmented:2,token:1},$e={[be]:"normal",[ke]:"segmented",[xe]:"token"},Ue="$";function We(e,t,n,r,i,s){let o=e.getFirstChild();for(;null!==o;){const e=o.__key;o.__parent===t&&(Ui(o)&&We(o,e,n,r,i,s),n.has(e)||s.delete(e),i.push(e)),o=o.getNextSibling()}}let Ke=!1,He=0;function je(e){He=e.timeStamp}function qe(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Ls(e,n)}function Je(e,t,n){const r=yo(uo(n));let i=null,s=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,s=r.focusOffset);const o=e.nodeValue;null!==o&&Hs(t,o,i,s,!1)}function Ge(e,t,n){if(Ur(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return xs(t)&&n.isAttached()}function Ve(e,t,n,r){for(let i=e;i&&!Fo(i);i=so(i)){const e=Ls(i,t);if(void 0!==e){const t=Ns(e,n);if(t)return Hi(t)||!bo(i)?void 0:[i,t]}else if(i===r)return[r,Rs(n)]}}function Ze(e,t,n){Ke=!0;const r=performance.now()-He>100;try{Di(e,(()=>{const i=ii()||function(e){return e.getEditorState().read((()=>{const e=ii();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=Ve(g,e,a,o);if(!p)continue;const[f,m]=p;if("characterData"===h)r&&Pr(m)&&xs(g)&&Ge(i,g,m)&&Je(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=As(r),s=r.parentNode;if(null!=s&&r!==l&&null===i&&!qe(r,s,e)){if(ue){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];(qe(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||qe(n,i,e)||s.removeChild(n)}}n.takeRecords()}null!==i&&(c&&Ms(i),ue&&to(e)&&i.insertRawText(u))}))}finally{Ke=!1}}function Ye(e){const t=e._observer;null!==t&&Ze(e,t.takeRecords(),t)}function Xe(e){!function(e){0===He&&uo(e).addEventListener("textInput",je,!0)}(e),e._observer=new MutationObserver(((t,n)=>{Ze(e,t,n)}))}let Qe=class e{constructor(e,t=new Map,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedConfigMap=t,this.unknownState=n,this.knownState=r;const s=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}(t,n,r);this.size=s}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.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};for(const[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);return et(e)?{[Ue]:e}:{}}getWritable(t){if(this.node===t)return this;const n=new Map(this.knownState),r=et(i=this.unknownState)&&{...i};var i;if(r)for(const e of n.keys())delete r[e.key];return new e(t,this.sharedConfigMap,et(r),n,this.size)}updateFromKnown(e,t){const n=e.key;this.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||this.size++,r.set(e,t)}updateFromUnknown(e,t){const n=this.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={},e)for(const[t,n]of Object.entries(e))this.updateFromUnknown(t,n);this.unknownState=et(this.unknownState)}};function et(e){if(e)for(const t in e)return e}function tt(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,r=(e,t)=>{for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const e=t?t.getValue(r):r.defaultValue;if(e!==i&&!r.isEqual(e,i))return!0}return!1},i=(e,t)=>{const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r)for(const[e,t]of Object.entries(r))if(!n.has(e)&&(n.add(e),t!==(i?i[e]:void 0)))return!0;return!1};return!(e&&r(e,t)||t&&r(t,e)||e&&i(e,t)||t&&i(t,e))}(l,c))}function nt(e,t){const n=e.mergeWithSibling(t),r=Ti()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function rt(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Pr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(tt(t,r)){r=nt(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Pr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(tt(r,n)){r=nt(r,n);break}break}n.remove()}}else r.remove()}function it(e){return st(e.anchor),st(e.focus),e}function st(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),Pr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!Ui(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let ot,at,lt,ct,ut,dt,ht,gt,pt,ft,mt="",yt="",_t=null,bt="",xt="",kt=!1,St=!1,vt=null;function wt(e,t){const n=ht.get(e);if(null!==t){const n=$t(e);n.parentNode===t&&t.removeChild(n)}if(gt.has(e)||at._keyToDOMMap.delete(e),Ui(n)){const e=Mt(n,ht);Tt(e,0,e.length-1,null)}void 0!==n&&Xs(ft,lt,ct,n,"destroyed")}function Tt(e,t,n,r){let i=t;for(;i<=n;++i){const t=e[i];void 0!==t&&wt(t,r)}}function Ct(e,t){e.setProperty("text-align",t)}const Et="40px";function Nt(e,t){const n=ot.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")||Et;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function At(e,t){const n=e.style;0===t?Ct(n,""):1===t?Ct(n,"left"):2===t?Ct(n,"center"):3===t?Ct(n,"right"):4===t?Ct(n,"justify"):5===t?Ct(n,"start"):6===t&&Ct(n,"end")}function Lt(e,t){const n=gt.get(e);void 0===n&&oe(60);const r=n.createDOM(ot,at);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,at),Pr(n)?r.setAttribute("data-lexical-text","true"):Hi(n)&&r.setAttribute("data-lexical-decorator","true"),Ui(n)){const e=n.__indent,t=n.__size;if(0!==e&&Nt(r,e),0!==t){const e=t-1;!function(e,t,n,r){const i=yt;yt="",Pt(e,n,0,t,n.getDOMSlot(r)),It(n,r),yt=i}(Mt(n,gt),e,n,r)}const i=n.__format;0!==i&&At(r,i),n.isInline()||Ot(null,n,r),ro(n)&&(mt+=Ae,xt+=Ae)}else{const t=n.getTextContent();if(Hi(n)){const t=n.decorate(at,ot);null!==t&&zt(e,t),r.contentEditable="false"}else Pr(n)&&(n.isDirectionless()||(yt+=t));mt+=t,xt+=t}return null!==t&&t.insertChild(r),Xs(ft,lt,ct,n,"created"),r}function Pt(e,t,n,r,i){const s=mt;mt="";let o=n;for(;o<=r;++o){Lt(e[o],i);const t=gt.get(e[o]);null!==t&&Pr(t)&&(null===_t&&(_t=t.getFormat()),""===bt&&(bt=t.getStyle()))}ro(t)&&(mt+=Ae),i.element.__lexicalTextContent=mt,mt=s+mt}function Ft(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return gr(e)?"line-break":Hi(e)&&e.isInline()?"decorator":null}return"empty"}return null}function Ot(e,t,n){const r=Ft(e,ht),i=Ft(t,gt);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function It(e,t){const n=t.__lexicalDirTextContent||"",r=t.__lexicalDir||"";if(n!==yt||r!==vt){const n=""===yt,i=n?vt:function(e){return Oe.test(e)?"rtl":Ie.test(e)?"ltr":null}(yt);if(i!==r){const s=t.classList,o=ot.theme;let a=null!==r?o[r]:void 0,l=null!==i?o[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=_e(a);a=o[r]=e}s.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=_e(l);l=o[i]=e}void 0!==l&&s.add(...l)}t.dir=i}St||(e.getWritable().__dir=i)}vt=i,t.__lexicalDirTextContent=yt,t.__lexicalDir=i}}function Rt(e,t,n){const r=yt;var i;yt="",_t=null,bt="",function(e,t,n){const r=mt,i=e.__size,s=t.__size;mt="";const o=n.element;if(1===i&&1===s){const n=e.__first,i=t.__first;if(n===i)Dt(n,o);else{const e=$t(n),t=Lt(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}wt(n,null)}const s=gt.get(i);Pr(s)&&(null===_t&&(_t=s.getFormat()),""===bt&&(bt=s.getStyle()))}else{const r=Mt(e,ht),a=Mt(t,gt);if(r.length!==i&&oe(227),a.length!==s&&oe(228),0===i)0!==s&&Pt(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;Tt(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=Bt(Dt(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=io(at,r);e===u?u=Bt(Dt(r,s.element)):(s.withBefore(u).insertChild(e),Dt(r,s.element)),d++,h++}else Lt(r,s.withBefore(u)),h++;else u=Bt($t(e)),wt(e,s.element),d++}const i=gt.get(r);null!==i&&Pr(i)&&(null===_t&&(_t=i.getFormat()),""===bt&&(bt=i.getStyle()))}const g=d>o,p=h>a;if(g&&!p){const t=n[a+1],r=void 0===t?null:at.getElementByKey(t);Pt(n,e,h,a,s.withBefore(r))}else p&&!g&&Tt(t,d,o,s.element)}(t,r,a,i,s,n)}ro(t)&&(mt+=Ae),o.__lexicalTextContent=mt,mt=r+mt}(e,t,t.getDOMSlot(n)),It(t,n),i=t,null==_t||_t===i.__textFormat||St||i.setTextFormat(_t),function(e){""===bt||bt===e.__textStyle||St||e.setTextStyle(bt)}(t),yt=r}function Mt(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 Dt(e,t){const n=ht.get(e);let r=gt.get(e);void 0!==n&&void 0!==r||oe(61);const i=kt||dt.has(e)||ut.has(e),s=io(at,e);if(n===r&&!i){if(Ui(n)){const e=s.__lexicalTextContent;void 0!==e&&(mt+=e,xt+=e);const t=s.__lexicalDirTextContent;void 0!==t&&(yt+=t)}else{const e=n.getTextContent();Pr(n)&&!n.isDirectionless()&&(yt+=e),xt+=e,mt+=e}return s}if(n!==r&&i&&Xs(ft,lt,ct,r,"updated"),r.updateDOM(n,s,ot)){const n=Lt(e,null);return null===t&&oe(62),t.replaceChild(n,s),wt(e,null),n}if(Ui(n)&&Ui(r)){const e=r.__indent;e!==n.__indent&&Nt(s,e);const t=r.__format;t!==n.__format&&At(s,t),i&&(Rt(n,r,s),qi(r)||r.isInline()||Ot(n,r,s)),ro(r)&&(mt+=Ae,xt+=Ae)}else{const t=r.getTextContent();if(Hi(r)){const t=r.decorate(at,ot);null!==t&&zt(e,t)}else Pr(r)&&!r.isDirectionless()&&(yt+=t);mt+=t,xt+=t}if(!St&&qi(r)&&r.__cachedText!==xt){const e=r.getWritable();e.__cachedText=xt,r=e}return s}function zt(e,t){let n=at._pendingDecorators;const r=at._decorators;if(null===n){if(r[e]===t)return;n=Fs(at)}n[e]=t}function Bt(e){let t=e.nextSibling;return null!==t&&t===at._blockCursorElement&&(t=t.nextSibling),t}function $t(e){const t=pt.get(e);return void 0===t&&oe(75,e),t}function Ut(e){return{type:e}}const Wt=Ut("SELECTION_CHANGE_COMMAND"),Kt=Ut("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ht=Ut("CLICK_COMMAND"),jt=Ut("DELETE_CHARACTER_COMMAND"),qt=Ut("INSERT_LINE_BREAK_COMMAND"),Jt=Ut("INSERT_PARAGRAPH_COMMAND"),Gt=Ut("CONTROLLED_TEXT_INSERTION_COMMAND"),Vt=Ut("PASTE_COMMAND"),Zt=Ut("REMOVE_TEXT_COMMAND"),Yt=Ut("DELETE_WORD_COMMAND"),Xt=Ut("DELETE_LINE_COMMAND"),Qt=Ut("FORMAT_TEXT_COMMAND"),en=Ut("UNDO_COMMAND"),tn=Ut("REDO_COMMAND"),nn=Ut("KEYDOWN_COMMAND"),rn=Ut("KEY_ARROW_RIGHT_COMMAND"),sn=Ut("MOVE_TO_END"),on=Ut("KEY_ARROW_LEFT_COMMAND"),an=Ut("MOVE_TO_START"),ln=Ut("KEY_ARROW_UP_COMMAND"),cn=Ut("KEY_ARROW_DOWN_COMMAND"),un=Ut("KEY_ENTER_COMMAND"),dn=Ut("KEY_SPACE_COMMAND"),hn=Ut("KEY_BACKSPACE_COMMAND"),gn=Ut("KEY_ESCAPE_COMMAND"),pn=Ut("KEY_DELETE_COMMAND"),fn=Ut("KEY_TAB_COMMAND"),mn=Ut("INSERT_TAB_COMMAND"),yn=Ut("INDENT_CONTENT_COMMAND"),_n=Ut("OUTDENT_CONTENT_COMMAND"),bn=Ut("DROP_COMMAND"),xn=Ut("FORMAT_ELEMENT_COMMAND"),kn=Ut("DRAGSTART_COMMAND"),Sn=Ut("DRAGOVER_COMMAND"),vn=Ut("DRAGEND_COMMAND"),wn=Ut("COPY_COMMAND"),Tn=Ut("CUT_COMMAND"),Cn=Ut("SELECT_ALL_COMMAND"),En=Ut("CLEAR_EDITOR_COMMAND"),Nn=Ut("CLEAR_HISTORY_COMMAND"),An=Ut("CAN_REDO_COMMAND"),Ln=Ut("CAN_UNDO_COMMAND"),Pn=Ut("FOCUS_COMMAND"),Fn=Ut("BLUR_COMMAND"),On=Ut("KEY_MODIFIER_COMMAND"),In=Object.freeze({}),Rn=[["keydown",function(e,t){if(!(Mn=e.timeStamp,Dn=e.key,t.isComposing()||no(t,nn,e)||null==e.key)){if(jn&&Vs(e))return Di(t,(()=>{tr(t,qn)})),jn=!1,void(qn="");if(function(e){return qs(e,"ArrowRight",{shiftKey:"any"})}(e))no(t,rn,e);else if(function(e){return qs(e,"ArrowRight",Js)}(e))no(t,sn,e);else if(function(e){return qs(e,"ArrowLeft",{shiftKey:"any"})}(e))no(t,on,e);else if(function(e){return qs(e,"ArrowLeft",Js)}(e))no(t,an,e);else if(function(e){return qs(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))no(t,ln,e);else if(function(e){return qs(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))no(t,cn,e);else if(function(e){return qs(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))Kn=!0,no(t,un,e);else if(function(e){return" "===e.key}(e))no(t,dn,e);else if(function(e){return ce&&qs(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),Kn=!0,no(t,qt,!0);else if(function(e){return qs(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))Kn=!1,no(t,un,e);else if(function(e){return qs(e,"Backspace",{shiftKey:"any"})||ce&&qs(e,"h",{ctrlKey:!0})}(e))Vs(e)?no(t,hn,e):(e.preventDefault(),no(t,jt,!0));else if(function(e){return"Escape"===e.key}(e))no(t,gn,e);else if(function(e){return qs(e,"Delete",{})||ce&&qs(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),no(t,jt,!1)):no(t,pn,e);else if(function(e){return qs(e,"Backspace",Gs)}(e))e.preventDefault(),no(t,Yt,!0);else if(function(e){return qs(e,"Delete",Gs)}(e))e.preventDefault(),no(t,Yt,!1);else if(function(e){return ce&&qs(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),no(t,Xt,!0);else if(function(e){return ce&&(qs(e,"Delete",{metaKey:!0})||qs(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),no(t,Xt,!1);else if(function(e){return qs(e,"b",Js)}(e))e.preventDefault(),no(t,Qt,"bold");else if(function(e){return qs(e,"u",Js)}(e))e.preventDefault(),no(t,Qt,"underline");else if(function(e){return qs(e,"i",Js)}(e))e.preventDefault(),no(t,Qt,"italic");else if(function(e){return qs(e,"Tab",{shiftKey:"any"})}(e))no(t,fn,e);else if(function(e){return qs(e,"z",Js)}(e))e.preventDefault(),no(t,en,void 0);else if(function(e){return ce?qs(e,"z",{metaKey:!0,shiftKey:!0}):qs(e,"y",{ctrlKey:!0})||qs(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),no(t,tn,void 0);else{const n=t._editorState._selection;null===n||Ur(n)?Zs(e)&&(e.preventDefault(),no(t,Cn,e)):function(e){return qs(e,"c",Js)}(e)?(e.preventDefault(),no(t,wn,e)):function(e){return qs(e,"x",Js)}(e)?(e.preventDefault(),no(t,Tn,e)):Zs(e)&&(e.preventDefault(),no(t,Cn,e))}(function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey})(e)&&no(t,On,e)}}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;xo(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&Di(t,(()=>{hs(n)||(Wn=!0)}))}],["compositionstart",function(e,t){Di(t,(()=>{const n=ii();if(Ur(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();Cs(r.key),(e.timeStamp<Mn+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Pr(i)&&i.getStyle()!==n.style)&&no(t,Gt,Le)}}))}],["compositionend",function(e,t){ue?Hn=!0:ge||!he&&!ye?Di(t,(()=>{tr(t,e.data)})):(jn=!0,qn=e.data)}],["input",function(e,t){e.stopPropagation(),Di(t,(()=>{if(bo(e.target)&&hs(e.target))return;const n=ii(),r=e.data,i=er(e);if(null!=r&&Ur(n)&&Vn(n,i,r,e.timeStamp,!1)){Hn&&(tr(t,r),Hn=!1);const i=n.anchor.getNode(),s=yo(uo(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;de&&!n.isCollapsed()&&Pr(i)&&null!==s.anchorNode&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===Ws(s.anchorNode)||no(t,Gt,r);const c=r.length;ue&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),he||ge||ye||!t.isComposing()||(Mn=0,Cs(null))}else Ks(!1,t,null!==r?r:void 0),Hn&&(tr(t,r||void 0),Hn=!1);!function(){Si();Ye(Ti())}()}),{event:e}),Bn=null}],["click",function(e,t){Di(t,(()=>{const n=ii(),r=yo(uo(t)),i=si();if(r)if(Ur(n)){const t=n.anchor,s=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!qi(s)&&1===Is().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=function(e,t){let n=e;for(;n!==Is()&&null!=n;){if(t(n))return n;n=n.getParent()}return null}(s,(e=>Ui(e)&&!e.isInline()));Ui(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=r.anchorNode;(bo(n)||xs(n))&&Ms(ri(i,r,t,e))}no(t,Ht,e)}))}],["cut",In],["copy",In],["dragstart",In],["dragover",In],["dragend",In],["paste",In],["focus",In],["blur",In],["drop",In]];de&&Rn.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=er(e);"deleteCompositionText"===n||ue&&to(t)||"insertCompositionText"!==n&&Di(t,(()=>{const i=ii();if("deleteContentBackward"===n){if(null===i){const e=si();if(!Ur(e))return;Ms(e.clone())}if(Ur(i)){const n=i.anchor.key===i.focus.key;if(s=e.timeStamp,"MediaLast"===Dn&&s<Mn+30&&t.isComposing()&&n){if(Cs(null),Mn=0,setTimeout((()=>{Di(t,(()=>{Cs(null)}))}),30),Ur(i)){const e=i.anchor.getNode();e.markDirty(),Pr(e)||oe(142),Qn(i,e)}}else{Cs(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=me&&n&&!a&&o;if(l&&i.isCollapsed()&&(l=!Hi(eo(i.anchor,!0))),!l){no(t,jt,!0);const e=ii();me&&Ur(e)&&e.isCollapsed()&&(Jn=e,setTimeout((()=>Jn=null)))}}return}}var s;if(!Ur(i))return;const o=e.data;null!==Bn&&Ks(!1,t,Bn),i.dirty&&null===Bn||!i.isCollapsed()||qi(i.anchor.getNode())||null===r||i.applyDOMRange(r),Bn=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":no(t,Gt,e);break;case"insertFromComposition":Cs(null),no(t,Gt,e);break;case"insertLineBreak":Cs(null),no(t,qt,!1);break;case"insertParagraph":Cs(null),Kn&&!ge?(Kn=!1,no(t,qt,!1)):no(t,Jt,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":no(t,Vt,e);break;case"deleteByComposition":(function(e,t){return e!==t||Ui(e)||Ui(t)||!_s(e)||!_s(t)})(c,u)&&no(t,Zt,e);break;case"deleteByDrag":case"deleteByCut":no(t,Zt,e);break;case"deleteContent":no(t,jt,!1);break;case"deleteWordBackward":no(t,Yt,!0);break;case"deleteWordForward":no(t,Yt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":no(t,Xt,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":no(t,Xt,!1);break;case"formatStrikeThrough":no(t,Qt,"strikethrough");break;case"formatBold":no(t,Qt,"bold");break;case"formatItalic":no(t,Qt,"italic");break;case"formatUnderline":no(t,Qt,"underline");break;case"historyUndo":no(t,en,void 0);break;case"historyRedo":no(t,tn,void 0)}else{if("\n"===o)e.preventDefault(),no(t,qt,!1);else if(o===Ae)e.preventDefault(),no(t,Jt,void 0);else if(null==o&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),i.insertRawText(t)}else null!=o&&Vn(i,r,o,e.timeStamp,!0)?(e.preventDefault(),no(t,Gt,o)):Bn=o;zn=e.timeStamp}}))}(e,t)]);let Mn=0,Dn=null,zn=0,Bn=null;const $n=new WeakMap;let Un=!1,Wn=!1,Kn=!1,Hn=!1,jn=!1,qn="",Jn=null,Gn=[0,"",0,"root",0];function Vn(e,t,n,r,i){const s=e.anchor,o=e.focus,a=s.getNode(),l=Ti(),c=yo(uo(l)),u=null!==c?c.anchorNode:null,d=s.key,h=l.getElementByKey(d),g=n.length;return d!==o.key||!Pr(a)||(!i&&(!de||zn<r+50)||a.isDirty()&&g<2||Bs(n))&&s.offset!==o.offset&&!a.isComposing()||bs(a)||a.isDirty()&&g>1||(i||!de)&&null!==h&&!a.isComposing()&&u!==ks(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=_s(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Pr(t)||Ui(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,a)}function Zn(e,t){return xs(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function Yn(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=e;Un&&(Un=!1,Zn(r,i)&&Zn(s,o)&&!Jn)||Di(t,(()=>{if(!n)return void Ms(null);if(!ps(t,r,s))return;let a=ii();if(Jn&&Ur(a)&&a.isCollapsed()){const e=a.anchor,t=Jn.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(a=Jn.clone(),Ms(a))}if(Jn=null,Ur(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const i=uo(t).event,s=i?i.timeStamp:performance.now(),[o,l,c,u,d]=Gn,h=Is(),g=!1===t.isComposing()&&""===h.getTextContent();if(s<d+200&&n.offset===c&&n.key===u)Xn(a,o,l);else if("text"===n.type)Pr(r)||oe(141),Qn(a,r);else if("element"===n.type&&!g){Ui(r)||oe(259);const e=n.getNode();e.isEmpty()?function(e,t){Xn(e,t.getTextFormat(),t.getTextStyle())}(a,e):Xn(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(Pr(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}}no(t,Wt,void 0)}))}function Xn(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Qn(e,t){Xn(e,t.getFormat(),t.getStyle())}function er(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function tr(e,t){const n=e._compositionKey;if(Cs(null),null!==n&&null!=t){if(""===t){const t=Ns(n),r=ks(e.getElementByKey(n));return void(null!==r&&null!==r.nodeValue&&Pr(t)&&Hs(t,r.nodeValue,null,null,!0))}if("\n"===t[t.length-1]){const t=ii();if(Ur(t)){const n=t.focus;return t.anchor.set(n.key,n.offset,n.type),void no(e,un,null)}}}Ks(!0,e,t)}function nr(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}const rr=new Map;function ir(e){const t=function(e){const t=co(e);return t?t.getSelection():null}(e.target);if(null===t)return;const n=ms(t.anchorNode);if(null===n)return;Wn&&(Wn=!1,Di(n,(()=>{const r=si(),i=t.anchorNode;(bo(i)||xs(i))&&Ms(ri(r,t,n,e))})));const r=$s(n),i=r[r.length-1],s=i._key,o=rr.get(s),a=o||i;a!==n&&Yn(t,a,!1),Yn(t,n,!0),n!==i?rr.set(s,n):o&&rr.delete(s)}function sr(e){e._lexicalHandled=!0}function or(e){return!0===e._lexicalHandled}function ar(e){const t=e.ownerDocument,n=$n.get(t);if(void 0===n)return;const r=n-1;r>=0||oe(164),$n.set(t,r),0===r&&t.removeEventListener("selectionchange",ir);const i=ys(e);fs(i)?(function(e){if(null!==e._parentEditor){const t=$s(e),n=t[t.length-1]._key;rr.get(n)===e&&rr.delete(n)}else rr.delete(e._key)}(i),e.__lexicalEditor=null):i&&oe(198);const s=nr(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}function lr(e,t,n){Si();const r=e.__key,i=e.getParent();if(null===i)return;const s=function(e){const t=ii();if(!Ur(t)||!Ui(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),s=r.getNode();return lo(i,e)&&n.set(e.__key,0,"element"),lo(s,e)&&r.set(e.__key,0,"element"),t}(e);let o=!1;if(Ur(s)&&t){const t=s.anchor,n=s.focus;t.key===r&&(li(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(li(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Kr(s)&&t&&e.isSelected()&&e.selectPrevious();if(Ur(s)&&t&&!o){const t=e.getIndexWithinParent();ws(e),oi(s,i,t,-1)}else ws(e);n||ho(i)||i.canBeEmpty()||!i.isEmpty()||lr(i,t),t&&s&&qi(i)&&i.isEmpty()&&i.selectEnd()}class cr{static getType(){oe(64,this.name)}static clone(e){oe(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state}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){if(null!=t)return void(e.__key=t);Si(),vi();const n=Ti(),r=wi(),i=""+us++;r._nodeMap.set(i,e),Ui(e)?n._dirtyElements.set(i,!0):n._dirtyLeaves.add(i),n._cloneNotNeeded.add(i),n._dirtyType=1,e.__key=i}(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=Ns(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||ii();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Pr(this))return n;if(Ur(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Hi(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:Ns(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(ho(t))return Ui(e)||e===this&&Hi(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:Ns(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:Ns(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=Ui(this)?this:this.getParent(),n=Ui(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===sa(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=Ui(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=Ti()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){const e=Ns(this.__key);return null===e&&oe(113),e}getWritable(){Si();const e=wi(),t=Ti(),n=e._nodeMap,r=this.__key,i=this.getLatest(),s=t._cloneNotNeeded,o=ii();if(null!==o&&o.setCachedNodes(null),s.has(r))return Ts(i),i;const a=Lo(i);return s.add(r),Ts(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();return(t||n.__state)&&function(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Qe(t);return t.__state=n,n}(e).updateFromJSON(t),n}(this,e.$)}static transform(){return null}remove(e){lr(this,!0,e)}replace(e,t){Si();let n=ii();null!==n&&(n=n.clone()),po(this,e);const r=this.getLatest(),i=this.__key,s=e.__key,o=e.getWritable(),a=this.getParentOrThrow().getWritable(),l=a.__size;ws(o);const c=r.getPreviousSibling(),u=r.getNextSibling(),d=r.__prev,h=r.__next,g=r.__parent;if(lr(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&&(Ui(this)&&Ui(o)||oe(139),this.getChildren().forEach((e=>{o.append(e)}))),Ur(n)){Ms(n);const e=n.anchor,t=n.focus;e.key===i&&Br(e,o),t.key===i&&Br(t,o)}return Es()===i&&Cs(s),o}insertAfter(e,t=!0){Si(),po(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),s=ii();let o=!1,a=!1;if(null!==i){const t=e.getIndexWithinParent();if(ws(r),Ur(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&&Ur(s)){const e=this.getIndexWithinParent();oi(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){Si(),po(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;ws(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=ii();return t&&Ur(c)&&oi(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return ss()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Si();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Ui(n))return n.select();if(!Pr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Si();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Ui(n))return n.select(0,0);if(!Pr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}class ur extends cr{static getType(){return"linebreak"}static clone(e){return new ur(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&&vo(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&pr(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&pr(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&vo(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&pr(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&pr(r))return!0}return!1}(e)?null:{conversion:dr,priority:0}}}static importJSON(e){return hr().updateFromJSON(e)}}function dr(e){return{node:hr()}}function hr(){return go(new ur)}function gr(e){return e instanceof ur}function pr(e){return xs(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 mr(e,t){return 1&t?"strong":2&t?"em":"span"}function yr(e,t,n,r,i){const s=r.classList;let o=Ys(i,"base");void 0!==o&&s.add(...o),o=Ys(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 Re){const r=Re[e];if(o=Ys(i,e),void 0!==o)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&s.remove(...o);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||s.add(...o)}else t&r&&s.remove(...o)}}function _r(e,t,n){const r=t.firstChild,i=n.isComposing(),s=e+(i?Ne:"");if(null==r)t.textContent=s;else{const e=r.nodeValue;if(e!==s)if(i||ue){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 br(e,t,n,r,i,s){_r(i,e,t);const o=s.theme.text;void 0!==o&&yr(0,0,r,e,o)}function xr(e,t){const n=document.createElement(t);return n.appendChild(e),n}class kr extends cr{static getType(){return"text"}static clone(e){return new kr(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 $e[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Es()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=Re[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Ss(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=fr(0,n),i=mr(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)),br(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=mr(0,i),c=mr(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 br(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)),_r(r,u,this);const d=n.theme.text;void 0!==d&&i!==s&&yr(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:Cr,priority:0}),b:()=>({conversion:vr,priority:0}),code:()=>({conversion:Ar,priority:0}),em:()=>({conversion:Ar,priority:0}),i:()=>({conversion:Ar,priority:0}),mark:()=>({conversion:Ar,priority:0}),s:()=>({conversion:Ar,priority:0}),span:()=>({conversion:Sr,priority:0}),strong:()=>({conversion:Ar,priority:0}),sub:()=>({conversion:Ar,priority:0}),sup:()=>({conversion:Ar,priority:0}),u:()=>({conversion:Ar,priority:0})}}static importJSON(e){return Lr().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=xr(t,"b")),this.hasFormat("italic")&&(t=xr(t,"i")),this.hasFormat("strikethrough")&&(t=xr(t,"s")),this.hasFormat("underline")&&(t=xr(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?Re[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Me[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Ss(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=Be[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){Si();let n=e,r=t;const i=ii(),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(!Ur(i))return ei(o,n,o,r,"text","text");{const e=Es();e!==i.anchor.key&&e!==i.focus.key||Cs(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=ii();if(r&&Ur(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){Si();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Es(),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 _=ii();if(Ur(_)){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=Lr(c),d.__format=h,d.__style=g,d.__detail=p,f=!0):d=t.setTextContent(c);const b=[d];for(let e=1;e<l;e++){const t=Lr(o[e]);t.__format=h,t.__style=g,t.__detail=p;const n=t.__key;i===r&&Cs(n),b.push(t)}const x=m?m.offset:null,k=y?y.offset:null;let S=0;for(const e of b){if(!m&&!y)break;const t=S+e.getTextContentSize();if(null!==m&&null!==x&&x<=t&&x>=S&&(m.set(e.getKey(),x-S,"text"),x<t&&(m=null)),null!==y&&null!==k&&k<=t&&k>=S){y.set(e.getKey(),k-S,"text");break}S=t}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&Ts(t),null!==n&&Ts(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();f?(e.splice(t,0,b),this.remove()):e.splice(t,1,b),Ur(_)&&oi(_,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;Es()===r&&Cs(n);const o=ii();if(Ur(o)){const i=o.anchor,a=o.focus;null!==i&&i.key===r&&ci(i,t,n,e,s),null!==a&&a.key===r&&ci(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 Sr(e){return{forChild:Fr(e.style),node:null}}function vr(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Fr(t.style,n?void 0:"bold"),node:null}}const wr=new WeakMap;function Tr(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 Cr(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))&&!Tr(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(hr()):"\t"===r?t.push(Ir()):""!==r&&t.push(Lr(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=Er(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=Er(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:Lr(n)}}function Er(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&&!So(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(xs(n))return n;if("BR"===n.nodeName)return null}}const Nr={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ar(e){const t=Nr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Fr(e.style,t),node:null}}function Lr(e=""){return go(new kr(e))}function Pr(e){return e instanceof kr}function Fr(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=>Pr(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 Or extends kr{static getType(){return"tab"}static clone(e){return new Or(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=Ys(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return Ir().updateFromJSON(e)}setTextContent(e){return"\t"!==e&&""!==e&&oe(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 Ir(){return go(new Or)}function Rr(e){return e instanceof Or}class Mr{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:ia(_a(ca(this,"next")),_a(ca(e,"next")))<0}getNode(){const e=Ns(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,ki()||(Es()===s&&Cs(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}function Dr(e,t,n){return new Mr(e,t,n)}function zr(e,t){let n=t.__key,r=e.offset,i="element";if(Pr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Ui(t)){const e=t.getNextSibling();if(Pr(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 Br(e,t){if(Ui(t)){const n=t.getLastDescendant();Ui(n)||Pr(n)?zr(e,n):zr(e,t)}else zr(e,t)}class $r{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Kr(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 $r(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(Pr(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=Ns(e);null!==t&&n.push(t)}return ki()||(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((ii()||si())===this&&e[0]){const t=Jo(e[0],"next");da(na(t,t))}for(const t of e)t.remove()}}function Ur(e){return e instanceof Wr}class Wr{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!!Ur(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(Ko(n)){const{origin:e}=n;0===t.length?i.add(e):(s.add(e),t.push(e))}else{const{origin:e}=n;Ui(e)&&s.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Wo(e.focus)&&Ui(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=Yo(e.focus.origin,"previous");Ko(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Xo(n))i.delete(n.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!Ui(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=>Uo(e)?e.origin:e.getNodeAtCaret(),s=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(s)}return t}(ka(ga(this),"next"));return ki()||(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]=jr(this);let l="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Ui(d)&&!d.isInline())c||(l+="\n"),c=!d.isEmpty();else if(c=!1,Pr(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!Hi(d)&&!gr(d)||d===n&&this.isCollapsed()||(l+=d.getTextContent())}return l}applyDOMRange(e){const t=Ti(),n=t.getEditorState()._selection,r=Xr(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),it(this)}clone(){const e=this.anchor,t=this.focus;return new Wr(Dr(e.key,e.offset,e.type),Dr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Ss(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=Re[e];return!!(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(hr()):"\t"===r?n.push(Ir()):n.push(Lr(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=Lr(),a=qi(i)?ss().append(o):o;o.setFormat(n),o.setStyle(r),null===s?i.append(a):s.insertBefore(a),e.is(t)&&t.set(o.__key,0,"text"),e.set(o.__key,0,"text")}(s,o,r,i),"element"===o.type&&ua(o,_a(ca(o,"next")));const a=s.offset;let l=o.offset;const c=this.getNodes(),u=c.length;let d=c[0];Pr(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&&(bs(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&null===d.getNextSibling())){let t=d.getNextSibling();if(Pr(t)&&t.canInsertTextBefore()&&!bs(t)||(t=Lr(),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&&(bs(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&null===d.getPreviousSibling())){let t=d.getPreviousSibling();if(Pr(t)&&!bs(t)||(t=Lr(),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=Lr(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&""!==e){const t=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||Ui(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),Yr(this.anchor,this.focus,null),void this.insertText(e)}if(1===u){if(_s(d)){const t=Lr(e);return t.select(),void d.replace(t)}const t=d.getFormat(),n=d.getStyle();if(a!==l||t===r&&n===i){if(Rr(d)){const t=Lr(e);return t.setFormat(r),t.setStyle(i),t.select(),void d.replace(t)}}else{if(""!==d.getTextContent()){const t=Lr(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=Ui(d)?d:d.getParentOrThrow();let r=Ui(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(Pr(p)&&!_s(p)&&l!==p.getTextContentSize()){if(p.isSegmented()){const e=Lr(p.getTextContent());p.replace(e),p=e}qi(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)||Ui(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(_s(d))if(a===h)d.select();else{const t=Lr(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=ii()===this;ha(this,ya(ga(this))),e&&ii()!==this&&Ms(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Cs(null);const n=this.getNodes(),r=[];for(const e of n)Pr(e)&&r.push(e);const i=t=>{n.forEach((n=>{if(Ui(n)){const r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},s=r.length;if(0===s)return this.toggleFormat(e),Cs(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(bs(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||bs(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const _=m.getFormatFlags(e,p);y>0&&(y===m.getTextContentSize()||bs(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=ii();return Ur(t)||oe(134),t.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),n=To(t,wo),r=e[e.length-1];if(Ui(n)&&"__language"in n){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=hi(this);n.splice(t,0,e),r.selectEnd()}return}if(!e.some((e=>(Ui(e)||Hi(e))&&!e.isInline()))){Ui(n)||oe(211,t.constructor.name,t.getType());const i=hi(this);return n.splice(i,0,e),void r.selectEnd()}const i=function(e){const t=ss();let n=null;for(let r=0;r<e.length;r++){const i=e[r],s=gr(i);if(s||Hi(i)&&i.isInline()||Ui(i)&&i.isInline()||Pr(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=Ui(n)&&n.isEmpty()?null:this.insertParagraph(),l=o[o.length-1];let c=o[0];var u;Ui(u=c)&&wo(u)&&!u.isEmpty()&&Ui(n)&&(!n.isEmpty()||n.canMergeWhenEmpty())&&(Ui(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=To(s,wo);a&&Ui(d)&&(a.canMergeWhenEmpty()||wo(l))&&(d.append(...a.getChildren()),a.remove()),Ui(n)&&n.isEmpty()&&n.remove(),s.selectEnd();const h=Ui(n)?n.getLastChild():null;gr(h)&&d!==n&&h.remove()}insertParagraph(){if("root"===this.anchor.key){const e=ss();return Is().splice(this.anchor.offset,0,[e]),e.select(),e}const e=hi(this),t=To(this.anchor.getNode(),wo);Ui(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=hr();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,i=this.focus;let s=e[0],o=e[n];const[a,l]=jr(this);if(0===t)return[];if(1===t){if(Pr(s)&&!this.isCollapsed()){const e=a>l?l:a,t=a>l?a:l,n=s.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[s]}const c=r.isBefore(i);if(Pr(s)){const t=c?a:l;t===s.getTextContentSize()?e.shift():0!==t&&([,s]=s.splitText(t),e[0]=s)}if(Pr(o)){const t=o.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([o]=o.splitText(r),e[n]=o)}return e}modify(e,t,n){if(pi(this,e,t,n))return;const r="move"===e,i=Ti(),s=yo(uo(i));if(!s)return;const o=i._blockCursorElement,a=i._rootElement,l=this.focus.getNode();if(null===a||null===o||!Ui(l)||l.isInline()||l.canBeEmpty()||mo(o,i,a),this.dirty){let e=io(i,this.anchor.key),t=io(i,this.focus.key);"text"===this.anchor.type&&(e=ks(e)),"text"===this.focus.type&&(t=ks(t)),e&&t&&ui(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=qi(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(ho(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];lo(t,i)?r.push(t):o=!0}if(o&&r.length>0)if(t){const e=r[0];Ui(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=r[r.length-1];Ui(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&&pi(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Ui(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(Ui(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=ta(ca(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(Ko(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(Ui(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=_a(t);ha(this,na(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(Wo(t)){if(Ui(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(Hi(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Ui(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=ni();e.add(t.origin.getKey()),Ms(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;return ha(this,na(!t.origin.isEmpty()&&n.isEmpty()?pa(Jo(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&&qr(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 Gr(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 Gr(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!(Bs(e)||Jr(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()&&qi(e.getParent())&&null===e.getPreviousSibling()&&qr(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 Kr(e){return e instanceof $r}function Hr(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function jr(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]:[Hr(n),Hr(r)]}function qr(e,t){for(let n=t;n;n=n.getParent()){if(Ui(n)){if(n.collapseAtStart(e))return!0;if(ho(n))break}if(n.getPreviousSibling())break}return!1}const Jr=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch(e){}return()=>!1})();function Gr(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 Vr(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=Ds(u),Pr(i))s=zs(i,o);else{let a=Ds(e);if(null===a)return null;if(Ui(a)){const l=r.getElementByKey(a.getKey());null===l&&oe(214);const c=a.getDOMSlot(l);[a,s]=c.resolveChildIndex(a,l,e,t),Ui(a)||oe(215),o&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let u=a.getChildAtIndex(s);if(Ui(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=Ui(u)?u:u.getParentOrThrow()),s=0}Pr(u)?(i=u,a=null,s=zs(u,o)):u!==a&&o&&!d&&(Ui(a)||oe(216),s=Math.min(a.getChildrenSize(),s+1))}else{const n=a.getIndexWithinParent();s=0===t&&Hi(a)&&Ds(e)===a?n:n+1,a=a.getParentOrThrow()}if(Ui(a))return Dr(a.__key,s,"element")}}else i=Ds(e);return Pr(i)?Dr(i.__key,s,"text"):null}function Zr(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&&Ui(s)&&s.isInline()){const t=s.getPreviousSibling();Pr(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else Ui(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Pr(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),s=i.getParent();if(t&&Ui(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&Ui(s)&&s.isInline()&&!s.canInsertTextAfter()){const t=s.getNextSibling();Pr(t)&&e.set(t.__key,0,"text")}}}function Yr(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),i=e.is(t);Zr(e,r,i),Zr(t,!r,i),i&&t.set(e.key,e.offset,e.type);const s=Ti();if(s.isComposing()&&s._compositionKey!==e.key&&Ur(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 Xr(e,t,n,r,i,s){if(null===e||null===n||!ps(i,e,n))return null;const o=Vr(e,t,Ur(s)?s.anchor:null,i);if(null===o)return null;const a=Vr(n,r,Ur(s)?s.focus:null,i);if(null===a)return null;if("element"===o.type&&"element"===a.type){const t=Ds(e),r=Ds(n);if(Hi(t)&&Hi(r))return null}return Yr(o,a,s),[o,a]}function Qr(e){return Ui(e)&&!e.isInline()}function ei(e,t,n,r,i,s){const o=wi(),a=new Wr(Dr(e,t,i),Dr(n,r,s),0,"");return a.dirty=!0,o._selection=a,a}function ti(){const e=Dr("root",0,"element"),t=Dr("root",0,"element");return new Wr(e,t,0,"")}function ni(){return new $r(new Set)}function ri(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(Ur(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,a&&Ur(e)&&!ps(n,c,u))return e.clone();const g=Xr(c,d,u,h,n,e);if(null===g)return null;const[p,f]=g;return new Wr(p,f,Ur(e)?e.format:0,Ur(e)?e.style:"")}function ii(){return wi()._selection}function si(){return Ti()._editorState._selection}function oi(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"),ai(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")}}ai(e)}function ai(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,s=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!Ui(s))return;const e=s.getChildrenSize(),i=n>=e,o=i?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Pr(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,"text"),r.set(o.__key,e,"text")}}else{if(Ui(s)){const e=s.getChildrenSize(),r=n>=e,i=r?s.getChildAtIndex(e-1):s.getChildAtIndex(n);if(Pr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(Ui(o)){const e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(Pr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function li(e,t,n,r,i){let s=null,o=0,a=null;null!==r?(s=r.__key,Pr(r)?(o=r.getTextContentSize(),a="text"):Ui(r)&&(o=r.getChildrenSize(),a="element")):null!==i&&(s=i.__key,Pr(i)?a="text":Ui(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 ci(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 ui(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function di(e){let t=ii()||si();null===t&&(t=Is().selectEnd()),t.insertNodes(e)}function hi(e){let t=e;e.isCollapsed()||t.removeText();const n=ii();Ur(n)&&(t=n),Ur(t)||oe(161);const r=t.anchor;let i=r.getNode(),s=r.offset;for(;!wo(i);){const e=i;if([i,s]=gi(i,s),e.is(i))break}return s}function gi(e,t){const n=e.getParent();if(!n){const e=ss();return Is().append(e),e.select(),[Is(),0]}if(Pr(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(!Ui(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Wr(Dr(e.__key,t,"element"),Dr(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function pi(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=ca(e.focus,n?"previous":"next"),o="lineboundary"===r,a="move"===t;let l=s,c="decorators-and-blocks"===i;if(!ba(l)){for(const e of l){c=!1;const{origin:t}=e;if(!Hi(t)||t.isIsolated()||(l=e,!o||!t.isInline()))break}if(c)for(const e of ta(s).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(Ko(e))e.origin.isInline()||(l=e);else{if(Ui(e.origin))continue;Hi(e.origin)&&!e.origin.isInline()&&(l=e)}break}}if(l===s)return!1;if(a&&!o&&Hi(l.origin)&&l.origin.isKeyboardSelectable()){const e=ni();return e.add(l.origin.getKey()),Ms(e),!0}return l=_a(l),a&&ua(e.anchor,l),ua(e.focus,l),c||!o}let fi=null,mi=null,yi=!1,_i=!1,bi=0;const xi={characterData:!0,childList:!0,subtree:!0};function ki(){return yi||null!==fi&&fi._readOnly}function Si(){yi&&oe(13)}function vi(){bi>99&&oe(14)}function wi(){return null===fi&&oe(195,Ci()),fi}function Ti(){return null===mi&&oe(196,Ci()),mi}function Ci(){let e=0;const t=new Set,n=cs.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=ys(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 Ei(e,t,n){const r=t.__type,i=function(e,t){const n=e._nodes.get(t);return void 0===n&&oe(30,t),n}(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 Ni(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function Ai(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 Li(e){return Pi(e,Ti()._nodes)}function Pi(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(Ui(s)&&Array.isArray(o))for(let e=0;e<o.length;e++){const n=Pi(o[e],t);s.append(n)}return s}function Fi(e,t,n){const r=fi,i=yi,s=mi;fi=t,yi=!0,mi=e;try{return n()}finally{fi=r,yi=i,mi=s}}function Oi(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=yi,d=mi,h=e._updating,g=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&l&&null!==g){mi=e,fi=n,yi=!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){mt="",xt="",yt="",kt=2===r,vt=null,at=n,ot=n._config,lt=n._nodes,ct=at._listeners.mutation,ut=i,dt=s,ht=e._nodeMap,gt=t._nodeMap,St=t._readOnly,pt=new Map(n._keyToDOMMap);const o=new Map;return ft=o,Dt("root",null),at=void 0,lt=void 0,ut=void 0,dt=void 0,ht=void 0,gt=void 0,ot=void 0,pt=void 0,ft=void 0,o}(s,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),_i)throw t;return as(e,null,r,n),Xe(e),e._dirtyType=2,_i=!0,Oi(e,s),void(_i=!1)}finally{g.observe(r,xi),e._updating=h,fi=c,yi=u,mi=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=Fs(e)),delete r[s])}(e,n);const x=i?null:yo(uo(e));if(e._editable&&null!==x&&(l||null===a||a.dirty)&&null!==r&&!_.has(ts)){mi=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(Qi)&&u!==s||null!==u&&gs(u))return;if(!Ur(t))return void(null!==e&&ps(n,o,a)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,f=io(n,g),m=io(n,p),y=d.offset,_=h.offset,b=t.format,x=t.style,k=t.isCollapsed();let S=f,v=m,w=!1;if("text"===d.type){S=ks(f);const e=d.getNode();w=e.getFormat()!==b||e.getStyle()!==x}else Ur(e)&&"text"===e.anchor.type&&(w=!0);var T,C,E,N,A;if("text"===h.type&&(v=ks(m)),null!==S&&null!==v&&(k&&(null===e||w||Ur(e)&&(e.format!==b||e.style!==x))&&(T=b,C=x,E=y,N=g,A=performance.now(),Gn=[T,C,E,N,A]),l!==y||c!==_||o!==S||a!==v||"Range"===r.type&&k||(null!==u&&s.contains(u)||s.focus({preventScroll:!0}),"element"===d.type))){if(ui(r,S,y,v,_),!i.has(es)&&t.isCollapsed()&&null!==s&&s===document.activeElement){const e=Ur(t)&&"element"===t.anchor.type?S.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=oo(n),i=co(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=uo(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=so(c)}}(n,t,s)}}Un=!0}}(o,a,e,x,_,r)}!function(e,t,n){let r=e._blockCursorElement;if(Ur(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())fo(s.getChildAtIndex(o-1))&&(a=!0);else{const t=s.getChildAtIndex(o);if(null!==t&&fo(t)){const n=t.getPreviousSibling();(null===n||fo(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=_e(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,xi),mi=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],l=t.get(a);void 0!==l&&o(l,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}(e,p,_,f,s),Ur(a)||null===a||null!==o&&o.is(a)||e.dispatchCommand(Wt,void 0);const k=e._pendingDecorators;null!==k&&(e._decorators=k,e._pendingDecorators=null,Ii("decorator",e,!0,k)),function(e,t,n){const r=Os(t),i=Os(n);r!==i&&Ii("textcontent",e,!0,i)}(e,t||s,n),Ii("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;Mi(e,t,r)}}}(e)}function Ii(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 Ri(e,t){const n=e._updates;let r=t||!1;for(;0!==n.length;){const t=n.shift();if(t){const[n,i]=t;let s;if(void 0!==i){if(s=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete){const t=e._pendingEditorState;null===t&&oe(191),t._flushSync=!0}s&&e._deferred.push(s),Ai(e,i.tag)}n()}}return r}function Mi(e,t,n){const r=e._updateTags;let i,s=!1,o=!1;void 0!==n&&(i=n.onUpdate,Ai(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=Ji(l||a),c=!0),l._flushSync=o;const u=fi,d=yi,h=mi,g=e._updating;fi=l,yi=!1,e._updating=!0,mi=e;const p=e._headless||null===e.getRootElement();try{c&&(p?null!==a._selection&&(l._selection=a._selection.clone()):l._selection=function(e,t){const n=e.getEditorState()._selection,r=yo(uo(e));return Ur(n)||null==n?ri(n,r,e,t):n.clone()}(e,n&&n.event||null));const r=e._compositionKey;t(),s=Ri(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Ur(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);Pr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&rt(t)}}(l,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,s=Es(),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);Pr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&rt(r),void 0!==r&&Ni(r,s)&&Ei(t,r,o),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){bi++;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&&Ni(l,s)&&Ei(t,l,o)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,bi++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Ri(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()||(Ui(t)&&We(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(Ur(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 Kr(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 Oi(e)}finally{fi=u,yi=d,mi=h,e._updating=g,bi=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,Oi(e)):c&&ds((()=>{Oi(e)})):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Di(e,t,n){mi===e&&void 0===n?t():Mi(e,t,n)}class zi{constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new zi(this.element,e,this.after)}withAfter(e){return new zi(this.element,this.before,e)}withElement(e){return this.element===e?this:new zi(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&&(ge||he);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=Bi(t,n);i.push(r);const s=Bi(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 Bi(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 $i extends cr{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.__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 ze[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=Ti()._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(Pr(t)&&e.push(t),Ui(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Ui(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Ui(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 Ui(e)&&e.getLastDescendant()||e||null}const r=t[e];return Ui(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Ns(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&oe(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Ns(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(),Ui(i)&&r!==n-1&&!i.isInline()&&(e+=Ae)}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(),Ui(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=De[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){const t=Re[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return Ss(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Si();const n=ii();let r=e,i=t;const s=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Pr(e)||Ui(e))return e.select(0,0)}else if(!(void 0!==e&&e!==s||void 0!==t&&t!==s)){const e=this.getLastChild();if(Pr(e)||Ui(e))return e.select()}void 0===r&&(r=s),void 0===i&&(i=s);const o=this.__key;return Ur(n)?(n.anchor.set(o,r,"element"),n.focus.set(o,i,"element"),n.dirty=!0,n):ei(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?De[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){const r=n.length,i=this.getChildrenSize(),s=this.getWritable();e+t<=i||oe(226,String(e),String(t),String(i));const o=s.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r;if(0!==e)if(e===i)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n<t;n++){null===e&&oe(100);const t=e.getNextSibling(),n=e.__key;ws(e.getWritable()),l.push(n),e=t}}let h=u;for(let e=0;e<r;e++){const t=n[e];null!==h&&t.is(h)&&(u=h=h.getPreviousSibling());const r=t.getWritable();r.__parent===o&&d--,ws(r);const i=t.__key;if(null===h)s.__first=i,r.__prev=null;else{const e=h.getWritable();e.__next=i,r.__prev=e.__key}t.__key===o&&oe(76),r.__parent=o,a.push(i),h=t}if(e+t===i)null!==h&&(h.getWritable().__next=null,s.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(s.__size=d,l.length){const e=ii();if(Ur(e)){const t=new Set(l),n=new Set(a),{anchor:r,focus:i}=e;Wi(r,t,n)&&li(r,r.getNode(),this,u,c),Wi(i,t,n)&&li(i,i.getNode(),this,u,c),0!==d||this.canBeEmpty()||ho(this)||this.remove()}}return s}getDOMSlot(e){return new zi(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 Ui(e){return e instanceof $i}function Wi(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 Ki extends cr{decorate(e,t){oe(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Hi(e){return e instanceof Ki}class ji extends $i{static getType(){return"root"}static clone(){return new ji}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){oe(51)}getTextContent(){const e=this.__cachedText;return!ki()&&0!==Ti()._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)Ui(e)||Hi(e)||oe(282);return super.splice(e,t,n)}static importJSON(e){return Is().updateFromJSON(e)}collapseAtStart(){return!0}}function qi(e){return e instanceof ji}function Ji(e){return new Zi(new Map(e._nodeMap))}function Gi(){return new Zi(new Map([["root",new ji]]))}function Vi(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&oe(130,n.name),Ui(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=Vi(i[e]);r.push(t)}}return t}class Zi{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 Fi(t&&t.editor||null,this,e)}clone(e){const t=new Zi(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Fi(null,this,(()=>({root:Vi(Is())})))}}const Yi="historic",Xi="history-merge",Qi="collaboration",es="skip-scroll-into-view",ts="skip-dom-selection";class ns extends $i{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class rs extends $i{static getType(){return"paragraph"}static clone(e){return new rs(e.__key)}createDOM(e){const t=document.createElement("p"),n=Ys(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:is,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 ss().updateFromJSON(e)}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle()}}insertNewAfter(e,t){const n=ss();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||Pr(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 is(e){const t=ss();return e.style&&(t.setFormat(e.style.textAlign),Po(e,t)),{node:t}}function ss(){return go(new rs)}function os(e){return e instanceof rs}function as(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=Gi(),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 ls(e){const t=e||{},n=mi,r=t.theme||{},i=void 0===e?n:t.parentEditor||null,s=t.disableEvents||!1,o=Gi(),a=t.namespace||(null!==i?i._config.namespace:Us()),l=t.editorState,c=[ji,kr,ur,Or,rs,ns,...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}const i=t.getType(),s=t.transform(),o=new Set;null!==s&&o.add(s),g.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,transforms:o})}}const p=new cs(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 cs{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=Us(),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;i.set(t,r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{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=Ao(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=Ao(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=Ns(t);e&&e.markDirty()}}),null===e._pendingEditorState?{tag:Xi}: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 no(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=Ys(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,as(this,t,e,r),null!==t&&(this._config.disableEvents||ar(t),null!=n&&t.classList.remove(...n)),null!==e){const t=co(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,Xe(this),this._updateTags.add(Xi),Oi(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument,r=$n.get(n);(void 0===r||r<1)&&n.addEventListener("selectionchange",ir),$n.set(n,(r||0)+1),e.__lexicalEditor=t;const i=nr(e);for(let n=0;n<Rn.length;n++){const[r,s]=Rn[n],o="function"==typeof s?e=>{or(e)||(sr(e),(t.isEditable()||"click"===r)&&s(e,t))}:e=>{if(or(e))return;sr(e);const n=t.isEditable();switch(r){case"cut":return n&&no(t,Tn,e);case"copy":return no(t,wn,e);case"paste":return n&&no(t,Vt,e);case"dragstart":return n&&no(t,kn,e);case"dragover":return n&&no(t,Sn,e);case"dragend":return n&&no(t,vn,e);case"focus":return n&&no(t,Pn,e);case"blur":return n&&no(t,Fn,e);case"drop":return n&&no(t,bn,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(Xi),Oi(this);Ii("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=Ji(e),n._selection=e._selection?e._selection.clone():null),Ye(this);const r=this._pendingEditorState,i=this._updateTags,s=void 0!==t?t.tag:null;null===r||r.isEmpty()||(null!=s&&i.add(s),Oi(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&i.add(s),this._updating||Oi(this)}parseEditorState(e,t){return function(e,t,n){const r=Gi(),i=fi,s=yi,o=mi,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,yi=!1,mi=t;try{const i=t._nodes;Pi(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,yi=s,mi=o}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Oi(this),this.getEditorState().read(e,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):Mi(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Di(this,(()=>{const r=ii(),i=Is();null!==r?r.dirty||Ms(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),ao("focus"),function(e){Si(),Ti()._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=yo(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ii("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}cs.version="0.32.1+prod.esm";let us=1;const ds="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function hs(e){return Hi(Ps(e))}function gs(e){const t=document.activeElement;if(!bo(t))return!1;const n=t.nodeName;return Hi(Ps(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==ys(t))}function ps(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!gs(t)&&ms(t)===e}catch(e){return!1}}function fs(e){return e instanceof cs}function ms(e){let t=e;for(;null!=t;){const e=ys(t);if(fs(e))return e;t=so(t)}return null}function ys(e){return e?e.__lexicalEditor:null}function _s(e){return Rr(e)||e.isToken()}function bs(e){return _s(e)||e.isSegmented()}function xs(e){return xo(e)&&3===e.nodeType}function ks(e){let t=e;for(;null!=t;){if(xs(t))return t;t=t.firstChild}return null}function Ss(e,t,n){const r=Re[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 vs(e){return Pr(e)||gr(e)||Hi(e)}function ws(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 Ts(e){vi();const t=e.getLatest(),n=t.__parent,r=wi(),i=Ti(),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,Ui(e)?o.set(a,!0):i._dirtyLeaves.add(a)}function Cs(e){Si();const t=Ti(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Ns(n);null!==e&&e.getWritable()}if(null!==e){const t=Ns(e);null!==t&&t.getWritable()}}}function Es(){return ki()?null:Ti()._compositionKey}function Ns(e,t){const n=(t||wi())._nodeMap.get(e);return void 0===n?null:n}function As(e,t){const n=Ls(e,Ti());return void 0!==n?Ns(n,t):null}function Ls(e,t){return e[`__lexicalKey_${t._key}`]}function Ps(e,t){let n=e;for(;null!=n;){const e=As(n,t);if(null!==e)return e;n=so(n)}return null}function Fs(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Os(e){return e.read((()=>Is().getTextContent()))}function Is(){return Rs(wi())}function Rs(e){return e._nodeMap.get("root")}function Ms(e){Si();const t=wi();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function Ds(e){const t=Ti(),n=function(e,t){let n=e;for(;null!=n;){const e=Ls(n,t);if(void 0!==e)return e;n=so(n)}return null}(e,t);return null===n?e===t.getRootElement()?Ns("root"):null:Ns(n)}function zs(e,t){return t?e.getTextContentSize():0}function Bs(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function $s(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function Us(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ws(e){return xs(e)?e.nodeValue:null}function Ks(e,t,n){const r=yo(uo(t));if(null===r)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(null!==i){let t=Ws(i);const r=Ps(i);if(null!==t&&Pr(r)){if(t===Ne&&n){const e=n.length;t=n,s=e,o=e}null!==t&&Hs(r,t,s,o,e)}}}function Hs(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]===Ne&&(a=t.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(""===a){if(Cs(null),he||ge||ye)s.remove();else{const e=Ti();setTimeout((()=>{e.update((()=>{s.isAttached()&&s.remove()}))}),20)}return}const t=s.getParent(),i=si(),l=s.getTextContentSize(),c=Es(),u=s.getKey();if(s.isToken()||null!==c&&u===c&&!o||Ur(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=ii();if(!Ur(d)||null===n||null===r)return void s.setTextContent(a);if(d.setTextNodeRange(s,n,s,r),s.isSegmented()){const e=Lr(s.getTextContent());s.replace(e),s=e}s.setTextContent(a)}}}function js(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function qs(e,t,n){return function(e,t){return js(e,t,"altKey")&&js(e,t,"ctrlKey")&&js(e,t,"shiftKey")&&js(e,t,"metaKey")}(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const Js={ctrlKey:!ce,metaKey:ce},Gs={altKey:ce,ctrlKey:!ce};function Vs(e){return"Backspace"===e.key}function Zs(e){return qs(e,"a",Js)}function Ys(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=_e(i);return n[t]=e,e}return i}function Xs(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 Qs(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 eo(e,t){const n=e.offset;if("element"===e.type)return Qs(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?Qs(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function to(e){const t=uo(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function no(e,t,n){return function(e,t,n){const r=$s(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(Di(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 ro(e){return!qi(e)&&!e.isLastChild()&&!e.isInline()}function io(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&oe(75,t),n}function so(e){const t=e.assignedSlot||e.parentElement;return ko(t)?t.host:t}function oo(e){return function(e){return xo(e)&&9===e.nodeType}(e)?e:bo(e)?e.ownerDocument:null}function ao(e){Si(),Ti()._updateTags.add(e)}function lo(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function co(e){const t=oo(e);return t?t.defaultView:null}function uo(e){const t=e._window;return null===t&&oe(78),t}function ho(e){return qi(e)||Ui(e)&&e.isShadowRoot()}function go(e){const t=Ti(),n=e.constructor.getType(),r=t._nodes.get(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 po(e,t){!qi(e.getParent())||Ui(t)||Hi(t)||oe(99)}function fo(e){return(Hi(e)||Ui(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 yo(e){return ae?(e||window).getSelection():null}function _o(e){return bo(e)&&"A"===e.tagName}function bo(e){return xo(e)&&1===e.nodeType}function xo(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function ko(e){return xo(e)&&11===e.nodeType}function So(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 vo(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 wo(e){if(Hi(e)&&!e.isInline())return!0;if(!Ui(e)||ho(e))return!1;const t=e.getFirstChild(),n=null===t||gr(t)||Pr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function To(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}function Co(){return Ti()}const Eo=new WeakMap,No=new Map;function Ao(e){if(!e._readOnly&&e.isEmpty())return No;e._readOnly||oe(192);let t=Eo.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),Eo.set(e,t)),t}function Lo(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function Po(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function Fo(e){return!0===e.__lexicalUnmanaged}const Oo={next:"previous",previous:"next"};class Io{constructor(e){this.origin=e}[Symbol.iterator](){return ra({hasNext:Wo,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Jo(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Jo(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=Jo(e,this.direction)}for(const e of o.values())e.remove();return this}}class Ro extends Io{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Yo(e,this.direction)}getParentCaret(e="root"){return Jo(zo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Do(this.direction);return Jo(this.getNodeAtCaret(),e)||Yo(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Ro&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Mo={root:qi,shadowRoot:ho};function Do(e){return Oo[e]}function zo(e,t="root"){return Mo[t](e)?null:e}class Bo extends Io{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Jo(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Ui(this.origin)?Yo(this.origin,this.direction):null}getParentCaret(e="root"){return Jo(zo(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Do(this.direction);return Jo(this.getNodeAtCaret(),e)||Yo(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Bo&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Bo||e instanceof $o)&&this.direction===e.direction&&this.origin.is(e.origin)}}class $o extends Io{type="text";constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Go(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Jo(zo(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Go(this.origin,Do(this.direction),this.offset)}isSamePointCaret(e){return e instanceof $o&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Bo||e instanceof $o)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Jo(this.origin,this.direction)}}function Uo(e){return e instanceof $o}function Wo(e){return e instanceof Bo}function Ko(e){return e instanceof Ro}const Ho={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},jo={next:class extends Bo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Bo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},qo={next:class extends Ro{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Ro{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Jo(e,t){return e?new jo[t](e):null}function Go(e,t,n){return e?new Ho[t](e,Vo(e,n)):null}function Vo(e,t){const n=e.getTextContentSize();let r="next"===t?n:"previous"===t?0:t;return(r<0||r>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);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.`)}(284,String(t),String(n),e.getKey()),r=r<0?0:n),r}function Zo(e,t){return new ea(e,t)}function Yo(e,t){return Ui(e)?new qo[t](e):null}function Xo(e){return e&&function(e){return e&&e.getChildCaret()||e}(e.getAdjacentCaret())}class Qo{type="node-caret-range";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 Qo(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return Uo(t)?function(e,t){const{direction:n,origin:r}=e;return Zo(e,Vo(r,"focus"===t?Do(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[Zo(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=Uo(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Uo(n),i=t=>t.isSameNodeCaret(n)?null:Xo(t)||t.getParentCaret(e);return ra({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 ea{type="slice";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 Go(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}function ta(e){return na(e,Jo(Is(),e.direction))}function na(e,t){return e.direction!==t.direction&&oe(265),new Qo(e,t,e.direction)}function ra(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 ia(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 sa(n)}}function sa(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 oa(e,t){return t.is(e)}function aa(e){return Ui(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?(oa(e,r)||oe(276),{commonAncestor:r,type:"ancestor"}):null===i?(oa(t,r)||oe(277),{commonAncestor:r,type:"descendant"}):((Ui(s)||oa(e,s))&&(Ui(i)||oa(t,i))&&r.is(s.getParent())&&r.is(i.getParent())||oe(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function ca(e,t){const{type:n,key:r,offset:i}=e,s=function(e){const t=Ns(e);return null===t&&oe(63,e),t}(e.key);return"text"===n?(Pr(s)||oe(266,s.getType(),r),Go(s,t,i)):(Ui(s)||oe(267,s.getType(),r),function(e,t,n){let r=Yo(e,"next");for(let e=0;e<t;e++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return xa(r,n)}(s,e.offset,t))}function ua(e,t){const{origin:n,direction:r}=t,i="next"===r;Uo(t)?e.set(n.getKey(),t.offset,"text"):Wo(t)?Pr(n)?e.set(n.getKey(),Vo(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(Ko(t)&&Ui(n)||oe(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}function da(e){const t=ii(),n=Ur(t)?t:ti();return ha(n,e),Ms(n),n}function ha(e,t){ua(e.anchor,t.anchor),ua(e.focus,t.focus)}function ga(e){const{anchor:t,focus:n}=e,r=ca(t,"next"),i=ca(n,"next"),s=ia(r,i)<=0?"next":"previous";return na(xa(r,s),xa(i,s))}function pa(e){const{direction:t,origin:n}=e,r=Jo(n,Do(t)).getNodeAtCaret();return r?Jo(r,t):Yo(n.getParentOrThrow(),t)}function fa(e,t="root"){const n=[e];for(let r=Ko(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(pa(r));return n}function ma(e){return!!e&&e.origin.isAttached()}function ya(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const s=ka(e,r),o=fa(s.anchor,n),a=fa(s.focus.getFlipped(),n),l=new Set,c=[];for(const e of s.iterNodeCarets(n))if(Ko(e))l.add(e.origin.getKey());else if(Wo(e)){const{origin:t}=e;Ui(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=pa(Jo(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=Lr(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());s.replaceOrInsert(n),t=Go(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(ma(e)){u=_a(e);break}for(const e of a)if(ma(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(ho(i))return;!n&&t(i)&&(n=i)}return n},u=c(s,wo),d=u&&c(o,(e=>n.has(e.getKey())&&wo(e)));return u&&d?[u,d]:null}(u,d,l);if(h){const[e,t]=h;Yo(e,"previous").splice(0,t.getChildren()),t.remove()}const g=[u,d,...o,...a].find(ma);if(g)return function(e){return na(e,e)}(xa(_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(;Ko(t);){const e=Xo(t);if(!Ko(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Pr(t.origin))return Uo(t)?t:Go(t.origin,n,n);const r=t.getAdjacentCaret();return Wo(r)&&Pr(r.origin)?Go(r.origin,n,Do(n)):t}function ba(e){return Uo(e)&&e.offset!==Vo(e.origin,e.direction)}function xa(e,t){return e.direction===t?e:e.getFlipped()}function ka(e,t){return e.direction===t?e:na(xa(e.focus,t),xa(e.anchor,t))}const Sa=()=>{const e=document.head.querySelector("meta[name=csp-nonce]");return e?.content},va=new Map;function wa(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 Ta(e){let t=va.get(e);return void 0===t&&(t=wa(e),va.set(e,t)),t}function Ca(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!bs(t)&&null!==n){const[r,i]=n,s=e.isBackward(),o=r.getNode(),a=i.getNode(),l=t.is(o),c=t.is(a);if(l||c){const[n,r]=jr(e),i=o.is(a),l=t.is(s?a:o),c=t.is(s?o:a);let u,d=0;i?(d=n>r?r:n,u=n>r?n:r):l?(d=s?r:n,u=void 0):c&&(d=0,u=s?n:r),t.__text=t.__text.slice(d,u)}}return t}function Ea(e){const t=e.getStyle(),n=wa(t);va.set(t,n)}function Na(e){const t=e.anchor.getNode(),n=qi(t)?t:t.getParentOrThrow(),r=Co().getElementByKey(n.getKey());if(null===r)return!1;const i=r.ownerDocument.defaultView;return null!==i&&"vertical-rl"===i.getComputedStyle(r).writingMode}function Aa(e,t){const n=Na(e)?!t:t,r=ca(e.focus,n?"previous":"next");if(ba(r))return!1;for(const e of ta(r)){if(Ko(e))return!e.origin.isInline();if(!Ui(e.origin)){if(Hi(e.origin))return!0;break}}return!1}function La(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(qi(t)?t:t.getParentOrThrow()).getDirection()}(e);let i;i=Na(e)||r?!n:n,function(e,t,n,r){e.modify(t?"extend":"move",n,r)}(e,t,i,"character")}const Pa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Fa=Pa&&"documentMode"in document?document.documentMode:null;function Oa(...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 Ia(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Ra(e,...t){const n=Oa(...t);n.length>0&&e.classList.add(...n)}function Ma(e,...t){const n=Oa(...t);n.length>0&&e.classList.remove(...n)}function Da(e){return e?e.getAdjacentCaret():null}function za(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function Ba(e){const t=$a(e,(e=>Ui(e)&&!e.isInline()));return Ui(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}Pa&&"InputEvent"in window&&!Fa&&new window.InputEvent("input");const $a=(e,t)=>{let n=e;for(;n!==Is()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function Ua(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function Wa(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 Ka(e){let t=e.getParent();hl(t)||Wa(40);let n=t;for(;null!==n;)n=n.getParent(),hl(n)&&(t=n);return t}function Ha(e){let t=[];const n=e.getChildren().filter(sl);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();hl(i)?t=t.concat(Ha(i)):t.push(r)}return t}function ja(e){return sl(e)&&hl(e.getFirstChild())}function qa(e){return il().append(e)}function Ja(e,t){return sl(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function Ga(e){const t=ii();if(null!==t){let n=t.getNodes();if(Ur(t)){const r=t.getStartEndPoints();null===r&&Wa(143);const[i]=r,s=i.getNode(),o=s.getParent();if(ho(s)){const e=s.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=ss();s.append(e),n=e.select().getNodes()}}else if(Ja(s,n)){const t=dl(e);if(ho(o)){s.replace(t);const e=il();Ui(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(sl(s)){const e=s.getParentOrThrow();Va(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(Ui(i)&&i.isEmpty()&&!sl(i)&&!r.has(i.getKey())){Za(i,e);continue}let s=vs(i)?i.getParent():sl(i)&&i.isEmpty()?i:null;for(;null!=s;){const t=s.getKey();if(hl(s)){if(!r.has(t)){const n=dl(e);Va(n,s.getChildren()),s.replace(n),r.add(t)}break}{const n=s.getParent();if(ho(n)&&!r.has(t)){r.add(t),Za(s,e);break}s=n}}}}}function Va(e,t){e.splice(e.getChildrenSize(),0,t)}function Za(e,t){if(hl(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=il();let s;if(Va(i,e.getChildren()),hl(n)&&t===n.getListType())n.append(i),hl(r)&&t===r.getListType()&&(Va(n,r.getChildren()),r.remove()),s=n;else if(hl(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const n=dl(t);n.append(i),e.replace(n),s=n}return i.setFormat(e.getFormatType()),i.setIndent(e.getIndent()),e.remove(),s}function Ya(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&ja(n)&&ja(r)&&(Ya(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function Xa(e){const t=new Set;if(ja(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(ja(r)&&ja(i)){const n=i.getFirstChild();if(hl(n)){n.append(e);const i=r.getFirstChild();hl(i)&&(Va(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(ja(r)){const t=r.getFirstChild();if(hl(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(ja(i)){const t=i.getFirstChild();hl(t)&&t.append(e)}else if(hl(n)){const t=il().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=dl(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 Qa(e){if(ja(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(hl(n?n.getParent():void 0)&&sl(n)&&hl(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=il(),s=dl(r);i.append(s),e.getPreviousSiblings().forEach((e=>s.append(e)));const o=il(),a=dl(r);o.append(a),Va(a,e.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(e)}}}function el(...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 tl=class e extends $i{static getType(){return"listitem"}static clone(t){return new e(t.__value,t.__checked,t.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){const r=this.getParent();hl(r)&&"check"===r.getListType()&&function(e,t,n){hl(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(...el(o)),s){const e=n.getParent(),t=hl(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=el(a);n.getChildren().some((e=>hl(e)))?r.push(...e):i.push(...e)}i.length>0&&Ma(e,...i),r.length>0&&Ra(e,...r)}(t,n.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(""===s?t.removeAttribute("style"):t.style.cssText=s),function(e,t,n){const r=Ta(t.__textStyle);for(const t in r)e.style.setProperty(`--listitem-marker-${t}`,r[t]);if(n)for(const t in Ta(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}static transform(){return e=>{if(sl(e)||Wa(144),null==e.__checked)return;const t=e.getParent();hl(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:nl,priority:0})}}static importJSON(e){return il().updateFromJSON(e)}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(Ui(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(sl(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!hl(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=dl(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&&(Ui(e)||Wa(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(hl(n)||Wa(39),sl(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=dl(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&&ja(t)&&ja(n)&&(Ya(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=il().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=ss();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=sl(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 hl(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(;sl(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&Wa(117),(e=Math.floor(e))>=0||Wa(199);let t=this.getIndent();for(;t!==e;)t<e?(Xa(this),t++):(Qa(this),t--);return this}canInsertAfter(e){return sl(e)}canReplaceWith(e){return sl(e)}canMergeWith(e){return sl(e)||os(e)}extractWithChild(e,t){if(!Ur(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 dl("bullet")}canMergeWhenEmpty(){return!0}};function nl(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return rl(t);const t=e.getAttribute("aria-checked");return{node:il("true"===t||"false"!==t&&void 0)}}function rl(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:il(e.hasAttribute("checked"))}}function il(e){return go(new tl(void 0,e))}function sl(e){return e instanceof tl}let ol=class e extends $i{static getType(){return"list"}static clone(t){const n=t.__listType||ul[t.__tag];return new e(n,t.__start,t.__key)}constructor(e="number",t=1,n){super(n);const r=ul[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__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,al(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(al(t,n.theme,this),!1)}static transform(){return e=>{hl(e)||Wa(163),function(e){const t=e.getNextSibling();hl(t)&&e.getListType()===t.getListType()&&Ya(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())sl(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),hl(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:cl,priority:0}),ul:()=>({conversion:cl,priority:0})}}static importJSON(e){return dl().updateFromJSON(e)}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];sl(t)||(r===n&&(r=[...n]),r[e]=il().append(!Ui(t)||hl(t)||t.isInline()?t:Lr(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return sl(e)}};function al(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(sl(n)){const e=n.getParent();if(hl(e)){t++,n=e.getParent();continue}Wa(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(...el(a));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(void 0!==c){const e=el(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&Ma(e,...i),r.length>0&&Ra(e,...r)}function ll(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(sl(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{hl(e)&&t.push(qa(e))}))}else t.push(qa(r))}return t}function cl(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=dl("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(bo(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?dl("check"):dl("bullet")),{after:ll,node:n}}const ul={ol:"number",ul:"bullet"};function dl(e="number",t=1){return go(new ol(e,t))}function hl(e){return e instanceof ol}const gl=Ut("INSERT_UNORDERED_LIST_COMMAND"),pl=Ut("INSERT_ORDERED_LIST_COMMAND"),fl=Ut("REMOVE_LIST_COMMAND");function ml(e){return Ia(e.registerCommand(pl,(()=>(Ga("number"),!0)),1),e.registerCommand(gl,(()=>(Ga("bullet"),!0)),1),e.registerCommand(fl,(()=>(function(){const e=ii();if(Ur(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Ja(r,n))t.add(Ka(r));else for(let e=0;e<n.length;e++){const r=n[e];if(vs(r)){const e=za(r,tl);null!=e&&t.add(Ka(e))}}for(const n of t){let t=n;const r=Ha(n);for(const n of r){const r=ss().setTextStyle(e.style).setTextFormat(e.format);Va(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&ua(e.anchor,_a(Yo(r,"next"))),n.__key===e.focus.key&&ua(e.focus,_a(Yo(r,"next"))),n.remove()}n.remove()}}}(),!0)),1),e.registerCommand(Jt,(()=>function(){const e=ii();if(!Ur(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!sl(t)||0!==t.getChildrenSize())return!1;const n=Ka(t),r=t.getParent();hl(r)||Wa(40);const i=r.getParent();let s;if(ho(i))s=ss(),n.insertAfter(s);else{if(!sl(i))return!1;s=il(),i.insertAfter(s)}s.setTextStyle(e.style).setTextFormat(e.format).select();const o=t.getNextSiblings();if(o.length>0){const e=dl(r.getListType());if(sl(s)){const t=il();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||!sl(e)&&!hl(e))break;t=e}t.remove()}(t),!0}()),1),e.registerNodeTransform(tl,(e=>{const t=e.getFirstChild();if(t){if(Pr(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=ii();Ur(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(kr,(e=>{const t=e.getParent();if(sl(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function yl(e,t){const n=t.body?t.body.childNodes:[];let r=[];const i=[];for(let t=0;t<n.length;t++){const s=n[t];if(!xl.has(s.nodeName)){const t=kl(s,e,i,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof ns&&t.insertAfter(hr());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(i),r}function _l(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=Is().getChildren();for(let i=0;i<r.length;i++)bl(e,r[i],n,t);return n.innerHTML}function bl(e,t,n,r=null){let i=null===r||t.isSelected(r);const s=Ui(t)&&t.excludeFromCopy("html");let o=t;if(null!==r){let e=Lo(t);e=Pr(e)&&null!==r?Ca(r,e):e,o=e}const a=Ui(o)?o.getChildren():[],l=e._nodes.get(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=bl(e,s,h,r);!i&&Ui(t)&&o&&t.extractWithChild(s,r,"html")&&(i=!0)}if(i&&!s){if((bo(u)||ko(u))&&u.append(h),n.append(u),d){const e=d.call(o,u);e&&(ko(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return i}const xl=new Set(["STYLE","SCRIPT"]);function kl(e,t,n,r,i=new Map,s){let o=[];if(xl.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||!ho(a))&&(null!=a&&Qr(a)||r);for(let e=0;e<d.length;e++)h.push(...kl(d[e],t,n,g,new Map(i),a));return null!=u&&(h=u(h)),vo(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(Qr(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(s.push(o),e===t.length-1||e<t.length-1&&Qr(t[e+1])){const e=n();e.setFormat(r),e.append(...s),i.push(e),s=[]}}return i}(e,h,g?()=>{const e=new ns;return n.push(e),e}:ss)),null==a?h.length>0?o=o.concat(h):vo(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(So(e.nextSibling)&&So(e.previousSibling))}(e)&&(o=o.concat(hr())):Ui(a)&&a.append(...h),o}function Sl(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 vl(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 wl(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=Li(e[n]);Pr(r)&&Ea(r),t.push(r)}return t}(e.nodes),t)}catch(e){}const i=e.getData("text/html"),s=e.getData("text/plain");if(i&&s!==i)try{return wl(n,yl(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){}const o=s||e.getData("text/uri-list");if(null!=o)if(Ur(t)){const e=o.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=ii();if(Ur(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([Ir()]):n.insertText(r)}}}else t.insertRawText(o)}function wl(e,t,n){e.dispatchCommand(Kt,{nodes:t,selection:n})||n.insertNodes(t)}function Tl(e,t,n,r=[]){let i=null===t||n.isSelected(t);const s=Ui(n)&&n.excludeFromCopy("html");let o=n;if(null!==t){let e=Lo(n);e=Pr(e)&&null!==t?Ca(t,e):e,o=e}const a=Ui(o)?o.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Sl(58,n.name),Ui(e)){const e=t.children;Array.isArray(e)||Sl(59,n.name)}return t}(o);if(Pr(o)){const e=o.__text;e.length>0?l.text=e:i=!1}for(let r=0;r<a.length;r++){const s=a[r],o=Tl(e,t,s,l.children);!i&&Ui(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 Cl=null;async function El(e,t,n){if(null!==Cl)return!1;if(null!==t)return new Promise(((r,i)=>{e.update((()=>{r(Nl(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,s=window.document,o=yo(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 i=e.registerCommand(wn,(r=>(Ua(r,ClipboardEvent)&&(i(),null!==Cl&&(window.clearTimeout(Cl),Cl=null),t(Nl(e,r,n))),!0)),4);Cl=window.setTimeout((()=>{i(),Cl=null,t(!1)}),50),s.execCommand("copy"),a.remove()}))}function Nl(e,t,n){if(void 0===n){const t=yo(e._window);if(!t)return!1;const r=t.anchorNode,i=t.focusNode;if(null!==r&&null!==i&&!ps(e,r,i))return!1;const s=ii();if(null===s)return!1;n=function(e=ii()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Co();for(const[r,i]of Al){const s=i(n,e);null!==s&&(t[r]=s)}}return t}(s)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const Al=[["text/html",function(e,t=ii()){return null==t&&Sl(166),Ur(t)&&t.isCollapsed()||0===t.getNodes().length?"":_l(e,t)}],["application/x-lexical-editor",function(e,t=ii()){return null==t&&Sl(166),Ur(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=Is().getChildren();for(let i=0;i<r.length;i++)Tl(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function Ll(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 Pl="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Fl=Pl&&"documentMode"in document?document.documentMode:null,Ol=!(!Pl||!("InputEvent"in window)||Fl)&&"getTargetRanges"in new window.InputEvent("input"),Il=Pl&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Rl=Pl&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Ml=Pl&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Dl=Pl&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ml,zl=Ut("DRAG_DROP_PASTE_FILE");class Bl extends $i{static getType(){return"quote"}static clone(e){return new Bl(e.__key)}createDOM(e){const t=document.createElement("blockquote");return Ra(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:jl,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 $l().updateFromJSON(e)}insertNewAfter(e,t){const n=ss(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=ss();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function $l(){return go(new Bl)}function Ul(e){return e instanceof Bl}let Wl=class e extends $i{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){Ra(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Hl,priority:0}),h2:e=>({conversion:Hl,priority:0}),h3:e=>({conversion:Hl,priority:0}),h4:e=>({conversion:Hl,priority:0}),h5:e=>({conversion:Hl,priority:0}),h6:e=>({conversion:Hl,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&Kl(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Kl(e)?{conversion:e=>({node:ql("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 ql(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?ss():ql(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=ss();e.select(),this.replace(e,!0)}return i}collapseAtStart(){const e=this.isEmpty()?ss():ql(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};function Kl(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Hl(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=ql(t),null!==e.style&&(Po(e,n),n.setFormat(e.style.textAlign))),{node:n}}function jl(e){const t=$l();return null!==e.style&&(t.setFormat(e.style.textAlign),Po(e,t)),{node:t}}function ql(e="h1"){return go(new Wl(e))}function Jl(e){return e instanceof Wl}function Gl(e){let t=null;if(Ua(e,DragEvent)?t=e.dataTransfer:Ua(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 Vl(e){const t=ii();if(!Ur(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=$a(i,(e=>Ui(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 Zl(e){return Hi(Ps(e))}function Yl(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Xl(e){return Ia(e.registerCommand(Ht,(e=>{const t=ii();return!!Kr(t)&&(t.clear(),!0)}),0),e.registerCommand(jt,(e=>{const t=ii();return Ur(t)?(t.deleteCharacter(e),!0):!!Kr(t)&&(t.deleteNodes(),!0)}),0),e.registerCommand(Yt,(e=>{const t=ii();return!!Ur(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(Xt,(e=>{const t=ii();return!!Ur(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Gt,(t=>{const n=ii();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)vl(r,n,e);else if(Ur(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(Zt,(()=>{const e=ii();return!!Ur(e)&&(e.removeText(),!0)}),0),e.registerCommand(Qt,(e=>{const t=ii();return!!Ur(t)&&(t.formatText(e),!0)}),0),e.registerCommand(xn,(e=>{const t=ii();if(!Ur(t)&&!Kr(t))return!1;const n=t.getNodes();for(const t of n){const n=$a(t,(e=>Ui(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(qt,(e=>{const t=ii();return!!Ur(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Jt,(()=>{const e=ii();return!!Ur(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(mn,(()=>(di([Ir()]),!0)),0),e.registerCommand(yn,(()=>Vl((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(_n,(()=>Vl((e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),0),e.registerCommand(ln,(e=>{const t=ii();if(Kr(t)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(Ur(t)){const n=eo(t.focus,!0);if(!e.shiftKey&&Hi(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(cn,(e=>{const t=ii();if(Kr(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(Ur(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===Is().getChildrenSize()}(t))return e.preventDefault(),!0;const n=eo(t.focus,!1);if(!e.shiftKey&&Hi(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(on,(e=>{const t=ii();if(Kr(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!Ur(t))return!1;if(Aa(t,!0)){const n=e.shiftKey;return e.preventDefault(),La(t,n,!0),!0}return!1}),0),e.registerCommand(rn,(e=>{const t=ii();if(Kr(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!Ur(t))return!1;const n=e.shiftKey;return!!Aa(t,!1)&&(e.preventDefault(),La(t,n,!1),!0)}),0),e.registerCommand(hn,(t=>{if(Zl(t.target))return!1;const n=ii();if(Ur(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(qi(n))return!1;const r=Ba(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(_n,void 0);if(Rl&&"ko-KR"===navigator.language)return!1}else if(!Kr(n))return!1;return t.preventDefault(),e.dispatchCommand(jt,!0)}),0),e.registerCommand(pn,(t=>{if(Zl(t.target))return!1;const n=ii();return!(!Ur(n)&&!Kr(n))&&(t.preventDefault(),e.dispatchCommand(jt,!1))}),0),e.registerCommand(un,(t=>{const n=ii();if(!Ur(n))return!1;if(Yl(n),null!==t){if((Rl||Il||Dl)&&Ol)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(qt,!1)}return e.dispatchCommand(Jt,void 0)}),0),e.registerCommand(gn,(()=>!!Ur(ii())&&(e.blur(),!0)),0),e.registerCommand(bn,(t=>{const[,n]=Gl(t);if(n.length>0){const r=Ll(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,s=Ps(i);if(null!==s){const e=ti();if(Pr(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")}Ms(it(e))}e.dispatchCommand(zl,n)}return t.preventDefault(),!0}return!!Ur(ii())}),0),e.registerCommand(kn,(e=>{const[t]=Gl(e),n=ii();return!(t&&!Ur(n))}),0),e.registerCommand(Sn,(e=>{const[t]=Gl(e),n=ii();if(t&&!Ur(n))return!1;const r=Ll(e.clientX,e.clientY);if(null!==r){Hi(Ps(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(Cn,(()=>(function(e){const t=Is();if(Ur(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"),it(e),e}{const e=t.select(0,t.getChildrenSize());Ms(it(e))}}(),!0)),0),e.registerCommand(wn,(t=>(El(e,Ua(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(Tn,(t=>(async function(e,t){await El(t,Ua(e,ClipboardEvent)?e:null),t.update((()=>{const e=ii();Ur(e)?e.removeText():Kr(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(Vt,(t=>{const[,n,r]=Gl(t);return n.length>0&&!r?(e.dispatchCommand(zl,n),!0):(!xo(t.target)||!gs(t.target))&&(null!==ii()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=ii(),r=Ua(e,InputEvent)||Ua(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&vl(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(dn,(e=>{const t=ii();return Ur(t)&&Yl(t),!1}),0),e.registerCommand(fn,(e=>{const t=ii();return Ur(t)&&Yl(t),!1}),0))}var Ql=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,"&amp;").replace(/</g,"&lt;").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,S=r.next,v=l;S!==t.tail&&!(d&&v>=d.reach);v+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof s)){var T,C=1;if(_){if(!(T=o(k,v,e,y))||T.index>=e.length)break;var E=T.index,N=T.index+T[0].length,A=v;for(A+=S.value.length;E>=A;)A+=(S=S.next).value.length;if(v=A-=S.value.length,S.value instanceof s)continue;for(var L=S;L!==t.tail&&(A<N||"string"==typeof L.value);L=L.next)C++,A+=L.value.length;C--,w=e.slice(v,A),T.index-=v}else if(!(T=o(k,0,w,y)))continue;E=T.index;var P=T[0],F=w.slice(0,E),O=w.slice(E+P.length),I=v+w.length;d&&I>d.reach&&(d.reach=I);var R=S.prev;if(F&&(R=c(t,R,F),v+=F.length),u(t,R,C),S=c(t,R,new s(h,m?i.tokenize(P,m):P,b,P)),O&&c(t,S,O),C>1){var M={cause:h+","+p,reach:I};a(e,t,n,S.prev,v,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,"&quot;")+'"';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 Ql(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=Xl),"undefined"!=typeof global&&(global.Prism=Xl),Xl.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]},Xl.languages.markup.tag.inside["attr-value"].inside.entity=Xl.languages.markup.entity,Xl.languages.markup.doctype.inside["internal-subset"].inside=Xl.languages.markup,Xl.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Xl.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Xl.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Xl.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},Xl.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Xl.languages.markup.tag,"addAttribute",{value:function(e,t){Xl.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:Xl.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Xl.languages.html=Xl.languages.markup,Xl.languages.mathml=Xl.languages.markup,Xl.languages.svg=Xl.languages.markup,Xl.languages.xml=Xl.languages.extend("markup",{}),Xl.languages.ssml=Xl.languages.xml,Xl.languages.atom=Xl.languages.xml,Xl.languages.rss=Xl.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"))}(Xl),Xl.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:/[{}[\];(),.:]/},Xl.languages.javascript=Xl.languages.extend("clike",{"class-name":[Xl.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}|\?\?=?|\?\.?|[~:]/}),Xl.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Xl.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:Xl.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:Xl.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Xl.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Xl.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:Xl.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Xl.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:Xl.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"}}),Xl.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Xl.languages.markup&&(Xl.languages.markup.tag.addInlined("script","javascript"),Xl.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")),Xl.languages.js=Xl.languages.javascript,function(){if(void 0!==Xl&&"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+'"])';Xl.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Xl.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}Xl.util.setLanguage(a,c),Xl.util.setLanguage(o,c);var d=Xl.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,Xl.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Xl.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Xl.highlightElement(t)}};var s=!1;Xl.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Xl.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(/&amp;/,"&"))})),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:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},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);const ec=globalThis.Prism||window.Prism,tc=e=>{try{return!!e&&ec.languages.hasOwnProperty(e)}catch(e){return!1}};function nc(e,t){for(const n of e.childNodes){if(bo(n)&&n.tagName===t)return!0;nc(n,t)}return!1}const rc="data-language",ic="data-highlight-language";let sc=class e extends Ui{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=tc(e)}createDOM(e){const t=document.createElement("code");Ia(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(rc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(ic,n)),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&(t.setAttribute(rc,r),this.__isSyntaxHighlightSupported&&t.setAttribute(ic,r)):i&&(t.removeAttribute(rc),e.__isSyntaxHighlightSupported&&t.removeAttribute(ic)),!1}exportDOM(e){const t=document.createElement("pre");Ia(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(rc,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(ic,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||nc(e,"BR"))?{conversion:lc,priority:1}:null,div:()=>({conversion:cc,priority:1}),pre:()=>({conversion:lc,priority:0}),table:e=>gc(e)?{conversion:uc,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&gc(n)?{conversion:dc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&gc(t)?{conversion:dc,priority:3}:null}}}static importJSON(e){return oc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}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=ss();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Fr(o)){let e=vc(o);const t=[];for(;;)if(Mr(e))t.push(Ir()),e=e.getNextSibling();else{if(!bc(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(_c(" ".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=[hr(),...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(ac(o)){const{offset:t}=e.anchor;o.splice(t,0,[hr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ss();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.__isSyntaxHighlightSupported=tc(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}};function oc(e){return go(new sc(e))}function ac(e){return e instanceof sc}function lc(e){return{node:oc(e.getAttribute(rc))}}function cc(e){const t=e,n=hc(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(hc(t))return!0;t=t.parentElement}return!1}(t)?{node:n?oc():null}:{node:null}}function uc(){return{node:oc()}}function dc(){return{node:null}}function hc(e){return null!==e.style.fontFamily.match("monospace")}function gc(e){return e.classList.contains("js-file-line-container")}const fc={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"},pc={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};let mc=class e extends vr{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 Ia(t,yc(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=yc(n.theme,e.__highlightType),s=yc(n.theme,this.__highlightType);return i!==s&&(i&&Ma(t,i),s&&Ia(t,s)),r}static importJSON(e){return _c().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 oc()}};function yc(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function _c(e="",t){return go(new mc(e,t))}function bc(e){return e instanceof mc}function xc(e,t){let n=e;for(let r=Vo(e,t);r&&(bc(r.origin)||Mr(r.origin));r=Da(r))n=r.origin;return n}function vc(e){return xc(e,"previous")}function Sc(e){return xc(e,"next")}const Cc={defaultLanguage:"javascript",tokenize(e,t){return ec.tokenize(e,ec.languages[t||""]||ec.languages[this.defaultLanguage])}};function Tc(e,t,n){const r=e.getParent();ac(r)?kc(r,t,n):bc(e)&&e.replace(Lr(e.__text))}function Ec(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++)gr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const wc=new Set;function kc(e,t,n){const r=e.getKey();wc.has(r)||(wc.add(r),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=Ns(e);if(!ac(n)||!n.isAttached())return;const r=ii();if(!$r(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&gr(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=Fr(e);if(t||gr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Ns(r);if(!ac(t)||!t.isAttached())return!1;const i=t.getTextContent(),s=Nc(n.tokenize(i,t.getLanguage()||n.defaultLanguage)),o=function(e,t){let n=0;for(;n<e.length&&Ac(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++,!Ac(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:()=>{wc.delete(r)},skipTransforms:!0}))}function Nc(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(hr()):"\t"===i?n.push(Ir()):i.length>0&&n.push(_c(i,t))}}else{const{content:e}=r;"string"==typeof e?n.push(...Nc([e],r.type)):Array.isArray(e)&&n.push(...Nc(e,r.type))}return n}function Ac(e,t){return bc(e)&&bc(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Mr(e)&&Mr(t)||gr(e)&&gr(t)}function Lc(e){if(!$r(e))return!1;const t=e.anchor.getNode(),n=ac(t)?t:t.getParent(),r=e.focus.getNode(),i=ac(r)?r:r.getParent();return ac(n)&&n.is(i)}function Fc(e){const t=e.getNodes(),n=[];if(1===t.length&&ac(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];bc(i)||Mr(i)||gr(i)||Ql(169),gr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=Rr(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Oc(e){const t=ii();if(!$r(t)||!Lc(t))return!1;const n=Fc(t),r=n.length;if(0===r&&t.isCollapsed())return e===yn&&t.insertNodes([Ir()]),!0;if(0===r&&e===yn&&"\n"===t.getTextContent()){const e=Ir(),n=hr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),da(va(na(Go(e,"next",0),_a(Vo(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=vc(n)),e===yn){const e=Ir();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=Rr(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Mr(n)&&n.remove()}}return!0}function Pc(e,t){const n=ii();if(!$r(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===ln;if(!Lc(n)||!bc(a)&&!Mr(a)||!bc(l)&&!Mr(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=vc(a),d=Sc(l)):(u=vc(l),d=Sc(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(!bc(t)&&!Mr(t)&&!gr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!gr(g))return!0;const f=c?g.getPreviousSibling():g.getNextSibling();if(null==f)return!0;const p=bc(f)||Mr(f)||gr(f)?c?vc(f):Sc(f):null;let m=null!=p?p:f;return g.remove(),h.forEach((e=>e.remove())),e===ln?(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 Ic(e,t){const n=ii();if(!$r(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===an;if(!Lc(n)||!bc(s)&&!Mr(s)||!bc(o)&&!Mr(o))return!1;if(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(bc(i)||Mr(i)||gr(i)||Ql(167),gr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];bc(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())bc(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();bc(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(!bc(n)||r===s){if(n=n.getNextSibling(),null===n||gr(n))return null;bc(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(bc(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(o,i.offset);if(null!==e){const{node:t,offset:r}=e;gr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else o.getParentOrThrow().selectStart()}else(function(e){const t=Sc(e);return gr(t)&&Ql(168),t})(o).select();return t.preventDefault(),t.stopPropagation(),!0}const Mc=new Set(["http:","https:","mailto:","sms:","tel:"]);let Dc=class e extends Ui{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),Ia(t,e.theme.link),t}updateLinkDOM(e,t,n){if(_o(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:Rc,priority:1})}}static importJSON(e){return Bc().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=Vc(e);try{const t=new URL(Vc(e));if(!Mc.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=Bc(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(!$r(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 Rc(e){let t=null;if(_o(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Bc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Bc(e="",t){return go(new Dc(e,t))}function zc(e){return e instanceof Dc}let Uc=class e extends Dc{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(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__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 $c().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($i(n)){const e=$c(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function $c(e="",t){return go(new Uc(e,t))}function Wc(e){return e instanceof Uc}function Kc(e,t){if("element"===e.type){const n=e.getNode();return $i(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 Hc(e,t={}){const{target:n,title:r}=t,i=void 0===t.rel?"noreferrer":t.rel,s=ii();if(null===s||!$r(s)&&!Kr(s))return;if(Kr(s)){const t=s.getNodes();if(0===t.length)return;return void t.forEach((t=>{if(null===e){const e=za(t,(e=>!Wc(e)&&zc(e)));e&&(e.insertBefore(t),0===e.getChildren().length&&e.remove())}else{const r=za(t,(e=>!Wc(e)&&zc(e)));if(r)r.setURL(e),void 0!==n&&r.setTarget(n),void 0!==i&&r.setRel(i);else{const r=Bc(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}))}const o=s.extract();if(null===e)return void o.forEach((e=>{const t=za(e,(e=>!Wc(e)&&zc(e)));if(t){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));const a=new Set,l=t=>{a.has(t.getKey())||(a.add(t.getKey()),t.setURL(e),void 0!==n&&t.setTarget(n),void 0!==i&&t.setRel(i),void 0!==r&&t.setTitle(r))};if(1===o.length){const e=jc(o[0],zc);if(null!==e)return l(e)}!function(e){const t=ii();if(!$r(t))return e();const n=it(t),r=n.isBackward(),i=Kc(n.anchor,r?-1:0),s=Kc(n.focus,r?0:-1);if(e(),i||s){const e=ii();if($r(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")}Ds(it(t))}}}((()=>{let t=null;for(const s of o){if(!s.isAttached())continue;const o=jc(s,zc);if(o){l(o);continue}if($i(s)){if(!s.isInline())continue;if(zc(s)){if(!(Wc(s)||null!==t&&t.getParentOrThrow().isParentOf(s))){l(s),t=s;continue}for(const e of s.getChildren())s.insertBefore(e);s.remove();continue}}const a=s.getPreviousSibling();zc(a)&&a.is(t)?a.append(s):(t=Bc(e,{rel:i,target:n,title:r}),s.insertAfter(t),t.append(s))}}))}function jc(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Jc=/^\+?[0-9\s()-]{5,}$/;function Vc(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Jc.test(e)?`tel:${e}`:`https://${e}`}function Gc(e){let t=e;for(;null!==t;){if(il(t))return t;t=t.getParent()}return null}function qc(e){let t=e;for(;t;){if(dl(t))return t.getListType();t=t.getParent()}return null}class Yc extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){this.#e(),window.addEventListener("resize",this.#e)}disconnectedCallback(){window.removeEventListener("resize",this.#e)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i()}#t(){this.addEventListener("click",this.#s.bind(this))}#s({target:e}){this.#o(e,"[data-command]",this.#a.bind(this)),this.#o(e,"[data-dialog-target]",this.#l.bind(this))}#o(e,t,n){const r=e.closest(t);r&&n(r)}#a(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#l(e){const t=document.getElementById(e.dataset.dialogTarget).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.#c(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#c(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.#u.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#d()}))}))}#d(){const e=ii();if(!$r(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=ac(n)||e.hasFormat("code"),o=this.#h(t),a=qc(t),l=Ul(n),c=Jl(n),u=this.#g(t);this.#f("bold",r),this.#f("italic",i),this.#f("code",s),this.#f("unordered-list",o&&"bullet"===a),this.#f("ordered-list",o&&"number"===a),this.#f("quote",l),this.#f("heading",c),this.#f("link",u)}#p(e){return e.getNodes().some((e=>{if(bc(e))return!0;if(Fr(e)){const t=e.getParent();if(t&&bc(t))return!0}return!1}))}#h(e){let t=e;for(;t;){if(dl(t)||il(t))return!0;t=t.getParent()}return!1}#g(e){let t=e;for(;t;){if(zc(t))return!0;t=t.getParent()}return!1}#f(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#m(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#y(),this.#_(),this.#b.style.display=this.#x.children.length?"block":"none"};get#b(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#x(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#y(){for(;this.#x.children.length>0;)this.insertBefore(this.#x.children[0],this.#b)}#_(){const e=this.#u.reverse();let t=!1;for(const n of e){if(!this.#m()){t&&this.#x.appendChild(n);break}this.#x.appendChild(n),t=!0}}get#u(){return Array.from(this.querySelectorAll(":scope > button"))}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="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 id="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 <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 Zc(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}function Xc(e){const t=Zc(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}customElements.define("lexxy-toolbar",Yc);const Qc=/[!-/:-@[-`{-~\s]/,eu=/^\s{0,3}$/;function tu(e){if(!os(e))return!1;const t=e.getFirstChild();return null==t||1===e.getChildrenSize()&&Fr(t)&&eu.test(t.getTextContent())}function nu(e){return Fr(e)&&!e.hasFormat("code")}function ru(e,t,n){let r=function(e,t){const n=function(e,t){const n=e.match(t.openTagsRegExp);if(null==n)return null;for(const r of n){const n=r.replace(/^\s/,""),i=t.fullMatchRegExpByTag[n];if(null==i)continue;const s=e.match(i),o=t.transformersByTag[n];if(null!=s&&null!=o){if(!1!==o.intraword)return s;const{index:t=0}=s,n=e[t-1],r=e[t+s[0].length];if((!n||Qc.test(n))&&(!r||Qc.test(r)))return s}}return null}(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}(e,t),i=function(e,t){const n=e;let r,i,s,o;for(const e of t){if(!e.replace||!e.importRegExp)continue;const t=n.getTextContent().match(e.importRegExp);if(!t)continue;const a=t.index||0,l=e.getEndIndex?e.getEndIndex(n,t):a+t[0].length;!1!==l&&(void 0===r||void 0===i||a<r&&l>i)&&(r=a,i=l,s=e,o=t)}return void 0===r||void 0===i||void 0===s||void 0===o?null:{endIndex:i,match:o,startIndex:r,transformer:s}}(e,n);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex?i=null:r=null),r){const i=function(e,t,n,r,i){const s=e.getTextContent();let o,a,l;if(i[0]===s?o=e:0===t?[o,a]=e.splitText(n):[l,o,a]=e.splitText(t,n),o.setTextContent(i[2]),r)for(const e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:a,nodeBefore:l,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);nu(i.nodeAfter)&&ru(i.nodeAfter,t,n),nu(i.nodeBefore)&&ru(i.nodeBefore,t,n),nu(i.transformedNode)&&ru(i.transformedNode,t,n)}else if(i){const r=function(e,t,n,r,i){let s,o,a;return 0===t?[s,o]=e.splitText(n):[a,s,o]=e.splitText(t,n),r.replace?{nodeAfter:o,nodeBefore:a,transformedNode:r.replace(s,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;nu(r.nodeAfter)&&ru(r.nodeAfter,t,n),nu(r.nodeBefore)&&ru(r.nodeBefore,t,n),nu(r.transformedNode)&&ru(r.transformedNode,t,n)}const s=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,((e,t)=>String.fromCodePoint(t)));e.setTextContent(s)}function iu(e,t,n,r){for(const i of n){const{handleImportAfterStartMatch:n,regExpEnd:s,regExpStart:o,replace:a}=i,l=e[t].match(o);if(!l)continue;if(n){const s=n({lines:e,rootNode:r,startLineIndex:t,startMatch:l,transformer:i});if(null===s)continue;if(s)return s}const c="object"==typeof s&&"regExp"in s?s.regExp:s,u=s&&"object"==typeof s&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const n=c?e[d].match(c):null;if(!n&&(!u||u&&d<h-1)){d++;continue}if(n&&t===d&&n.index===l.index){d++;continue}const i=[];if(n&&t===d)i.push(e[t].slice(l[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){const t=e[r].slice(l[0].length);i.push(t)}else if(r===d&&n){const t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==a(r,null,l,n,i,!0))return[!0,d];break}}return[!1,t]}function su(e,t,n,r,i,s){const o=Lr(e),a=ss();a.append(o),t.append(a);for(const{regExp:t,replace:r}of n){const n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(a,[o],n,!0)))break}if(ru(o,r,i),a.isAttached()&&e.length>0){const e=a.getPreviousSibling();if(!s&&(os(e)||Ul(e)||dl(e))){let t=e;if(dl(e)){const n=e.getLastDescendant();t=null==n?null:za(n,il)}null!=t&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[hr(),...a.getChildren()]),a.remove())}}}function ou(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 au(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(lu(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function lu(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}const cu=/^(\s*)(\d{1,})\.\s/,uu=/^(\s*)[-*+]\s/,du=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,hu=/^(#{1,6})\s/,gu=/^>\s/,fu=/^[ \t]*```(\w+)?/,pu=/[ \t]*```$/,mu=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,yu=/^(?:\|)(.+)(?:\|)\s?$/,_u=/^(\| ?:?-*:? ?)+\|\s?$/,bu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},xu=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=rl("check"===e?"x"===r[3]:void 0);if(dl(o)&&o.getListType()===e){const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(dl(s)&&s.getListType()===e)s.append(a),t.remove();else{const n=ul(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const l=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]);l&&a.setIndent(l)},vu=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(il(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(dl(e)){r.push(vu(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l="number"===a?`${e.getStart()+s}. `:"check"===a?`- [${o.getChecked()?"x":" "}] `:"- ";r.push(i+l+t(o)),s++}return r.join("\n")},Su={dependencies:[$l],export:(e,t)=>{if(!Jl(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:hu,replace:bu((e=>jl("h"+e[1].length))),type:"element"},Cu={dependencies:[Bl],export:(e,t)=>{if(!Ul(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:gu,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Ul(n))return n.splice(n.getChildrenSize(),0,[hr(),...t]),void e.remove()}const i=zl();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},Tu={dependencies:[sc],export:e=>{if(!ac(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:pu},regExpStart:fu,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=oc(),a=n[1]+i[0]):(o=oc(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=oc(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=Lr(a);o.append(t),e.append(o)}else t&&bu((e=>oc(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},Eu={dependencies:[sl,el],export:(e,t)=>dl(e)?vu(e,t,0):null,regExp:uu,replace:xu("bullet"),type:"element"},wu={dependencies:[sl,el],export:(e,t)=>dl(e)?vu(e,t,0):null,regExp:cu,replace:xu("number"),type:"element"},ku={dependencies:[Dc],export:(e,t,n)=>{if(!zc(e)||Wc(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=Bc(r,{title:i}),o=Lr(n);return o.setFormat(e.getFormat()),s.append(o),e.replace(s),o},trigger:")",type:"text-match"},Nu=[...[Su,Cu,Eu,wu],...[Tu],...[{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"}],...[ku]];function Au(e,t=Nu,n,r=!1,i=!1){const s=r?e:function(e,t=!1){const n=e.split("\n");let r=!1;const i=[];for(let e=0;e<n.length;e++){const s=n[e],o=i[i.length-1];mu.test(s)?i.push(s):fu.test(s)||pu.test(s)?(r=!r,i.push(s)):r||""===s||""===o||!o||hu.test(o)||hu.test(s)||gu.test(s)||cu.test(s)||uu.test(s)||du.test(s)||yu.test(s)||_u.test(s)||!t?i.push(s):i[i.length-1]=o+s}return i.join("\n")}(e,i);return function(e,t=!1){const n=Xc(e),r=function(e){const t={},n={},r=[];for(const i of e){const{tag:e}=i;t[e]=i;const s=e.replace(/(\*|\^|\+)/g,"\\$1");r.push(s),1===e.length?n[e]=new RegExp(`(?<![\\\\${s}])(${s})((\\\\${s})?.*?[^${s}\\s](\\\\${s})?)((?<!\\\\)|(?<=\\\\\\\\))(${s})(?![\\\\${s}])`):n[e]=new RegExp(`(?<!\\\\)(${s})((\\\\${s})?.*?[^\\s](\\\\${s})?)((?<!\\\\)|(?<=\\\\\\\\))(${s})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:new RegExp(`(?<![\\\\])(${r.join("|")})`,"g"),transformersByTag:t}}(n.textFormat);return(e,i)=>{const s=e.split("\n"),o=s.length,a=i||Is();a.clear();for(let e=0;e<o;e++){const i=s[e],[o,l]=iu(s,e,n.multilineElement,a);o?e=l:su(i,a,n.element,r,n.textMatch,t)}const l=a.getChildren();for(const e of l)!t&&tu(e)&&a.getChildrenSize()>1&&e.remove();null!==ii()&&a.selectStart()}}(t,r)(s,n)}function Lu(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(!($r(s)&&$r(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||Ji(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)&&Fr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Fr(c)||!Fr(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 f=h.offset,p=g.offset,m=d.length-u.length;return 1===m&&p===f-1?2:-1===m&&p===f+1?3:-1===m&&p===f?4:0}function Fu(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(Zi))return r=0,n=u,2;const d=Lu(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Xi))return 0;if(null===i)return 1;const f=s._selection;return a.size>0||l.size>0?!1===g&&0!==d&&d===r&&u<n+t&&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!($r(s)&&$r(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Fr(r)||!Fr(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:null!==f?0:2})();return n=u,r=d,h}}function Ou(e){e.undoStack=[],e.redoStack=[],e.current=null}var Pu={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",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"}};function Iu(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]}`}const Mu=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote"].join(","),Du=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","q","strong","ul"],Ru=["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 Bu(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 zu(e){return(new DOMParser).parseFromString(e,"text/html")}function Uu(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function $u(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Wu(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Ku extends Ki{static getType(){return"action_text_attachment"}static clone(e){return new Ku({...e},e.__key)}static importJSON(e){return new Ku({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Ku({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 Ku({src:e.getAttribute("src"),contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),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.#v(e)})),this.isPreviewableAttachment?(e.appendChild(this.#S()),e.appendChild(this.#C())):(e.appendChild(this.#T()),e.appendChild(this.#E())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Bu("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,Bu("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#w(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#w||this.previewable}#S(){return Bu("img",{src:this.src,alt:this.altText,...this.#k})}get#k(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#T(){return Bu("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#E(){const e=Bu("figcaption",{className:"attachment__caption"}),t=Bu("strong",{className:"attachment__name",textContent:this.caption||this.fileName}),n=Bu("span",{className:"attachment__size",textContent:Iu(this.fileSize)});return e.appendChild(t),e.appendChild(n),e}#v(e){Uu(e,"lexxy:internal:select-node",{key:this.getKey()})}#C(){const e=Bu("figcaption",{className:"attachment__caption"}),t=Bu("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#N.bind(this)),t.addEventListener("keydown",this.#A.bind(this)),e.appendChild(t),e}#L(e){}#N(e){const t=e.target;t.placeholder=this.fileName,this.#F(t)}#F(e){Uu(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#A(e){"Enter"===e.key&&(this.#F(e.target),Uu(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Hu extends Ku{static getType(){return"action_text_attachment_upload"}static clone(e){return new Hu({...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.#S()):e.appendChild(this.#T()),e.appendChild(this.#O());const t=Bu("progress",{value:this.progress,max:100});return e.appendChild(t),this.#P(e).then((()=>this.#I(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#S(){return Bu("img")}#T(){return Bu("span",{className:"attachment__icon",textContent:this.#M()})}#M(){return this.file.name.split(".").pop().toLowerCase()}#O(){const e=Bu("figcaption",{className:"attachment__caption"}),t=Bu("span",{className:"attachment__name",textContent:this.file.name||""}),n=Bu("span",{className:"attachment__size",textContent:Iu(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#P(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()}#I(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.#R(t,n).then((()=>{this.#B(n,t)}))}))}#D(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Bu("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=Ns(this.getKey());i&&i.replace(new Ku({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:Xi})}async#R(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#S();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}const ju=["bold","rotateHeadingFormat","italic","link","unlink","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","uploadAttachments"];class Ju{static configureFor(e){new Ju(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#z(),this.#U()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(Qt,"bold")}dispatchItalic(){this.editor.dispatchCommand(Qt,"italic")}dispatchLink(e){this.#$(e)}dispatchUnlink(){this.#$(null)}dispatchInsertUnorderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"bullet"===qc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(hl,void 0)}dispatchInsertOrderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"number"===qc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gl,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedLines((e=>Ul(e)),(()=>zl()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(Qt,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>ac(e)),(()=>new sc("plain")))}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=ii();if(!$r(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Jl(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>jl(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Bu("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)}#z(){for(const t of ju){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#W(t,0,this[n].bind(this))}var e;this.#W(qt,1,this.dispatchPaste.bind(this))}#W(e,t,n){this.editor.registerCommand(e,n,t)}#$(e){this.editor.update((()=>{Hc(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.#H.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#J.bind(this)))}#j(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()}#H(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 Vu(){return new Promise(requestAnimationFrame)}class Gu{constructor(e){this.editorElement=e,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#V(),this.#G()}clear(){this.current=null}set current(e){Kr(e)?(this._current=ii(),this.#q()):this.editor.update((()=>{this.#q(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Y();if(!t)return;const n=this.#Z(t);n&&(e=this.#X(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{Is().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=ii();if(!$r(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(gr(e))return!1;return!0}get isInsideList(){const e=ii();if(!$r(e))return!1;return null!==Gc(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Fr(e)?this.#ee(e,t):$i(e)?this.#te(e,t):this.#ne(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Fr(e)?this.#re(e,t):$i(e)?this.#ie(e,t):this.#se(e):null}get#oe(){return this.editorElement.contents}get#ae(){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(on,this.#le.bind(this),1),this.editor.registerCommand(ln,this.#le.bind(this),1),this.editor.registerCommand(rn,this.#ce.bind(this),1),this.editor.registerCommand(cn,this.#ce.bind(this),1),this.editor.registerCommand(fn,this.#ue.bind(this),1),this.editor.registerCommand(hn,this.#de.bind(this),1),this.editor.registerCommand(Wt,(()=>{this.current=ii()}),1)}#V(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Vu();const{key:t}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e){const t=ni();t.add(e.getKey()),Ds(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#he()}))}#q(){this.#ge(),this.#fe(),this.previouslySelectedKeys=this.#ae,this._currentlySelectedKeys=null}#ge(){for(const e of this.previouslySelectedKeys)if(!this.#ae.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#fe(){for(const e of this.#ae)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#le(){this.current?await this.#pe((e=>e.selectPrevious())):this.#me(this.nodeBeforeCursor)}async#ce(){this.current?await this.#pe((e=>e.selectNext(0,0))):this.#me(this.nodeAfterCursor)}async#pe(e){await Vu(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#he(){this.editor.update((()=>{const e=this.#ye();e&&this.#_e(e)}))}#ye(){const e=ii();return e?Kr(e)?this.#be(e):$r(e)?this.#xe(e):null:null}#be(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#xe(e){return e.anchor.getNode().getTopLevelElement()}#_e(e){const t=e.getNextSibling();t?t.selectStart():this.#ve()}#ve(){const e=Is(),t=ss();e.append(t),t.selectStart()}#me(e){e&&e instanceof Ki&&this.editor.update((()=>{const t=ni();t.add(e.getKey()),Ds(t)}))}#ue(){const e=this.nodeAfterCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#de(){const e=this.nodeBeforeCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#Y(){const e=ii();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#Z(e){let t=e.getBoundingClientRect();if(this.#Se(t)){const n=this.#Ce(e);t=n.getBoundingClientRect(),this.#Te(n),n.remove()}return t}#Se(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#Ce(e){const t=this.#Ee();return e.insertNode(t),t}#Ee(){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}#Te(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#X(e,t){const n=this.editor.getRootElement().getBoundingClientRect();let r=e.left-n.left,i=e.top-n.top;const s=this.#we(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#we(e){const t=window.getSelection().anchorNode,n=this.#ke(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#ke(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(){const e=ii();if(!$r(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ee(e,t){return t===e.getTextContentSize()?this.#Ne(e):null}#Ne(e){if(e.getNextSibling()instanceof Ki)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#te(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#ne(e)}#re(e,t){return 0===t?this.#Ae(e):null}#Ae(e){if(e.getPreviousSibling()instanceof Ki)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#ie(e,t){return t>0?e.getChildAtIndex(t-1):this.#se(e)}#ne(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#se(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class qu{constructor(e){this.editorElement=e,this.editor=e.editor}insertHtml(e){this.editor.update((()=>{const t=ii();if(!$r(t))return;const n=ml(this.editor,zu(e));t.insertNodes(n)}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=ii();if(!$r(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=ii();if(!$r(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.insertNodeWrappingAllSelectedLines(t)}))}insertNodeWrappingAllSelectedLines(e){this.editor.update((()=>{const t=ii();$r(t)&&(t.isCollapsed()?this.#Le(t,e):this.#Fe(t,e))}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=ii();if(!$r(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=ss();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=ii();e=$r(t)&&!t.isCollapsed()})),e}hasSelectedWords(){let e=!1;return this.editor.update((()=>{const t=ii();$r(t)&&(e=!t.isCollapsed()&&t.anchor.getNode().getTopLevelElement()===t.focus.getNode().getTopLevelElement())})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=ii();if(!$r(e))return;const{listItems:t,parentLists:n}=this.#Oe(e);if(t.size>0){const e=this.#Pe(t);this.#Ie(n),this.#Me(e)}}))}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Hc(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Fr(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=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Fr(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.#De();if(!n)return;const i=this.#Re(n,r,e);-1!==i&&this.#Be(n,r,i,t)}))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#ze(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=ii(),i=r?.anchor.getNode(),s=i?.getTopLevelElement(),o=new Hu({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});s&&os(s)&&0===s.getChildrenSize()?s.replace(o):s&&$i(s)?s.insertAfter(o):di([o])}),{tag:Xi})}deleteSelectedNodes(){this.editor.update((()=>{if(Kr(this.#Ue.current)){let e=!1;if(this.#Ue.current.getNodes().forEach((t=>{const n=t.getParent();t.remove(),"root"===n.getType()&&0===n.getChildrenSize()&&n.append(ss()),e=!0})),e)return this.#Ue.clear(),this.editor.focus(),!0}}))}get#Ue(){return this.editorElement.selection}#Le(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else di([t()])}#Fe(e,t){const n=this.#$e(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#We(n);if(0===r.size)return;const s=this.#Ke(t,r);this.#He(e,s),this.#je(i)}#$e(e){const t=e.extract().map((e=>this.#Je(e))).filter(Boolean);return Ds(null),t}#Je(e){return os(e)?e:Fr(e)&&e.getParent()&&os(e.getParent())?e.getParent():null}#We(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}}#Ke(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Lr(e)),t<r.length-1&&n.append(hr())})),n}#He(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#je(e){e.forEach((e=>e.remove()))}#Oe(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Gc(e);if(t){n.add(t);const e=t.getParent();e&&dl(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#Pe(e){const t=[];for(const n of e){const e=this.#Ve(n);e&&t.push(e)}return t}#Ve(e){const t=e.getParent();if(!t||!dl(t))return null;const n=ss(),r=this.#Ge(e,n);return e.insertAfter(n),this.#qe(n,r),e.remove(),n}#Ge(e,t){const n=[];return e.getChildren().forEach((e=>{dl(e)?n.push(e):t.append(e)})),n}#qe(e,t){t.forEach((t=>{e.insertAfter(t)}))}#Ie(e){for(const t of e)dl(t)&&0===t.getChildrenSize()&&t.remove()}#Me(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Ye(t,n)}#Ye(e,t){e.selectStart();const n=ii();n&&$r(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#De(){const e=ii();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Fr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#Re(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#Be(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Lr(s),l=Lr(o||" ");e.replace(a);this.#Ze(a,r).insertAfter(l),this.#Xe(l.getParentOrThrow()),l.select(0,0)}#Ze(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#Xe(e){if(os(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Fr(n)&&""===n.getTextContent()&&r&&!Fr(r)&&e.append(hr())}}#ze(e){return $u(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Yu(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}class Zu{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#Qe(t)?(this.#et(t),e.preventDefault(),!0):void this.#tt(t))}#Qe(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#et(e){e.items[0].getAsString((e=>{(function(e){try{return new URL(e),!0}catch(e){return!1}})(e)&&this.contents.hasSelectedText()?this.contents.createLinkWithSelectedText(e):this.#nt(e)}))}#nt(e){this.editor.update((()=>{Au(e,Nu)}))}#tt(e){this.editorElement.supportsAttachments&&this.#rt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#rt(e){const t=window.scrollY,n=window.scrollX;e(),await Vu(),window.scrollTo(n,t),this.editor.focus()}}class Xu extends Ki{static getType(){return"custom_action_text_attachment"}static clone(e){return new Xu({...e},e.__key)}static importJSON(e){return new Xu({...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(Lr(" ")),n.push(new Xu({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Lr(" ")),{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=Bu("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{Uu(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Bu("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 Qu extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic",""];static observedAttributes=["connected"];#it="";constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Wu("lexxy-editor"),this.editor=this.#st(),this.contents=new qu(this),this.selection=new Gu(this),this.clipboard=new Zu(this),Ju.configureFor(this),this.#ot(),requestAnimationFrame((()=>$u(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#at()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#lt()))}formResetCallback(){this.value=this.#it,this.editor.dispatchCommand(Nn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#ct?(this.toolbar=this.toolbar||this.#ut(),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:Du,ALLOWED_ATTR:Ru,SAFE_FOR_XML:!1})}(yl(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{ao(ts);const t=Is();t.clear(),t.append(...this.#dt(e)),t.select(),this.#ht(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#dt(e){e||(e="<p></p>");return ml(this.editor,zu(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof Ki&&!t.isInline())return t}return e}))}#ot(){this.#gt(),this.#ft(),this.#pt(),this.#mt(),this.#yt(),this.#_t(),this.#bt(),this.#xt()}#st(){this.editorContentElement=this.editorContentElement||this.#vt();const e=ls({namespace:"LexicalEditor",onError(e){throw e},theme:Pu,nodes:this.#St});return e.setRootElement(this.editorContentElement),e}get#St(){const e=[Bl,$l,sl,el,sc,mc,Dc,Uc,Xu];return this.supportsAttachments&&e.push(Ku,Hu),e}#vt(){const e=Bu("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#Ct,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#Tt.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#Ct(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#Tt(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#Et(e){const t=void 0!==this.#Et&&this.#Et!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,t&&$u(this,"lexxy:change")}get#Et(){return this._internalFormValue}#bt(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#it=e}#xt(){document.addEventListener("turbo:before-cache",this.#wt)}#wt=e=>{this.#at()};#gt(){this.#kt(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#Et=this.value,this.#ht()})))}#kt(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Nt(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#ft(){Zl(this.editor),function(e,t,n){const r=Fu(e,n),i=Pa(e.registerCommand(en,(()=>(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(An,!0)),0===r.length&&e.dispatchCommand(Ln,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Zi})}}(e,t),!0)),0),e.registerCommand(tn,(()=>(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(Ln,!0));const s=n.pop();0===n.length&&e.dispatchCommand(An,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Zi})}}(e,t),!0)),0),e.registerCommand(kn,(()=>(Ou(t),!1)),0),e.registerCommand(Nn,(()=>(Ou(t),e.dispatchCommand(An,!1),e.dispatchCommand(Ln,!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(An,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Ln,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}(this.editor,{current:null,redoStack:[],undoStack:[]},20),pl(this.editor),this.#At(),function(e,t=Nu){const n=Xc(t),r=Zc(n.textFormat,(({tag:e})=>e[e.length-1])),i=Zc(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)||ou(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!ho(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(!ho(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&&!lu(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Qc.test(l))continue;const c=e;let u=c,d=au(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!gr(h);)if(Fr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=au(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 f=g[d-1];if(!1===t.intraword&&f&&!Qc.test(f))continue;const p=c.getTextContent(),m=p.slice(0,a)+p.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=ii(),b=ti();Ds(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 $r(_)&&(b.format=_.format),!0}}(t,s,r)};e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Qi)||t.has(Zi))return;if(e.isComposing())return;const o=r.read(ii),a=i.read(ii);if(!$r(a)||!$r(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Fr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!nu(u))return;const e=u.getParent();null===e||ac(e)||s(e,u,o.anchor.offset)}))}))}(this.editor,Nu)}#At(){!function(e,t){if(!e.hasNodes([sc,mc]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=Cc);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(sc,(t=>{e.update((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Ns(n);null!==t&&Ec(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(sc,(n=>kc(n,e,t))),e.registerNodeTransform(vr,(n=>Tc(n,e,t))),e.registerNodeTransform(mc,(n=>Tc(n,e,t))),e.registerCommand(pn,(t=>{const n=function(e){const t=ii();if(!$r(t)||!Lc(t))return null;const n=e?_n:yn,r=e?_n:mn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Fc(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&Ql(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=vc(a[0]),d=Sc(a[0]),h=Rr(u.getKey(),0,"text"),g=Rr(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(mn,(()=>!!Lc(ii())&&(di([Ir()]),!0)),1),e.registerCommand(yn,(e=>Oc(yn)),1),e.registerCommand(_n,(e=>Oc(_n)),1),e.registerCommand(ln,(e=>{const t=ii();if(!$r(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Lc(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&ac(r.getParentOrThrow())?(e.preventDefault(),!0):Pc(ln,e))}),1),e.registerCommand(cn,(e=>{const t=ii();if(!$r(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Lc(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&ac(r.getParentOrThrow())?(e.preventDefault(),!0):Pc(cn,e))}),1),e.registerCommand(an,(e=>Ic(an,e)),1),e.registerCommand(sn,(e=>Ic(sn,e)),1)),Pa(...n)}(this.editor),this.append(Bu("lexxy-code-language-picker"))}#pt(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e instanceof Ku){const t=e.getWritable();Object.assign(t,n)}}))}))}#mt(){this.editor.registerCommand(un,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#yt(){Qu.debug&&this.#kt(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#_t(){this.#ct&&this.toolbarElement.setEditor(this)}#ut(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#Lt()}get#ct(){return"false"!==this.getAttribute("toolbar")}#Lt(){const e=Bu("lexxy-toolbar");return e.innerHTML=Yc.defaultTemplate,this.prepend(e),e}#ht(){this.classList.toggle("lexxy-editor--empty",this.#Ft)}get#Ft(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(Mu)}#at(){this.#Nt(),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)}#lt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Qu);class ed extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#Ot.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Pt.bind(this)),this.addEventListener("keydown",this.#It.bind(this))}show(e){this.input.value=this.#Mt,this.dialog.show()}close(){this.dialog.close()}#Ot(e){const t=e.submitter?.value;this.#Dt.dispatchCommand(t,this.input.value)}#Pt(e){this.#Dt.dispatchCommand("unlink"),this.close()}#It(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#Mt(){let e="";return this.#Dt.getEditorState().read((()=>{const t=ii();if(!$r(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if(zc(n)){e=n.getURL();break}n=n.getParent()}})),e}get#Dt(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",ed);class td{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Bu("li",{role:"option",id:Wu("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=zu(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class nd extends td{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Rt(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Rt(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return Yu(e).includes(Yu(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class rd extends nd{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class id extends nd{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class sd extends td{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.#Bt(e));return this.#Rt(t)}#Bt(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Rt(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 od extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#zt(),this.#Ut()}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#$t(){return!this.supportsSpaceInSearches}#zt(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new sd(e):new id(e):new rd(this.querySelectorAll("lexxy-prompt-item"))}#Ut(){const e=this.#Dt.registerUpdateListener((()=>{this.#Dt.read((()=>{const t=ii();if(!t)return;let n;if($r(t)?n=t.anchor.getNode():Kr(t)&&([n]=t.getNodes()),n&&Fr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#Wt())}}))}))}get#Dt(){return this.#Kt.editor}get#Kt(){return this.closest("lexxy-editor")}get#Ue(){return this.#Kt.selection}async#Wt(){this.popoverElement??=await this.#Ht(),await this.#jt(),this.#Jt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#Vt(),this.#Kt.addEventListener("keydown",this.#Gt),this.#Kt.addEventListener("lexxy:change",this.#jt),this.#qt()}#qt(){this.keyListeners.push(this.#Dt.registerCommand(un,this.#Yt.bind(this),3)),this.keyListeners.push(this.#Dt.registerCommand(pn,this.#Yt.bind(this),3)),this.#$t&&this.keyListeners.push(this.#Dt.registerCommand(dn,this.#Yt.bind(this),3))}#Vt(){const e=this.#Zt[0];e&&this.#Xt(e)}get#Zt(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#Xt(e){this.#Qt(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#Kt.focus(),this.#en.setAttribute("aria-controls",this.popoverElement.id),this.#en.setAttribute("aria-activedescendant",e.id),this.#en.setAttribute("aria-haspopup","listbox")}#Qt(){this.#Zt.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#en.removeAttribute("aria-controls"),this.#en.removeAttribute("aria-activedescendant"),this.#en.removeAttribute("aria-haspopup")}#Jt(){const{x:e,y:t,fontSize:n}=this.#Ue.cursorPosition,r=this.#Kt.getBoundingClientRect(),i=this.#en.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#tn(){this.#Qt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#Kt.removeEventListener("lexxy:change",this.#jt),this.#Kt.removeEventListener("keydown",this.#Gt),this.#nn(),await Vu(),this.#Ut()}#nn(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#jt=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#rn.containsTextBackUntil(this.trigger)?await this.#in():this.#tn()};async#in(){const e=this.#rn.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#sn(t):this.#on(),this.#Vt()}#sn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#on(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Bu("li",{innerHTML:this.#an});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#an(){return this.getAttribute("empty-results")||"Nothing found"}#Gt=e=>{"Escape"===e.key?(this.#tn(),this.#Kt.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#ln(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#cn(),e.preventDefault(),e.stopPropagation())};#ln(){const e=this.#un+1;e<this.#Zt.length&&this.#Xt(this.#Zt[e])}#cn(){const e=this.#un-1;e>=0&&this.#Xt(this.#Zt[e])}get#un(){return this.#Zt.findIndex((e=>e.hasAttribute("aria-selected")))}get#dn(){return this.#Zt[this.#un]}#Yt(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#hn(),!0}#hn(){this.#gn(),this.#tn(),this.#Kt.focus()}#gn(){const e=this.source.promptItemFor(this.#dn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#rn.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#fn(t,n):this.#pn(e,t,n)}#fn(e,t){this.#Dt.update((()=>{const n=ml(this.#Dt,zu(`${e.innerHTML}`));this.#rn.replaceTextBackUntil(t,n)}))}#pn(e,t,n){this.#Dt.update((()=>{const r=new Xu({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#rn.replaceTextBackUntil(n,r)}))}get#rn(){return this.#Kt.contents}get#en(){return this.#Kt.editorContentElement}async#Ht(){const e=Bu("ul",{role:"listbox",id:Wu("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#mn),this.#Kt.appendChild(e),e}#mn=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#Xt(t),this.#hn())}}customElements.define("lexxy-prompt",od);class ad extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#yn(),this.#_n()}#yn(){this.languagePickerElement=this.#bn(),this.languagePickerElement.addEventListener("change",(()=>{this.#xn(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.editorElement.appendChild(this.languagePickerElement)}#bn(){const e=Bu("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.#vn)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#vn(){const e={...fc};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])}#xn(e){this.editor.update((()=>{const t=this.#Sn();t&&t.setLanguage(e)}))}#_n(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Sn();e?this.#Cn(e):this.#Tn()}))}))}#Sn(){const e=ii();if(!$r(e))return null;const t=e.anchor.getNode(),n=t.getParent();return ac(t)?t:ac(n)?n:null}#Cn(e){const t=e.getLanguage();this.#En(t),this.#wn(),this.#kn(e)}#En(e){if(this.languagePickerElement&&e){const t=function(e){return pc[e]||e}(e);this.languagePickerElement.value=t}}#kn(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`}#wn(){this.languagePickerElement.hidden=!1}#Tn(){this.languagePickerElement.hidden=!0}}function ld(){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=Bu("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",ad),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{ld as highlightAll};
10
+ */function ec(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=Ql),"undefined"!=typeof global&&(global.Prism=Ql),Ql.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]},Ql.languages.markup.tag.inside["attr-value"].inside.entity=Ql.languages.markup.entity,Ql.languages.markup.doctype.inside["internal-subset"].inside=Ql.languages.markup,Ql.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Ql.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Ql.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Ql.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},Ql.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Ql.languages.markup.tag,"addAttribute",{value:function(e,t){Ql.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:Ql.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Ql.languages.html=Ql.languages.markup,Ql.languages.mathml=Ql.languages.markup,Ql.languages.svg=Ql.languages.markup,Ql.languages.xml=Ql.languages.extend("markup",{}),Ql.languages.ssml=Ql.languages.xml,Ql.languages.atom=Ql.languages.xml,Ql.languages.rss=Ql.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"))}(Ql),Ql.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:/[{}[\];(),.:]/},Ql.languages.javascript=Ql.languages.extend("clike",{"class-name":[Ql.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}|\?\?=?|\?\.?|[~:]/}),Ql.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Ql.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:Ql.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:Ql.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Ql.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:Ql.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Ql.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:Ql.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"}}),Ql.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Ql.languages.markup&&(Ql.languages.markup.tag.addInlined("script","javascript"),Ql.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")),Ql.languages.js=Ql.languages.javascript,function(){if(void 0!==Ql&&"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+'"])';Ql.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Ql.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}Ql.util.setLanguage(a,c),Ql.util.setLanguage(o,c);var d=Ql.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,Ql.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Ql.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Ql.highlightElement(t)}};var s=!1;Ql.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Ql.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(/&amp;/,"&"))})),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:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},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);const tc=globalThis.Prism||window.Prism,nc=e=>{try{return!!e&&tc.languages.hasOwnProperty(e)}catch(e){return!1}};function rc(e,t){for(const n of e.childNodes){if(bo(n)&&n.tagName===t)return!0;rc(n,t)}return!1}const ic="data-language",sc="data-highlight-language";let oc=class e extends $i{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=nc(e)}createDOM(e){const t=document.createElement("code");Ra(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&(t.setAttribute(ic,r),this.__isSyntaxHighlightSupported&&t.setAttribute(sc,r)):i&&(t.removeAttribute(ic),e.__isSyntaxHighlightSupported&&t.removeAttribute(sc)),!1}exportDOM(e){const t=document.createElement("pre");Ra(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||rc(e,"BR"))?{conversion:cc,priority:1}:null,div:()=>({conversion:uc,priority:1}),pre:()=>({conversion:cc,priority:0}),table:e=>pc(e)?{conversion:dc,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&pc(n)?{conversion:hc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pc(t)?{conversion:hc,priority:3}:null}}}static importJSON(e){return ac().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}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=ss();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Pr(o)){let e=Sc(o);const t=[];for(;;)if(Rr(e))t.push(Ir()),e=e.getNextSibling();else{if(!xc(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(bc(" ".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=[hr(),...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(lc(o)){const{offset:t}=e.anchor;o.splice(t,0,[hr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ss();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.__isSyntaxHighlightSupported=nc(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}};function ac(e){return go(new oc(e))}function lc(e){return e instanceof oc}function cc(e){return{node:ac(e.getAttribute(ic))}}function uc(e){const t=e,n=gc(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(gc(t))return!0;t=t.parentElement}return!1}(t)?{node:n?ac():null}:{node:null}}function dc(){return{node:ac()}}function hc(){return{node:null}}function gc(e){return null!==e.style.fontFamily.match("monospace")}function pc(e){return e.classList.contains("js-file-line-container")}const fc={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"},mc={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};class yc extends kr{constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new yc(e.__text,e.__highlightType||void 0,e.__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 Ra(t,_c(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=_c(n.theme,e.__highlightType),s=_c(n.theme,this.__highlightType);return i!==s&&(i&&Ma(t,i),s&&Ra(t,s)),r}static importJSON(e){return bc().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 ac()}}function _c(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function bc(e="",t){return go(new yc(e,t))}function xc(e){return e instanceof yc}function kc(e,t){let n=e;for(let r=Jo(e,t);r&&(xc(r.origin)||Rr(r.origin));r=Da(r))n=r.origin;return n}function Sc(e){return kc(e,"previous")}function vc(e){return kc(e,"next")}const wc={defaultLanguage:"javascript",tokenize(e,t){return tc.tokenize(e,tc.languages[t||""]||tc.languages[this.defaultLanguage])}};function Tc(e,t,n){const r=e.getParent();lc(r)?Nc(r,t,n):xc(e)&&e.replace(Lr(e.__text))}function Cc(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++)gr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Ec=new Set;function Nc(e,t,n){const r=e.getKey();Ec.has(r)||(Ec.add(r),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=Ns(e);if(!lc(n)||!n.isAttached())return;const r=ii();if(!Ur(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&gr(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=Pr(e);if(t||gr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Ns(r);if(!lc(t)||!t.isAttached())return!1;const i=t.getTextContent(),s=Ac(n.tokenize(i,t.getLanguage()||n.defaultLanguage)),o=function(e,t){let n=0;for(;n<e.length&&Lc(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++,!Lc(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:()=>{Ec.delete(r)},skipTransforms:!0}))}function Ac(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(hr()):"\t"===i?n.push(Ir()):i.length>0&&n.push(bc(i,t))}}else{const{content:e}=r;"string"==typeof e?n.push(...Ac([e],r.type)):Array.isArray(e)&&n.push(...Ac(e,r.type))}return n}function Lc(e,t){return xc(e)&&xc(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Rr(e)&&Rr(t)||gr(e)&&gr(t)}function Pc(e){if(!Ur(e))return!1;const t=e.anchor.getNode(),n=lc(t)?t:t.getParent(),r=e.focus.getNode(),i=lc(r)?r:r.getParent();return lc(n)&&n.is(i)}function Fc(e){const t=e.getNodes(),n=[];if(1===t.length&&lc(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];xc(i)||Rr(i)||gr(i)||ec(169),gr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=Dr(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Oc(e){const t=ii();if(!Ur(t)||!Pc(t))return!1;const n=Fc(t),r=n.length;if(0===r&&t.isCollapsed())return e===yn&&t.insertNodes([Ir()]),!0;if(0===r&&e===yn&&"\n"===t.getTextContent()){const e=Ir(),n=hr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),da(ka(na(Go(e,"next",0),_a(Jo(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=Sc(n)),e===yn){const e=Ir();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=Dr(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Rr(n)&&n.remove()}}return!0}function Ic(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===ln;if(!Pc(n)||!xc(a)&&!Rr(a)||!xc(l)&&!Rr(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=Sc(a),d=vc(l)):(u=Sc(l),d=vc(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(!xc(t)&&!Rr(t)&&!gr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!gr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=xc(p)||Rr(p)||gr(p)?c?Sc(p):vc(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===ln?(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 Rc(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===an;if(!Pc(n)||!xc(s)&&!Rr(s)||!xc(o)&&!Rr(o))return!1;if(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(xc(i)||Rr(i)||gr(i)||ec(167),gr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];xc(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())xc(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();xc(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(!xc(n)||r===s){if(n=n.getNextSibling(),null===n||gr(n))return null;xc(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(xc(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(o,i.offset);if(null!==e){const{node:t,offset:r}=e;gr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else o.getParentOrThrow().selectStart()}else(function(e){const t=vc(e);return gr(t)&&ec(168),t})(o).select();return t.preventDefault(),t.stopPropagation(),!0}const Mc=new Set(["http:","https:","mailto:","sms:","tel:"]);let Dc=class e extends $i{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),Ra(t,e.theme.link),t}updateLinkDOM(e,t,n){if(_o(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:zc,priority:1})}}static importJSON(e){return Bc().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=Gc(e);try{const t=new URL(Gc(e));if(!Mc.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=Bc(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(!Ur(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 zc(e){let t=null;if(_o(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Bc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Bc(e="",t){return go(new Dc(e,t))}function $c(e){return e instanceof Dc}let Uc=class e extends Dc{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(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__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 Wc().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(Ui(n)){const e=Wc(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function Wc(e="",t){return go(new Uc(e,t))}function Kc(e){return e instanceof Uc}function Hc(e,t){if("element"===e.type){const n=e.getNode();return Ui(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 jc(e,t={}){const{target:n,title:r}=t,i=void 0===t.rel?"noreferrer":t.rel,s=ii();if(null===s||!Ur(s)&&!Kr(s))return;if(Kr(s)){const t=s.getNodes();if(0===t.length)return;return void t.forEach((t=>{if(null===e){const e=$a(t,(e=>!Kc(e)&&$c(e)));e&&(e.insertBefore(t),0===e.getChildren().length&&e.remove())}else{const r=$a(t,(e=>!Kc(e)&&$c(e)));if(r)r.setURL(e),void 0!==n&&r.setTarget(n),void 0!==i&&r.setRel(i);else{const r=Bc(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}))}const o=s.extract();if(null===e)return void o.forEach((e=>{const t=$a(e,(e=>!Kc(e)&&$c(e)));if(t){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));const a=new Set,l=t=>{a.has(t.getKey())||(a.add(t.getKey()),t.setURL(e),void 0!==n&&t.setTarget(n),void 0!==i&&t.setRel(i),void 0!==r&&t.setTitle(r))};if(1===o.length){const e=qc(o[0],$c);if(null!==e)return l(e)}!function(e){const t=ii();if(!Ur(t))return e();const n=it(t),r=n.isBackward(),i=Hc(n.anchor,r?-1:0),s=Hc(n.focus,r?0:-1);if(e(),i||s){const e=ii();if(Ur(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")}Ms(it(t))}}}((()=>{let t=null;for(const s of o){if(!s.isAttached())continue;const o=qc(s,$c);if(o){l(o);continue}if(Ui(s)){if(!s.isInline())continue;if($c(s)){if(!(Kc(s)||null!==t&&t.getParentOrThrow().isParentOf(s))){l(s),t=s;continue}for(const e of s.getChildren())s.insertBefore(e);s.remove();continue}}const a=s.getPreviousSibling();$c(a)&&a.is(t)?a.append(s):(t=Bc(e,{rel:i,target:n,title:r}),s.insertAfter(t),t.append(s))}}))}function qc(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Jc=/^\+?[0-9\s()-]{5,}$/;function Gc(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Jc.test(e)?`tel:${e}`:`https://${e}`}function Vc(e){let t=e;for(;null!==t;){if(sl(t))return t;t=t.getParent()}return null}function Zc(e){let t=e;for(;t;){if(hl(t))return t.getListType();t=t.getParent()}return null}class Yc extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){this.#e(),window.addEventListener("resize",this.#e)}disconnectedCallback(){window.removeEventListener("resize",this.#e)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i()}#t(){this.addEventListener("click",this.#s.bind(this))}#s({target:e}){this.#o(e,"[data-command]",this.#a.bind(this)),this.#o(e,"[data-dialog-target]",this.#l.bind(this))}#o(e,t,n){const r=e.closest(t);r&&n(r)}#a(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#l(e){const t=document.getElementById(e.dataset.dialogTarget).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.#c(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#c(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.#u.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#d()}))}))}#d(){const e=ii();if(!Ur(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=lc(n)||e.hasFormat("code"),o=this.#h(t),a=Zc(t),l=Ul(n),c=Jl(n),u=this.#g(t);this.#p("bold",r),this.#p("italic",i),this.#p("code",s),this.#p("unordered-list",o&&"bullet"===a),this.#p("ordered-list",o&&"number"===a),this.#p("quote",l),this.#p("heading",c),this.#p("link",u)}#f(e){return e.getNodes().some((e=>{if(xc(e))return!0;if(Pr(e)){const t=e.getParent();if(t&&xc(t))return!0}return!1}))}#h(e){let t=e;for(;t;){if(hl(t)||sl(t))return!0;t=t.getParent()}return!1}#g(e){let t=e;for(;t;){if($c(t))return!0;t=t.getParent()}return!1}#p(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#m(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#y(),this.#_(),this.#b.style.display=this.#x.children.length?"block":"none",this.#b.setAttribute("nonce",Sa())};get#b(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#x(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#y(){for(;this.#x.children.length>0;)this.insertBefore(this.#x.children[0],this.#b)}#_(){const e=this.#u.reverse();let t=!1;for(const n of e){if(!this.#m()){t&&this.#x.appendChild(n);break}this.#x.appendChild(n),t=!0}}get#u(){return Array.from(this.querySelectorAll(":scope > button"))}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="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 id="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 <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 Xc(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",Yc);const Qc=/[!-/:-@[-`{-~\s]/;function eu(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 tu(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(nu(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function nu(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function ru(e,t=gu){const n=function(e){const t=Xc(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=Xc(n.textFormat,(({tag:e})=>e[e.length-1])),i=Xc(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)||eu(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!ho(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(!ho(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&&!nu(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Qc.test(l))continue;const c=e;let u=c,d=tu(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!gr(h);)if(Pr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=tu(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&&!Qc.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 _=ii(),b=ti();Ms(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 Ur(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Qi)||t.has(Yi))return;if(e.isComposing())return;const o=r.read(ii),a=i.read(ii);if(!Ur(a)||!Ur(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Pr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Pr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||lc(e)||s(e,u,o.anchor.offset)}))}))}const iu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},su=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=il("check"===e?"x"===r[3]:void 0);if(hl(o)&&o.getListType()===e){const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(hl(s)&&s.getListType()===e)s.append(a),t.remove();else{const n=dl(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const l=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]);l&&a.setIndent(l)},ou=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(sl(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(hl(e)){r.push(ou(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l="number"===a?`${e.getStart()+s}. `:"check"===a?`- [${o.getChecked()?"x":" "}] `:"- ";r.push(i+l+t(o)),s++}return r.join("\n")},au={dependencies:[Wl],export:(e,t)=>{if(!Jl(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:iu((e=>ql("h"+e[1].length))),type:"element"},lu={dependencies:[Bl],export:(e,t)=>{if(!Ul(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(Ul(n))return n.splice(n.getChildrenSize(),0,[hr(),...t]),void e.remove()}const i=$l();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},cu={dependencies:[oc],export:e=>{if(!lc(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=ac(),a=n[1]+i[0]):(o=ac(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=ac(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=Lr(a);o.append(t),e.append(o)}else t&&iu((e=>ac(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},uu={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:su("bullet"),type:"element"},du={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:su("number"),type:"element"},hu={dependencies:[Dc],export:(e,t,n)=>{if(!$c(e)||Kc(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=Bc(r,{title:i}),o=Lr(n);return o.setFormat(e.getFormat()),s.append(o),e.replace(s),o},trigger:")",type:"text-match"},gu=[...[au,lu,uu,du],...[cu],...[{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"}],...[hu]];function pu(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(!(Ur(s)&&Ur(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||qi(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)&&Pr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Pr(c)||!Pr(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}function fu(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(Yi))return r=0,n=u,2;const d=pu(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Xi))return 0;if(null===i)return 1;const p=s._selection;return a.size>0||l.size>0?!1===g&&0!==d&&d===r&&u<n+t&&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!(Ur(s)&&Ur(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Pr(r)||!Pr(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:null!==p?0:2})();return n=u,r=d,h}}function mu(e){e.undoStack=[],e.redoStack=[],e.current=null}var yu={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",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"}};function _u(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]}`}const bu=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote"].join(","),xu=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","q","strong","ul"],ku=["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 Su(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 vu(e){return(new DOMParser).parseFromString(e,"text/html")}function wu(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function Tu(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Cu(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Eu extends Ki{static getType(){return"action_text_attachment"}static clone(e){return new Eu({...e},e.__key)}static importJSON(e){return new Eu({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Eu({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 Eu({src:e.getAttribute("src"),contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),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.#k(e)})),this.isPreviewableAttachment?(e.appendChild(this.#S()),e.appendChild(this.#v())):(e.appendChild(this.#w()),e.appendChild(this.#T())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Su("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,Su("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#C(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#C||this.previewable}#S(){return Su("img",{src:this.src,alt:this.altText,...this.#E})}get#E(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#w(){return Su("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#T(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("strong",{className:"attachment__name",textContent:this.caption||this.fileName}),n=Su("span",{className:"attachment__size",textContent:_u(this.fileSize)});return e.appendChild(t),e.appendChild(n),e}#k(e){wu(e,"lexxy:internal:select-node",{key:this.getKey()})}#v(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#N.bind(this)),t.addEventListener("keydown",this.#A.bind(this)),e.appendChild(t),e}#L(e){}#N(e){const t=e.target;t.placeholder=this.fileName,this.#P(t)}#P(e){wu(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#A(e){"Enter"===e.key&&(this.#P(e.target),wu(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Nu extends Eu{static getType(){return"action_text_attachment_upload"}static clone(e){return new Nu({...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.#S()):e.appendChild(this.#w()),e.appendChild(this.#F());const t=Su("progress",{value:this.progress,max:100});return e.appendChild(t),this.#O(e).then((()=>this.#I(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#S(){return Su("img")}#w(){return Su("span",{className:"attachment__icon",textContent:this.#R()})}#R(){return this.file.name.split(".").pop().toLowerCase()}#F(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("span",{className:"attachment__name",textContent:this.file.name||""}),n=Su("span",{className:"attachment__size",textContent:_u(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#O(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()}#I(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.#M(n):this.#D(t,n).then((()=>{this.#z(n,t)}))}))}#M(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Su("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#z(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=Ns(this.getKey());i&&i.replace(new Eu({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:Xi})}async#D(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#S();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}const Au=["bold","rotateHeadingFormat","italic","link","unlink","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","uploadAttachments"];class Lu{static configureFor(e){new Lu(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#B(),this.#$()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(Qt,"bold")}dispatchItalic(){this.editor.dispatchCommand(Qt,"italic")}dispatchLink(e){this.#U(e)}dispatchUnlink(){this.#U(null)}dispatchInsertUnorderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"bullet"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gl,void 0)}dispatchInsertOrderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"number"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(pl,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedLines((e=>Ul(e)),(()=>$l()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(Qt,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>lc(e)),(()=>new oc("plain")))}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Jl(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>ql(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Su("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)}#B(){for(const t of Au){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#W(t,0,this[n].bind(this))}var e;this.#W(Vt,1,this.dispatchPaste.bind(this))}#W(e,t,n){this.editor.registerCommand(e,n,t)}#U(e){this.editor.update((()=>{jc(null===e?null:e)}))}#$(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#K.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#H.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#q.bind(this)))}#j(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#q(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#K(e){e.preventDefault()}#H(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 Pu(){return new Promise(requestAnimationFrame)}class Fu{constructor(e){this.editorElement=e,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#J(),this.#G()}clear(){this.current=null}set current(e){Kr(e)?(this._current=ii(),this.#V()):this.editor.update((()=>{this.#V(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Z();if(!t)return;const n=this.#Y(t);n&&(e=this.#X(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{Is().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=ii();if(!Ur(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(gr(e))return!1;return!0}get isInsideList(){const e=ii();if(!Ur(e))return!1;return null!==Vc(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#ee(e,t):Ui(e)?this.#te(e,t):this.#ne(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#re(e,t):Ui(e)?this.#ie(e,t):this.#se(e):null}get#oe(){return this.editorElement.contents}get#ae(){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(on,this.#le.bind(this),1),this.editor.registerCommand(ln,this.#le.bind(this),1),this.editor.registerCommand(rn,this.#ce.bind(this),1),this.editor.registerCommand(cn,this.#ce.bind(this),1),this.editor.registerCommand(pn,this.#ue.bind(this),1),this.editor.registerCommand(hn,this.#de.bind(this),1),this.editor.registerCommand(Wt,(()=>{this.current=ii()}),1)}#J(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Pu();const{key:t}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e){const t=ni();t.add(e.getKey()),Ms(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#he()}))}#V(){this.#ge(),this.#pe(),this.previouslySelectedKeys=this.#ae,this._currentlySelectedKeys=null}#ge(){for(const e of this.previouslySelectedKeys)if(!this.#ae.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#pe(){for(const e of this.#ae)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#le(){this.current?await this.#fe((e=>e.selectPrevious())):this.#me(this.nodeBeforeCursor)}async#ce(){this.current?await this.#fe((e=>e.selectNext(0,0))):this.#me(this.nodeAfterCursor)}async#fe(e){await Pu(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#he(){this.editor.update((()=>{const e=this.#ye();e&&this.#_e(e)}))}#ye(){const e=ii();return e?Kr(e)?this.#be(e):Ur(e)?this.#xe(e):null:null}#be(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#xe(e){return e.anchor.getNode().getTopLevelElement()}#_e(e){const t=e.getNextSibling();t?t.selectStart():this.#ke()}#ke(){const e=Is(),t=ss();e.append(t),t.selectStart()}#me(e){e&&e instanceof Ki&&this.editor.update((()=>{const t=ni();t.add(e.getKey()),Ms(t)}))}#ue(){const e=this.nodeAfterCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#de(){const e=this.nodeBeforeCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#Z(){const e=ii();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#Y(e){let t=e.getBoundingClientRect();if(this.#Se(t)){const n=this.#ve(e);t=n.getBoundingClientRect(),this.#we(n),n.remove()}return t}#Se(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#ve(e){const t=this.#Te();return e.insertNode(t),t}#Te(){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",Sa()),e}#we(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#X(e,t){const n=this.editor.getRootElement().getBoundingClientRect();let r=e.left-n.left,i=e.top-n.top;const s=this.#Ce(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Ce(e){const t=window.getSelection().anchorNode,n=this.#Ee(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#Ee(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(){const e=ii();if(!Ur(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ee(e,t){return t===e.getTextContentSize()?this.#Ne(e):null}#Ne(e){if(e.getNextSibling()instanceof Ki)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#te(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#ne(e)}#re(e,t){return 0===t?this.#Ae(e):null}#Ae(e){if(e.getPreviousSibling()instanceof Ki)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#ie(e,t){return t>0?e.getChildAtIndex(t-1):this.#se(e)}#ne(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#se(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Ou extends Ki{static getType(){return"custom_action_text_attachment"}static clone(e){return new Ou({...e},e.__key)}static importJSON(e){return new Ou({...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(Lr(" ")),n.push(new Ou({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Lr(" ")),{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=Su("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{wu(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Su("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 Iu{constructor(e){this.editorElement=e,this.editor=e.editor}insertHtml(e){this.editor.update((()=>{const t=ii();if(!Ur(t))return;const n=yl(this.editor,vu(e));t.insertNodes(n)}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=ii();if(!Ur(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=ii();if(!Ur(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.insertNodeWrappingAllSelectedLines(t)}))}insertNodeWrappingAllSelectedLines(e){this.editor.update((()=>{const t=ii();Ur(t)&&(t.isCollapsed()?this.#Le(t,e):this.#Pe(t,e))}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=ss();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=ii();e=Ur(t)&&!t.isCollapsed()})),e}hasSelectedWords(){let e=!1;return this.editor.update((()=>{const t=ii();Ur(t)&&(e=!t.isCollapsed()&&t.anchor.getNode().getTopLevelElement()===t.focus.getNode().getTopLevelElement())})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const{listItems:t,parentLists:n}=this.#Fe(e);if(t.size>0){const e=this.#Oe(t);this.#Ie(n),this.#Re(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Lr(e),r=Bc(e);r.append(n);const i=ii();Ur(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{jc(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(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=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(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.#Me();if(!n)return;const i=this.#De(n,r,e);-1!==i&&this.#ze(n,r,i,t)}))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#Be(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=ii(),i=r?.anchor.getNode(),s=i?.getTopLevelElement(),o=new Nu({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});s&&os(s)&&0===s.getChildrenSize()?s.replace(o):s&&Ui(s)?s.insertAfter(o):di([o])}),{tag:Xi})}deleteSelectedNodes(){this.editor.update((()=>{if(Kr(this.#$e.current)){let e=!1;if(this.#$e.current.getNodes().forEach((t=>{const n=t.getParent();t.remove(),"root"===n.getType()&&0===n.getChildrenSize()&&n.append(ss()),e=!0})),e)return this.#$e.clear(),this.editor.focus(),!0}}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Ns(e);if(!r)return;const i=ii();let s=!1;if(Ur(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&Ms(null)}const o=n.attachment?this.#Ue(t,n.attachment):this.#We(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Ns(e);if(!r)return;let i=r;try{i=r.getTopLevelElementOrThrow()}catch{}const s=n.attachment?this.#Ue(t,n.attachment):this.#We(t);i.insertAfter(s)}))}get#$e(){return this.editorElement.selection}#Le(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else di([t()])}#Pe(e,t){const n=this.#Ke(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#He(n);if(0===r.size)return;const s=this.#je(t,r);this.#qe(e,s),this.#Je(i)}#Ke(e){const t=e.extract().map((e=>this.#Ge(e))).filter(Boolean);return Ms(null),t}#Ge(e){return os(e)?e:Pr(e)&&e.getParent()&&os(e.getParent())?e.getParent():null}#He(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}}#je(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Lr(e)),t<r.length-1&&n.append(hr())})),n}#qe(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#Je(e){e.forEach((e=>e.remove()))}#Fe(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Vc(e);if(t){n.add(t);const e=t.getParent();e&&hl(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#Oe(e){const t=[];for(const n of e){const e=this.#Ve(n);e&&t.push(e)}return t}#Ve(e){const t=e.getParent();if(!t||!hl(t))return null;const n=ss(),r=this.#Ze(e,n);return e.insertAfter(n),this.#Ye(n,r),e.remove(),n}#Ze(e,t){const n=[];return e.getChildren().forEach((e=>{hl(e)?n.push(e):t.append(e)})),n}#Ye(e,t){t.forEach((t=>{e.insertAfter(t)}))}#Ie(e){for(const t of e)hl(t)&&0===t.getChildrenSize()&&t.remove()}#Re(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Xe(t,n)}#Xe(e,t){e.selectStart();const n=ii();n&&Ur(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#Me(){const e=ii();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Pr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#De(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#ze(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Lr(s),l=Lr(o||" ");e.replace(a);this.#Qe(a,r).insertAfter(l),this.#et(l.getParentOrThrow()),l.select(0,0)}#Qe(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#et(e){if(os(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Pr(n)&&""===n.getTextContent()&&r&&!Pr(r)&&e.append(hr())}}#Ue(e,t={}){return new Ou({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#We(e){return yl(this.editor,vu(e))[0]||ss()}#Be(e){return Tu(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Ru(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mu={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Du(e){Mu=e}var zu={exec:()=>null};function Bu(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($u.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var $u={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")},Uu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wu=/(?:[*+-]|\d{1,9}[.)])/,Ku=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hu=Bu(Ku).replace(/bull/g,Wu).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(),ju=Bu(Ku).replace(/bull/g,Wu).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(),qu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ju=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Gu=Bu(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ju).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vu=Bu(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wu).getRegex(),Zu="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",Yu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xu=Bu("^ {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",Yu).replace("tag",Zu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qu=Bu(qu).replace("hr",Uu).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",Zu).getRegex(),ed={blockquote:Bu(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qu).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Gu,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Uu,html:Xu,lheading:Hu,list:Vu,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Qu,table:zu,text:/^[^\n]+/},td=Bu("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Uu).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",Zu).getRegex(),nd={...ed,lheading:ju,table:td,paragraph:Bu(qu).replace("hr",Uu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",td).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",Zu).getRegex()},rd={...ed,html:Bu("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Yu).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:zu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bu(qu).replace("hr",Uu).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Hu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},id=/^( {2,}|\\)\n(?!\s*$)/,sd=/[\p{P}\p{S}]/u,od=/[\s\p{P}\p{S}]/u,ad=/[^\s\p{P}\p{S}]/u,ld=Bu(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,od).getRegex(),cd=/(?!~)[\p{P}\p{S}]/u,ud=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dd=Bu(ud,"u").replace(/punct/g,sd).getRegex(),hd=Bu(ud,"u").replace(/punct/g,cd).getRegex(),gd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pd=Bu(gd,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,sd).getRegex(),fd=Bu(gd,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,cd).getRegex(),md=Bu("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,sd).getRegex(),yd=Bu(/\\(punct)/,"gu").replace(/punct/g,sd).getRegex(),_d=Bu(/^<(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(),bd=Bu(Yu).replace("(?:--\x3e|$)","--\x3e").getRegex(),xd=Bu("^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",bd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Sd=Bu(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vd=Bu(/^!?\[(label)\]\[(ref)\]/).replace("label",kd).replace("ref",Ju).getRegex(),wd=Bu(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ju).getRegex(),Td={_backpedal:zu,anyPunctuation:yd,autolink:_d,blockSkip:/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,br:id,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:zu,emStrongLDelim:dd,emStrongRDelimAst:pd,emStrongRDelimUnd:md,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Sd,nolink:wd,punctuation:ld,reflink:vd,reflinkSearch:Bu("reflink|nolink(?!\\()","g").replace("reflink",vd).replace("nolink",wd).getRegex(),tag:xd,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:zu},Cd={...Td,link:Bu(/^!?\[(label)\]\((.*?)\)/).replace("label",kd).getRegex(),reflink:Bu(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kd).getRegex()},Ed={...Td,emStrongRDelimAst:fd,emStrongLDelim:hd,url:Bu(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Nd={...Ed,br:Bu(id).replace("{2,}","*").getRegex(),text:Bu(Ed.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ad={normal:ed,gfm:nd,pedantic:rd},Ld={normal:Td,gfm:Ed,breaks:Nd,pedantic:Cd},Pd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Fd=e=>Pd[e];function Od(e,t){if(t){if($u.escapeTest.test(e))return e.replace($u.escapeReplace,Fd)}else if($u.escapeTestNoEncode.test(e))return e.replace($u.escapeReplaceNoEncode,Fd);return e}function Id(e){try{e=encodeURI(e).replace($u.percentDecode,"%")}catch{return null}return e}function Rd(e,t){let n=e.replace($u.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split($u.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($u.slashPipe,"|");return r}function Md(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 Dd(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 zd=class{options;rules;lexer;constructor(e){this.options=e||Mu}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:Md(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=Md(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:Md(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Md(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=Rd(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(Rd(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=Md(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)),Dd(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 Dd(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}}}},Bd=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Mu,this.options.tokenizer=this.options.tokenizer||new zd,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:$u,block:Ad.normal,inline:Ld.normal};this.options.pedantic?(t.block=Ad.pedantic,t.inline=Ld.pedantic):this.options.gfm&&(t.block=Ad.gfm,this.options.breaks?t.inline=Ld.breaks:t.inline=Ld.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ad,inline:Ld}}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($u.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($u.tabCharGlobal," ").replace($u.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}},$d=class{options;parser;constructor(e){this.options=e||Mu}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match($u.notSpaceStart)?.[0],i=e.replace($u.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Od(r)+'">'+(n?i:Od(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Od(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+" "+Od(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>${Od(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=Id(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Od(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=Id(e);if(null===i)return Od(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Od(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Od(e.text)}},Ud=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""}},Wd=class e{options;renderer;textRenderer;constructor(e){this.options=e||Mu,this.options.renderer=this.options.renderer||new $d,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ud}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}},Kd=class{options;block;constructor(e){this.options=e||Mu}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?Bd.lex:Bd.lexInline}provideParser(){return this.block?Wd.parse:Wd.parseInline}},Hd=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=Wd;Renderer=$d;TextRenderer=Ud;Lexer=Bd;Tokenizer=zd;Hooks=Kd;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 $d(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 zd(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 Kd;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];Kd.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Kd.passThroughHooksRespectAsync.has(n))return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{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 Bd.lex(e,t??this.defaults)}parser(e,t){return Wd.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"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?Bd.lex:Bd.lexInline,a=i.hooks?i.hooks.provideParser():e?Wd.parse:Wd.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>o(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=a(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}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>"+Od(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function jd(e,t){return Hd.parse(e,t)}function qd(e){try{return new URL(e),!0}catch(e){return!1}}function Jd(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}jd.options=jd.setOptions=function(e){return Hd.setOptions(e),jd.defaults=Hd.defaults,Du(jd.defaults),jd},jd.getDefaults=Ru,jd.defaults=Mu,jd.use=function(...e){return Hd.use(...e),jd.defaults=Hd.defaults,Du(jd.defaults),jd},jd.walkTokens=function(e,t){return Hd.walkTokens(e,t)},jd.parseInline=Hd.parseInline,jd.Parser=Wd,jd.parser=Wd.parse,jd.Renderer=$d,jd.TextRenderer=Ud,jd.Lexer=Bd,jd.lexer=Bd.lex,jd.Tokenizer=zd,jd.Hooks=Kd,jd.parse=jd,jd.options,jd.setOptions,jd.use,jd.walkTokens,jd.parseInline,Wd.parse,Bd.lex;class Gd{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#tt(t)?(this.#nt(t),e.preventDefault(),!0):void this.#rt(t))}#tt(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#nt(e){e.items[0].getAsString((e=>{if(qd(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(qd(e)){const t=this.contents.createLink(e);this.#it(t,{url:e})}else this.#st(e)}))}#it(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};Tu(this.editorElement,"lexxy:insert-link",{...t,...n})}#st(e){const t=jd(e);this.contents.insertHtml(t)}#rt(e){this.editorElement.supportsAttachments&&this.#ot((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#ot(e){const t=window.scrollY,n=window.scrollX;e(),await Pu(),window.scrollTo(n,t),this.editor.focus()}}class Vd extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic",""];static observedAttributes=["connected"];#at="";constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Cu("lexxy-editor"),this.editor=this.#lt(),this.contents=new Iu(this),this.selection=new Fu(this),this.clipboard=new Gd(this),Lu.configureFor(this),this.#ct(),requestAnimationFrame((()=>Tu(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#ut()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#dt()))}formResetCallback(){this.value=this.#at,this.editor.dispatchCommand(Nn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#ht?(this.toolbar=this.toolbar||this.#gt(),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:xu,ALLOWED_ATTR:ku,SAFE_FOR_XML:!1})}(_l(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{ao(ts);const t=Is();t.clear(),t.append(...this.#pt(e)),t.select(),this.#ft(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#pt(e){e||(e="<p></p>");return yl(this.editor,vu(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof Ki&&!t.isInline())return t}return e}))}#ct(){this.#mt(),this.#yt(),this.#_t(),this.#bt(),this.#xt(),this.#kt(),this.#St(),this.#vt()}#lt(){this.editorContentElement=this.editorContentElement||this.#wt();const e=ls({namespace:"LexicalEditor",onError(e){throw e},theme:yu,nodes:this.#Tt});return e.setRootElement(this.editorContentElement),e}get#Tt(){const e=[Bl,Wl,ol,tl,oc,yc,Dc,Uc,Ou];return this.supportsAttachments&&e.push(Eu,Nu),e}#wt(){const e=Su("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#Ct,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#Et.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#Ct(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#Et(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#Nt(e){const t=void 0!==this.#Nt&&this.#Nt!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,t&&Tu(this,"lexxy:change")}get#Nt(){return this._internalFormValue}#St(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#at=e}#vt(){document.addEventListener("turbo:before-cache",this.#At)}#At=e=>{this.#ut()};#mt(){this.#Lt(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#Nt=this.value,this.#ft(),this.#Pt()})))}#Lt(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Ft(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#yt(){Xl(this.editor),function(e,t,n){const r=fu(e,n),i=Ia(e.registerCommand(en,(()=>(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(An,!0)),0===r.length&&e.dispatchCommand(Ln,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(tn,(()=>(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(Ln,!0));const s=n.pop();0===n.length&&e.dispatchCommand(An,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(En,(()=>(mu(t),!1)),0),e.registerCommand(Nn,(()=>(mu(t),e.dispatchCommand(An,!1),e.dispatchCommand(Ln,!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(An,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Ln,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}(this.editor,{current:null,redoStack:[],undoStack:[]},20),ml(this.editor),this.#Ot(),ru(this.editor,gu)}#Ot(){!function(e,t){if(!e.hasNodes([oc,yc]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=wc);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(oc,(t=>{e.update((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Ns(n);null!==t&&Cc(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(oc,(n=>Nc(n,e,t))),e.registerNodeTransform(kr,(n=>Tc(n,e,t))),e.registerNodeTransform(yc,(n=>Tc(n,e,t))),e.registerCommand(fn,(t=>{const n=function(e){const t=ii();if(!Ur(t)||!Pc(t))return null;const n=e?_n:yn,r=e?_n:mn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Fc(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&ec(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=Sc(a[0]),d=vc(a[0]),h=Dr(u.getKey(),0,"text"),g=Dr(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(mn,(()=>!!Pc(ii())&&(di([Ir()]),!0)),1),e.registerCommand(yn,(e=>Oc(yn)),1),e.registerCommand(_n,(e=>Oc(_n)),1),e.registerCommand(ln,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(ln,e))}),1),e.registerCommand(cn,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(cn,e))}),1),e.registerCommand(an,(e=>Rc(an,e)),1),e.registerCommand(sn,(e=>Rc(sn,e)),1)),Ia(...n)}(this.editor),this.append(Su("lexxy-code-language-picker"))}#_t(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e instanceof Eu){const t=e.getWritable();Object.assign(t,n)}}))}))}#bt(){this.editor.registerCommand(un,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#xt(){Vd.debug&&this.#Lt(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#kt(){this.#ht&&this.toolbarElement.setEditor(this)}#gt(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#It()}get#ht(){return"false"!==this.getAttribute("toolbar")}#It(){const e=Su("lexxy-toolbar");return e.innerHTML=Yc.defaultTemplate,this.prepend(e),e}#ft(){this.classList.toggle("lexxy-editor--empty",this.#Rt)}get#Rt(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(bu)}#Pt(){this.hasAttribute("required")&&this.#Rt?this.internals.setValidity({valueMissing:!0},"Please fill out this field.",this.editorContentElement):this.internals.setValidity({})}#ut(){this.#Ft(),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.#At)}#dt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Vd);class Zd extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#Mt.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Dt.bind(this)),this.addEventListener("keydown",this.#zt.bind(this))}show(e){this.input.value=this.#Bt,this.dialog.show()}close(){this.dialog.close()}#Mt(e){const t=e.submitter?.value;this.#$t.dispatchCommand(t,this.input.value)}#Dt(e){this.#$t.dispatchCommand("unlink"),this.close()}#zt(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#Bt(){let e="";return this.#$t.getEditorState().read((()=>{const t=ii();if(!Ur(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if($c(n)){e=n.getURL();break}n=n.getParent()}})),e}get#$t(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",Zd);class Yd{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Su("li",{role:"option",id:Cu("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=vu(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class Xd extends Yd{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Ut(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Ut(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return Jd(e).includes(Jd(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class Qd extends Xd{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class eh extends Xd{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class th extends Yd{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.#Wt(e));return this.#Ut(t)}#Wt(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Ut(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 nh extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#Kt(),this.#Ht()}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#jt(){return!this.supportsSpaceInSearches}#Kt(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new th(e):new eh(e):new Qd(this.querySelectorAll("lexxy-prompt-item"))}#Ht(){const e=this.#$t.registerUpdateListener((()=>{this.#$t.read((()=>{const t=ii();if(!t)return;let n;if(Ur(t)?n=t.anchor.getNode():Kr(t)&&([n]=t.getNodes()),n&&Pr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#qt())}}))}))}get#$t(){return this.#Jt.editor}get#Jt(){return this.closest("lexxy-editor")}get#$e(){return this.#Jt.selection}async#qt(){this.popoverElement??=await this.#Gt(),await this.#Vt(),this.#Zt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#Yt(),this.#Jt.addEventListener("keydown",this.#Xt),this.#Jt.addEventListener("lexxy:change",this.#Vt),this.#Qt()}#Qt(){this.keyListeners.push(this.#$t.registerCommand(un,this.#en.bind(this),3)),this.keyListeners.push(this.#$t.registerCommand(fn,this.#en.bind(this),3)),this.#jt&&this.keyListeners.push(this.#$t.registerCommand(dn,this.#en.bind(this),3))}#Yt(){const e=this.#tn[0];e&&this.#nn(e)}get#tn(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#nn(e){this.#rn(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#Jt.focus(),this.#in.setAttribute("aria-controls",this.popoverElement.id),this.#in.setAttribute("aria-activedescendant",e.id),this.#in.setAttribute("aria-haspopup","listbox")}#rn(){this.#tn.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#in.removeAttribute("aria-controls"),this.#in.removeAttribute("aria-activedescendant"),this.#in.removeAttribute("aria-haspopup")}#Zt(){const{x:e,y:t,fontSize:n}=this.#$e.cursorPosition,r=this.#Jt.getBoundingClientRect(),i=this.#in.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#sn(){this.#rn(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#Jt.removeEventListener("lexxy:change",this.#Vt),this.#Jt.removeEventListener("keydown",this.#Xt),this.#on(),await Pu(),this.#Ht()}#on(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#Vt=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#an.containsTextBackUntil(this.trigger)?await this.#ln():this.#sn()};async#ln(){const e=this.#an.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#cn(t):this.#un(),this.#Yt()}#cn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#un(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Su("li",{innerHTML:this.#dn});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#dn(){return this.getAttribute("empty-results")||"Nothing found"}#Xt=e=>{"Escape"===e.key?(this.#sn(),this.#Jt.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#hn(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#gn(),e.preventDefault(),e.stopPropagation())};#hn(){const e=this.#pn+1;e<this.#tn.length&&this.#nn(this.#tn[e])}#gn(){const e=this.#pn-1;e>=0&&this.#nn(this.#tn[e])}get#pn(){return this.#tn.findIndex((e=>e.hasAttribute("aria-selected")))}get#fn(){return this.#tn[this.#pn]}#en(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#mn(),!0}#mn(){this.#yn(),this.#sn(),this.#Jt.focus()}#yn(){const e=this.source.promptItemFor(this.#fn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#an.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#_n(t,n):this.#bn(e,t,n)}#_n(e,t){this.#$t.update((()=>{const n=yl(this.#$t,vu(`${e.innerHTML}`));this.#an.replaceTextBackUntil(t,n)}))}#bn(e,t,n){this.#$t.update((()=>{const r=new Ou({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#an.replaceTextBackUntil(n,r)}))}get#an(){return this.#Jt.contents}get#in(){return this.#Jt.editorContentElement}async#Gt(){const e=Su("ul",{role:"listbox",id:Cu("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",Sa()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#xn),this.#Jt.appendChild(e),e}#xn=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#nn(t),this.#mn())}}customElements.define("lexxy-prompt",nh);class rh extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#kn(),this.#Sn()}#kn(){this.languagePickerElement=this.#vn(),this.languagePickerElement.addEventListener("change",(()=>{this.#wn(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",Sa()),this.editorElement.appendChild(this.languagePickerElement)}#vn(){const e=Su("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.#Tn)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#Tn(){const e={...fc};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])}#wn(e){this.editor.update((()=>{const t=this.#Cn();t&&t.setLanguage(e)}))}#Sn(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Cn();e?this.#En(e):this.#Nn()}))}))}#Cn(){const e=ii();if(!Ur(e))return null;const t=e.anchor.getNode(),n=t.getParent();return lc(t)?t:lc(n)?n:null}#En(e){const t=e.getLanguage();this.#An(t),this.#Ln(),this.#Pn(e)}#An(e){if(this.languagePickerElement&&e){const t=function(e){return mc[e]||e}(e);this.languagePickerElement.value=t}}#Pn(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`}#Ln(){this.languagePickerElement.hidden=!1}#Nn(){this.languagePickerElement.hidden=!0}}function ih(){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=Su("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",rh),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{ih as highlightAll};