sykpcomposer 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/assets/icons/3-columns.svg +3 -3
- package/dist/assets/icons/LICENSE.md +5 -5
- package/dist/assets/icons/add-sign.svg +3 -3
- package/dist/assets/icons/file-earmark-text.svg +3 -3
- package/dist/assets/icons/minus-sign.svg +3 -3
- package/dist/assets/icons/scissors.svg +2 -2
- package/dist/index.es.js +3881 -8455
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +23 -41
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Editor.d.ts +1 -1
- package/dist/src/components/ExampleTheme.d.ts +43 -0
- package/dist/src/components/hooks/useModal.d.ts +12 -0
- package/dist/src/components/plugins/PageMargin.d.ts +14 -0
- package/dist/src/components/plugins/PageMarginPlugin/CustomMarginDialog.d.ts +13 -0
- package/dist/src/components/plugins/PageMarginPlugin/index.d.ts +46 -0
- package/dist/src/components/plugins/ToolbarPlugin/TextAlignment.d.ts +8 -0
- package/dist/src/components/ui/Button.d.ts +17 -0
- package/dist/src/components/ui/ContentEditable.d.ts +12 -0
- package/dist/src/components/ui/Dialog.d.ts +15 -0
- package/dist/src/components/ui/Divider.d.ts +2 -0
- package/dist/src/components/ui/DropDown.d.ts +24 -0
- package/dist/src/components/ui/Modal.d.ts +14 -0
- package/dist/src/components/ui/TextInput.d.ts +19 -0
- package/dist/src/utils/getSelectedNode.d.ts +2 -0
- package/dist/src/utils/joinClasses.d.ts +8 -0
- package/dist/src/vite-env.d.ts +1 -1
- package/dist/style.css +1 -0
- package/package.json +46 -48
- package/dist/src/components/plugins/AutoLinkPlugin.d.ts +0 -1
- package/dist/src/components/plugins/CodeHighlightPlugin.d.ts +0 -1
- package/dist/src/components/plugins/ListMaxIndentLevelPlugin.d.ts +0 -3
- package/dist/src/components/plugins/TreeViewPlugin.d.ts +0 -1
- package/dist/src/components/themes/ExampleTheme.d.ts +0 -70
- /package/dist/src/components/plugins/{ToolbarPlugin.d.ts → ToolbarPlugin/ToolbarPlugin.d.ts} +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -1,61 +1,43 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Re,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],D):(Re=typeof globalThis<"u"?globalThis:Re||self,D(Re.ViteButton={},Re.React,Re.ReactDOM))})(this,function(Re,D,un){"use strict";function Zs(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const lt=Zs(D);var or={exports:{}},at={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var
|
|
5
|
+
*/var sr,wi;function Si(){if(wi)return sr;wi=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return sr=i()?Object.assign:function(o,s){for(var l,a=r(o),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)e.call(l,f)&&(a[f]=l[f]);if(n){c=n(l);for(var d=0;d<c.length;d++)t.call(l,c[d])&&(a[c[d]]=l[c[d]])}}return a},sr}/** @license React v17.0.2
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var
|
|
12
|
+
*/var Ti;function el(){if(Ti)return at;Ti=1,Si();var n=D,e=60103;if(at.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var t=Symbol.for;e=t("react.element"),at.Fragment=t("react.fragment")}var r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,o={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,f={},d=null,h=null;c!==void 0&&(d=""+c),a.key!==void 0&&(d=""+a.key),a.ref!==void 0&&(h=a.ref);for(u in a)i.call(a,u)&&!o.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:e,type:l,key:d,ref:h,props:f,_owner:r.current}}return at.jsx=s,at.jsxs=s,at}var lr={};/** @license React v17.0.2
|
|
13
13
|
* react-jsx-runtime.development.js
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var
|
|
20
|
-
`+
|
|
21
|
-
`),
|
|
22
|
-
`),
|
|
23
|
-
`+
|
|
19
|
+
*/var ki;function tl(){return ki||(ki=1,function(n){process.env.NODE_ENV!=="production"&&function(){var e=D,t=Si(),r=60103,i=60106;n.Fragment=60107;var o=60108,s=60114,l=60109,a=60110,c=60112,u=60113,f=60120,d=60115,h=60116,g=60121,m=60122,_=60117,v=60129,y=60131;if(typeof Symbol=="function"&&Symbol.for){var x=Symbol.for;r=x("react.element"),i=x("react.portal"),n.Fragment=x("react.fragment"),o=x("react.strict_mode"),s=x("react.profiler"),l=x("react.provider"),a=x("react.context"),c=x("react.forward_ref"),u=x("react.suspense"),f=x("react.suspense_list"),d=x("react.memo"),h=x("react.lazy"),g=x("react.block"),m=x("react.server.block"),_=x("react.fundamental"),x("react.scope"),x("react.opaque.id"),v=x("react.debug_trace_mode"),x("react.offscreen"),y=x("react.legacy_hidden")}var k=typeof Symbol=="function"&&Symbol.iterator,S="@@iterator";function w(p){if(p===null||typeof p!="object")return null;var E=k&&p[k]||p[S];return typeof E=="function"?E:null}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(p){{for(var E=arguments.length,L=new Array(E>1?E-1:0),$=1;$<E;$++)L[$-1]=arguments[$];N("error",p,L)}}function N(p,E,L){{var $=P.ReactDebugCurrentFrame,J=$.getStackAddendum();J!==""&&(E+="%s",L=L.concat([J]));var Y=L.map(function(z){return""+z});Y.unshift("Warning: "+E),Function.prototype.apply.call(console[p],console,Y)}}var F=!1;function R(p){return!!(typeof p=="string"||typeof p=="function"||p===n.Fragment||p===s||p===v||p===o||p===u||p===f||p===y||F||typeof p=="object"&&p!==null&&(p.$$typeof===h||p.$$typeof===d||p.$$typeof===l||p.$$typeof===a||p.$$typeof===c||p.$$typeof===_||p.$$typeof===g||p[0]===m))}function H(p,E,L){var $=E.displayName||E.name||"";return p.displayName||($!==""?L+"("+$+")":L)}function V(p){return p.displayName||"Context"}function W(p){if(p==null)return null;if(typeof p.tag=="number"&&T("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case n.Fragment:return"Fragment";case i:return"Portal";case s:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case a:var E=p;return V(E)+".Consumer";case l:var L=p;return V(L._context)+".Provider";case c:return H(p,p.render,"ForwardRef");case d:return W(p.type);case g:return W(p._render);case h:{var $=p,J=$._payload,Y=$._init;try{return W(Y(J))}catch{return null}}}return null}var q=0,ce,Fe,He,sn,ln,an,wt;function St(){}St.__reactDisabledLog=!0;function Tt(){{if(q===0){ce=console.log,Fe=console.info,He=console.warn,sn=console.error,ln=console.group,an=console.groupCollapsed,wt=console.groupEnd;var p={configurable:!0,enumerable:!0,value:St,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}q++}}function kt(){{if(q--,q===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:t({},p,{value:ce}),info:t({},p,{value:Fe}),warn:t({},p,{value:He}),error:t({},p,{value:sn}),group:t({},p,{value:ln}),groupCollapsed:t({},p,{value:an}),groupEnd:t({},p,{value:wt})})}q<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var me=P.ReactCurrentDispatcher,ot;function Oe(p,E,L){{if(ot===void 0)try{throw Error()}catch(J){var $=J.stack.trim().match(/\n( *(at )?)/);ot=$&&$[1]||""}return`
|
|
20
|
+
`+ot+p}}var qe=!1,st;{var Uc=typeof WeakMap=="function"?WeakMap:Map;st=new Uc}function Ws(p,E){if(!p||qe)return"";{var L=st.get(p);if(L!==void 0)return L}var $;qe=!0;var J=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=me.current,me.current=null,Tt();try{if(E){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch($e){$=$e}Reflect.construct(p,[],z)}else{try{z.call()}catch($e){$=$e}p.call(z.prototype)}}else{try{throw Error()}catch($e){$=$e}p()}}catch($e){if($e&&$&&typeof $e.stack=="string"){for(var B=$e.stack.split(`
|
|
21
|
+
`),ue=$.stack.split(`
|
|
22
|
+
`),X=B.length-1,Z=ue.length-1;X>=1&&Z>=0&&B[X]!==ue[Z];)Z--;for(;X>=1&&Z>=0;X--,Z--)if(B[X]!==ue[Z]){if(X!==1||Z!==1)do if(X--,Z--,Z<0||B[X]!==ue[Z]){var Me=`
|
|
23
|
+
`+B[X].replace(" at new "," at ");return typeof p=="function"&&st.set(p,Me),Me}while(X>=1&&Z>=0);break}}}finally{qe=!1,me.current=Y,kt(),Error.prepareStackTrace=J}var Nt=p?p.displayName||p.name:"",Qs=Nt?Oe(Nt):"";return typeof p=="function"&&st.set(p,Qs),Qs}function Bs(p,E,L){return Ws(p,!1)}function Vc(p){var E=p.prototype;return!!(E&&E.isReactComponent)}function rr(p,E,L){if(p==null)return"";if(typeof p=="function")return Ws(p,Vc(p));if(typeof p=="string")return Oe(p);switch(p){case u:return Oe("Suspense");case f:return Oe("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case c:return Bs(p.render);case d:return rr(p.type,E,L);case g:return Bs(p._render);case h:{var $=p,J=$._payload,Y=$._init;try{return rr(Y(J),E,L)}catch{}}}return""}var zs={},Ks=P.ReactDebugCurrentFrame;function ir(p){if(p){var E=p._owner,L=rr(p.type,p._source,E?E.type:null);Ks.setExtraStackFrame(L)}else Ks.setExtraStackFrame(null)}function Jc(p,E,L,$,J){{var Y=Function.call.bind(Object.prototype.hasOwnProperty);for(var z in p)if(Y(p,z)){var B=void 0;try{if(typeof p[z]!="function"){var ue=Error(($||"React class")+": "+L+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ue.name="Invariant Violation",ue}B=p[z](E,z,$,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){B=X}B&&!(B instanceof Error)&&(ir(J),T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",$||"React class",L,z,typeof B),ir(null)),B instanceof Error&&!(B.message in zs)&&(zs[B.message]=!0,ir(J),T("Failed %s type: %s",L,B.message),ir(null))}}}var cn=P.ReactCurrentOwner,yi=Object.prototype.hasOwnProperty,Yc={key:!0,ref:!0,__self:!0,__source:!0},Us,Vs,xi;xi={};function Hc(p){if(yi.call(p,"ref")){var E=Object.getOwnPropertyDescriptor(p,"ref").get;if(E&&E.isReactWarning)return!1}return p.ref!==void 0}function qc(p){if(yi.call(p,"key")){var E=Object.getOwnPropertyDescriptor(p,"key").get;if(E&&E.isReactWarning)return!1}return p.key!==void 0}function Gc(p,E){if(typeof p.ref=="string"&&cn.current&&E&&cn.current.stateNode!==E){var L=W(cn.current.type);xi[L]||(T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(cn.current.type),p.ref),xi[L]=!0)}}function Xc(p,E){{var L=function(){Us||(Us=!0,T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};L.isReactWarning=!0,Object.defineProperty(p,"key",{get:L,configurable:!0})}}function Qc(p,E){{var L=function(){Vs||(Vs=!0,T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};L.isReactWarning=!0,Object.defineProperty(p,"ref",{get:L,configurable:!0})}}var Zc=function(p,E,L,$,J,Y,z){var B={$$typeof:r,type:p,key:E,ref:L,props:z,_owner:Y};return B._store={},Object.defineProperty(B._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(B,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(B,"_source",{configurable:!1,enumerable:!1,writable:!1,value:J}),Object.freeze&&(Object.freeze(B.props),Object.freeze(B)),B};function eu(p,E,L,$,J){{var Y,z={},B=null,ue=null;L!==void 0&&(B=""+L),qc(E)&&(B=""+E.key),Hc(E)&&(ue=E.ref,Gc(E,J));for(Y in E)yi.call(E,Y)&&!Yc.hasOwnProperty(Y)&&(z[Y]=E[Y]);if(p&&p.defaultProps){var X=p.defaultProps;for(Y in X)z[Y]===void 0&&(z[Y]=X[Y])}if(B||ue){var Z=typeof p=="function"?p.displayName||p.name||"Unknown":p;B&&Xc(z,Z),ue&&Qc(z,Z)}return Zc(p,B,ue,J,$,cn.current,z)}}var vi=P.ReactCurrentOwner,Js=P.ReactDebugCurrentFrame;function Et(p){if(p){var E=p._owner,L=rr(p.type,p._source,E?E.type:null);Js.setExtraStackFrame(L)}else Js.setExtraStackFrame(null)}var bi;bi=!1;function Ci(p){return typeof p=="object"&&p!==null&&p.$$typeof===r}function Ys(){{if(vi.current){var p=W(vi.current.type);if(p)return`
|
|
24
24
|
|
|
25
|
-
Check the render method of \``+
|
|
25
|
+
Check the render method of \``+p+"`."}return""}}function tu(p){{if(p!==void 0){var E=p.fileName.replace(/^.*[\\\/]/,""),L=p.lineNumber;return`
|
|
26
26
|
|
|
27
|
-
Check your code at `+
|
|
27
|
+
Check your code at `+E+":"+L+"."}return""}}var Hs={};function nu(p){{var E=Ys();if(!E){var L=typeof p=="string"?p:p.displayName||p.name;L&&(E=`
|
|
28
28
|
|
|
29
|
-
Check the top-level render call using <`+
|
|
29
|
+
Check the top-level render call using <`+L+">.")}return E}}function qs(p,E){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var L=nu(E);if(Hs[L])return;Hs[L]=!0;var $="";p&&p._owner&&p._owner!==vi.current&&($=" It was passed a child from "+W(p._owner.type)+"."),Et(p),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L,$),Et(null)}}function Gs(p,E){{if(typeof p!="object")return;if(Array.isArray(p))for(var L=0;L<p.length;L++){var $=p[L];Ci($)&&qs($,E)}else if(Ci(p))p._store&&(p._store.validated=!0);else if(p){var J=w(p);if(typeof J=="function"&&J!==p.entries)for(var Y=J.call(p),z;!(z=Y.next()).done;)Ci(z.value)&&qs(z.value,E)}}}function ru(p){{var E=p.type;if(E==null||typeof E=="string")return;var L;if(typeof E=="function")L=E.propTypes;else if(typeof E=="object"&&(E.$$typeof===c||E.$$typeof===d))L=E.propTypes;else return;if(L){var $=W(E);Jc(L,p.props,"prop",$,p)}else if(E.PropTypes!==void 0&&!bi){bi=!0;var J=W(E);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",J||"Unknown")}typeof E.getDefaultProps=="function"&&!E.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function iu(p){{for(var E=Object.keys(p.props),L=0;L<E.length;L++){var $=E[L];if($!=="children"&&$!=="key"){Et(p),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),Et(null);break}}p.ref!==null&&(Et(p),T("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function Xs(p,E,L,$,J,Y){{var z=R(p);if(!z){var B="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(B+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ue=tu(J);ue?B+=ue:B+=Ys();var X;p===null?X="null":Array.isArray(p)?X="array":p!==void 0&&p.$$typeof===r?(X="<"+(W(p.type)||"Unknown")+" />",B=" Did you accidentally export a JSX literal instead of a component?"):X=typeof p,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,B)}var Z=eu(p,E,L,J,Y);if(Z==null)return Z;if(z){var Me=E.children;if(Me!==void 0)if($)if(Array.isArray(Me)){for(var Nt=0;Nt<Me.length;Nt++)Gs(Me[Nt],p);Object.freeze&&Object.freeze(Me)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Gs(Me,p)}return p===n.Fragment?iu(Z):ru(Z),Z}}function ou(p,E,L){return Xs(p,E,L,!0)}function su(p,E,L){return Xs(p,E,L,!1)}var lu=su,au=ou;n.jsx=lu,n.jsxs=au}()}(lr)),lr}process.env.NODE_ENV==="production"?or.exports=el():or.exports=tl();var b=or.exports;function nl(n){return{}}const dn={},rl={},Ei={},Ge={},ct={},fn={},ut={},ar={},cr={},Pt={},Ot={},de={},hn={},gn={},il={},Ni={},ol={},Pi={},sl={},Oi={},Di={},pn={},ll={},ji={},Ai={},Li={},al={},cl={},Ii={},ur={},Fi={},_e={},Mi={},$i={},ul={},mn={},dr={},fr={},dl={},fl={},Dt={},jt={},hl={},gl={},pl={},ye=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ml=ye&&"documentMode"in document?document.documentMode:null,xe=ye&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),We=ye&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_n=!(!ye||!("InputEvent"in window)||ml)&&"getTargetRanges"in new window.InputEvent("input"),hr=ye&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),yn=ye&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_l=ye&&/Android/.test(navigator.userAgent),Ri=ye&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yl=ye&&_l&&Ri,gr=ye&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ri,At=1,Be=3,Xe=0,Wi=1,dt=2,xl=0,vl=1,bl=2,xn=4,vn=8,pr=128,Cl=112|(3|xn|vn)|pr,mr=1,_r=2,yr=3,xr=4,vr=5,br=6,bn=hr||yn||gr?" ":"",De=`
|
|
30
30
|
|
|
31
|
-
`,Pu=bt?" ":ir,Zs="֑-߿יִ-﷽ﹰ-ﻼ",Xs="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Lu=new RegExp("^[^"+Xs+"]*["+Zs+"]"),Ru=new RegExp("^[^"+Zs+"]*["+Xs+"]"),lt={bold:1,code:16,highlight:ci,italic:2,strikethrough:nr,subscript:32,superscript:64,underline:rr},Iu={directionless:1,unmergeable:2},Qs={center:fi,end:mi,justify:hi,left:di,right:gi,start:pi},Du={[fi]:"center",[mi]:"end",[hi]:"justify",[di]:"left",[gi]:"right",[pi]:"start"},$u={normal:0,segmented:2,token:1},Mu={[Nu]:"normal",[Fu]:"segmented",[Au]:"token"};function ju(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R=ju(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function sr(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const zu=100;let _i=!1,yi=0;function Bu(n){yi=n.timeStamp}function bi(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Uu(n,e,t){const r=tt(t._window);let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&ki(e,o,i,s,!1)}function Wu(n,e,t){if(A(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===vt&&t.isAttached()}function eo(n,e,t){_i=!0;const r=performance.now()-yi>zu;try{$e(n,()=>{const i=P()||function(d){return d.getEditorState().read(()=>{const g=P();return g!==null?g.clone():null})}(n),s=new Map,o=n.getRootElement(),a=n._editorState,l=n._blockCursorElement;let u=!1,c="";for(let d=0;d<e.length;d++){const g=e[d],h=g.type,m=g.target;let _=ut(m,a);if(!(_===null&&m!==o||X(_))){if(h==="characterData")r&&O(_)&&Wu(i,m,_)&&Uu(m,_,n);else if(h==="childList"){u=!0;const b=g.addedNodes;for(let x=0;x<b.length;x++){const w=b[x],S=uo(w),C=w.parentNode;if(C!=null&&w!==l&&S===null&&(w.nodeName!=="BR"||!bi(w,C,n))){if(bt){const k=w.innerText||w.nodeValue;k&&(c+=k)}C.removeChild(w)}}const p=g.removedNodes,y=p.length;if(y>0){let x=0;for(let w=0;w<y;w++){const S=p[w];(S.nodeName==="BR"&&bi(S,m,n)||l===S)&&(m.appendChild(S),x++)}y!==x&&(m===o&&(_=go(a)),s.set(m,_))}}}}if(s.size>0)for(const[d,g]of s)if(T(g)){const h=g.getChildrenKeys();let m=d.firstChild;for(let _=0;_<h.length;_++){const b=h[_],p=n.getElementByKey(b);p!==null&&(m==null?(d.appendChild(p),m=p):m!==p&&d.replaceChild(p,m),m=m.nextSibling)}}else O(g)&&g.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const g=f[d],h=g.addedNodes,m=g.target;for(let _=0;_<h.length;_++){const b=h[_],p=b.parentNode;p==null||b.nodeName!=="BR"||bi(b,m,n)||p.removeChild(b)}}t.takeRecords()}i!==null&&(u&&(i.dirty=!0,De(i)),bt&&wo(n)&&i.insertRawText(c))})}finally{_i=!1}}function to(n){const e=n._observer;e!==null&&eo(n,e.takeRecords(),e)}function no(n){(function(e){yi===0&&gr(e).addEventListener("textInput",Bu,!0)})(n),n._observer=new MutationObserver((e,t)=>{eo(n,e,t)})}function ro(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,a=e.__style;return!(t!==null&&t!==s||r!==null&&r!==o||i!==null&&i!==a)}function io(n,e){const t=n.mergeWithSibling(e),r=re()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function so(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&O(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(ro(e,r)){r=io(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&O(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(ro(r,t)){r=io(r,t);break}break}t.remove()}}else r.remove()}function oo(n){return ao(n.anchor),ao(n.focus),n}function ao(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),O(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!T(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let Ku=1;const Hu=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function vi(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return X(ut(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&or(e)==null)}function vn(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!vi(e)&&lo(e)===n}catch{return!1}}function xi(n){return n instanceof Ar}function lo(n){let e=n;for(;e!=null;){const t=or(e);if(xi(t))return t;e=dr(e)}return null}function or(n){return n?n.__lexicalEditor:null}function Vt(n){return n.isToken()||n.isSegmented()}function Ju(n){return n.nodeType===vt}function ar(n){let e=n;for(;e!=null;){if(Ju(e))return e;e=e.firstChild}return null}function Si(n,e,t){const r=lt[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~lt.superscript:e==="superscript"&&(i&=~lt.subscript),i}function wi(n){return O(n)||Z(n)||X(n)}function Vu(n,e){if(e!=null)return void(n.__key=e);Oe(),la();const t=re(),r=gt(),i=""+Ku++;r._nodeMap.set(i,n),T(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Ys,n.__key=i}function Pt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling();if(i===null)if(s!==null){const o=s.getWritable();r.__first=s.__key,o.__prev=null}else r.__first=null;else{const o=i.getWritable();if(s!==null){const a=s.getWritable();a.__prev=o.__key,o.__next=a.__key}else o.__next=null;t.__prev=null}if(s===null)if(i!==null){const o=i.getWritable();r.__last=i.__key,o.__next=null}else r.__last=null;else{const o=s.getWritable();if(i!==null){const a=i.getWritable();a.__next=o.__key,o.__prev=a.__key}else o.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function lr(n){la();const e=n.getLatest(),t=e.__parent,r=gt(),i=re(),s=r._nodeMap,o=i._dirtyElements;t!==null&&function(l,u,c){let f=l;for(;f!==null;){if(c.has(f))return;const d=u.get(f);if(d===void 0)break;c.set(f,!1),f=d.__parent}}(t,s,o);const a=e.__key;i._dirtyType=Ys,T(n)?o.set(a,!0):i._dirtyLeaves.add(a)}function _e(n){Oe();const e=re(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=ae(t);r!==null&&r.getWritable()}if(n!==null){const r=ae(n);r!==null&&r.getWritable()}}}function xt(){return In()?null:re()._compositionKey}function ae(n,e){const t=(e||gt())._nodeMap.get(n);return t===void 0?null:t}function uo(n,e){const t=n[`__lexicalKey_${re()._key}`];return t!==void 0?ae(t,e):null}function ut(n,e){let t=n;for(;t!=null;){const r=uo(t,e);if(r!==null)return r;t=dr(t)}return null}function co(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function fo(n){return n.read(()=>le().getTextContent())}function le(){return go(gt())}function go(n){return n._nodeMap.get("root")}function De(n){Oe();const e=gt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function qt(n){const e=re(),t=function(r,i){let s=r;for(;s!=null;){const o=s[`__lexicalKey_${i._key}`];if(o!==void 0)return o;s=dr(s)}return null}(n,e);return t===null?n===e.getRootElement()?ae("root"):null:ae(t)}function ho(n,e){return e?n.getTextContentSize():0}function po(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Ci(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function mo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function _o(n){return n.nodeType===vt?n.nodeValue:null}function Ei(n,e,t){const r=tt(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let a=_o(i);const l=ut(i);if(a!==null&&O(l)){if(a===ir&&t){const u=t.length;a=t,s=u,o=u}a!==null&&ki(l,a,s,o,n)}}}function ki(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let a=e;(o||i)&&e[e.length-1]===ir&&(a=e.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(a===""){if(_e(null),li||tr||ui)s.remove();else{const m=re();setTimeout(()=>{m.update(()=>{s.isAttached()&&s.remove()})},20)}return}const u=s.getParent(),c=Xt(),f=s.getTextContentSize(),d=xt(),g=s.getKey();if(s.isToken()||d!==null&&g===d&&!o||A(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===n.__key&&c.anchor.offset===0&&!s.canInsertTextBefore()&&!o||c.focus.key===n.__key&&c.focus.offset===f&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const h=P();if(!A(h)||t===null||r===null)return void s.setTextContent(a);if(h.setTextNodeRange(s,t,s,r),s.isSegmented()){const m=se(s.getTextContent());s.replace(m),s=m}s.setTextContent(a)}}}function qu(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(s){const o=s.getPreviousSibling();return(O(o)||T(o)&&o.isInline())&&!o.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function yo(n){return n==="ArrowLeft"}function bo(n){return n==="ArrowRight"}function xn(n,e){return Ve?n:e}function vo(n){return n==="Enter"}function Sn(n){return n==="Backspace"}function wn(n){return n==="Delete"}function xo(n,e,t){return n.toLowerCase()==="a"&&xn(e,t)}function Gu(){const n=le();De(oo(n.select(0,n.getChildrenSize())))}function Cn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=sr(i);return t[e]=s,s}return i}function Ti(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,a=e.get(s);a===void 0&&R(33,s);const l=a.klass;let u=n.get(l);u===void 0&&(u=new Map,n.set(l,u));const c=u.get(o),f=c==="destroyed"&&i==="created";(c===void 0||f)&&u.set(o,f?"updated":i)}function So(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function En(n,e){const t=n.offset;if(n.type==="element")return So(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?So(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function wo(n){const e=gr(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function $(n,e,t){return ga(n,e,t)}function ur(n){return!Se(n)&&!n.isLastChild()&&!n.isInline()}function cr(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&R(75,e),t}function dr(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function fr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function gr(n){const e=n._window;return e===null&&R(78),e}function Yu(n){let e=n.getParentOrThrow();for(;e!==null;){if(Ae(e))return e;e=e.getParentOrThrow()}return e}function Ae(n){return Se(n)||T(n)&&n.isShadowRoot()}function ve(n){const e=re(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&R(97);const i=r.replace;if(i!==null){const s=i(n);return s instanceof n.constructor||R(98),s}return n}function Ni(n,e){!Se(n.getParent())||T(e)||X(e)||R(99)}function Ai(n){return(X(n)||T(n)&&!n.canBeEmpty())&&!n.isInline()}function Fi(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Zu(n,e,t){let r=n._blockCursorElement;if(A(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,s=i.getNode(),o=i.offset;let a=!1,l=null;if(o===s.getChildrenSize())Ai(s.getChildAtIndex(o-1))&&(a=!0);else{const u=s.getChildAtIndex(o);if(Ai(u)){const c=u.getPreviousSibling();(c===null||Ai(c))&&(a=!0,l=n.getElementByKey(u.__key))}}if(a){const u=n.getElementByKey(s.__key);return r===null&&(n._blockCursorElement=r=function(c){const f=c.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let g=f.blockCursor;if(g!==void 0){if(typeof g=="string"){const h=sr(g);g=f.blockCursor=h}g!==void 0&&d.classList.add(...g)}return d}(n._config)),e.style.caretColor="transparent",void(l===null?u.appendChild(r):u.insertBefore(r,l))}}r!==null&&Fi(r,n,e)}function tt(n){return Je?(n||window).getSelection():null}function Xu(n){return nt(n)&&n.tagName==="A"}function nt(n){return n.nodeType===1}function Oi(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function hr(n){const e=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 n.nodeName.match(e)!==null}function Gt(n){if(Se(n)||X(n)&&!n.isInline())return!0;if(!T(n)||Ae(n))return!1;const e=n.getFirstChild(),t=e===null||Z(e)||O(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Pi(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Qu(){return re()}const Co=new WeakMap,ec=new Map;function tc(n){if(!n._readOnly&&n.isEmpty())return ec;n._readOnly||R(192);let e=Co.get(n);if(!e){e=new Map,Co.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let s=e.get(i);s||(s=new Map,e.set(i,s)),s.set(t,r)}}return e}function Li(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Eo(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(T(o)&&Eo(o,a,t,r,i,s),t.has(a)||s.delete(a),i.push(a)),o=o.getNextSibling()}}let St,Ce,kn,pr,Ri,Ii,Lt,qe,Di,Tn,de="",Ee="",rt=null,Ge="",ct="",ko=!1,Nn=!1,mr=null;function _r(n,e){const t=Lt.get(n);if(e!==null){const r=zi(n);r.parentNode===e&&e.removeChild(r)}if(qe.has(n)||Ce._keyToDOMMap.delete(n),T(t)){const r=br(t,Lt);$i(r,0,r.length-1,null)}t!==void 0&&Ti(Tn,kn,pr,t,"destroyed")}function $i(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&_r(s,r)}}function Rt(n,e){n.setProperty("text-align",e)}const nc="40px";function To(n,e){const t=St.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||nc;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function No(n,e){const t=n.style;e===0?Rt(t,""):e===di?Rt(t,"left"):e===fi?Rt(t,"center"):e===gi?Rt(t,"right"):e===hi?Rt(t,"justify"):e===pi?Rt(t,"start"):e===mi&&Rt(t,"end")}function yr(n,e,t){const r=qe.get(n);r===void 0&&R(60);const i=r.createDOM(St,Ce);if(function(s,o,a){const l=a._keyToDOMMap;o["__lexicalKey_"+a._key]=s,l.set(s,o)}(n,i,Ce),O(r)?i.setAttribute("data-lexical-text","true"):X(r)&&i.setAttribute("data-lexical-decorator","true"),T(r)){const s=r.__indent,o=r.__size;if(s!==0&&To(i,s),o!==0){const l=o-1;(function(u,c,f,d){const g=Ee;Ee="",Mi(u,f,0,c,d,null),Oo(f,d),Ee=g})(br(r,qe),l,r,i)}const a=r.__format;a!==0&&No(i,a),r.isInline()||Fo(null,r,i),ur(r)&&(de+=at,ct+=at)}else{const s=r.getTextContent();if(X(r)){const o=r.decorate(Ce,St);o!==null&&Po(n,o),i.contentEditable="false"}else O(r)&&(r.isDirectionless()||(Ee+=s));de+=s,ct+=s}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const s=e.__lexicalLineBreak;s!=null?e.insertBefore(i,s):e.appendChild(i)}return Ti(Tn,kn,pr,r,"created"),i}function Mi(n,e,t,r,i,s){const o=de;de="";let a=t;for(;a<=r;++a){yr(n[a],i,s);const l=qe.get(n[a]);l!==null&&O(l)&&(rt===null&&(rt=l.getFormat()),Ge===""&&(Ge=l.getStyle()))}ur(e)&&(de+=at),i.__lexicalTextContent=de,de=o+de}function Ao(n,e){const t=e.get(n);return Z(t)||X(t)&&t.isInline()}function Fo(n,e,t){const r=n!==null&&(n.__size===0||Ao(n.__last,Lt)),i=e.__size===0||Ao(e.__last,qe);if(r){if(!i){const s=t.__lexicalLineBreak;if(s!=null)try{t.removeChild(s)}catch(o){if(typeof o=="object"&&o!=null){const a=`${o.toString()} Parent: ${t.tagName}, child: ${s.tagName}.`;throw new Error(a)}throw o}t.__lexicalLineBreak=null}}else if(i){const s=document.createElement("br");t.__lexicalLineBreak=s,t.appendChild(s)}}function Oo(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==Ee||r!==mr){const s=Ee==="",o=s?mr:(i=Ee,Lu.test(i)?"rtl":Ru.test(i)?"ltr":null);if(o!==r){const a=e.classList,l=St.theme;let u=r!==null?l[r]:void 0,c=o!==null?l[o]:void 0;if(u!==void 0){if(typeof u=="string"){const f=sr(u);u=l[r]=f}a.remove(...u)}if(o===null||s&&o==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const f=sr(c);c=l[o]=f}c!==void 0&&a.add(...c)}e.dir=o}Nn||(n.getWritable().__dir=o)}mr=o,e.__lexicalDirTextContent=Ee,e.__lexicalDir=o}var i}function rc(n,e,t){const r=Ee;var i;Ee="",rt=null,Ge="",function(s,o,a){const l=de,u=s.__size,c=o.__size;if(de="",u===1&&c===1){const f=s.__first,d=o.__first;if(f===d)An(f,a);else{const h=zi(f),m=yr(d,null,null);try{a.replaceChild(m,h)}catch(_){if(typeof _=="object"&&_!=null){const b=`${_.toString()} Parent: ${a.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${h.tagName}, key: ${f}}.`;throw new Error(b)}throw _}_r(f,null)}const g=qe.get(d);O(g)&&(rt===null&&(rt=g.getFormat()),Ge===""&&(Ge=g.getStyle()))}else{const f=br(s,Lt),d=br(o,qe);if(u===0)c!==0&&Mi(d,o,0,c-1,a,null);else if(c===0){if(u!==0){const g=a.__lexicalLineBreak==null;$i(f,0,u-1,g?null:a),g&&(a.textContent="")}}else(function(g,h,m,_,b,p){const y=_-1,x=b-1;let w,S,C=(I=p,I.firstChild),k=0,E=0;for(var I;k<=y&&E<=x;){const G=h[k],z=m[E];if(G===z)C=ji(An(z,p)),k++,E++;else{w===void 0&&(w=new Set(h)),S===void 0&&(S=new Set(m));const W=S.has(G),Y=w.has(z);if(W)if(Y){const J=cr(Ce,z);J===C?C=ji(An(z,p)):(C!=null?p.insertBefore(J,C):p.appendChild(J),An(z,p)),k++,E++}else yr(z,p,C),E++;else C=ji(zi(G)),_r(G,p),k++}const U=qe.get(z);U!==null&&O(U)&&(rt===null&&(rt=U.getFormat()),Ge===""&&(Ge=U.getStyle()))}const M=k>y,K=E>x;if(M&&!K){const G=m[x+1];Mi(m,g,E,x,p,G===void 0?null:Ce.getElementByKey(G))}else K&&!M&&$i(h,k,y,p)})(o,f,d,u,c,a)}ur(o)&&(de+=at),a.__lexicalTextContent=de,de=l+de}(n,e,t),Oo(e,t),Mn(i=e)&&rt!=null&&rt!==i.__textFormat&&!Nn&&(i.setTextFormat(rt),i.setTextStyle(Ge)),function(s){Mn(s)&&Ge!==""&&Ge!==s.__textStyle&&!Nn&&s.setTextStyle(Ge)}(e),Ee=r}function br(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&R(101),t.push(r),r=i.__next}return t}function An(n,e){const t=Lt.get(n);let r=qe.get(n);t!==void 0&&r!==void 0||R(61);const i=ko||Ii.has(n)||Ri.has(n),s=cr(Ce,n);if(t===r&&!i){if(T(t)){const o=s.__lexicalTextContent;o!==void 0&&(de+=o,ct+=o);const a=s.__lexicalDirTextContent;a!==void 0&&(Ee+=a)}else{const o=t.getTextContent();O(t)&&!t.isDirectionless()&&(Ee+=o),ct+=o,de+=o}return s}if(t!==r&&i&&Ti(Tn,kn,pr,r,"updated"),r.updateDOM(t,s,St)){const o=yr(n,null,null);return e===null&&R(62),e.replaceChild(o,s),_r(n,null),o}if(T(t)&&T(r)){const o=r.__indent;o!==t.__indent&&To(s,o);const a=r.__format;a!==t.__format&&No(s,a),i&&(rc(t,r,s),Se(r)||r.isInline()||Fo(t,r,s)),ur(r)&&(de+=at,ct+=at)}else{const o=r.getTextContent();if(X(r)){const a=r.decorate(Ce,St);a!==null&&Po(n,a)}else O(r)&&!r.isDirectionless()&&(Ee+=o);de+=o,ct+=o}if(!Nn&&Se(r)&&r.__cachedText!==ct){const o=r.getWritable();o.__cachedText=ct,r=o}return s}function Po(n,e){let t=Ce._pendingDecorators;const r=Ce._decorators;if(t===null){if(r[n]===e)return;t=co(Ce)}t[n]=e}function ji(n){let e=n.nextSibling;return e!==null&&e===Ce._blockCursorElement&&(e=e.nextSibling),e}function ic(n,e,t,r,i,s){de="",ct="",Ee="",ko=r===Jt,mr=null,Ce=t,St=t._config,kn=t._nodes,pr=Ce._listeners.mutation,Ri=i,Ii=s,Lt=n._nodeMap,qe=e._nodeMap,Nn=e._readOnly,Di=new Map(t._keyToDOMMap);const o=new Map;return Tn=o,An("root",null),Ce=void 0,kn=void 0,Ri=void 0,Ii=void 0,Lt=void 0,qe=void 0,St=void 0,Di=void 0,Tn=void 0,o}function zi(n){const e=Di.get(n);return e===void 0&&R(75,n),e}const dt=Object.freeze({}),Bi=30,Ui=[["keydown",function(n,e){if(Fn=n.timeStamp,Lo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;$(e,_u,n)||t!=null&&(function(a,l,u,c){return bo(a)&&!l&&!c&&!u}(t,i,o,s)?$(e,Us,n):function(a,l,u,c,f){return bo(a)&&!c&&!u&&(l||f)}(t,i,r,o,s)?$(e,ni,n):function(a,l,u,c){return yo(a)&&!l&&!c&&!u}(t,i,o,s)?$(e,Ws,n):function(a,l,u,c,f){return yo(a)&&!c&&!u&&(l||f)}(t,i,r,o,s)?$(e,Yn,n):function(a,l,u){return function(c){return c==="ArrowUp"}(a)&&!l&&!u}(t,i,s)?$(e,Kt,n):function(a,l,u){return function(c){return c==="ArrowDown"}(a)&&!l&&!u}(t,i,s)?$(e,Zn,n):function(a,l){return vo(a)&&l}(t,r)?(On=!0,$(e,Xn,n)):function(a){return a===" "}(t)?$(e,yu,n):function(a,l){return Ve&&l&&a.toLowerCase()==="o"}(t,i)?(n.preventDefault(),On=!0,$(e,Ut,!0)):function(a,l){return vo(a)&&!l}(t,r)?(On=!1,$(e,Xn,n)):function(a,l,u,c){return Ve?!l&&!u&&(Sn(a)||a.toLowerCase()==="h"&&c):!(c||l||u)&&Sn(a)}(t,o,s,i)?Sn(t)?$(e,ri,n):(n.preventDefault(),$(e,Ft,!0)):function(a){return a==="Escape"}(t)?$(e,Ks,n):function(a,l,u,c,f){return Ve?!(u||c||f)&&(wn(a)||a.toLowerCase()==="d"&&l):!(l||c||f)&&wn(a)}(t,i,r,o,s)?wn(t)?$(e,ii,n):(n.preventDefault(),$(e,Ft,!1)):function(a,l,u){return Sn(a)&&(Ve?l:u)}(t,o,i)?(n.preventDefault(),$(e,hn,!0)):function(a,l,u){return wn(a)&&(Ve?l:u)}(t,o,i)?(n.preventDefault(),$(e,hn,!1)):function(a,l){return Ve&&l&&Sn(a)}(t,s)?(n.preventDefault(),$(e,pn,!0)):function(a,l){return Ve&&l&&wn(a)}(t,s)?(n.preventDefault(),$(e,pn,!1)):function(a,l,u,c){return a.toLowerCase()==="b"&&!l&&xn(u,c)}(t,o,s,i)?(n.preventDefault(),$(e,Ie,"bold")):function(a,l,u,c){return a.toLowerCase()==="u"&&!l&&xn(u,c)}(t,o,s,i)?(n.preventDefault(),$(e,Ie,"underline")):function(a,l,u,c){return a.toLowerCase()==="i"&&!l&&xn(u,c)}(t,o,s,i)?(n.preventDefault(),$(e,Ie,"italic")):function(a,l,u,c){return a==="Tab"&&!l&&!u&&!c}(t,o,i,s)?$(e,Hs,n):function(a,l,u,c){return a.toLowerCase()==="z"&&!l&&xn(u,c)}(t,r,s,i)?(n.preventDefault(),$(e,qn,void 0)):function(a,l,u,c){return Ve?a.toLowerCase()==="z"&&u&&l:a.toLowerCase()==="y"&&c||a.toLowerCase()==="z"&&c&&l}(t,r,s,i)?(n.preventDefault(),$(e,Gn,void 0)):xe(e._editorState._selection)?function(a,l,u,c){return!l&&a.toLowerCase()==="c"&&(Ve?u:c)}(t,r,s,i)?(n.preventDefault(),$(e,Qn,n)):function(a,l,u,c){return!l&&a.toLowerCase()==="x"&&(Ve?u:c)}(t,r,s,i)?(n.preventDefault(),$(e,oi,n)):xo(t,s,i)&&(n.preventDefault(),$(e,ai,n)):!bt&&xo(t,s,i)&&(n.preventDefault(),$(e,ai,n)),function(a,l,u,c){return a||l||u||c}(i,r,o,s)&&$(e,Cu,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&$e(e,()=>{X(ut(t))||(Ki=!0)})}],["compositionstart",function(n,e){$e(e,()=>{const t=P();if(A(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();_e(r.key),(n.timeStamp<Fn+Bi||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||O(i)&&i.getStyle()!==t.style)&&$(e,Wt,Pu)}})}],["compositionend",function(n,e){bt?Pn=!0:$e(e,()=>{Hi(e,n.data)})}],["input",function(n,e){n.stopPropagation(),$e(e,()=>{const t=P(),r=n.data,i=jo(n);if(r!=null&&A(t)&&Do(t,i,r,n.timeStamp,!1)){Pn&&(Hi(e,r),Pn=!1);const s=t.anchor.getNode(),o=tt(e._window);if(o===null)return;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,u=a?t.focus.offset:t.anchor.offset;er&&!t.isCollapsed()&&O(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,l)+r+s.getTextContent().slice(l+u)===_o(o.anchorNode)||$(e,Wt,r);const c=r.length;bt&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),li||tr||ui||!e.isComposing()||(Fn=0,_e(null))}else Ei(!1,e,r!==null?r:void 0),Pn&&(Hi(e,r||void 0),Pn=!1);Oe(),to(re())}),Yt=null}],["click",function(n,e){$e(e,()=>{const t=P(),r=tt(e._window),i=Xt();if(r){if(A(t)){const s=t.anchor,o=s.getNode();s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Se(o)&&le().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()&&(T(o)?o.select(0):o.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const s=r.anchorNode;if(s!==null){const o=s.nodeType;(o===bn||o===vt)&&De(es(i,r,e,n))}}}$(e,ei,n)})}],["cut",dt],["copy",dt],["dragstart",dt],["dragover",dt],["dragend",dt],["paste",dt],["focus",dt],["blur",dt],["drop",dt]];er&&Ui.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,s=jo(t);i==="deleteCompositionText"||bt&&wo(r)||i!=="insertCompositionText"&&$e(r,()=>{const o=P();if(i==="deleteContentBackward"){if(o===null){const g=Xt();if(!A(g))return;De(g.clone())}if(A(o)){const g=o.anchor.key===o.focus.key;if(a=t.timeStamp,Lo==="MediaLast"&&a<Fn+Bi&&r.isComposing()&&g){if(_e(null),Fn=0,setTimeout(()=>{$e(r,()=>{_e(null)})},Bi),A(o)){const h=o.anchor.getNode();h.markDirty(),o.format=h.getFormat(),O(h)||R(142),o.style=h.getStyle()}}else{_e(null),t.preventDefault();const h=o.anchor.getNode().getTextContent(),m=o.anchor.offset===0&&o.focus.offset===h.length;Tu&&g&&!m||$(r,Ft,!0)}return}}var a;if(!A(o))return;const l=t.data;Yt!==null&&Ei(!1,r,Yt),o.dirty&&Yt===null||!o.isCollapsed()||Se(o.anchor.getNode())||s===null||o.applyDOMRange(s),Yt=null;const u=o.anchor,c=o.focus,f=u.getNode(),d=c.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":$(r,Wt,t);break;case"insertFromComposition":_e(null),$(r,Wt,t);break;case"insertLineBreak":_e(null),$(r,Ut,!1);break;case"insertParagraph":_e(null),On&&!tr?(On=!1,$(r,Ut,!1)):$(r,gn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":$(r,Vn,t);break;case"deleteByComposition":(function(g,h){return g!==h||T(g)||T(h)||!g.isToken()||!h.isToken()})(f,d)&&$(r,ti,t);break;case"deleteByDrag":case"deleteByCut":$(r,ti,t);break;case"deleteContent":$(r,Ft,!1);break;case"deleteWordBackward":$(r,hn,!0);break;case"deleteWordForward":$(r,hn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":$(r,pn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":$(r,pn,!1);break;case"formatStrikeThrough":$(r,Ie,"strikethrough");break;case"formatBold":$(r,Ie,"bold");break;case"formatItalic":$(r,Ie,"italic");break;case"formatUnderline":$(r,Ie,"underline");break;case"historyUndo":$(r,qn,void 0);break;case"historyRedo":$(r,Gn,void 0)}else{if(l===`
|
|
32
|
-
`)t.preventDefault()
|
|
33
|
-
`){const r=
|
|
34
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&
|
|
35
|
-
`||
|
|
36
|
-
`?i.push(
|
|
37
|
-
`),
|
|
38
|
-
`||
|
|
39
|
-
`?r.push(Ye()):o===" "?r.push(Ue()):r.push(se(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,a=t),o.type==="element"&&function(_,b,p,y){const x=_.getNode(),w=x.getChildAtIndex(_.offset),S=se(),C=Se(x)?ne().append(S):S;S.setFormat(p),S.setStyle(y),w===null?x.append(C):w.insertBefore(C),_.is(b)&&b.set(S.__key,0,"text"),_.set(S.__key,0,"text")}(o,a,i,s);const l=o.offset;let u=a.offset;const c=this.getNodes(),f=c.length;let d=c[0];O(d)||R(26);const g=d.getTextContent().length,h=d.getParentOrThrow();let m=c[f-1];if(f===1&&a.type==="element"&&(u=g,a.set(o.key,u,"text")),this.isCollapsed()&&l===g&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!h.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(O(_)&&_.canInsertTextBefore()&&!Vt(_)||(_=se(),_.setFormat(i),_.setStyle(s),h.canInsertTextAfter()?d.insertAfter(_):h.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!h.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(O(_)&&!Vt(_)||(_=se(),_.setFormat(i),h.canInsertTextBefore()?d.insertBefore(_):h.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&l!==g){const _=se(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!h.canInsertTextBefore()||!h.canInsertTextAfter()||T(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),ea(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const y=se(e);return y.select(),void d.replace(y)}const _=d.getFormat(),b=d.getStyle();if(l!==u||_===i&&b===s){if(ge(d)){const y=se(e);return y.setFormat(i),y.setStyle(s),y.select(),void d.replace(y)}}else{if(d.getTextContent()!==""){const y=se(e);if(y.setFormat(i),y.setStyle(s),y.select(),l===0)d.insertBefore(y,!1);else{const[x]=d.splitText(l);x.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(s)}const p=u-l;d=d.spliceText(l,p,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=b))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),b=T(d)?d:d.getParentOrThrow();let p=T(m)?m:m.getParentOrThrow(),y=m;if(!b.is(p)&&p.isInline())do y=p,p=p.getParentOrThrow();while(p.isInline());if(a.type==="text"&&(u!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<u)if(O(m)&&!m.isToken()&&u!==m.getTextContentSize()){if(m.isSegmented()){const k=se(m.getTextContent());m.replace(k),m=k}Se(a.getNode())||a.type!=="text"||(m=m.spliceText(0,u,"")),_.add(m.__key)}else{const k=m.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?m.remove():k.remove()}else _.add(m.__key);const x=p.getChildren(),w=new Set(c),S=b.is(p),C=b.isInline()&&d.getNextSibling()===null?b:d;for(let k=x.length-1;k>=0;k--){const E=x[k];if(E.is(d)||T(E)&&E.isParentOf(d))break;E.isAttached()&&(!w.has(E)||E.is(y)?S||C.insertAfter(E,!1):E.remove())}if(!S){let k=p,E=null;for(;k!==null;){const I=k.getChildren(),M=I.length;(M===0||I[M-1].is(E))&&(_.delete(k.__key),E=k),k=k.getParent()}}if(d.isToken())if(l===g)d.select();else{const k=se(e);k.select(),d.replace(k)}else d=d.spliceText(l,g-l,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let k=1;k<f;k++){const E=c[k],I=E.__key;_.has(I)||E.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void _e(null);const t=this.getNodes(),r=[];for(const p of t)O(p)&&r.push(p);const i=r.length;if(i===0)return this.toggleFormat(e),void _e(null);const s=this.anchor,o=this.focus,a=this.isBackward(),l=a?o:s,u=a?s:o;let c=0,f=r[0],d=l.type==="element"?0:l.offset;if(l.type==="text"&&d===f.getTextContentSize()&&(c=1,f=r[1],d=0),f==null)return;const g=f.getFormatFlags(e,null),h=i-1;let m=r[h];const _=u.type==="text"?u.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(Vt(f)||d===0&&_===f.getTextContentSize())f.setFormat(g);else{const p=f.splitText(d,_),y=d===0?p[0]:p[1];y.setFormat(g),l.type==="text"&&l.set(y.__key,0,"text"),u.type==="text"&&u.set(y.__key,_-d,"text")}return void(this.format=g)}d===0||Vt(f)||([,f]=f.splitText(d),d=0),f.setFormat(g);const b=m.getFormatFlags(e,g);_>0&&(_===m.getTextContentSize()||Vt(m)||([m]=m.splitText(_)),m.setFormat(b));for(let p=c+1;p<h;p++){const y=r[p],x=y.getFormatFlags(e,b);y.setFormat(x)}l.type==="text"&&l.set(f.__key,d,"text"),u.type==="text"&&u.set(m.__key,_,"text"),this.format=g|b}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const g=P();return A(g)||R(134),g.insertNodes(e)}const t=Pi((this.isBackward()?this.focus:this.anchor).getNode(),Gt),r=e[e.length-1];if("__language"in t&&T(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=ts(this);t.splice(g,0,e),r.selectEnd()}return}if(!e.some(g=>(T(g)||X(g))&&!g.isInline())){T(t)||R(135);const g=ts(this);return t.splice(g,0,e),void r.selectEnd()}const i=function(g){const h=ne();let m=null;for(let _=0;_<g.length;_++){const b=g[_],p=Z(b);if(p||X(b)&&b.isInline()||T(b)&&b.isInline()||O(b)||b.isParentRequired()){if(m===null&&(m=b.createParentElementNode(),h.append(m),p))continue;m!==null&&m.append(b)}else h.append(b),m=null}return h}(e),s=i.getLastDescendant(),o=i.getChildren(),a=!T(t)||!t.isEmpty()?this.insertParagraph():null,l=o[o.length-1];let u=o[0];var c;T(c=u)&&Gt(c)&&!c.isEmpty()&&T(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(T(t)||R(135),t.append(...u.getChildren()),u=o[1]),u&&function(g,h,m){const _=h.getParentOrThrow().getLastChild();let b=h;const p=[h];for(;b!==_;)b.getNextSibling()||R(140),b=b.getNextSibling(),p.push(b);let y=g;for(const x of p)y=y.insertAfter(x)}(t,u);const f=Pi(s,Gt);a&&T(f)&&(a.canMergeWhenEmpty()||Gt(l))&&(f.append(...a.getChildren()),a.remove()),T(t)&&t.isEmpty()&&t.remove(),s.selectEnd();const d=T(t)?t.getLastChild():null;Z(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=ne();return le().splice(this.anchor.offset,0,[o]),o.select(),o}const e=ts(this),t=Pi(this.anchor.getNode(),Gt);T(t)||R(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const t=Ye();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,s=this.focus;let o=e[0],a=e[r];const[l,u]=Zi(this);if(t===0)return[];if(t===1){if(O(o)&&!this.isCollapsed()){const f=l>u?u:l,d=l>u?l:u,g=o.splitText(f,d),h=f===0?g[0]:g[1];return h!=null?[h]:[]}return[o]}const c=i.isBefore(s);if(O(o)){const f=c?l:u;f===o.getTextContentSize()?e.shift():f!==0&&([,o]=o.splitText(f),e[0]=o)}if(O(a)){const f=a.getTextContent().length,d=c?u:l;d===0?e.pop():d!==f&&([a]=a.splitText(d),e[r]=a)}return e}modify(e,t,r){const i=this.focus,s=this.anchor,o=e==="move",a=En(i,t);if(X(a)&&!a.isIsolated()){if(o&&a.isKeyboardSelectable()){const g=Qi();return g.add(a.__key),void De(g)}const d=t?a.getPreviousSibling():a.getNextSibling();if(O(d)){const g=d.__key,h=t?d.getTextContent().length:0;return i.set(g,h,"text"),void(o&&s.set(g,h,"text"))}{const g=a.getParentOrThrow();let h,m;return T(d)?(m=d.__key,h=t?d.getChildrenSize():0):(h=a.getIndexWithinParent(),m=g.__key,t||h++),i.set(m,h,"element"),void(o&&s.set(m,h,"element"))}}const l=re(),u=tt(l._window);if(!u)return;const c=l._blockCursorElement,f=l._rootElement;if(f===null||c===null||!T(a)||a.isInline()||a.canBeEmpty()||Fi(c,l,f),function(d,g,h,m){d.modify(g,h,m)}(u,e,t?"backward":"forward",r),u.rangeCount>0){const d=u.getRangeAt(0),g=this.anchor.getNode(),h=Se(g)?g:Yu(g);if(this.applyDOMRange(d),this.dirty=!0,!o){const m=this.getNodes(),_=[];let b=!1;for(let p=0;p<m.length;p++){const y=m[p];fr(y,h)?_.push(y):b=!0}if(b&&_.length>0)if(t){const p=_[0];T(p)?p.selectStart():p.getParentOrThrow().selectStart()}else{const p=_[_.length-1];T(p)?p.selectEnd():p.getParentOrThrow().selectEnd()}u.anchorNode===d.startContainer&&u.anchorOffset===d.startOffset||function(p){const y=p.focus,x=p.anchor,w=x.key,S=x.offset,C=x.type;Ct(x,y.key,y.offset,y.type),Ct(y,w,S,C),p._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&T(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),s=t.getNextSibling()||(i===null?null:i.getNextSibling());if(T(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const s=this.focus,o=En(s,e);if(X(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&T(i)&&i.getChildrenSize()===0){i.remove();const a=Qi();a.add(o.__key),De(a)}else o.remove(),re().dispatchCommand(fn,void 0);return}if(!e&&T(o)&&T(i)&&i.isEmpty())return i.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const a=s.type==="text"?s.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,u=a.getTextContentSize();if(a.is(i)||e&&l!==u||!e&&l!==0)return void Zo(a,e,l)}else if(i!==null&&i.isSegmented()){const l=r.offset,u=i.getTextContentSize();if(i.is(a)||e&&l!==0||!e&&l!==u)return void Zo(i,e,l)}(function(l,u){const c=l.anchor,f=l.focus,d=c.getNode(),g=f.getNode();if(d===g&&c.type==="text"&&f.type==="text"){const h=c.offset,m=f.offset,_=h<m,b=_?h:m,p=_?m:h,y=p-1;b!==y&&(po(d.getTextContent().slice(b,p))||(u?f.offset=y:c.offset=y))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Se(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function xe(n){return n instanceof Cr}function Yo(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function Zi(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Yo(t),Yo(r)]}function Zo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,a=0;for(let u=0;u<s;u++){const c=u===s-1;if(a=o,o+=i[u].length,e&&o===t||o>t||c){i.splice(u,1),c&&(a=void 0);break}}const l=i.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Xo(n,e,t,r){let i,s=e;if(n.nodeType===bn){let o=!1;const a=n.childNodes,l=a.length,u=r._blockCursorElement;s===l&&(o=!0,s=l-1);let c=a[s],f=!1;if(c===u)c=a[s+1],f=!0;else if(u!==null){const d=u.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,u)&&s--}if(i=qt(c),O(i))s=ho(i,o);else{let d=qt(n);if(d===null)return null;if(T(d)){s=Math.min(d.getChildrenSize(),s);let g=d.getChildAtIndex(s);if(T(g)&&function(h,m,_){const b=h.getParent();return _===null||b===null||!b.canBeEmpty()||b!==_.getNode()}(g,0,t)){const h=o?g.getLastDescendant():g.getFirstDescendant();h===null?d=g:(g=h,d=T(g)?g:g.getParentOrThrow()),s=0}O(g)?(i=g,d=null,s=ho(g,o)):g!==d&&o&&!f&&s++}else{const g=d.getIndexWithinParent();s=e===0&&X(d)&&qt(n)===d?g:g+1,d=d.getParentOrThrow()}if(T(d))return it(d.__key,s,"element")}}else i=qt(n);return O(i)?it(i.__key,s,"text"):null}function Qo(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const s=i.getPreviousSibling(),o=i.getParent();if(e){if((t||!e)&&s===null&&T(o)&&o.isInline()){const a=o.getPreviousSibling();O(a)&&(n.key=a.__key,n.offset=a.getTextContent().length)}}else T(s)&&!t&&s.isInline()?(n.key=s.__key,n.offset=s.getChildrenSize(),n.type="element"):O(s)&&(n.key=s.__key,n.offset=s.getTextContent().length)}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&T(s)&&s.isInline())n.key=s.__key,n.offset=0,n.type="element";else if((t||e)&&s===null&&T(o)&&o.isInline()&&!o.canInsertTextAfter()){const a=o.getNextSibling();O(a)&&(n.key=a.__key,n.offset=0)}}}function ea(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Qo(n,r,i),Qo(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const s=re();if(s.isComposing()&&s._compositionKey!==n.key&&A(t)){const o=t.anchor,a=t.focus;Ct(n,o.key,o.offset,o.type),Ct(e,a.key,a.offset,a.type)}}}function ta(n,e,t,r,i,s){if(n===null||t===null||!vn(i,n,t))return null;const o=Xo(n,e,A(s)?s.anchor:null,i);if(o===null)return null;const a=Xo(t,r,A(s)?s.focus:null,i);if(a===null)return null;if(o.type==="element"&&a.type==="element"){const l=qt(n),u=qt(t);if(X(l)&&X(u))return null}return ea(o,a,s),[o,a]}function Xi(n){return T(n)&&!n.isInline()}function na(n,e,t,r,i,s){const o=gt(),a=new Et(it(n,e,i),it(t,r,s),0,"");return a.dirty=!0,o._selection=a,a}function ra(){const n=it("root",0,"element"),e=it("root",0,"element");return new Et(n,e,0,"")}function Qi(){return new Cr(new Set)}function es(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,a=o==="selectionchange",l=!_i&&(a||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let u,c,f,d;if(A(n)&&!l)return n.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,a&&A(n)&&!vn(t,u,c))return n.clone();const g=ta(u,f,c,d,t,n);if(g===null)return null;const[h,m]=g;return new Et(h,m,A(n)?n.format:0,A(n)?n.style:"")}function P(){return gt()._selection}function Xt(){return re()._editorState._selection}function Er(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),a=s.getNode();if(!e.is(o)&&!e.is(a))return;const l=e.__key;if(n.isCollapsed()){const u=i.offset;if(t<=u&&r>0||t<u&&r<0){const c=Math.max(0,u+r);i.set(l,c,"element"),s.set(l,c,"element"),ia(n)}}else{const u=n.isBackward(),c=u?s:i,f=c.getNode(),d=u?i:s,g=d.getNode();if(e.is(f)){const h=c.offset;(t<=h&&r>0||t<h&&r<0)&&c.set(l,Math.max(0,h+r),"element")}if(e.is(g)){const h=d.offset;(t<=h&&r>0||t<h&&r<0)&&d.set(l,Math.max(0,h+r),"element")}}ia(n)}function ia(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!T(s))return;const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(O(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}}else{if(T(s)){const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if(O(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(T(o)){const a=o.getChildrenSize(),l=i>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(i);if(O(u)){let c=0;l&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}}function kr(n,e,t,r,i){let s=null,o=0,a=null;r!==null?(s=r.__key,O(r)?(o=r.getTextContentSize(),a="text"):T(r)&&(o=r.getChildrenSize(),a="element")):i!==null&&(s=i.__key,O(i)?a="text":T(i)&&(a="element")),s!==null&&a!==null?n.set(s,o,a):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function sa(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function gc(n,e,t,r,i,s,o){const a=r.anchorNode,l=r.focusNode,u=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==s||f!==null&&vi(f))return;if(!A(e))return void(n!==null&&vn(t,a,l)&&r.removeAllRanges());const d=e.anchor,g=e.focus,h=d.key,m=g.key,_=cr(t,h),b=cr(t,m),p=d.offset,y=g.offset,x=e.format,w=e.style,S=e.isCollapsed();let C=_,k=b,E=!1;if(d.type==="text"){C=ar(_);const U=d.getNode();E=U.getFormat()!==x||U.getStyle()!==w}else A(n)&&n.anchor.type==="text"&&(E=!0);var I,M,K,G,z;if(g.type==="text"&&(k=ar(b)),C!==null&&k!==null&&(S&&(n===null||E||A(n)&&(n.format!==x||n.style!==w))&&(I=x,M=w,K=p,G=h,z=performance.now(),Io=[I,M,K,G,z]),u!==p||c!==y||a!==C||l!==k||r.type==="Range"&&S||(f!==null&&s.contains(f)||s.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(C,p,k,y)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&s!==null&&s===document.activeElement){const U=e instanceof Et&&e.anchor.type==="element"?C.childNodes[p]||null:r.rangeCount>0?r.getRangeAt(0):null;if(U!==null){let W;if(U instanceof Text){const Y=document.createRange();Y.selectNode(U),W=Y.getBoundingClientRect()}else W=U.getBoundingClientRect();(function(Y,J,fe){const je=fe.ownerDocument,ze=je.defaultView;if(ze===null)return;let{top:ue,bottom:Be}=J,ye=0,Ke=0,be=fe;for(;be!==null;){const He=be===je.body;if(He)ye=0,Ke=gr(Y).innerHeight;else{const Qe=be.getBoundingClientRect();ye=Qe.top,Ke=Qe.bottom}let Re=0;if(ue<ye?Re=-(ye-ue):Be>Ke&&(Re=Be-Ke),Re!==0)if(He)ze.scrollBy(0,Re);else{const Qe=be.scrollTop;be.scrollTop+=Re;const et=be.scrollTop-Qe;ue-=et,Be-=et}if(He)break;be=dr(be)}})(t,W,s)}}Wi=!0}}function oa(n){let e=P()||Xt();e===null&&(e=le().selectEnd()),e.insertNodes(n)}function ts(n){let e=n;n.isCollapsed()||e.removeText();const t=P();A(t)&&(e=t),A(e)||R(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!Gt(i);)[i,s]=hc(i,s);return s}function hc(n,e){const t=n.getParent();if(!t){const i=ne();return le().append(i),i.select(),[le(),0]}if(O(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,i[0].getIndexWithinParent()+s]}if(!T(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Et(it(n.__key,e,"element"),it(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let he=null,pe=null,Fe=!1,ns=!1,Tr=0;const aa={characterData:!0,childList:!0,subtree:!0};function In(){return Fe||he!==null&&he._readOnly}function Oe(){Fe&&R(13)}function la(){Tr>99&&R(14)}function gt(){return he===null&&R(195,ua()),he}function re(){return pe===null&&R(196,ua()),pe}function ua(){let n=0;const e=new Set,t=Ar.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=or(i);if(xi(s))n++;else if(s){let o=String(s.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function pc(){return pe}function ca(n,e,t){const r=e.__type,i=function(a,l){const u=a._nodes.get(l);return u===void 0&&R(30,l),u}(n,r);let s=t.get(r);s===void 0&&(s=Array.from(i.transforms),t.set(r,s));const o=s.length;for(let a=0;a<o&&(s[a](e),e.isAttached());a++);}function da(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function mc(n){return rs(n,re()._nodes)}function rs(n,e){const t=n.type,r=e.get(t);r===void 0&&R(17,t);const i=r.klass;n.type!==i.getType()&&R(18,i.name);const s=i.importJSON(n),o=n.children;if(T(s)&&Array.isArray(o))for(let a=0;a<o.length;a++){const l=rs(o[a],e);s.append(l)}return s}function fa(n,e,t){const r=he,i=Fe,s=pe;he=e,Fe=!0,pe=n;try{return t()}finally{he=r,Fe=i,pe=s}}function kt(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const s=n._editorState,o=s._selection,a=t._selection,l=n._dirtyType!==Ot,u=he,c=Fe,f=pe,d=n._updating,g=n._observer;let h=null;if(n._pendingEditorState=null,n._editorState=t,!i&&l&&g!==null){pe=n,he=t,Fe=!1,n._updating=!0;try{const S=n._dirtyType,C=n._dirtyElements,k=n._dirtyLeaves;g.disconnect(),h=ic(s,t,n,S,C,k)}catch(S){if(S instanceof Error&&n._onError(S),ns)throw S;return ba(n,null,r,t),no(n),n._dirtyType=Jt,ns=!0,kt(n,s),void(ns=!1)}finally{g.observe(r,aa),n._updating=d,he=u,Fe=c,pe=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,b=n._normalizedNodes,p=n._updateTags,y=n._deferred;l&&(n._dirtyType=Ot,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(S,C){const k=S._decorators;let E=S._pendingDecorators||k;const I=C._nodeMap;let M;for(M in E)I.has(M)||(E===k&&(E=co(S)),delete E[M])}(n,t);const x=i?null:tt(n._window);if(n._editable&&x!==null&&(l||a===null||a.dirty)){pe=n,he=t;try{if(g!==null&&g.disconnect(),l||a===null||a.dirty){const S=n._blockCursorElement;S!==null&&Fi(S,n,r),gc(o,a,n,x,p,r)}Zu(n,r,a),g!==null&&g.observe(r,aa)}finally{pe=f,he=u}}h!==null&&function(S,C,k,E,I){const M=Array.from(S._listeners.mutation),K=M.length;for(let G=0;G<K;G++){const[z,U]=M[G],W=C.get(U);W!==void 0&&z(W,{dirtyLeaves:E,prevEditorState:I,updateTags:k})}}(n,h,p,m,s),A(a)||a===null||o!==null&&o.is(a)||n.dispatchCommand(fn,void 0);const w=n._pendingDecorators;w!==null&&(n._decorators=w,n._pendingDecorators=null,Dn("decorator",n,!0,w)),function(S,C,k){const E=fo(C),I=fo(k);E!==I&&Dn("textcontent",S,!0,I)}(n,e||s,t),Dn("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:b,prevEditorState:e||s,tags:p}),function(S,C){if(S._deferred=[],C.length!==0){const k=S._updating;S._updating=!0;try{for(let E=0;E<C.length;E++)C[E]()}finally{S._updating=k}}}(n,y),function(S){const C=S._updates;if(C.length!==0){const k=C.shift();if(k){const[E,I]=k;pa(S,E,I)}}}(n)}function Dn(n,e,t,...r){const i=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let o=0;o<s.length;o++)s[o].apply(null,r)}finally{e._updating=i}}function ga(n,e,t){if(n._updating===!1||pe!==n){let i=!1;return n.update(()=>{i=ga(n,e,t)}),i}const r=Ci(n);for(let i=4;i>=0;i--)for(let s=0;s<r.length;s++){const o=r[s]._commands.get(e);if(o!==void 0){const a=o[i];if(a!==void 0){const l=Array.from(a),u=l.length;for(let c=0;c<u;c++)if(l[c](t,n)===!0)return!0}}}return!1}function ha(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i;let a,l;if(o!==void 0){if(a=o.onUpdate,l=o.tag,o.skipTransforms&&(r=!0),o.discrete){const u=n._pendingEditorState;u===null&&R(191),u._flushSync=!0}a&&n._deferred.push(a),l&&n._updateTags.add(l)}s()}}return r}function pa(n,e,t){const r=n._updateTags;let i,s,o=!1,a=!1;t!==void 0&&(i=t.onUpdate,s=t.tag,s!=null&&r.add(s),o=t.skipTransforms||!1,a=t.discrete||!1),i&&n._deferred.push(i);const l=n._editorState;let u=n._pendingEditorState,c=!1;(u===null||u._readOnly)&&(u=n._pendingEditorState=new Nr(new Map((u||l)._nodeMap)),c=!0),u._flushSync=a;const f=he,d=Fe,g=pe,h=n._updating;he=u,Fe=!1,n._updating=!0,pe=n;try{c&&(n._headless?l._selection!==null&&(u._selection=l._selection.clone()):u._selection=function(p){const y=p.getEditorState()._selection,x=tt(p._window);return A(y)||y==null?es(y,x,p,null):y.clone()}(n));const _=n._compositionKey;e(),o=ha(n,o),function(p,y){const x=y.getEditorState()._selection,w=p._selection;if(A(w)){const S=w.anchor,C=w.focus;let k;if(S.type==="text"&&(k=S.getNode(),k.selectionTransform(x,w)),C.type==="text"){const E=C.getNode();k!==E&&E.selectionTransform(x,w)}}}(u,n),n._dirtyType!==Ot&&(o?function(p,y){const x=y._dirtyLeaves,w=p._nodeMap;for(const S of x){const C=w.get(S);O(C)&&C.isAttached()&&C.isSimpleText()&&!C.isUnmergeable()&&so(C)}}(u,n):function(p,y){const x=y._dirtyLeaves,w=y._dirtyElements,S=p._nodeMap,C=xt(),k=new Map;let E=x,I=E.size,M=w,K=M.size;for(;I>0||K>0;){if(I>0){y._dirtyLeaves=new Set;for(const G of E){const z=S.get(G);O(z)&&z.isAttached()&&z.isSimpleText()&&!z.isUnmergeable()&&so(z),z!==void 0&&da(z,C)&&ca(y,z,k),x.add(G)}if(E=y._dirtyLeaves,I=E.size,I>0){Tr++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map;for(const G of M){const z=G[0],U=G[1];if(z!=="root"&&!U)continue;const W=S.get(z);W!==void 0&&da(W,C)&&ca(y,W,k),w.set(z,U)}E=y._dirtyLeaves,I=E.size,M=y._dirtyElements,K=M.size,Tr++}y._dirtyLeaves=x,y._dirtyElements=w}(u,n),ha(n),function(p,y,x,w){const S=p._nodeMap,C=y._nodeMap,k=[];for(const[E]of w){const I=C.get(E);I!==void 0&&(I.isAttached()||(T(I)&&Eo(I,E,S,C,k,w),S.has(E)||w.delete(E),k.push(E)))}for(const E of k)C.delete(E);for(const E of x){const I=C.get(E);I===void 0||I.isAttached()||(S.has(E)||x.delete(E),C.delete(E))}}(l,u,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(u._flushSync=!0);const b=u._selection;if(A(b)){const p=u._nodeMap,y=b.anchor.key,x=b.focus.key;p.get(y)!==void 0&&p.get(x)!==void 0||R(19)}else xe(b)&&b._nodes.size===0&&(u._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=l,n._dirtyType=Jt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void kt(n)}finally{he=f,Fe=d,pe=g,n._updating=h,Tr=0}n._dirtyType!==Ot||function(_,b){const p=b.getEditorState()._selection,y=_._selection;if(y!==null){if(y.dirty||!y.is(p))return!0}else if(p!==null)return!0;return!1}(u,n)?u._flushSync?(u._flushSync=!1,kt(n)):c&&Hu(()=>{kt(n)}):(u._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function $e(n,e,t){n._updating?n._updates.push([e,t]):pa(n,e,t)}class Me extends xr{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}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}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Du[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=re()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(O(t)&&e.push(t),T(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;T(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;T(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const s=t[r-1];return T(s)&&s.getLastDescendant()||s||null}const i=t[e];return T(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:ae(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&R(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:ae(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&R(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContent(),T(s)&&i!==r-1&&!s.isInline()&&(e+=at)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContentSize(),T(s)&&i!==r-1&&!s.isInline()&&(e+=at.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Qs[e];return!!(this.getFormat()&t)}return!1}select(e,t){Oe();const r=P();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if(O(l)||T(l))return l.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const l=this.getLastChild();if(O(l)||T(l))return l.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const a=this.__key;return A(r)?(r.anchor.set(a,i,"element"),r.focus.set(a,s,"element"),r.dirty=!0,r):na(a,i,a,s,"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(t=>t.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!==""?Qs[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,s=this.getChildrenSize(),o=this.getWritable(),a=o.__key,l=[],u=[],c=this.getChildAtIndex(e+t);let f=null,d=s-t+i;if(e!==0)if(e===s)f=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(f=h.getPreviousSibling())}if(t>0){let h=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){h===null&&R(100);const _=h.getNextSibling(),b=h.__key;Pt(h.getWritable()),u.push(b),h=_}}let g=f;for(let h=0;h<i;h++){const m=r[h];g!==null&&m.is(g)&&(f=g=g.getPreviousSibling());const _=m.getWritable();_.__parent===a&&d--,Pt(_);const b=m.__key;if(g===null)o.__first=b,_.__prev=null;else{const p=g.getWritable();p.__next=b,_.__prev=p.__key}m.__key===a&&R(76),_.__parent=a,l.push(b),g=m}if(e+t===s)g!==null&&(g.getWritable().__next=null,o.__last=g.__key);else if(c!==null){const h=c.getWritable();if(g!==null){const m=g.getWritable();h.__prev=g.__key,m.__next=c.__key}else h.__prev=null}if(o.__size=d,u.length){const h=P();if(A(h)){const m=new Set(u),_=new Set(l),{anchor:b,focus:p}=h;ma(b,m,_)&&kr(b,b.getNode(),this,f,c),ma(p,m,_)&&kr(p,p.getNode(),this,f,c),d!==0||this.canBeEmpty()||Ae(this)||this.remove()}}return o}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}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,r){return!1}canMergeWhenEmpty(){return!1}}function T(n){return n instanceof Me}function ma(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class _a extends xr{constructor(e){super(e)}decorate(e,t){R(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function X(n){return n instanceof _a}class $n extends Me{static getType(){return"root"}static clone(){return new $n}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){R(51)}getTextContent(){const e=this.__cachedText;return!In()&&re()._dirtyType!==Ot||e===null?super.getTextContent():e}remove(){R(52)}replace(e){R(53)}insertBefore(e){R(54)}insertAfter(e){R(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];T(r)||X(r)||R(56)}return super.append(...e)}static importJSON(e){const t=le();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Se(n){return n instanceof $n}function is(){return new Nr(new Map([["root",new $n]]))}function ya(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&R(130,t.name),T(n)){const r=e.children;Array.isArray(r)||R(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=ya(i[s]);r.push(o)}}return e}class Nr{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return fa(t&&t.editor||null,this,e)}clone(e){const t=new Nr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return fa(null,this,()=>({root:ya(le())}))}}class ss extends Me{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Qt extends Me{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=lt[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Qt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=Cn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:_c,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&nt(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const s=this.getIndent();s>0&&(t.style.textIndent=20*s+"px")}return{element:t}}static importJSON(e){const t=ne();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=ne();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||O(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function _c(n){const e=ne();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function ne(){return ve(new Qt)}function Mn(n){return n instanceof Qt}const q=0,me=1,yc=3,bc=4;function ba(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=is(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Ot,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function vc(n){const e=n||{},t=pc(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=is(),a=e.namespace||(i!==null?i._config.namespace:mo()),l=e.editorState,u=[$n,ft,Ln,Rn,Qt,ss,...e.nodes||[]],{onError:c,html:f}=e,d=e.editable===void 0||e.editable;let g;if(n===void 0&&t!==null)g=t._nodes;else{g=new Map;for(let m=0;m<u.length;m++){let _=u[m],b=null,p=null;if(typeof _!="function"){const S=_;_=S.replace,b=S.with,p=S.withKlass||null}const y=_.getType(),x=_.transform(),w=new Set;x!==null&&w.add(x),g.set(y,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:b,replaceWithKlass:p,transforms:w})}}const h=new Ar(o,i,g,{disableEvents:s,namespace:a,theme:r},c||console.error,function(m,_){const b=new Map,p=new Set,y=x=>{Object.keys(x).forEach(w=>{let S=b.get(w);S===void 0&&(S=[],b.set(w,S)),S.push(x[w])})};return m.forEach(x=>{const w=x.klass.importDOM;if(w==null||p.has(w))return;p.add(w);const S=w.call(x.klass);S!==null&&y(S)}),_&&y(_),b}(g,f?f.import:void 0),d);return l!==void 0&&(h._pendingEditorState=l,h._dirtyType=Jt),h}class Ar{constructor(e,t,r,i,s,o,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=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Ot,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=mo(),this._onError=s,this._htmlConversions=o,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}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,r){r===void 0&&R(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);s===void 0&&R(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;s.set(t,i);const o=r&&r.skipInitialization;return o===void 0||o||this.initializeMutationListener(t,i),()=>{s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&R(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=tc(r).get(t.getType());if(!i)return;const s=new Map;for(const o of i.keys())s.set(o,"created");s.size>0&&e(s,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],s=r.replaceWithKlass;if(s!=null){const l=this.registerNodeTransformToKlass(s,t);i.push(l)}var o,a;return o=this,a=e.getType(),$e(o,()=>{const l=gt();if(l.isEmpty())return;if(a==="root")return void le().markDirty();const u=l._nodeMap;for(const[,c]of u)c.markDirty()},o._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(l=>l.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return $(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 r=Cn(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,ba(this,t,e,i),t!==null&&(this._config.disableEvents||sc(t),r!=null&&t.classList.remove(...r)),e!==null){const s=function(a){const l=a.ownerDocument;return l&&l.defaultView||null}(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=Jt,no(this),this._updateTags.add("history-merge"),kt(this),this._config.disableEvents||function(a,l){const u=a.ownerDocument,c=vr.get(u);(c===void 0||c<1)&&u.addEventListener("selectionchange",Bo),vr.set(u,(c||0)+1),a.__lexicalEditor=l;const f=zo(a);for(let d=0;d<Ui.length;d++){const[g,h]=Ui[d],m=typeof h=="function"?_=>{Wo(_)||(Uo(_),(l.isEditable()||g==="click")&&h(_,l))}:_=>{if(Wo(_))return;Uo(_);const b=l.isEditable();switch(g){case"cut":return b&&$(l,oi,_);case"copy":return $(l,Qn,_);case"paste":return b&&$(l,Vn,_);case"dragstart":return b&&$(l,Vs,_);case"dragover":return b&&$(l,qs,_);case"dragend":return b&&$(l,bu,_);case"focus":return b&&$(l,Su,_);case"blur":return b&&$(l,wu,_);case"drop":return b&&$(l,Js,_)}};a.addEventListener(g,m),f.push(()=>{a.removeEventListener(g,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;Dn("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&R(38),to(this);const r=this._pendingEditorState,i=this._updateTags,s=t!==void 0?t.tag:null;r===null||r.isEmpty()||(s!=null&&i.add(s),kt(this)),this._pendingEditorState=e,this._dirtyType=Jt,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),kt(this)}parseEditorState(e,t){return function(r,i,s){const o=is(),a=he,l=Fe,u=pe,c=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,g=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,he=o,Fe=!1,pe=i;try{const h=i._nodes;rs(r.root,h),s&&s(),o._readOnly=!0}catch(h){h instanceof Error&&i._onError(h)}finally{i._dirtyElements=c,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=g,he=a,Fe=l,pe=u}return o}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return kt(this),this.getEditorState().read(e,{editor:this})}update(e,t){$e(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),$e(this,()=>{const i=P(),s=le();i!==null?i.dirty=!0:s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=tt(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Dn("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ar.version="0.17.1+prod.esm";const va=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,xc=va?L.useLayoutEffect:L.useEffect,Fr={tag:"history-merge"};function Sc({initialConfig:n,children:e}){const t=L.useMemo(()=>{const{theme:r,namespace:i,nodes:s,onError:o,editorState:a,html:l}=n,u=pu(null,r),c=vc({editable:n.editable,html:l,namespace:i,nodes:s,onError:f=>o(f,c),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const g=le();if(g.isEmpty()){const h=ne();g.append(h);const m=va?document.activeElement:null;(P()!==null||m!==null&&m===f.getRootElement())&&h.select()}},Fr);else if(d!==null)switch(typeof d){case"string":{const g=f.parseEditorState(d);f.setEditorState(g,Fr);break}case"object":f.setEditorState(d,Fr);break;case"function":f.update(()=>{le().isEmpty()&&d(f)},Fr)}}}(c,a),[c,u]},[]);return xc(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),N.jsx(Bs.Provider,{value:t,children:e})}const wc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Cc(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Ec(){return function(n){const[e]=we(),t=L.useMemo(()=>n(e),[e,n]),r=L.useRef(t.initialValueFn()),[i,s]=L.useState(r.current);return wc(()=>{const{initialValueFn:o,subscribe:a}=t,l=o();return r.current!==l&&(r.current=l,s(l)),a(u=>{r.current=u,s(u)})},[t,n]),i}(Cc)}function kc(){return le().getTextContent()}function Tc(n,e=!0){if(n)return!1;let t=kc();return e&&(t=t.trim()),t===""}function Nc(n){if(!Tc(n,!1))return!1;const e=le().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(X(i))return!1;if(T(i)){if(!Mn(i)||i.__indent!==0)return!1;const s=i.getChildren(),o=s.length;for(let a=0;a<o;a++){const l=s[r];if(!O(l))return!1}}}return!0}function xa(n){return()=>Nc(n)}function Ac(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Ac(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Fc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sa=Fc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Oc=new Map;function Pc(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,s]=r.split(/:([^]+)/);i&&s&&(e[i.trim()]=s.trim())}return e}function wa(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,s=n.isBackward(),o=r.getNode(),a=i.getNode(),l=e.is(o),u=e.is(a);if(l||u){const[c,f]=Zi(n),d=o.is(a),g=e.is(s?a:o),h=e.is(s?o:a);let m,_=0;return d?(_=c>f?f:c,m=c>f?c:f):g?(_=s?f:c,m=void 0):h&&(_=0,m=s?c:f),e.__text=e.__text.slice(_,m),e}}return e}function Ca(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return T(e)||Sa(177),n.offset===e.getChildrenSize()}function Lc(n){const e=n.getStyle(),t=Pc(e);Oc.set(e,t)}function Ea(n){return n.getNode().isAttached()}function Rc(n){let e=n;for(;e!==null&&!Ae(e);){const t=e.getLatest(),r=e.getParent();t.getChildrenSize()===0&&e.remove(!0),e=r}}function jn(n,e,t=null){const r=n.getStartEndPoints(),i=r?r[0]:null,s=n.getNodes(),o=s.length;if(i!==null&&(o===0||o===1&&i.type==="element"&&i.getNode().getChildrenSize()===0)){const u=i.type==="text"?i.getNode().getParentOrThrow():i.getNode(),c=u.getChildren();let f=e();return f.setFormat(u.getFormatType()),f.setIndent(u.getIndent()),c.forEach(d=>f.append(d)),t&&(f=t.append(f)),void u.replace(f)}let a=null,l=[];for(let u=0;u<o;u++){const c=s[u];Ae(c)?(os(n,l,l.length,e,t),l=[],a=c):a===null||a!==null&&fr(c,a)?l.push(c):(os(n,l,l.length,e,t),l=[c])}os(n,l,l.length,e,t)}function os(n,e,t,r,i=null){if(e.length===0)return;const s=e[0],o=new Map,a=[];let l=T(s)?s:s.getParentOrThrow();l.isInline()&&(l=l.getParentOrThrow());let u=!1;for(;l!==null;){const h=l.getPreviousSibling();if(h!==null){l=h,u=!0;break}if(l=l.getParentOrThrow(),Ae(l))break}const c=new Set;for(let h=0;h<t;h++){const m=e[h];T(m)&&m.getChildrenSize()===0&&c.add(m.getKey())}const f=new Set;for(let h=0;h<t;h++){const m=e[h];let _=m.getParent();if(_!==null&&_.isInline()&&(_=_.getParent()),_!==null&&wi(m)&&!f.has(m.getKey())){const b=_.getKey();if(o.get(b)===void 0){const p=r();p.setFormat(_.getFormatType()),p.setIndent(_.getIndent()),a.push(p),o.set(b,p),_.getChildren().forEach(y=>{p.append(y),f.add(y.getKey()),T(y)&&y.getChildrenKeys().forEach(x=>f.add(x))}),Rc(_)}}else if(c.has(m.getKey())){T(m)||Sa(179);const b=r();b.setFormat(m.getFormatType()),b.setIndent(m.getIndent()),a.push(b),m.remove(!0)}}if(i!==null)for(let h=0;h<a.length;h++){const m=a[h];i.append(m)}let d=null;if(Ae(l))if(u)if(i!==null)l.insertAfter(i);else for(let h=a.length-1;h>=0;h--){const m=a[h];l.insertAfter(m)}else{const h=l.getFirstChild();if(T(h)&&(l=h),h===null)if(i)l.append(i);else for(let m=0;m<a.length;m++){const _=a[m];l.append(_),d=_}else if(i!==null)h.insertBefore(i);else for(let m=0;m<a.length;m++){const _=a[m];h.insertBefore(_),d=_}}else if(i)l.insertAfter(i);else for(let h=a.length-1;h>=0;h--){const m=a[h];l.insertAfter(m),d=m}const g=Xt();A(g)&&Ea(g.anchor)&&Ea(g.focus)?De(g.clone()):d!==null?d.selectEnd():n.dirty=!0}function ka(n,e){const t=En(n.focus,e);return X(t)&&!t.isIsolated()||T(t)&&!t.isInline()&&!t.canBeEmpty()}function Ic(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Ta(n){const e=n.anchor.getNode();return(Se(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function Na(n,e,t){const r=Ta(n);Ic(n,e,t?!r:r,"character")}function Dc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var $c=Dc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Aa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Mc=Aa&&"documentMode"in document?document.documentMode:null;!(!Aa||!("InputEvent"in window)||Mc)&&"getTargetRanges"in new window.InputEvent("input");function Fa(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function We(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Pe(n,...e){const t=Fa(...e);t.length>0&&n.classList.add(...t)}function Or(n,...e){const t=Fa(...e);t.length>0&&n.classList.remove(...t)}function Oa(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function jc(n){const e=as(n,t=>T(t)&&!t.isInline());return T(e)||$c(4,n.__key),e}const as=(n,e)=>{let t=n;for(;t!==le()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function Tt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function zc(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const s=r.data;if(typeof s=="string"){let o;try{o=JSON.parse(s)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const a=o.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[u,c,f,d,g,h]=l;n.update(()=>{const m=P();if(A(m)){const _=m.anchor;let b=_.getNode(),p=0,y=0;if(O(b)&&u>=0&&c>=0&&(p=u,y=u+c,m.setTextNodeRange(b,p,b,y)),p===y&&f===""||(m.insertRawText(f),b=_.getNode()),O(b)){p=d,y=d+g;const x=b.getTextContentSize();p=p>x?x:p,y=y>x?x:y,m.setTextNodeRange(b,p,b,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Bc(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let s=0;s<t.length;s++){const o=t[s];if(!La.has(o.nodeName)){const a=Ra(o,n,i,!1);a!==null&&(r=r.concat(a))}}return function(s){for(const o of s)o.getNextSibling()instanceof ss&&o.insertAfter(Ye());for(const o of s){const a=o.getChildren();for(const l of a)o.insertBefore(l);o.remove()}}(i),r}function Uc(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=le().getChildren();for(let i=0;i<r.length;i++)Pa(n,r[i],t,e);return t.innerHTML}function Pa(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=T(e)&&e.excludeFromCopy("html");let o=e;if(r!==null){let g=Li(e);g=O(g)&&r!==null?wa(r,g):g,o=g}const a=T(o)?o.getChildren():[],l=n._nodes.get(o.getType());let u;u=l&&l.exportDOM!==void 0?l.exportDOM(n,o):o.exportDOM(n);const{element:c,after:f}=u;if(!c)return!1;const d=document.createDocumentFragment();for(let g=0;g<a.length;g++){const h=a[g],m=Pa(n,h,d,r);!i&&T(e)&&m&&e.extractWithChild(h,r,"html")&&(i=!0)}if(i&&!s){if(nt(c)&&c.append(d),t.append(c),f){const g=f.call(o,c);g&&c.replaceWith(g)}}else t.append(d);return i}const La=new Set(["STYLE","SCRIPT"]);function Ra(n,e,t,r,i=new Map,s){let o=[];if(La.has(n.nodeName))return o;let a=null;const l=function(h,m){const{nodeName:_}=h,b=m._htmlConversions.get(_.toLowerCase());let p=null;if(b!==void 0)for(const y of b){const x=y(h);x!==null&&(p===null||(p.priority||0)<(x.priority||0))&&(p=x)}return p!==null?p.conversion:null}(n,e),u=l?l(n):null;let c=null;if(u!==null){c=u.after;const h=u.node;if(a=Array.isArray(h)?h[h.length-1]:h,a!==null){for(const[,m]of i)if(a=m(a,s),!a)break;a&&o.push(...Array.isArray(h)?h:[a])}u.forChild!=null&&i.set(n.nodeName,u.forChild)}const f=n.childNodes;let d=[];const g=(a==null||!Ae(a))&&(a!=null&&Xi(a)||r);for(let h=0;h<f.length;h++)d.push(...Ra(f[h],e,t,g,new Map(i),a));return c!=null&&(d=c(d)),hr(n)&&(d=Wc(n,d,g?()=>{const h=new ss;return t.push(h),h}:ne)),a==null?d.length>0?o=o.concat(d):hr(n)&&function(h){return h.nextSibling==null||h.previousSibling==null?!1:Oi(h.nextSibling)&&Oi(h.previousSibling)}(n)&&(o=o.concat(Ye())):T(a)&&a.append(...d),o}function Wc(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const a=e[o];if(Xi(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(s.push(a),o===e.length-1||o<e.length-1&&Xi(e[o+1])){const l=t();l.setFormat(r),l.append(...s),i.push(l),s=[]}}return i}function Kc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pr=Kc(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Hc=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ia=n=>Hc?(n||window).getSelection():null;function Jc(n,e=P()){return e==null&&Pr(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?"":Uc(n,e)}function Vc(n,e=P()){return e==null&&Pr(166),A(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(qc(n,e))}function Da(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const o=JSON.parse(r);if(o.namespace===t._config.namespace&&Array.isArray(o.nodes))return $a(t,Gc(o.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const o=new DOMParser().parseFromString(i,"text/html");return $a(t,Bc(t,o),e)}catch{}const s=n.getData("text/plain")||n.getData("text/uri-list");if(s!=null)if(A(e)){const o=s.split(/(\r?\n|\t)/);o[o.length-1]===""&&o.pop();for(let a=0;a<o.length;a++){const l=P();if(A(l)){const u=o[a];u===`
|
|
40
|
-
`||
|
|
41
|
-
`?l.insertParagraph():u===" "?l.insertNodes([Ue()]):l.insertText(u)}}}else e.insertRawText(s)}function $a(n,e,t){n.dispatchCommand(mu,{nodes:e,selection:t})||t.insertNodes(e)}function Ma(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=T(t)&&t.excludeFromCopy("html");let o=t;if(e!==null){let u=Li(t);u=O(u)&&e!==null?wa(e,u):u,o=u}const a=T(o)?o.getChildren():[],l=function(u){const c=u.exportJSON(),f=u.constructor;if(c.type!==f.getType()&&Pr(58,f.name),T(u)){const d=c.children;Array.isArray(d)||Pr(59,f.name)}return c}(o);if(O(o)){const u=o.__text;u.length>0?l.text=u:i=!1}for(let u=0;u<a.length;u++){const c=a[u],f=Ma(n,e,c,l.children);!i&&T(t)&&f&&t.extractWithChild(c,e,"clone")&&(i=!0)}if(i&&!s)r.push(l);else if(Array.isArray(l.children))for(let u=0;u<l.children.length;u++){const c=l.children[u];r.push(c)}return i}function qc(n,e){const t=[],r=le().getChildren();for(let i=0;i<r.length;i++)Ma(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Gc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=mc(r);O(i)&&Lc(i),e.push(i)}return e}let en=null;async function ja(n,e,t){if(en!==null)return!1;if(e!==null)return new Promise((l,u)=>{n.update(()=>{l(za(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,s=Ia(n._window);if(r===null||s===null)return!1;const o=i.createElement("span");o.style.cssText="position: fixed; top: -1000px;",o.append(i.createTextNode("#")),r.append(o);const a=new Range;return a.setStart(o,0),a.setEnd(o,1),s.removeAllRanges(),s.addRange(a),new Promise((l,u)=>{const c=n.registerCommand(Qn,f=>(Tt(f,ClipboardEvent)&&(c(),en!==null&&(window.clearTimeout(en),en=null),l(za(n,f,t))),!0),bc);en=window.setTimeout(()=>{c(),en=null,l(!1)},50),i.execCommand("copy"),o.remove()})}function za(n,e,t){if(t===void 0){const i=Ia(n._window);if(!i)return!1;const s=i.anchorNode,o=i.focusNode;if(s!==null&&o!==null&&!vn(n,s,o))return!1;const a=P();if(a===null)return!1;t=Zc(a)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Xc(r,t),!0)}const Yc=[["text/html",Jc],["application/x-lexical-editor",Vc]];function Zc(n=P()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Qu();for(const[r,i]of Yc){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Xc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ba(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const tn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Qc=tn&&"documentMode"in document?document.documentMode:null,ed=!(!tn||!("InputEvent"in window)||Qc)&&"getTargetRanges"in new window.InputEvent("input"),td=tn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),nd=tn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,rd=tn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),id=tn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!rd,Ua=dn();let Lr=class nu extends Me{static getType(){return"quote"}static clone(e){return new nu(e.__key)}constructor(e){super(e)}createDOM(e){const t=document.createElement("blockquote");return Pe(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:sd,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&nt(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){const t=Rr();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,t){const r=ne(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=ne();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Rr(){return ve(new Lr)}function Wa(n){return n instanceof Lr}let Ir=class ru extends Me{static getType(){return"heading"}static clone(e){return new ru(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];Pe(r,s)}return r}updateDOM(e,t){return!1}static importDOM(){return{h1:e=>({conversion:nn,priority:0}),h2:e=>({conversion:nn,priority:0}),h3:e=>({conversion:nn,priority:0}),h4:e=>({conversion:nn,priority:0}),h5:e=>({conversion:nn,priority:0}),h6:e=>({conversion:nn,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Ka(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Ka(e)?{conversion:t=>({node:Nt("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&nt(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){const t=Nt(e.tag);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?ne():Nt(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const a=ne();a.select(),this.replace(a,!0)}return s}collapseAtStart(){const e=this.isEmpty()?ne():Nt(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Ka(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function nn(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Nt(e),n.style!==null&&t.setFormat(n.style.textAlign)),{node:t}}function sd(n){const e=Rr();return n.style!==null&&e.setFormat(n.style.textAlign),{node:e}}function Nt(n){return ve(new Ir(n))}function Ha(n){return n instanceof Ir}function Dr(n){let e=null;if(Tt(n,DragEvent)?e=n.dataTransfer:Tt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function Ja(n){const e=P();if(!A(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const s=r[i],o=s.getKey();if(t.has(o))continue;const a=as(s,u=>T(u)&&!u.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function $r(n){const e=ut(n);return X(e)}function od(n){return We(n.registerCommand(ei,e=>{const t=P();return!!xe(t)&&(t.clear(),!0)},0),n.registerCommand(Ft,e=>{const t=P();return!!A(t)&&(t.deleteCharacter(e),!0)},q),n.registerCommand(hn,e=>{const t=P();return!!A(t)&&(t.deleteWord(e),!0)},q),n.registerCommand(pn,e=>{const t=P();return!!A(t)&&(t.deleteLine(e),!0)},q),n.registerCommand(Wt,e=>{const t=P();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Da(r,t,n);else if(A(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},q),n.registerCommand(ti,()=>{const e=P();return!!A(e)&&(e.removeText(),!0)},q),n.registerCommand(Ie,e=>{const t=P();return!!A(t)&&(t.formatText(e),!0)},q),n.registerCommand(mn,e=>{const t=P();if(!A(t)&&!xe(t))return!1;const r=t.getNodes();for(const i of r){const s=as(i,o=>T(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},q),n.registerCommand(Ut,e=>{const t=P();return!!A(t)&&(t.insertLineBreak(e),!0)},q),n.registerCommand(gn,()=>{const e=P();return!!A(e)&&(e.insertParagraph(),!0)},q),n.registerCommand(si,()=>(oa([Ue()]),!0),q),n.registerCommand(yt,()=>Ja(e=>{const t=e.getIndent();e.setIndent(t+1)}),q),n.registerCommand(Ht,()=>Ja(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),q),n.registerCommand(Kt,e=>{const t=P();if(xe(t)&&!$r(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(A(t)){const r=En(t.focus,!0);if(!e.shiftKey&&X(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},q),n.registerCommand(Zn,e=>{const t=P();if(xe(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(A(t)){if(function(i){const s=i.focus;return s.key==="root"&&s.offset===le().getChildrenSize()}(t))return e.preventDefault(),!0;const r=En(t.focus,!1);if(!e.shiftKey&&X(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},q),n.registerCommand(Ws,e=>{const t=P();if(xe(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!A(t))return!1;if(ka(t,!0)){const r=e.shiftKey;return e.preventDefault(),Na(t,r,!0),!0}return!1},q),n.registerCommand(Us,e=>{const t=P();if(xe(t)&&!$r(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!A(t))return!1;const r=e.shiftKey;return!!ka(t,!1)&&(e.preventDefault(),Na(t,r,!1),!0)},q),n.registerCommand(ri,e=>{if($r(e.target))return!1;const t=P();if(!A(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!Se(i)&&jc(i).getIndent()>0?n.dispatchCommand(Ht,void 0):n.dispatchCommand(Ft,!0)},q),n.registerCommand(ii,e=>{if($r(e.target))return!1;const t=P();return!!A(t)&&(e.preventDefault(),n.dispatchCommand(Ft,!1))},q),n.registerCommand(Xn,e=>{const t=P();if(!A(t))return!1;if(e!==null){if((nd||td||id)&&ed)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Ut,!1)}return n.dispatchCommand(gn,void 0)},q),n.registerCommand(Ks,()=>{const e=P();return!!A(e)&&(n.blur(),!0)},q),n.registerCommand(Js,e=>{const[,t]=Dr(e);if(t.length>0){const i=Ba(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,a=ut(o);if(a!==null){const l=ra();if(O(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"text");else{const c=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(c,f,"element"),l.focus.set(c,f,"element")}const u=oo(l);De(u)}n.dispatchCommand(Ua,t)}return e.preventDefault(),!0}const r=P();return!!A(r)},q),n.registerCommand(Vs,e=>{const[t]=Dr(e),r=P();return!(t&&!A(r))},q),n.registerCommand(qs,e=>{const[t]=Dr(e),r=P();if(t&&!A(r))return!1;const i=Ba(e.clientX,e.clientY);if(i!==null){const s=ut(i.node);X(s)&&e.preventDefault()}return!0},q),n.registerCommand(ai,()=>(Gu(),!0),q),n.registerCommand(Qn,e=>(ja(n,Tt(e,ClipboardEvent)?e:null),!0),q),n.registerCommand(oi,e=>(async function(t,r){await ja(r,Tt(t,ClipboardEvent)?t:null),r.update(()=>{const i=P();A(i)?i.removeText():xe(i)&&i.getNodes().forEach(s=>s.remove())})}(e,n),!0),q),n.registerCommand(Vn,e=>{const[,t,r]=Dr(e);return t.length>0&&!r?(n.dispatchCommand(Ua,t),!0):vi(e.target)?!1:P()!==null&&(function(i,s){i.preventDefault(),s.update(()=>{const o=P(),a=Tt(i,InputEvent)||Tt(i,KeyboardEvent)?null:i.clipboardData;a!=null&&o!==null&&Da(a,o,s)},{tag:"paste"})}(e,n),!0)},q))}const ls=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function Va(n){return n.getEditorState().read(xa(n.isComposing()))}function ad({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=we(),i=function(s,o){const[a,l]=L.useState(()=>s.getDecorators());return ls(()=>s.registerDecoratorListener(u=>{Jn.flushSync(()=>{l(u)})}),[s]),L.useEffect(()=>{l(s.getDecorators())},[s]),L.useMemo(()=>{const u=[],c=Object.keys(a);for(let f=0;f<c.length;f++){const d=c[f],g=N.jsx(o,{onError:m=>s._onError(m),children:N.jsx(L.Suspense,{fallback:null,children:a[d]})}),h=s.getElementByKey(d);h!==null&&u.push(Jn.createPortal(g,h,d))}return u},[o,a,s])}(r,t);return function(s){ls(()=>We(od(s),zc(s)),[s])}(r),N.jsxs(N.Fragment,{children:[n,N.jsx(ld,{content:e}),i]})}function ld({content:n}){const[e]=we(),t=function(i){const[s,o]=L.useState(()=>Va(i));return ls(()=>{function a(){const l=Va(i);o(l)}return a(),We(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),s}(e),r=Ec();return t?typeof n=="function"?n(r):n:null}const qa=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?L.useLayoutEffect:L.useEffect;function ud({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:o,ariaLabelledBy:a,ariaMultiline:l,ariaOwns:u,ariaRequired:c,autoCapitalize:f,className:d,id:g,role:h="textbox",spellCheck:m=!0,style:_,tabIndex:b,"data-testid":p,...y},x){const[w,S]=L.useState(n.isEditable()),C=L.useCallback(E=>{E&&E.ownerDocument&&E.ownerDocument.defaultView?n.setRootElement(E):n.setRootElement(null)},[n]),k=L.useMemo(()=>function(...E){return I=>{E.forEach(M=>{typeof M=="function"?M(I):M!=null&&(M.current=I)})}}(x,C),[C,x]);return qa(()=>(S(n.isEditable()),n.registerEditableListener(E=>{S(E)})),[n]),N.jsx("div",{...y,"aria-activedescendant":w?e:void 0,"aria-autocomplete":w?t:"none","aria-controls":w?r:void 0,"aria-describedby":i,"aria-expanded":w&&h==="combobox"?!!s:void 0,"aria-label":o,"aria-labelledby":a,"aria-multiline":l,"aria-owns":w?u:void 0,"aria-readonly":!w||void 0,"aria-required":c,autoCapitalize:f,className:d,contentEditable:w,"data-testid":p,id:g,ref:k,role:w?h:void 0,spellCheck:m,style:_,tabIndex:b})}const cd=L.forwardRef(ud);function Ga(n){return n.getEditorState().read(xa(n.isComposing()))}const dd=L.forwardRef(fd);function fd(n,e){const{placeholder:t,...r}=n,[i]=we();return N.jsxs(N.Fragment,{children:[N.jsx(cd,{editor:i,...r,ref:e}),t!=null&&N.jsx(gd,{editor:i,content:t})]})}function gd({content:n,editor:e}){const t=function(o){const[a,l]=L.useState(()=>Ga(o));return qa(()=>{function u(){const c=Ga(o);l(c)}return u(),We(o.registerUpdateListener(()=>{u()}),o.registerEditableListener(()=>{u()}))},[o]),a}(e),[r,i]=L.useState(e.isEditable());if(L.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(o=>{i(o)})),[e]),!t)return null;let s=null;return typeof n=="function"?s=n(r):n!==null&&(s=n),s===null?null:N.jsx("div",{"aria-hidden":!0,children:s})}const Mr=0,us=1,cs=2,Ze=0,hd=1,Ya=2,pd=3,md=4;function _d(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return Ze;const s=e._selection,o=n._selection;if(i)return hd;if(!(A(s)&&A(o)&&o.isCollapsed()&&s.isCollapsed()))return Ze;const a=function(b,p,y){const x=b._nodeMap,w=[];for(const S of p){const C=x.get(S);C!==void 0&&w.push(C)}for(const[S,C]of y){if(!C)continue;const k=x.get(S);k===void 0||Se(k)||w.push(k)}return w}(e,t,r);if(a.length===0)return Ze;if(a.length>1){const b=e._nodeMap,p=b.get(s.anchor.key),y=b.get(o.anchor.key);return p&&y&&!n._nodeMap.has(p.__key)&&O(p)&&p.__text.length===1&&s.anchor.offset===1?Ya:Ze}const l=a[0],u=n._nodeMap.get(l.__key);if(!O(u)||!O(l)||u.__mode!==l.__mode)return Ze;const c=u.__text,f=l.__text;if(c===f)return Ze;const d=s.anchor,g=o.anchor;if(d.key!==g.key||d.type!=="text")return Ze;const h=d.offset,m=g.offset,_=f.length-c.length;return _===1&&m===h-1?Ya:_===-1&&m===h+1?pd:_===-1&&m===h?md:Ze}function yd(n,e){let t=Date.now(),r=Ze;return(i,s,o,a,l,u)=>{const c=Date.now();if(u.has("historic"))return r=Ze,t=c,cs;const f=_d(i,s,a,l,n.isComposing()),d=(()=>{const g=o===null||o.editor===n,h=u.has("history-push");if(!h&&g&&u.has("history-merge"))return Mr;if(i===null)return us;const m=s._selection;return a.size>0||l.size>0?h===!1&&f!==Ze&&f===r&&c<t+e&&g||a.size===1&&function(_,b,p){const y=b._nodeMap.get(_),x=p._nodeMap.get(_),w=b._selection,S=p._selection;return!(A(w)&&A(S)&&w.anchor.type==="element"&&w.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!O(y)||!O(x)||y.__parent!==x.__parent)&&JSON.stringify(b.read(()=>y.exportJSON()))===JSON.stringify(p.read(()=>x.exportJSON()))}(Array.from(a)[0],i,s)?Mr:us:m!==null?Mr:cs})();return t=c,r=f,d}}function Za(n){n.undoStack=[],n.redoStack=[],n.current=null}function bd(n,e,t){const r=yd(n,t);return We(n.registerCommand(qn,()=>(function(s,o){const a=o.redoStack,l=o.undoStack;if(l.length!==0){const u=o.current,c=l.pop();u!==null&&(a.push(u),s.dispatchCommand(_n,!0)),l.length===0&&s.dispatchCommand(yn,!1),o.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(n,e),!0),q),n.registerCommand(Gn,()=>(function(s,o){const a=o.redoStack,l=o.undoStack;if(a.length!==0){const u=o.current;u!==null&&(l.push(u),s.dispatchCommand(yn,!0));const c=a.pop();a.length===0&&s.dispatchCommand(_n,!1),o.current=c||null,c&&c.editor.setEditorState(c.editorState,{tag:"historic"})}}(n,e),!0),q),n.registerCommand(vu,()=>(Za(e),!1),q),n.registerCommand(xu,()=>(Za(e),n.dispatchCommand(_n,!1),n.dispatchCommand(yn,!1),!0),q),n.registerUpdateListener(({editorState:s,prevEditorState:o,dirtyLeaves:a,dirtyElements:l,tags:u})=>{const c=e.current,f=e.redoStack,d=e.undoStack,g=c===null?null:c.editorState;if(c!==null&&s===g)return;const h=r(o,s,c,a,l,u);if(h===us)f.length!==0&&(e.redoStack=[],n.dispatchCommand(_n,!1)),c!==null&&(d.push({...c}),n.dispatchCommand(yn,!0));else if(h===cs)return;e.current={editor:n,editorState:s}}))}function vd(){return{current:null,redoStack:[],undoStack:[]}}function xd({delay:n,externalHistoryState:e}){const[t]=we();return function(r,i,s=1e3){const o=L.useMemo(()=>i||vd(),[i]);L.useEffect(()=>bd(r,o,s),[s,r,o])}(t,e,n),null}function Sd({defaultSelection:n}){const[e]=we();return L.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ds(n,e){return ds=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},ds(n,e)}var Xa={error:null},wd=function(n){var e,t;function r(){for(var s,o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return(s=n.call.apply(n,[this].concat(a))||this).state=Xa,s.resetErrorBoundary=function(){for(var u,c=arguments.length,f=new Array(c),d=0;d<c;d++)f[d]=arguments[d];s.props.onReset==null||(u=s.props).onReset.apply(u,f),s.reset()},s}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,ds(e,t),r.getDerivedStateFromError=function(s){return{error:s}};var i=r.prototype;return i.reset=function(){this.setState(Xa)},i.componentDidCatch=function(s,o){var a,l;(a=(l=this.props).onError)==null||a.call(l,s,o)},i.componentDidUpdate=function(s,o){var a,l,u,c,f=this.state.error,d=this.props.resetKeys;f!==null&&o.error!==null&&((u=s.resetKeys)===void 0&&(u=[]),(c=d)===void 0&&(c=[]),u.length!==c.length||u.some(function(g,h){return!Object.is(g,c[h])}))&&((a=(l=this.props).onResetKeysChange)==null||a.call(l,s.resetKeys,d),this.reset())},i.render=function(){var s=this.state.error,o=this.props,a=o.fallbackRender,l=o.FallbackComponent,u=o.fallback;if(s!==null){var c={error:s,resetErrorBoundary:this.resetErrorBoundary};if(Yr.isValidElement(u))return u;if(typeof a=="function")return a(c);if(l)return Yr.createElement(l,c);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(Yr.Component);function Cd({children:n,onError:e}){return N.jsx(wd,{fallback:N.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}const Ed=new Set(["http:","https:","mailto:","sms:","tel:"]);class At extends Me{static getType(){return"link"}static clone(e){return new At(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Pe(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,s=this.__target,o=this.__rel,a=this.__title;i!==e.__url&&(t.href=i),s!==e.__target&&(s?t.target=s:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),a!==e.__title&&(a?t.title=a:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:kd,priority:1})}}static importJSON(e){const t=zn(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!Ed.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=zn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!A(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function kd(n){let e=null;if(Xu(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=zn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function zn(n,e){return ve(new At(n,e))}function Xe(n){return n instanceof At}let jr=class iu extends At{constructor(e,t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new iu(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){const t=fs(e.url,{isUnlinked:e.isUnlinked,rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked,type:"autolink",version:1}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(T(r)){const i=fs(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}};function fs(n,e){return ve(new jr(n,e))}function rn(n){return n instanceof jr}const sn=dn();function gs(n,e={}){const{target:t,title:r}=e,i=e.rel===void 0?"noreferrer":e.rel,s=P();if(!A(s))return;const o=s.extract();if(n===null)o.forEach(a=>{const l=a.getParent();if(!rn(l)&&Xe(l)){const u=l.getChildren();for(let c=0;c<u.length;c++)l.insertBefore(u[c]);l.remove()}});else{if(o.length===1){const u=function(c,f){let d=c;for(;d!==null&&d.getParent()!==null&&!f(d);)d=d.getParentOrThrow();return f(d)?d:null}(o[0],Xe);if(u!==null)return u.setURL(n),t!==void 0&&u.setTarget(t),i!==null&&u.setRel(i),void(r!==void 0&&u.setTitle(r))}let a=null,l=null;o.forEach(u=>{const c=u.getParent();if(c!==l&&c!==null&&(!T(u)||u.isInline())){if(Xe(c))return l=c,c.setURL(n),t!==void 0&&c.setTarget(t),i!==null&&l.setRel(i),void(r!==void 0&&l.setTitle(r));if(c.is(a)||(a=c,l=zn(n,{rel:i,target:t,title:r}),Xe(c)?u.getPreviousSibling()===null?c.insertBefore(l):c.insertAfter(l):u.insertBefore(l)),Xe(u)){if(u.is(l))return;if(l!==null){const f=u.getChildren();for(let d=0;d<f.length;d++)l.append(f[d])}u.remove()}else l!==null&&l.append(u)}})}}const Qa=/^(\d+(?:\.\d+)?)px$/,zr={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};let hs=class su extends Me{static getType(){return"tablecell"}static clone(e){const t=new su(e.__headerState,e.__colSpan,e.__width,e.__key);return t.__rowSpan=e.__rowSpan,t.__backgroundColor=e.__backgroundColor,t}static importDOM(){return{td:e=>({conversion:el,priority:0}),th:e=>({conversion:el,priority:0})}}static importJSON(e){const t=e.colSpan||1,r=e.rowSpan||1,i=tl(e.headerState,t,e.width||void 0);return i.__rowSpan=r,i.__backgroundColor=e.backgroundColor||null,i}constructor(e=zr.NO_STATUS,t=1,r,i){super(i),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null}createDOM(e){const t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),Pe(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const{element:t}=super.exportDOM(e);if(t){const r=t;r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign="top",r.style.textAlign="start";const i=this.getBackgroundColor();i!==null?r.style.backgroundColor=i:this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return{element:t}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e){return this.getWritable().__headerState=e,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){return this.getWritable().__width=e,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){this.getWritable().__backgroundColor=e}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==zr.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function el(n){const e=n,t=n.nodeName.toLowerCase();let r;Qa.test(e.style.width)&&(r=parseFloat(e.style.width));const i=tl(t==="th"?zr.ROW:zr.NO_STATUS,e.colSpan,r);i.__rowSpan=e.rowSpan;const s=e.style.backgroundColor;s!==""&&(i.__backgroundColor=s);const o=e.style,a=o.textDecoration.split(" "),l=o.fontWeight==="700"||o.fontWeight==="bold",u=a.includes("line-through"),c=o.fontStyle==="italic",f=a.includes("underline");return{after:d=>(d.length===0&&d.push(ne()),d),forChild:(d,g)=>{if(nl(g)&&!T(d)){const h=ne();return Z(d)&&d.getTextContent()===`
|
|
42
|
-
`?null:(O(d)&&(l&&d.toggleFormat("bold"),u&&d.toggleFormat("strikethrough"),c&&d.toggleFormat("italic"),f&&d.toggleFormat("underline")),h.append(d),h)}return d},node:i}}function tl(n,e=1,t){return ve(new hs(n,e,t))}function nl(n){return n instanceof hs}class Bn extends Me{static getType(){return"tablerow"}static clone(e){return new Bn(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:Td,priority:0})}}static importJSON(e){return rl(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),Pe(t,e.theme.tableRow),t}isShadowRoot(){return!0}setHeight(e){return this.getWritable().__height=e,this.__height}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function Td(n){const e=n;let t;return Qa.test(e.style.height)&&(t=parseFloat(e.style.height)),{node:rl(t)}}function rl(n){return ve(new Bn(n))}function Nd(n){return n instanceof Bn}function Ad(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Ad(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});let il=class ou extends Me{static getType(){return"table"}static clone(e){return new ou(e.__key)}static importDOM(){return{table:e=>({conversion:Fd,priority:1})}}static importJSON(e){return sl()}constructor(e){super(e)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(e,t){const r=document.createElement("table");return Pe(r,e.theme.table),r}updateDOM(){return!1}exportDOM(e){return{...super.exportDOM(e),after:t=>{if(t){const r=t.cloneNode(),i=document.createElement("colgroup"),s=document.createElement("tbody");nt(t)&&s.append(...t.children);const o=this.getFirstChildOrThrow();if(!Nd(o))throw new Error("Expected to find row node.");const a=o.getChildrenSize();for(let l=0;l<a;l++){const u=document.createElement("col");i.append(u)}return r.replaceChildren(i,s),r}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:r,domRows:i}=t;for(let s=0;s<r;s++){const o=i[s];if(o==null)continue;const a=o.findIndex(l=>{if(!l)return;const{elem:u}=l;return ut(u)===e});if(a!==-1)return{x:a,y:s}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,r){const{domRows:i}=r,s=i[t];if(s==null)return null;const o=s[e<s.length?e:s.length-1];return o??null}getDOMCellFromCordsOrThrow(e,t,r){const i=this.getDOMCellFromCords(e,t,r);if(!i)throw new Error("Cell not found at cords.");return i}getCellNodeFromCords(e,t,r){const i=this.getDOMCellFromCords(e,t,r);if(i==null)return null;const s=ut(i.elem);return nl(s)?s:null}getCellNodeFromCordsOrThrow(e,t,r){const i=this.getCellNodeFromCords(e,t,r);if(!i)throw new Error("Node at cords not TableCellNode.");return i}canSelectBefore(){return!0}canIndent(){return!1}};function Fd(n){return{node:sl()}}function sl(){return ve(new il)}function Od(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var st=Od(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function ps(n){let e=1,t=n.getParent();for(;t!=null;){if(te(t)){const r=t.getParent();if(B(r)){e++,t=r.getParent();continue}st(40)}return e}return e}function ms(n){let e=n.getParent();B(e)||st(40);let t=e;for(;t!==null;)t=t.getParent(),B(t)&&(e=t);return e}function ol(n){let e=[];const t=n.getChildren().filter(te);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();B(s)?e=e.concat(ol(s)):e.push(i)}return e}function ot(n){return te(n)&&B(n.getFirstChild())}function al(n){return Le().append(n)}function ll(n,e){return te(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function ul(n,e){n.update(()=>{const t=P();if(t!==null){const r=t.getNodes();if(A(t)){const s=t.getStartEndPoints();s===null&&st(143);const[o]=s,a=o.getNode(),l=a.getParent();if(ll(a,r)){const u=ke(e);if(Ae(l)){a.replace(u);const c=Le();T(a)&&(c.setFormat(a.getFormatType()),c.setIndent(a.getIndent())),u.append(c)}else if(te(a)){const c=a.getParentOrThrow();It(u,c.getChildren()),c.replace(u)}return}}const i=new Set;for(let s=0;s<r.length;s++){const o=r[s];if(!T(o)||!o.isEmpty()||te(o)||i.has(o.getKey())){if(wi(o)){let a=o.getParent();for(;a!=null;){const l=a.getKey();if(B(a)){if(!i.has(l)){const u=ke(e);It(u,a.getChildren()),a.replace(u),i.add(l)}break}{const u=a.getParent();if(Ae(u)&&!i.has(l)){i.add(l),cl(a,e);break}a=u}}}}else cl(o,e)}}})}function It(n,e){n.splice(n.getChildrenSize(),0,e)}function cl(n,e){if(B(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=Le();if(i.setFormat(n.getFormatType()),i.setIndent(n.getIndent()),It(i,n.getChildren()),B(t)&&e===t.getListType())return t.append(i),n.remove(),B(r)&&e===r.getListType()&&(It(t,r.getChildren()),r.remove()),t;if(B(r)&&e===r.getListType())return r.getFirstChildOrThrow().insertBefore(i),n.remove(),r;{const s=ke(e);return s.append(i),n.replace(s),s}}function _s(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&ot(t)&&ot(r)&&(_s(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function Pd(n){n.update(()=>{const e=P();if(A(e)){const t=new Set,r=e.getNodes(),i=e.anchor.getNode();if(ll(i,r))t.add(ms(i));else for(let s=0;s<r.length;s++){const o=r[s];if(wi(o)){const a=Oa(o,Dt);a!=null&&t.add(ms(a))}}for(const s of t){let o=s;const a=ol(s);for(const l of a){const u=ne();It(u,l.getChildren()),o.insertAfter(u),o=u,l.__key===e.anchor.key&&e.anchor.set(u.getKey(),0,"element"),l.__key===e.focus.key&&e.focus.set(u.getKey(),0,"element"),l.remove()}s.remove()}}})}function Ld(n){const e=new Set;if(ot(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(ot(r)&&ot(i)){const s=i.getFirstChild();if(B(s)){s.append(n);const o=r.getFirstChild();B(o)&&(It(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(ot(r)){const s=r.getFirstChild();if(B(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(ot(i)){const s=i.getFirstChild();B(s)&&s.append(n)}else if(B(t)){const s=Le(),o=ke(t.getListType());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function Rd(n){if(ot(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(B(t?t.getParent():void 0)&&te(t)&&B(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=Le(),a=ke(s);o.append(a),n.getPreviousSiblings().forEach(c=>a.append(c));const l=Le(),u=ke(s);l.append(u),It(u,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(l),t.replace(n)}}}function Id(){const n=P();if(!A(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!te(e)||e.getChildrenSize()!==0)return!1;const t=ms(e),r=e.getParent();B(r)||st(40);const i=r.getParent();let s;if(Ae(i))s=ne(),t.insertAfter(s);else{if(!te(i))return!1;s=Le(),i.insertAfter(s)}s.select();const o=e.getNextSiblings();if(o.length>0){const a=ke(r.getListType());if(Mn(s))s.insertAfter(a);else{const l=Le();l.append(a),s.insertAfter(l)}o.forEach(l=>{l.remove(),a.append(l)})}return function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!te(l)&&!B(l))break;l=u}l.remove()}(e),!0}function Br(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}let Dt=class au extends Me{static getType(){return"listitem"}static clone(e){return new au(e.__value,e.__checked,e.__key)}constructor(e,t,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),r=this.getParent();return B(r)&&r.getListType()==="check"&&fl(t,this,null),t.value=this.__value,dl(t,e.theme,this),t}updateDOM(e,t,r){const i=this.getParent();return B(i)&&i.getListType()==="check"&&fl(t,this,e),t.value=this.__value,dl(t,r.theme,this),!1}static transform(){return e=>{if(te(e)||st(144),e.__checked==null)return;const t=e.getParent();B(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Dd,priority:0})}}static importJSON(e){const t=Le();return t.setChecked(e.checked),t.setValue(e.value),t.setFormat(e.format),t.setDirection(e.direction),t}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(T(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(te(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!B(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=ke(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(T(e)||st(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(B(r)||st(39),te(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=ke(r.getListType());i.forEach(o=>s.append(o)),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&ot(t)&&ot(r)&&(_s(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=Le(this.__checked==null&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=ne();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=te(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,a=e.focus,l=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(l,o.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return B(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const e=this.getParent();if(e===null)return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;te(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&st(117),(e=Math.floor(e))>=0||st(199);let t=this.getIndent();for(;t!==e;)t<e?(Ld(this),t++):(Rd(this),t--);return this}canInsertAfter(e){return te(e)}canReplaceWith(e){return te(e)}canMergeWith(e){return Mn(e)||te(e)}extractWithChild(e,t){if(!A(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return ke("bullet")}canMergeWhenEmpty(){return!0}};function dl(n,e,t){const r=[],i=[],s=e.list,o=s?s.listitem:void 0;let a;if(s&&s.nested&&(a=s.nested.listitem),o!==void 0&&r.push(...Br(o)),s){const l=t.getParent(),u=B(l)&&l.getListType()==="check",c=t.getChecked();u&&!c||i.push(s.listitemUnchecked),u&&c||i.push(s.listitemChecked),u&&r.push(c?s.listitemChecked:s.listitemUnchecked)}if(a!==void 0){const l=Br(a);t.getChildren().some(u=>B(u))?r.push(...l):i.push(...l)}i.length>0&&Or(n,...i),r.length>0&&Pe(n,...r)}function fl(n,e,t,r){B(e.getFirstChild())?(n.removeAttribute("role"),n.removeAttribute("tabIndex"),n.removeAttribute("aria-checked")):(n.setAttribute("role","checkbox"),n.setAttribute("tabIndex","-1"),t&&e.__checked===t.__checked||n.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function Dd(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return $d(t)}const e=n.getAttribute("aria-checked");return{node:Le(e==="true"||e!=="false"&&void 0)}}function $d(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:Le(n.hasAttribute("checked"))}}function Le(n){return ve(new Dt(void 0,n))}function te(n){return n instanceof Dt}let $t=class lu extends Me{static getType(){return"list"}static clone(e){const t=e.__listType||pl[e.__tag];return new lu(t,e.__start,e.__key)}constructor(e,t,r){super(r);const i=pl[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();t.__listType=e,t.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,gl(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||(gl(t,r.theme,this),!1)}static transform(){return e=>{B(e)||st(163),function(t){const r=t.getNextSibling();B(r)&&t.getListType()===r.getListType()&&_s(t,r)}(e),function(t){const r=t.getListType()!=="check";let i=t.getStart();for(const s of t.getChildren())te(s)&&(s.getValue()!==i&&s.setValue(i),r&&s.getLatest().__checked!=null&&s.setChecked(void 0),B(s.getFirstChild())||i++)}(e)}}static importDOM(){return{ol:()=>({conversion:hl,priority:0}),ul:()=>({conversion:hl,priority:0})}}static importJSON(e){const t=ke(e.listType,e.start);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportDOM(e){const{element:t}=super.exportDOM(e);return t&&nt(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(te(r))super.append(r);else{const i=Le();if(B(r))i.append(r);else if(T(r)){const s=se(r.getTextContent());i.append(s)}else i.append(r);super.append(i)}}return this}extractWithChild(e){return te(e)}};function gl(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],a=ps(t)-1,l=a%o.length,u=o[l],c=s[t.__tag];let f;const d=s.nested,g=s.checklist;if(d!==void 0&&d.list&&(f=d.list),c!==void 0&&r.push(c),g!==void 0&&t.__listType==="check"&&r.push(g),u!==void 0){r.push(...Br(u));for(let h=0;h<o.length;h++)h!==l&&i.push(t.__tag+h)}if(f!==void 0){const h=Br(f);a>1?r.push(...h):i.push(...h)}}i.length>0&&Or(n,...i),r.length>0&&Pe(n,...r)}function Md(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(te(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{B(s)&&e.push(al(s))})}else e.push(al(r))}return e}function hl(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=ke("number",n.start):e==="ul"&&(t=function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list"))return!0;for(const i of r.childNodes)if(nt(i)&&i.hasAttribute("aria-checked"))return!0;return!1}(n)?ke("check"):ke("bullet")),{after:Md,node:t}}const pl={ol:"number",ul:"bullet"};function ke(n,e=1){return ve(new $t(n,e))}function B(n){return n instanceof $t}const ml=dn(),_l=dn(),ys=dn();var jd={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
43
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
44
|
-
*
|
|
45
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
46
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
47
|
-
* @namespace
|
|
48
|
-
* @public
|
|
49
|
-
*/var t=function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function p(y){return y instanceof l?new l(y.type,p(y.content),y.alias):Array.isArray(y)?y.map(p):y.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++s}),p.__id},clone:function p(y,x){x=x||{};var w,S;switch(a.util.type(y)){case"Object":if(S=a.util.objId(y),x[S])return x[S];w={},x[S]=w;for(var C in y)y.hasOwnProperty(C)&&(w[C]=p(y[C],x));return w;case"Array":return S=a.util.objId(y),x[S]?x[S]:(w=[],x[S]=w,y.forEach(function(k,E){w[E]=p(k,x)}),w);default:return y}},getLanguage:function(p){for(;p;){var y=i.exec(p.className);if(y)return y[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,y){p.className=p.className.replace(RegExp(i,"gi"),""),p.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(w){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(p){var y=document.getElementsByTagName("script");for(var x in y)if(y[x].src==p)return y[x]}return null}},isActive:function(p,y,x){for(var w="no-"+y;p;){var S=p.classList;if(S.contains(y))return!0;if(S.contains(w))return!1;p=p.parentElement}return!!x}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,y){var x=a.util.clone(a.languages[p]);for(var w in y)x[w]=y[w];return x},insertBefore:function(p,y,x,w){w=w||a.languages;var S=w[p],C={};for(var k in S)if(S.hasOwnProperty(k)){if(k==y)for(var E in x)x.hasOwnProperty(E)&&(C[E]=x[E]);x.hasOwnProperty(k)||(C[k]=S[k])}var I=w[p];return w[p]=C,a.languages.DFS(a.languages,function(M,K){K===I&&M!=p&&(this[M]=C)}),C},DFS:function p(y,x,w,S){S=S||{};var C=a.util.objId;for(var k in y)if(y.hasOwnProperty(k)){x.call(y,k,y[k],w||k);var E=y[k],I=a.util.type(E);I==="Object"&&!S[C(E)]?(S[C(E)]=!0,p(E,x,null,S)):I==="Array"&&!S[C(E)]&&(S[C(E)]=!0,p(E,x,k,S))}}},plugins:{},highlightAll:function(p,y){a.highlightAllUnder(document,p,y)},highlightAllUnder:function(p,y,x){var w={callback:x,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var S=0,C;C=w.elements[S++];)a.highlightElement(C,y===!0,w.callback)},highlightElement:function(p,y,x){var w=a.util.getLanguage(p),S=a.languages[w];a.util.setLanguage(p,w);var C=p.parentElement;C&&C.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(C,w);var k=p.textContent,E={element:p,language:w,grammar:S,code:k};function I(K){E.highlightedCode=K,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),x&&x.call(E.element)}if(a.hooks.run("before-sanity-check",E),C=E.element.parentElement,C&&C.nodeName.toLowerCase()==="pre"&&!C.hasAttribute("tabindex")&&C.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),x&&x.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){I(a.util.encode(E.code));return}if(y&&r.Worker){var M=new Worker(a.filename);M.onmessage=function(K){I(K.data)},M.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else I(a.highlight(E.code,E.grammar,E.language))},highlight:function(p,y,x){var w={code:p,grammar:y,language:x};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(p,y){var x=y.rest;if(x){for(var w in x)y[w]=x[w];delete y.rest}var S=new f;return d(S,S.head,p),c(p,S,y,S.head,0),h(S)},hooks:{all:{},add:function(p,y){var x=a.hooks.all;x[p]=x[p]||[],x[p].push(y)},run:function(p,y){var x=a.hooks.all[p];if(!(!x||!x.length))for(var w=0,S;S=x[w++];)S(y)}},Token:l};r.Prism=a;function l(p,y,x,w){this.type=p,this.content=y,this.alias=x,this.length=(w||"").length|0}l.stringify=function p(y,x){if(typeof y=="string")return y;if(Array.isArray(y)){var w="";return y.forEach(function(I){w+=p(I,x)}),w}var S={type:y.type,content:p(y.content,x),tag:"span",classes:["token",y.type],attributes:{},language:x},C=y.alias;C&&(Array.isArray(C)?Array.prototype.push.apply(S.classes,C):S.classes.push(C)),a.hooks.run("wrap",S);var k="";for(var E in S.attributes)k+=" "+E+'="'+(S.attributes[E]||"").replace(/"/g,""")+'"';return"<"+S.tag+' class="'+S.classes.join(" ")+'"'+k+">"+S.content+"</"+S.tag+">"};function u(p,y,x,w){p.lastIndex=y;var S=p.exec(x);if(S&&w&&S[1]){var C=S[1].length;S.index+=C,S[0]=S[0].slice(C)}return S}function c(p,y,x,w,S,C){for(var k in x)if(!(!x.hasOwnProperty(k)||!x[k])){var E=x[k];E=Array.isArray(E)?E:[E];for(var I=0;I<E.length;++I){if(C&&C.cause==k+","+I)return;var M=E[I],K=M.inside,G=!!M.lookbehind,z=!!M.greedy,U=M.alias;if(z&&!M.pattern.global){var W=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,W+"g")}for(var Y=M.pattern||M,J=w.next,fe=S;J!==y.tail&&!(C&&fe>=C.reach);fe+=J.value.length,J=J.next){var je=J.value;if(y.length>p.length)return;if(!(je instanceof l)){var ze=1,ue;if(z){if(ue=u(Y,fe,p,G),!ue||ue.index>=p.length)break;var be=ue.index,Be=ue.index+ue[0].length,ye=fe;for(ye+=J.value.length;be>=ye;)J=J.next,ye+=J.value.length;if(ye-=J.value.length,fe=ye,J.value instanceof l)continue;for(var Ke=J;Ke!==y.tail&&(ye<Be||typeof Ke.value=="string");Ke=Ke.next)ze++,ye+=Ke.value.length;ze--,je=p.slice(fe,ye),ue.index-=fe}else if(ue=u(Y,0,je,G),!ue)continue;var be=ue.index,He=ue[0],Re=je.slice(0,be),Qe=je.slice(be+He.length),et=fe+je.length;C&&et>C.reach&&(C.reach=et);var an=J.prev;Re&&(an=d(y,an,Re),fe+=Re.length),g(y,an,ze);var Vr=new l(k,K?a.tokenize(He,K):He,U,He);if(J=d(y,an,Vr),Qe&&d(y,J,Qe),ze>1){var ln={cause:k+","+I,reach:et};c(p,y,x,J.prev,fe,ln),C&&ln.reach>C.reach&&(C.reach=ln.reach)}}}}}}function f(){var p={value:null,prev:null,next:null},y={value:null,prev:p,next:null};p.next=y,this.head=p,this.tail=y,this.length=0}function d(p,y,x){var w=y.next,S={value:x,prev:y,next:w};return y.next=S,w.prev=S,p.length++,S}function g(p,y,x){for(var w=y.next,S=0;S<x&&w!==p.tail;S++)w=w.next;y.next=w,w.prev=y,p.length-=S}function h(p){for(var y=[],x=p.head.next;x!==p.tail;)y.push(x.value),x=x.next;return y}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(p){var y=JSON.parse(p.data),x=y.language,w=y.code,S=y.immediateClose;r.postMessage(a.highlight(w,a.languages[x],x)),S&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function _(){a.manual||a.highlightAll()}if(!a.manual){var b=document.readyState;b==="loading"||b==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",_):window.requestAnimationFrame?window.requestAnimationFrame(_):window.setTimeout(_,16)}return a}(e);n.exports&&(n.exports=t),typeof Ds<"u"&&(Ds.Prism=t),t.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]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,s){var o={};o["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};a["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var l={};l[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\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:[i,"language-"+i],inside:t.languages[i]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(r){var i=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+i.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\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,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:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))}(t),t.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:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.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}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.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:t.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:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.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:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.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:t.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"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.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")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",i=function(m,_){return"✖ Error "+m+" while fetching file: "+_},s="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",u="loaded",c="failed",f="pre[data-src]:not(["+a+'="'+u+'"]):not(['+a+'="'+l+'"])';function d(m,_,b){var p=new XMLHttpRequest;p.open("GET",m,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?_(p.responseText):p.status>=400?b(i(p.status,p.statusText)):b(s))},p.send(null)}function g(m){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(_){var b=Number(_[1]),p=_[2],y=_[3];return p?y?[b,Number(y)]:[b,void 0]:[b,b]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var _=m.element;if(_.matches(f)){m.code="",_.setAttribute(a,l);var b=_.appendChild(document.createElement("CODE"));b.textContent=r;var p=_.getAttribute("data-src"),y=m.language;if(y==="none"){var x=(/\.(\w+)$/.exec(p)||[,"none"])[1];y=o[x]||x}t.util.setLanguage(b,y),t.util.setLanguage(_,y);var w=t.plugins.autoloader;w&&w.loadLanguages(y),d(p,function(S){_.setAttribute(a,u);var C=g(_.getAttribute("data-range"));if(C){var k=S.split(/\r\n?|\n/g),E=C[0],I=C[1]==null?k.length:C[1];E<0&&(E+=k.length),E=Math.max(0,Math.min(E-1,k.length)),I<0&&(I+=k.length),I=Math.max(0,Math.min(I,k.length)),S=k.slice(E,I).join(`
|
|
50
|
-
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(E+1))}b.textContent=S,t.highlightElement(b)},function(S){_.setAttribute(a,c),b.textContent=S})}}),t.plugins.fileHighlight={highlight:function(_){for(var b=(_||document).querySelectorAll(f),p=0,y;y=b[p++];)t.highlightElement(y)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(jd),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(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\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:[e,"language-"+e],inside:Prism.languages[e]},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(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(c){return c=c.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}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;n.languages.markdown=n.languages.extend("markup",{}),n.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:n.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:n.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:n.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:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<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:t(/!?\[(?:(?!\])<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(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(n.languages.markdown[c].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var g=0,h=d.length;g<h;g++){var m=d[g];if(m.type!=="code"){f(m.content);continue}var _=m.content[1],b=m.content[3];if(_&&b&&_.type==="code-language"&&b.type==="code-block"&&typeof _.content=="string"){var p=_.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase();var y="language-"+p;b.alias?typeof b.alias=="string"?b.alias=[b.alias,y]:b.alias.push(y):b.alias=[y]}}}f(c.tokens)}),n.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",d=0,g=c.classes.length;d<g;d++){var h=c.classes[d],m=/language-(.+)/.exec(h);if(m){f=m[1];break}}var _=n.languages[f];if(_)c.content=n.highlight(u(c.content),_,f);else if(f&&f!=="none"&&n.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);c.attributes.id=b,n.plugins.autoloader.loadLanguages(f,function(){var p=document.getElementById(b);p&&(p.innerHTML=n.highlight(p.textContent,n.languages[f],f))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function u(c){var f=c.replace(o,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,g){if(g=g.toLowerCase(),g[0]==="#"){var h;return g[1]==="x"?h=parseInt(g.slice(2),16):h=Number(g.slice(1)),l(h)}else{var m=a[g];return m||d}}),f}n.languages.md=n.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(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.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\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,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:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.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(n){var e=n.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:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.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]*)?(?:\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(n){n.inside.interpolation.inside=Prism.languages.swift}),function(n){n.languages.typescript=n.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/}),n.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 n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.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:e}}}}),n.languages.ts=n.languages.typescript}(Prism),function(n){var e=/\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/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[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:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[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+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.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/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.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:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\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 e.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(n){var e=/\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/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.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:e,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/}),n.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 t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.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:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])}(Prism);function zd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var on=zd(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const yl=n=>{try{return!!n&&window.Prism.languages.hasOwnProperty(n)}catch{return!1}};function bl(n,e){for(const t of n.childNodes){if(nt(t)&&t.tagName===e)return!0;bl(t,e)}return!1}const Un="data-language",Ur="data-highlight-language";class ht extends Me{static getType(){return"code"}static clone(e){return new ht(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e,this.__isSyntaxHighlightSupported=yl(e)}createDOM(e){const t=document.createElement("code");Pe(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();return r&&(t.setAttribute(Un,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Ur,r)),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;return i?i!==s&&(t.setAttribute(Un,i),this.__isSyntaxHighlightSupported&&t.setAttribute(Ur,i)):s&&(t.removeAttribute(Un),e.__isSyntaxHighlightSupported&&t.removeAttribute(Ur)),!1}exportDOM(e){const t=document.createElement("pre");Pe(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();return r&&(t.setAttribute(Un,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Ur,r)),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||bl(e,"BR"))?{conversion:vl,priority:1}:null,div:()=>({conversion:Bd,priority:1}),pre:()=>({conversion:vl,priority:0}),table:e=>bs(e)?{conversion:Ud,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&bs(r)?{conversion:xl,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&bs(t)?{conversion:xl,priority:3}:null}}}static importJSON(e){const t=Mt(e.language);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
51
|
-
`&&r[i-2].getTextContent()===`
|
|
52
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const l=ne();return this.insertAfter(l,t),l}const{anchor:s,focus:o}=e,a=(s.isBefore(o)?s:o).getNode();if(O(a)){let l=zt(a);const u=[];for(;;)if(ge(l))u.push(Ue()),l=l.getNextSibling();else{if(!ie(l))break;{let _=0;const b=l.getTextContent(),p=l.getTextContentSize();for(;_<p&&b[_]===" ";)_++;if(_!==0&&u.push(xs(" ".repeat(_))),_!==p)break;l=l.getNextSibling()}}const c=a.splitText(s.offset)[0],f=s.offset===0?0:1,d=c.getIndexWithinParent()+f,g=a.getParentOrThrow(),h=[Ye(),...u];g.splice(d,0,h);const m=u[u.length-1];m?m.select():s.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(Te(a)){const{offset:l}=e.anchor;a.splice(l,0,[Ye()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ne();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();t.__language=e,t.__isSyntaxHighlightSupported=yl(e)}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}}function Mt(n){return ve(new ht(n))}function Te(n){return n instanceof ht}function vl(n){return{node:Mt(n.getAttribute(Un))}}function Bd(n){const e=n,t=Sl(e);return t||function(r){let i=r.parentElement;for(;i!==null;){if(Sl(i))return!0;i=i.parentElement}return!1}(e)?{node:t?Mt():null}:{node:null}}function Ud(){return{node:Mt()}}function xl(){return{node:null}}function Sl(n){return n.style.fontFamily.match("monospace")!==null}function bs(n){return n.classList.contains("js-file-line-container")}const wl="javascript",Wd=()=>wl,Kd=()=>Object.keys(window.Prism.languages).filter(n=>typeof window.Prism.languages[n]!="function").sort();class jt extends ft{constructor(e,t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new jt(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=vs(e.theme,this.__highlightType);return Pe(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=vs(r.theme,e.__highlightType),o=vs(r.theme,this.__highlightType);return s!==o&&(s&&Or(t,s),o&&Pe(t,o)),i}static importJSON(e){const t=xs(e.text,e.highlightType);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Mt()}}function vs(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function xs(n,e){return ve(new jt(n,e))}function ie(n){return n instanceof jt}function zt(n){let e=n,t=n;for(;ie(t)||ge(t);)e=t,t=t.getPreviousSibling();return e}function Wn(n){let e=n,t=n;for(;ie(t)||ge(t);)e=t,t=t.getNextSibling();return e}const Hd={defaultLanguage:wl,tokenize(n,e){return window.Prism.tokenize(n,window.Prism.languages[e||""]||window.Prism.languages[this.defaultLanguage])}};function Jd(n,e){let t=null,r=null,i=n,s=e,o=n.getTextContent();for(;;){if(s===0){if(i=i.getPreviousSibling(),i===null)break;if(ie(i)||ge(i)||Z(i)||on(167),Z(i)){t={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const l=o[s];ie(i)&&l!==" "&&(r={node:i,offset:s})}if(r!==null)return r;let a=null;if(e<n.getTextContentSize())ie(n)&&(a=n.getTextContent()[e]);else{const l=n.getNextSibling();ie(l)&&(a=l.getTextContent()[0])}if(a!==null&&a!==" ")return t;{const l=function(u,c){let f=u,d=c,g=u.getTextContent(),h=u.getTextContentSize();for(;;){if(!ie(f)||d===h){if(f=f.getNextSibling(),f===null||Z(f))return null;ie(f)&&(d=0,g=f.getTextContent(),h=f.getTextContentSize())}if(ie(f)){if(g[d]!==" ")return{node:f,offset:d};d++}}}(n,e);return l!==null?l:t}}function Vd(n){const e=Wn(n);return Z(e)&&on(168),e}function Cl(n,e,t){const r=n.getParent();Te(r)?El(r,e,t):ie(n)&&n.replace(se(n.__text))}function qd(n,e){const t=e.getElementByKey(n.getKey());if(t===null)return;const r=n.getChildren(),i=r.length;if(i===t.__cachedChildrenLength)return;t.__cachedChildrenLength=i;let s="1",o=1;for(let a=0;a<i;a++)Z(r[a])&&(s+=`
|
|
53
|
-
`+ ++o);t.setAttribute("data-gutter",s)}const Ss=new Set;function El(n,e,t){const r=n.getKey();Ss.has(r)||(Ss.add(r),n.getLanguage()===void 0&&n.setLanguage(t.defaultLanguage),e.update(()=>{(function(i,s){const o=ae(i);if(!Te(o)||!o.isAttached())return;const a=P();if(!A(a))return void s();const l=a.anchor,u=l.offset,c=l.type==="element"&&Z(o.getChildAtIndex(l.offset-1));let f=0;if(!c){const d=l.getNode();f=u+d.getPreviousSiblings().reduce((g,h)=>g+h.getTextContentSize(),0)}if(s()){if(c)return void l.getNode().select(u,u);o.getChildren().some(d=>{const g=O(d);if(g||Z(d)){const h=d.getTextContentSize();if(g&&h>=f)return d.select(f,f),!0;f-=h}return!1})}})(r,()=>{const i=ae(r);if(!Te(i)||!i.isAttached())return!1;const s=i.getTextContent(),o=ws(t.tokenize(s,i.getLanguage()||t.defaultLanguage)),a=function(f,d){let g=0;for(;g<f.length&&kl(f[g],d[g]);)g++;const h=f.length,m=d.length,_=Math.min(h,m)-g;let b=0;for(;b<_;)if(b++,!kl(f[h-b],d[m-b])){b--;break}const p=g,y=h-b,x=d.slice(g,m-b);return{from:p,nodesForReplacement:x,to:y}}(i.getChildren(),o),{from:l,to:u,nodesForReplacement:c}=a;return!(l===u&&!c.length)&&(n.splice(l,u-l,c),!0)})},{onUpdate:()=>{Ss.delete(r)},skipTransforms:!0}))}function ws(n,e){const t=[];for(const r of n)if(typeof r=="string"){const i=r.split(/(\n|\t)/),s=i.length;for(let o=0;o<s;o++){const a=i[o];a===`
|
|
54
|
-
`||a===`\r
|
|
55
|
-
`?t.push(Ye()):a===" "?t.push(Ue()):a.length>0&&t.push(xs(a,e))}}else{const{content:i}=r;typeof i=="string"?t.push(...ws([i],r.type)):Array.isArray(i)&&t.push(...ws(i,r.type))}return t}function kl(n,e){return ie(n)&&ie(e)&&n.__text===e.__text&&n.__highlightType===e.__highlightType||ge(n)&&ge(e)||Z(n)&&Z(e)}function Wr(n){if(!A(n))return!1;const e=n.anchor.getNode(),t=n.focus.getNode();if(e.is(t)&&Te(e))return!0;const r=e.getParent();return Te(r)&&r.is(t.getParent())}function Tl(n){const e=n.getNodes(),t=[[]];if(e.length===1&&Te(e[0]))return t;let r=t[0];for(let i=0;i<e.length;i++){const s=e[i];ie(s)||ge(s)||Z(s)||on(169),Z(s)?i!==0&&r.length>0&&(r=[],t.push(r)):r.push(s)}return t}function Nl(n){const e=P();if(!A(e)||!Wr(e))return!1;const t=Tl(e),r=t.length;if(t.length>1){for(let o=0;o<r;o++){const a=t[o];if(a.length>0){let l=a[0];o===0&&(l=zt(l)),l!==null&&(n===yt?l.insertBefore(Ue()):ge(l)&&l.remove())}}return!0}const i=e.getNodes()[0];if(Te(i)||ie(i)||ge(i)||Z(i)||on(171),Te(i))return n===yt&&e.insertNodes([Ue()]),!0;const s=zt(i);return s===null&&on(172),n===yt?Z(s)?s.insertAfter(Ue()):s.insertBefore(Ue()):ge(s)&&s.remove(),!0}function Al(n,e){const t=P();if(!A(t))return!1;const{anchor:r,focus:i}=t,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),u=n===Kt;if(!Wr(t)||!ie(a)&&!ge(a)||!ie(l)&&!ge(l))return!1;if(!e.altKey){if(t.isCollapsed()){const b=a.getParentOrThrow();if(u&&s===0&&a.getPreviousSibling()===null){if(b.getPreviousSibling()===null)return b.selectPrevious(),e.preventDefault(),!0}else if(!u&&s===a.getTextContentSize()&&a.getNextSibling()===null&&b.getNextSibling()===null)return b.selectNext(),e.preventDefault(),!0}return!1}let c,f;if(a.isBefore(l)?(c=zt(a),f=Wn(l)):(c=zt(l),f=Wn(a)),c==null||f==null)return!1;const d=c.getNodesBetween(f);for(let b=0;b<d.length;b++){const p=d[b];if(!ie(p)&&!ge(p)&&!Z(p))return!1}e.preventDefault(),e.stopPropagation();const g=u?c.getPreviousSibling():f.getNextSibling();if(!Z(g))return!0;const h=u?g.getPreviousSibling():g.getNextSibling();if(h==null)return!0;const m=ie(h)||ge(h)||Z(h)?u?zt(h):Wn(h):null;let _=m??h;return g.remove(),d.forEach(b=>b.remove()),n===Kt?(d.forEach(b=>_.insertBefore(b)),_.insertBefore(g)):(_.insertAfter(g),_=g,d.forEach(b=>{_.insertAfter(b),_=b})),t.setTextNodeRange(a,s,l,o),!0}function Fl(n,e){const t=P();if(!A(t))return!1;const{anchor:r,focus:i}=t,s=r.getNode(),o=i.getNode(),a=n===Yn;if(!ie(s)&&!ge(s)||!ie(o)&&!ge(o))return!1;if(a){const l=Jd(o,i.offset);if(l!==null){const{node:u,offset:c}=l;Z(u)?u.selectNext(0,0):t.setTextNodeRange(u,c,u,c)}else o.getParentOrThrow().selectStart()}else Vd(o).select();return e.preventDefault(),e.stopPropagation(),!0}function Gd(n,e){if(!n.hasNodes([ht,jt]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return e==null&&(e=Hd),We(n.registerMutationListener(ht,t=>{n.update(()=>{for(const[r,i]of t)if(i!=="destroyed"){const s=ae(r);s!==null&&qd(s,n)}})},{skipInitialization:!1}),n.registerNodeTransform(ht,t=>El(t,n,e)),n.registerNodeTransform(ft,t=>Cl(t,n,e)),n.registerNodeTransform(jt,t=>Cl(t,n,e)),n.registerCommand(Hs,t=>{const r=function(i){const s=P();if(!A(s)||!Wr(s))return null;const o=i?Ht:yt,a=i?Ht:si;if(Tl(s).length>1)return o;const l=s.getNodes()[0];if(Te(l)||ie(l)||ge(l)||Z(l)||on(170),Te(l))return o;const u=zt(l),c=Wn(l),f=s.anchor,d=s.focus;let g,h;return d.isBefore(f)?(g=d,h=f):(g=f,h=d),u!==null&&c!==null&&g.key===u.getKey()&&g.offset===0&&h.key===c.getKey()&&h.offset===c.getTextContentSize()?o:a}(t.shiftKey);return r!==null&&(t.preventDefault(),n.dispatchCommand(r,void 0),!0)},me),n.registerCommand(si,()=>!!Wr(P())&&(oa([Ue()]),!0),me),n.registerCommand(yt,t=>Nl(yt),me),n.registerCommand(Ht,t=>Nl(Ht),me),n.registerCommand(Kt,t=>Al(Kt,t),me),n.registerCommand(Zn,t=>Al(Zn,t),me),n.registerCommand(ni,t=>Fl(ni,t),me),n.registerCommand(Yn,t=>Fl(Yn,t),me))}const Kr=1,Yd=new Set(["paragraph","quote","code","h1","h2","ul","ol"]),Zd={code:"Code Block",h1:"Large Heading",h2:"Small Heading",h3:"Heading",h4:"Heading",h5:"Heading",ol:"Numbered List",paragraph:"Normal",quote:"Quote",ul:"Bulleted List"};function Cs(){return N.jsx("div",{className:"divider"})}function Ol(n,e){e===null?(n.style.opacity="0",n.style.top="-1000px",n.style.left="-1000px"):(n.style.opacity="1",n.style.top=`${e.top+e.height+window.pageYOffset+10}px`,n.style.left=`${e.left+window.pageXOffset-n.offsetWidth/2+e.width/2}px`)}function Xd({editor:n}){const e=L.useRef(null),t=L.useRef(null),r=L.useRef(!1),[i,s]=L.useState(""),[o,a]=L.useState(!1),[l,u]=L.useState(null),c=L.useCallback(()=>{const f=P();if(A(f)){const _=Pl(f),b=_.getParent();Xe(b)?s(b.getURL()):Xe(_)?s(_.getURL()):s("")}const d=e.current,g=window.getSelection(),h=document.activeElement;if(d===null)return;const m=n.getRootElement();if(f!==null&&!g.isCollapsed&&m!==null&&m.contains(g.anchorNode)){const _=g.getRangeAt(0);let b;if(g.anchorNode===m){let p=m;for(;p.firstElementChild!=null;)p=p.firstElementChild;b=p.getBoundingClientRect()}else b=_.getBoundingClientRect();r.current||Ol(d,b),u(f)}else(!h||h.className!=="link-input")&&(Ol(d,null),u(null),a(!1),s(""));return!0},[n]);return L.useEffect(()=>We(n.registerUpdateListener(({editorState:f})=>{f.read(()=>{c()})}),n.registerCommand(fn,()=>(c(),!0),Kr)),[n,c]),L.useEffect(()=>{n.getEditorState().read(()=>{c()})},[n,c]),L.useEffect(()=>{o&&t.current&&t.current.focus()},[o]),N.jsx("div",{ref:e,className:"link-editor",children:o?N.jsx("input",{ref:t,className:"link-input",value:i,onChange:f=>{s(f.target.value)},onKeyDown:f=>{f.key==="Enter"?(f.preventDefault(),l!==null&&(i!==""&&n.dispatchCommand(sn,i),a(!1))):f.key==="Escape"&&(f.preventDefault(),a(!1))}}):N.jsx(N.Fragment,{children:N.jsxs("div",{className:"link-input",children:[N.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i}),N.jsx("div",{className:"link-edit",role:"button",tabIndex:0,onMouseDown:f=>f.preventDefault(),onClick:()=>{a(!0)}})]})})})}function Qd({onChange:n,className:e,options:t,value:r}){return N.jsxs("select",{className:e,onChange:n,value:r,children:[N.jsx("option",{hidden:!0,value:""}),t.map(i=>N.jsx("option",{value:i,children:i},i))]})}function Pl(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?Ca(t)?r:i:Ca(e)?i:r}function ef({editor:n,blockType:e,toolbarRef:t,setShowBlockOptionsDropDown:r}){const i=L.useRef(null);L.useEffect(()=>{const d=t.current,g=i.current;if(d!==null&&g!==null){const{top:h,left:m}=d.getBoundingClientRect();g.style.top=`${h+40}px`,g.style.left=`${m}px`}},[i,t]),L.useEffect(()=>{const d=i.current,g=t.current;if(d!==null&&g!==null){const h=m=>{const _=m.target;!d.contains(_)&&!g.contains(_)&&r(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[i,r,t]);const s=()=>{e!=="paragraph"&&n.update(()=>{const d=P();A(d)&&jn(d,()=>ne())}),r(!1)},o=()=>{e!=="h1"&&n.update(()=>{const d=P();A(d)&&jn(d,()=>Nt("h1"))}),r(!1)},a=()=>{e!=="h2"&&n.update(()=>{const d=P();A(d)&&jn(d,()=>Nt("h2"))}),r(!1)},l=()=>{e!=="ul"?n.dispatchCommand(ml):n.dispatchCommand(ys),r(!1)},u=()=>{e!=="ol"?n.dispatchCommand(_l):n.dispatchCommand(ys),r(!1)},c=()=>{e!=="quote"&&n.update(()=>{const d=P();A(d)&&jn(d,()=>Rr())}),r(!1)},f=()=>{e!=="code"&&n.update(()=>{const d=P();A(d)&&jn(d,()=>Mt())}),r(!1)};return N.jsxs("div",{className:"dropdown",ref:i,children:[N.jsxs("button",{className:"item",onClick:s,children:[N.jsx("span",{className:"icon paragraph"}),N.jsx("span",{className:"text",children:"Normal"}),e==="paragraph"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:o,children:[N.jsx("span",{className:"icon large-heading"}),N.jsx("span",{className:"text",children:"Large Heading"}),e==="h1"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:a,children:[N.jsx("span",{className:"icon small-heading"}),N.jsx("span",{className:"text",children:"Small Heading"}),e==="h2"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:l,children:[N.jsx("span",{className:"icon bullet-list"}),N.jsx("span",{className:"text",children:"Bullet List"}),e==="ul"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:u,children:[N.jsx("span",{className:"icon numbered-list"}),N.jsx("span",{className:"text",children:"Numbered List"}),e==="ol"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:c,children:[N.jsx("span",{className:"icon quote"}),N.jsx("span",{className:"text",children:"Quote"}),e==="quote"&&N.jsx("span",{className:"active"})]}),N.jsxs("button",{className:"item",onClick:f,children:[N.jsx("span",{className:"icon code"}),N.jsx("span",{className:"text",children:"Code Block"}),e==="code"&&N.jsx("span",{className:"active"})]})]})}function tf(){const[n]=we(),e=L.useRef(null),[t,r]=L.useState(!1),[i,s]=L.useState(!1),[o,a]=L.useState("paragraph"),[l,u]=L.useState(null),[c,f]=L.useState(!1),[d,g]=L.useState(""),[h,m]=L.useState(!1),[_,b]=L.useState(!1),[p,y]=L.useState(!1),[x,w]=L.useState(!1),[S,C]=L.useState(!1),[k,E]=L.useState(!1),[I,M]=L.useState(!1),K=L.useCallback(()=>{const W=P();if(A(W)){const Y=W.anchor.getNode(),J=Y.getKey()==="root"?Y:Y.getTopLevelElementOrThrow(),fe=J.getKey();if(n.getElementByKey(fe)!==null)if(u(fe),B(J)){const Be=Oa(Y,$t),ye=Be?Be.getTag():J.getTag();a(ye)}else{const Be=Ha(J)?J.getTag():J.getType();a(Be),Te(J)&&g(J.getLanguage()||Wd())}y(W.hasFormat("bold")),w(W.hasFormat("italic")),C(W.hasFormat("underline")),E(W.hasFormat("strikethrough")),M(W.hasFormat("code")),m(Ta(W));const ze=Pl(W),ue=ze.getParent();Xe(ue)||Xe(ze)?b(!0):b(!1)}},[n]);L.useEffect(()=>We(n.registerUpdateListener(({editorState:W})=>{W.read(()=>{K()})}),n.registerCommand(fn,(W,Y)=>(K(),!1),Kr),n.registerCommand(yn,W=>(r(W),!1),Kr),n.registerCommand(_n,W=>(s(W),!1),Kr)),[n,K]);const G=L.useMemo(()=>Kd(),[]),z=L.useCallback(W=>{n.update(()=>{if(l!==null){const Y=ae(l);Te(Y)&&Y.setLanguage(W.target.value)}})},[n,l]),U=L.useCallback(()=>{_?n.dispatchCommand(sn,null):n.dispatchCommand(sn,"https://")},[n,_]);return N.jsxs("div",{className:"toolbar",ref:e,children:[N.jsx("button",{disabled:!t,onClick:()=>{n.dispatchCommand(qn)},className:"toolbar-item spaced","aria-label":"Undo",children:N.jsx("i",{className:"format undo"})}),N.jsx("button",{disabled:!i,onClick:()=>{n.dispatchCommand(Gn)},className:"toolbar-item","aria-label":"Redo",children:N.jsx("i",{className:"format redo"})}),N.jsx(Cs,{}),Yd.has(o)&&N.jsxs(N.Fragment,{children:[N.jsxs("button",{className:"toolbar-item block-controls",onClick:()=>f(!c),"aria-label":"Formatting Options",children:[N.jsx("span",{className:"icon block-type "+o}),N.jsx("span",{className:"text",children:Zd[o]}),N.jsx("i",{className:"chevron-down"})]}),c&&Jn.createPortal(N.jsx(ef,{editor:n,blockType:o,toolbarRef:e,setShowBlockOptionsDropDown:f}),document.body),N.jsx(Cs,{})]}),o==="code"?N.jsxs(N.Fragment,{children:[N.jsx(Qd,{className:"toolbar-item code-language",onChange:z,options:G,value:d}),N.jsx("i",{className:"chevron-down inside"})]}):N.jsxs(N.Fragment,{children:[N.jsx("button",{onClick:()=>{n.dispatchCommand(Ie,"bold")},className:"toolbar-item spaced "+(p?"active":""),"aria-label":"Format Bold",children:N.jsx("i",{className:"format bold"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(Ie,"italic")},className:"toolbar-item spaced "+(x?"active":""),"aria-label":"Format Italics",children:N.jsx("i",{className:"format italic"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(Ie,"underline")},className:"toolbar-item spaced "+(S?"active":""),"aria-label":"Format Underline",children:N.jsx("i",{className:"format underline"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(Ie,"strikethrough")},className:"toolbar-item spaced "+(k?"active":""),"aria-label":"Format Strikethrough",children:N.jsx("i",{className:"format strikethrough"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(Ie,"code")},className:"toolbar-item spaced "+(I?"active":""),"aria-label":"Insert Code",children:N.jsx("i",{className:"format code"})}),N.jsx("button",{onClick:U,className:"toolbar-item spaced "+(_?"active":""),"aria-label":"Insert Link",children:N.jsx("i",{className:"format link"})}),_&&Jn.createPortal(N.jsx(Xd,{editor:n}),document.body),N.jsx(Cs,{}),N.jsx("button",{onClick:()=>{n.dispatchCommand(mn,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:N.jsx("i",{className:"format left-align"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(mn,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:N.jsx("i",{className:"format center-align"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(mn,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:N.jsx("i",{className:"format right-align"})}),N.jsx("button",{onClick:()=>{n.dispatchCommand(mn,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:N.jsx("i",{className:"format justify-align"})})," "]})]})}function nf({validateUrl:n}){const[e]=we();return L.useEffect(()=>{if(!e.hasNodes([At]))throw new Error("LinkPlugin: LinkNode not registered on editor");return We(e.registerCommand(sn,t=>{if(t===null)return gs(t),!0;if(typeof t=="string")return!(n!==void 0&&!n(t))&&(gs(t),!0);{const{url:r,target:i,rel:s,title:o}=t;return gs(r,{rel:s,target:i,title:o}),!0}},me),n!==void 0?e.registerCommand(Vn,t=>{const r=P();if(!A(r)||r.isCollapsed()||!Tt(t,ClipboardEvent))return!1;const i=t;if(i.clipboardData===null)return!1;const s=i.clipboardData.getData("text");return!!n(s)&&!r.getNodes().some(o=>T(o))&&(e.dispatchCommand(sn,s),t.preventDefault(),!0)},me):()=>{})},[e,n]),null}function rf(){const[n]=we();return L.useEffect(()=>{if(!n.hasNodes([$t,Dt]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),function(e){L.useEffect(()=>We(e.registerCommand(_l,()=>(ul(e,"number"),!0),me),e.registerCommand(ml,()=>(ul(e,"bullet"),!0),me),e.registerCommand(ys,()=>(Pd(e),!0),me),e.registerCommand(gn,()=>!!Id(),me)),[e])}(n),null}function Es(n,e){const t={};for(const r of n){const i=e(r);t[i]?t[i].push(r):t[i]=[r]}return t}function sf(n){const e=Es(n,t=>t.type);return{element:e.element||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Ll=/[!-/:-@[-`{-~\s]/,Rl=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,of=Rl&&"documentMode"in document?document.documentMode:null;Rl&&"InputEvent"in window&&!of&&new window.InputEvent("input");function af(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lf=af(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Il(n,e,t){const r=t.length;for(let i=e;i>=r;i--){const s=i-r;if(Dl(n,s,t,0,r)&&n[s+r]!==" ")return s}return-1}function Dl(n,e,t,r,i){for(let s=0;s<i;s++)if(n[e+s]!==t[r+s])return!1;return!0}function uf(n,e=Ts){const t=sf(e),r=Es(t.textFormat,({tag:o})=>o[o.length-1]),i=Es(t.textMatch,({trigger:o})=>o);for(const o of e){const a=o.type;if(a==="element"||a==="text-match"){const l=o.dependencies;for(const u of l)n.hasNode(u)||lf(173,u.getType())}}const s=(o,a,l)=>{(function(u,c,f,d){const g=u.getParent();if(!Ae(g)||u.getFirstChild()!==c)return!1;const h=c.getTextContent();if(h[f-1]!==" ")return!1;for(const{regExp:m,replace:_}of d){const b=h.match(m);if(b&&b[0].length===f){const p=c.getNextSiblings(),[y,x]=c.splitText(f);return y.remove(),_(u,x?[x,...p]:p,b,!1),!0}}return!1})(o,a,l,t.element)||function(u,c,f){let d=u.getTextContent();const g=f[d[c-1]];if(g==null)return!1;c<d.length&&(d=d.slice(0,c));for(const h of g){const m=d.match(h.regExp);if(m===null)continue;const _=m.index||0,b=_+m[0].length;let p;return _===0?[p]=u.splitText(b):[,p]=u.splitText(_,b),p.selectNext(0,0),h.replace(p,m),!0}return!1}(a,l,i)||function(u,c,f){const d=u.getTextContent(),g=c-1,h=d[g],m=f[h];if(!m)return!1;for(const _ of m){const{tag:b}=_,p=b.length,y=g-p+1;if(p>1&&!Dl(d,y,b,0,p)||d[y-1]===" ")continue;const x=d[g+1];if(_.intraword===!1&&x&&!Ll.test(x))continue;const w=u;let S=w,C=Il(d,y,b),k=S;for(;C<0&&(k=k.getPreviousSibling())&&!Z(k);)if(O(k)){const Y=k.getTextContent();S=k,C=Il(Y,Y.length,b)}if(C<0||S===w&&C+p===y)continue;const E=S.getTextContent();if(C>0&&E[C-1]===h)continue;const I=E[C-1];if(_.intraword===!1&&I&&!Ll.test(I))continue;const M=w.getTextContent(),K=M.slice(0,y)+M.slice(g+1);w.setTextContent(K);const G=S===w?K:E;S.setTextContent(G.slice(0,C)+G.slice(C+p));const z=P(),U=ra();De(U);const W=g-p*(S===w?2:1)+1;U.anchor.set(S.__key,C,"text"),U.focus.set(w.__key,W,"text");for(const Y of _.format)U.hasFormat(Y)||U.formatText(Y);U.anchor.set(U.focus.key,U.focus.offset,U.focus.type);for(const Y of _.format)U.hasFormat(Y)&&U.toggleFormat(Y);return A(z)&&(U.format=z.format),!0}}(a,l,r)};return n.registerUpdateListener(({tags:o,dirtyLeaves:a,editorState:l,prevEditorState:u})=>{if(o.has("collaboration")||o.has("historic")||n.isComposing())return;const c=l.read(P),f=u.read(P);if(!A(f)||!A(c)||!c.isCollapsed())return;const d=c.anchor.key,g=c.anchor.offset,h=l._nodeMap.get(d);!O(h)||!a.has(d)||g!==1&&g>f.anchor.offset+1||n.update(()=>{if(h.hasFormat("code"))return;const m=h.getParent();m===null||Te(m)||s(m,h,c.anchor.offset)})})}const $l=n=>(e,t,r)=>{const i=n(r);i.append(...t),e.replace(i),i.select(0,0)},Ml=n=>(e,t,r)=>{const i=e.getPreviousSibling(),s=e.getNextSibling(),o=Le(n==="check"?r[3]==="x":void 0);if(B(s)&&s.getListType()===n){const l=s.getFirstChild();l!==null?l.insertBefore(o):s.append(o),e.remove()}else if(B(i)&&i.getListType()===n)i.append(o),e.remove();else{const l=ke(n,n==="number"?Number(r[2]):void 0);l.append(o),e.replace(l)}o.append(...t),o.select(0,0);const a=function(l){const u=l.match(/\t/g),c=l.match(/ /g);let f=0;return u&&(f+=u.length),c&&(f+=Math.floor(c.length/4)),f}(r[1]);a&&o.setIndent(a)},ks=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(te(o)){if(o.getChildrenSize()===1){const c=o.getFirstChild();if(B(c)){r.push(ks(c,e,t+1));continue}}const a=" ".repeat(4*t),l=n.getListType(),u=l==="number"?`${n.getStart()+s}. `:l==="check"?`- [${o.getChecked()?"x":" "}] `:"- ";r.push(a+u+e(o)),s++}return r.join(`
|
|
56
|
-
`)},cf={dependencies:[Ir],export:(n,e)=>{if(!Ha(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:/^(#{1,6})\s/,replace:$l(n=>{const e="h"+n[1].length;return Nt(e)}),type:"element"},df={dependencies:[Lr],export:(n,e)=>{if(!Wa(n))return null;const t=e(n).split(`
|
|
57
|
-
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
58
|
-
`)},regExp:/^>\s/,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(Wa(s))return s.splice(s.getChildrenSize(),0,[Ye(),...e]),s.select(0,0),void n.remove()}const i=Rr();i.append(...e),n.replace(i),i.select(0,0)},type:"element"},ff={dependencies:[ht],export:n=>{if(!Te(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
59
|
-
`+e:"")+"\n```"},regExp:/^[ \t]*```(\w{1,10})?\s/,replace:$l(n=>Mt(n?n[1]:void 0)),type:"element"},gf={dependencies:[$t,Dt],export:(n,e)=>B(n)?ks(n,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:Ml("bullet"),type:"element"},hf={dependencies:[$t,Dt],export:(n,e)=>B(n)?ks(n,e,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:Ml("number"),type:"element"},pf={format:["code"],tag:"`",type:"text-format"},mf={format:["highlight"],tag:"==",type:"text-format"},_f={format:["bold","italic"],tag:"***",type:"text-format"},yf={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},bf={format:["bold"],tag:"**",type:"text-format"},vf={format:["bold"],intraword:!1,tag:"__",type:"text-format"},xf={format:["strikethrough"],tag:"~~",type:"text-format"},Sf={format:["italic"],tag:"*",type:"text-format"},wf={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Cf={dependencies:[At],export:(n,e,t)=>{if(!Xe(n))return null;const r=n.getTitle(),i=r?`[${n.getTextContent()}](${n.getURL()} "${r}")`:`[${n.getTextContent()}](${n.getURL()})`,s=n.getFirstChild();return n.getChildrenSize()===1&&O(s)?t(s,i):i},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=zn(r,{title:i}),o=se(t);o.setFormat(n.getFormat()),s.append(o),n.replace(s)},trigger:")",type:"text-match"},Ef=[cf,df,ff,gf,hf],kf=[pf,_f,yf,bf,vf,mf,Sf,wf,xf],Tf=[Cf],Ts=[...Ef,...kf,...Tf];function jl(n,e){return n.getEditorState().read(()=>{const t=ae(e);return t!==null&&t.isSelected()})}function Nf(n){const[e]=we(),[t,r]=L.useState(()=>jl(e,n));return L.useEffect(()=>{let i=!0;const s=e.registerUpdateListener(()=>{i&&r(jl(e,n))});return()=>{i=!1,s()}},[e,n]),[t,L.useCallback(i=>{e.update(()=>{let s=P();xe(s)||(s=Qi(),De(s)),xe(s)&&(i?s.add(n):s.delete(n))})},[e,n]),L.useCallback(()=>{e.update(()=>{const i=P();xe(i)&&i.clear()})},[e])]}function Af({nodeKey:n}){const[e]=we(),[t,r,i]=Nf(n),s=L.useCallback(o=>{const a=P();return t&&xe(a)&&(o.preventDefault(),e.update(()=>{a.getNodes().forEach(l=>{zl(l)&&l.remove()})})),!1},[e,t]);return L.useEffect(()=>We(e.registerCommand(ei,o=>{const a=e.getElementByKey(n);return o.target===a&&(o.shiftKey||i(),r(!t),!0)},me),e.registerCommand(ii,s,me),e.registerCommand(ri,s,me)),[i,e,t,n,s,r]),L.useEffect(()=>{const o=e.getElementByKey(n),a="selected";o!==null&&(t?Pe(o,a):Or(o,a))},[e,t,n]),null}class Kn extends _a{static getType(){return"horizontalrule"}static clone(e){return new Kn(e.__key)}static importJSON(e){return Ns()}static importDOM(){return{hr:()=>({conversion:Ff,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return Pe(t,e.theme.hr),t}getTextContent(){return`
|
|
60
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return N.jsx(Af,{nodeKey:this.__key})}}function Ff(){return{node:Ns()}}function Ns(){return ve(new Kn)}function zl(n){return n instanceof Kn}const Of=[{dependencies:[Kn],export:n=>zl(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Ns();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...Ts];function Pf({transformers:n=Of}){const[e]=we();return L.useEffect(()=>uf(e,n),[e,n]),null}function Lf(n){const e=n.getNodes();return e.length===0?new Set([n.anchor.getNode().getParentOrThrow(),n.focus.getNode().getParentOrThrow()]):new Set(e.map(t=>T(t)?t:t.getParentOrThrow()))}function Rf(n){const e=P();if(!A(e))return!1;const t=Lf(e);let r=0;for(const i of t)if(B(i))r=Math.max(ps(i)+1,r);else if(te(i)){const s=i.getParent();if(!B(s))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ps(s)+1,r)}return r<=n}function If({maxDepth:n}){const[e]=we();return L.useEffect(()=>e.registerCommand(yt,()=>!Rf(n??7),yc),[e,n]),null}function Df(){const[n]=we();return L.useEffect(()=>Gd(n),[n]),null}function $f(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mf=$f(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Bl(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const jf=/[.,;\s]/;function Hr(n){return jf.test(n)}function Ul(n){return Hr(n[n.length-1])}function As(n){return Hr(n[0])}function Wl(n){let e=n.getPreviousSibling();return T(e)&&(e=e.getLastDescendant()),e===null||Z(e)||O(e)&&Ul(e.getTextContent())}function Kl(n){let e=n.getNextSibling();return T(e)&&(e=e.getFirstDescendant()),e===null||Z(e)||O(e)&&As(e.getTextContent())}function zf(n,e,t,r){return(n>0?Hr(t[n-1]):Wl(r[0]))?e<t.length?Hr(t[e]):Kl(r[r.length-1]):!1}function Bf(n,e,t){const r=[],i=[],s=[];let o=0,a=0;const l=[...n];for(;l.length>0;){const u=l[0],c=u.getTextContent().length,f=a;a+c<=e?(r.push(u),o+=c):f>=t?s.push(u):i.push(u),a+=c,l.shift()}return[o,r,i,s]}function Uf(n,e,t,r){const i=fs(r.url,r.attributes);if(n.length===1){let s,o=n[0];e===0?[s,o]=o.splitText(t):[,s,o]=o.splitText(e,t);const a=se(r.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),i.append(a),s.replace(i),o}if(n.length>1){const s=n[0];let o,a=s.getTextContent().length;e===0?o=s:[,o]=s.splitText(e);const l=[];let u;for(let g=1;g<n.length;g++){const h=n[g],m=h.getTextContent().length,_=a;if(_<t)if(a+m<=t)l.push(h);else{const[b,p]=h.splitText(t-_);l.push(b),u=p}a+=m}const c=P(),f=c?c.getNodes().find(O):void 0,d=se(o.getTextContent());return d.setFormat(o.getFormat()),d.setDetail(o.getDetail()),d.setStyle(o.getStyle()),i.append(d,...l),f&&f===o&&(A(c)?d.select(c.anchor.offset,c.focus.offset):xe(c)&&d.select(0,d.getTextContent().length)),o.replace(i),u}}function Fs(n,e,t){const r=n.getChildren(),i=r.length;for(let l=0;l<i;l++){const u=r[l];if(!O(u)||!u.isSimpleText())return Jr(n),void t(null,n.getURL())}const s=n.getTextContent(),o=Bl(s,e);if(o===null||o.text!==s||!Wl(n)||!Kl(n))return Jr(n),void t(null,n.getURL());const a=n.getURL();if(a!==o.url&&(n.setURL(o.url),t(o.url,a)),o.attributes){const l=n.getRel();l!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,l));const u=n.getTarget();u!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,u))}}function Jr(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}function Wf(n,e,t){L.useEffect(()=>{n.hasNodes([jr])||Mf(77);const r=(i,s)=>{t&&t(i,s)};return We(n.registerNodeTransform(ft,i=>{const s=i.getParentOrThrow(),o=i.getPreviousSibling();if(rn(s)&&!s.getIsUnlinked())Fs(s,e,r);else if(!Xe(s)){if(i.isSimpleText()&&(As(i.getTextContent())||!rn(o))){const a=function(l){const u=[l];let c=l.getNextSibling();for(;c!==null&&O(c)&&c.isSimpleText()&&(u.push(c),!/[\s]/.test(c.getTextContent()));)c=c.getNextSibling();return u}(i);(function(l,u,c){let f=[...l];const d=f.map(_=>_.getTextContent()).join("");let g,h=d,m=0;for(;(g=Bl(h,u))&&g!==null;){const _=g.index,b=_+g.length;if(zf(m+_,m+b,d,f)){const[p,,y,x]=Bf(f,m+_,m+b),w=Uf(y,m+_-p,m+b-p,g);f=w?[w,...x]:x,c(g.url,null),m=0}else m+=b;h=h.substring(b)}})(a,e,r)}(function(a,l,u){const c=a.getPreviousSibling(),f=a.getNextSibling(),d=a.getTextContent();var g;!rn(c)||c.getIsUnlinked()||As(d)&&(g=d,!(c.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(g):/^\.[a-zA-Z0-9]{1,}/.test(g)))||(c.append(a),Fs(c,l,u),u(null,c.getURL())),!rn(f)||f.getIsUnlinked()||Ul(d)||(Jr(f),Fs(f,l,u),u(null,f.getURL()))})(i,e,r)}}),n.registerCommand(sn,i=>{const s=P();return i!==null||!A(s)||s.extract().forEach(o=>{const a=o.getParent();if(rn(a))return a.setIsUnlinked(!a.getIsUnlinked()),a.markDirty(),!0}),!1},me))},[n,e,t])}function Kf({matchers:n,onChange:e}){const[t]=we();return Wf(t,n,e),null}const Hf=/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,Jf=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,Vf=[n=>{const e=Hf.exec(n);return e&&{index:e.index,length:e[0].length,text:e[0],url:e[0]}},n=>{const e=Jf.exec(n);return e&&{index:e.index,length:e[0].length,text:e[0],url:`mailto:${e[0]}`}}];function qf(){return N.jsx(Kf,{matchers:Vf})}function Gf(){return N.jsx("div",{className:"editor-placeholder",children:"Enter some rich text..."})}const Yf={theme:fu,onError(n){throw n},nodes:[Ir,$t,Dt,Lr,ht,jt,il,hs,Bn,jr,At]};function Zf(){return N.jsx(Sc,{initialConfig:Yf,children:N.jsxs("div",{className:"editor-container",children:[N.jsx(tf,{}),N.jsxs("div",{className:"editor-inner",children:[N.jsx(ad,{contentEditable:N.jsx(dd,{className:"editor-input"}),placeholder:N.jsx(Gf,{}),ErrorBoundary:Cd}),N.jsx(xd,{}),N.jsx(Sd,{}),N.jsx(Df,{}),N.jsx(rf,{}),N.jsx(nf,{}),N.jsx(qf,{}),N.jsx(If,{maxDepth:7}),N.jsx(Pf,{transformers:Ts})]})]})})}_t.Editor=Zf,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
|
|
31
|
+
`,wl=We?" ":bn,Bi="֑-߿יִ-﷽ﹰ-ﻼ",zi="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Sl=new RegExp("^[^"+zi+"]*["+Bi+"]"),Tl=new RegExp("^[^"+Bi+"]*["+zi+"]"),je={bold:1,code:16,highlight:pr,italic:2,strikethrough:xn,subscript:32,superscript:64,underline:vn},kl={directionless:1,unmergeable:2},Ki={center:_r,end:br,justify:xr,left:mr,right:yr,start:vr},El={[_r]:"center",[br]:"end",[xr]:"justify",[mr]:"left",[yr]:"right",[vr]:"start"},Nl={normal:0,segmented:2,token:1},Pl={[xl]:"normal",[bl]:"segmented",[vl]:"token"};function Ol(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var A=Ol(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Cn(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Dl=100;let Cr=!1,wr=0;function jl(n){wr=n.timeStamp}function Sr(n,e,t){return e.__lexicalLineBreak===n||n[`__lexicalKey_${t._key}`]!==void 0}function Al(n,e,t){const r=Te(t._window);let i=null,o=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,o=r.focusOffset);const s=n.nodeValue;s!==null&&Or(e,s,i,o,!1)}function Ll(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===Be&&t.isAttached()}function Ui(n,e,t){Cr=!0;const r=performance.now()-wr>Dl;try{ge(n,()=>{const i=M()||function(d){return d.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})}(n),o=new Map,s=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target;let _=Ze(m,l);if(!(_===null&&m!==s||U(_))){if(g==="characterData")r&&j(_)&&Ll(i,m,_)&&Al(m,_,n);else if(g==="childList"){c=!0;const v=h.addedNodes;for(let k=0;k<v.length;k++){const S=v[k],w=Zi(S),P=S.parentNode;if(P!=null&&S!==a&&w===null&&(S.nodeName!=="BR"||!Sr(S,P,n))){if(We){const T=S.innerText||S.nodeValue;T&&(u+=T)}P.removeChild(S)}}const y=h.removedNodes,x=y.length;if(x>0){let k=0;for(let S=0;S<x;S++){const w=y[S];(w.nodeName==="BR"&&Sr(w,m,n)||a===w)&&(m.appendChild(w),k++)}x!==k&&(m===s&&(_=no(l)),o.set(m,_))}}}}if(o.size>0)for(const[d,h]of o)if(C(h)){const g=h.getChildrenKeys();let m=d.firstChild;for(let _=0;_<g.length;_++){const v=g[_],y=n.getElementByKey(v);y!==null&&(m==null?(d.appendChild(y),m=y):m!==y&&d.replaceChild(y,m),m=m.nextSibling)}}else j(h)&&h.markDirty();const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let _=0;_<g.length;_++){const v=g[_],y=v.parentNode;y==null||v.nodeName!=="BR"||Sr(v,m,n)||y.removeChild(v)}}t.takeRecords()}i!==null&&(c&&(i.dirty=!0,Se(i)),We&&ho(n)&&i.insertRawText(u))})}finally{Cr=!1}}function Vi(n){const e=n._observer;e!==null&&Ui(n,e.takeRecords(),e)}function Ji(n){(function(e){wr===0&&Pn(e).addEventListener("textInput",jl,!0)})(n),n._observer=new MutationObserver((e,t)=>{Ui(n,e,t)})}function Yi(n,e){const t=n.__mode,r=n.__format,i=n.__style,o=e.__mode,s=e.__format,l=e.__style;return!(t!==null&&t!==o||r!==null&&r!==s||i!==null&&i!==l)}function Hi(n,e){const t=n.mergeWithSibling(e),r=G()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function qi(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&j(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Yi(e,r)){r=Hi(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&j(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Yi(r,t)){r=Hi(r,t);break}break}t.remove()}}else r.remove()}function Gi(n){return Xi(n.anchor),Xi(n.focus),n}function Xi(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),j(r)){n.set(r.__key,i?r.getTextContentSize():0,"text");break}if(!C(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element")}}let Il=1;const Fl=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Tr(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return U(Ze(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&wn(e)==null)}function Lt(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Tr(e)&&Qi(e)===n}catch{return!1}}function kr(n){return n instanceof Jn}function Qi(n){let e=n;for(;e!=null;){const t=wn(e);if(kr(t))return t;e=Nn(e)}return null}function wn(n){return n?n.__lexicalEditor:null}function ft(n){return n.isToken()||n.isSegmented()}function Ml(n){return n.nodeType===Be}function Sn(n){let e=n;for(;e!=null;){if(Ml(e))return e;e=e.firstChild}return null}function Er(n,e,t){const r=je[e];if(t!==null&&(n&r)==(t&r))return n;let i=n^r;return e==="subscript"?i&=~je.superscript:e==="superscript"&&(i&=~je.subscript),i}function $l(n,e){if(e!=null)return void(n.__key=e);he(),Xo();const t=G(),r=Ie(),i=""+Il++;r._nodeMap.set(i,n),C(n)?t._dirtyElements.set(i,!0):t._dirtyLeaves.add(i),t._cloneNotNeeded.add(i),t._dirtyType=Wi,n.__key=i}function Qe(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),o=n.getNextSibling();if(i===null)if(o!==null){const s=o.getWritable();r.__first=o.__key,s.__prev=null}else r.__first=null;else{const s=i.getWritable();if(o!==null){const l=o.getWritable();l.__prev=s.__key,s.__next=l.__key}else s.__next=null;t.__prev=null}if(o===null)if(i!==null){const s=i.getWritable();r.__last=i.__key,s.__next=null}else r.__last=null;else{const s=o.getWritable();if(i!==null){const l=i.getWritable();l.__next=s.__key,s.__prev=l.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Tn(n){Xo();const e=n.getLatest(),t=e.__parent,r=Ie(),i=G(),o=r._nodeMap,s=i._dirtyElements;t!==null&&function(a,c,u){let f=a;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}}(t,o,s);const l=e.__key;i._dirtyType=Wi,C(n)?s.set(l,!0):i._dirtyLeaves.add(l)}function re(n){he();const e=G(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=se(t);r!==null&&r.getWritable()}if(n!==null){const r=se(n);r!==null&&r.getWritable()}}}function ze(){return Zt()?null:G()._compositionKey}function se(n,e){const t=(e||Ie())._nodeMap.get(n);return t===void 0?null:t}function Zi(n,e){const t=n[`__lexicalKey_${G()._key}`];return t!==void 0?se(t,e):null}function Ze(n,e){let t=n;for(;t!=null;){const r=Zi(t,e);if(r!==null)return r;t=Nn(t)}return null}function eo(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function to(n){return n.read(()=>Q().getTextContent())}function Q(){return no(Ie())}function no(n){return n._nodeMap.get("root")}function Se(n){he();const e=Ie();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function ht(n){const e=G(),t=function(r,i){let o=r;for(;o!=null;){const s=o[`__lexicalKey_${i._key}`];if(s!==void 0)return s;o=Nn(o)}return null}(n,e);return t===null?n===e.getRootElement()?se("root"):null:se(t)}function ro(n,e){return e?n.getTextContentSize():0}function io(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Nr(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function oo(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function so(n){return n.nodeType===Be?n.nodeValue:null}function Pr(n,e,t){const r=Te(e._window);if(r===null)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(i!==null){let l=so(i);const a=Ze(i);if(l!==null&&j(a)){if(l===bn&&t){const c=t.length;l=t,o=c,s=c}l!==null&&Or(a,l,o,s,n)}}}function Or(n,e,t,r,i){let o=n;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let l=e;(s||i)&&e[e.length-1]===bn&&(l=e.slice(0,-1));const a=o.getTextContent();if(i||l!==a){if(l===""){if(re(null),hr||yn||gr)o.remove();else{const m=G();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const c=o.getParent(),u=Qt(),f=o.getTextContentSize(),d=ze(),h=o.getKey();if(o.isToken()||d!==null&&h===d&&!s||O(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!o.canInsertTextBefore()&&!s||u.focus.key===n.__key&&u.focus.offset===f&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const g=M();if(!O(g)||t===null||r===null)return void o.setTextContent(l);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=ie(o.getTextContent());o.replace(m),o=m}o.setTextContent(l)}}}function Rl(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),i=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||i||function(o){const s=o.getPreviousSibling();return(j(s)||C(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||i)}function lo(n){return n==="ArrowLeft"}function ao(n){return n==="ArrowRight"}function It(n,e){return xe?n:e}function co(n){return n==="Enter"}function Ft(n){return n==="Backspace"}function Mt(n){return n==="Delete"}function uo(n,e,t){return n.toLowerCase()==="a"&&It(e,t)}function Wl(){const n=Q();Se(Gi(n.select(0,n.getChildrenSize())))}function $t(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const o=Cn(i);return t[e]=o,o}return i}function Dr(n,e,t,r,i){if(t.size===0)return;const o=r.__type,s=r.__key,l=e.get(o);l===void 0&&A(33,o);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(s),f=u==="destroyed"&&i==="created";(u===void 0||f)&&c.set(s,f?"updated":i)}function fo(n,e,t){const r=n.getParent();let i=t,o=n;return r!==null&&(e&&t===0?(i=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?i-1:i)}function Rt(n,e){const t=n.offset;if(n.type==="element")return fo(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?fo(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function ho(n){const e=Pn(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function I(n,e,t){return ns(n,e,t)}function kn(n){return!oe(n)&&!n.isLastChild()&&!n.isInline()}function En(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&A(75,e),t}function Nn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function jr(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Pn(n){const e=n._window;return e===null&&A(78),e}function Bl(n){let e=n.getParentOrThrow();for(;e!==null;){if(gt(e))return e;e=e.getParentOrThrow()}return e}function gt(n){return oe(n)||C(n)&&n.isShadowRoot()}function Wt(n){const e=G(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&A(97);const i=r.replace;if(i!==null){const o=i(n);return o instanceof n.constructor||A(98),o}return n}function Ar(n,e){!oe(n.getParent())||C(e)||U(e)||A(99)}function Lr(n){return(U(n)||C(n)&&!n.canBeEmpty())&&!n.isInline()}function Ir(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function zl(n,e,t){let r=n._blockCursorElement;if(O(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const i=t.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Lr(o.getChildAtIndex(s-1))&&(l=!0);else{const c=o.getChildAtIndex(s);if(Lr(c)){const u=c.getPreviousSibling();(u===null||Lr(u))&&(l=!0,a=n.getElementByKey(c.__key))}}if(l){const c=n.getElementByKey(o.__key);return r===null&&(n._blockCursorElement=r=function(u){const f=u.theme,d=document.createElement("div");d.contentEditable="false",d.setAttribute("data-lexical-cursor","true");let h=f.blockCursor;if(h!==void 0){if(typeof h=="string"){const g=Cn(h);h=f.blockCursor=g}h!==void 0&&d.classList.add(...h)}return d}(n._config)),e.style.caretColor="transparent",void(a===null?c.appendChild(r):c.insertBefore(r,a))}}r!==null&&Ir(r,n,e)}function Te(n){return ye?(n||window).getSelection():null}function Kl(n){return On(n)&&n.tagName==="A"}function On(n){return n.nodeType===1}function Fr(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Dn(n){const e=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 n.nodeName.match(e)!==null}function pt(n){if(oe(n)||U(n)&&!n.isInline())return!0;if(!C(n)||gt(n))return!1;const e=n.getFirstChild(),t=e===null||qt(e)||j(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Mr(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function Ul(){return G()}const go=new WeakMap,Vl=new Map;function Jl(n){if(!n._readOnly&&n.isEmpty())return Vl;n._readOnly||A(192);let e=go.get(n);if(!e){e=new Map,go.set(n,e);for(const[t,r]of n._nodeMap){const i=r.__type;let o=e.get(i);o||(o=new Map,e.set(i,o)),o.set(t,r)}}return e}function $r(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function po(n,e,t,r,i,o){let s=n.getFirstChild();for(;s!==null;){const l=s.__key;s.__parent===e&&(C(s)&&po(s,l,t,r,i,o),t.has(l)||o.delete(l),i.push(l)),s=s.getNextSibling()}}let Ke,le,Bt,jn,Rr,Wr,et,ve,Br,zt,ee="",ae="",ke=null,be="",Ae="",mo=!1,Kt=!1,An=null;function Ln(n,e){const t=et.get(n);if(e!==null){const r=Vr(n);r.parentNode===e&&e.removeChild(r)}if(ve.has(n)||le._keyToDOMMap.delete(n),C(t)){const r=Fn(t,et);zr(r,0,r.length-1,null)}t!==void 0&&Dr(zt,Bt,jn,t,"destroyed")}function zr(n,e,t,r){let i=e;for(;i<=t;++i){const o=n[i];o!==void 0&&Ln(o,r)}}function tt(n,e){n.setProperty("text-align",e)}const Yl="40px";function _o(n,e){const t=Ke.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Yl;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function yo(n,e){const t=n.style;e===0?tt(t,""):e===mr?tt(t,"left"):e===_r?tt(t,"center"):e===yr?tt(t,"right"):e===xr?tt(t,"justify"):e===vr?tt(t,"start"):e===br&&tt(t,"end")}function In(n,e,t){const r=ve.get(n);r===void 0&&A(60);const i=r.createDOM(Ke,le);if(function(o,s,l){const a=l._keyToDOMMap;s["__lexicalKey_"+l._key]=o,a.set(o,s)}(n,i,le),j(r)?i.setAttribute("data-lexical-text","true"):U(r)&&i.setAttribute("data-lexical-decorator","true"),C(r)){const o=r.__indent,s=r.__size;if(o!==0&&_o(i,o),s!==0){const a=s-1;(function(c,u,f,d){const h=ae;ae="",Kr(c,f,0,u,d,null),bo(f,d),ae=h})(Fn(r,ve),a,r,i)}const l=r.__format;l!==0&&yo(i,l),r.isInline()||vo(null,r,i),kn(r)&&(ee+=De,Ae+=De)}else{const o=r.getTextContent();if(U(r)){const s=r.decorate(le,Ke);s!==null&&Co(n,s),i.contentEditable="false"}else j(r)&&(r.isDirectionless()||(ae+=o));ee+=o,Ae+=o}if(e!==null)if(t!=null)e.insertBefore(i,t);else{const o=e.__lexicalLineBreak;o!=null?e.insertBefore(i,o):e.appendChild(i)}return Dr(zt,Bt,jn,r,"created"),i}function Kr(n,e,t,r,i,o){const s=ee;ee="";let l=t;for(;l<=r;++l){In(n[l],i,o);const a=ve.get(n[l]);a!==null&&j(a)&&(ke===null&&(ke=a.getFormat()),be===""&&(be=a.getStyle()))}kn(e)&&(ee+=De),i.__lexicalTextContent=ee,ee=s+ee}function xo(n,e){const t=e.get(n);return qt(t)||U(t)&&t.isInline()}function vo(n,e,t){const r=n!==null&&(n.__size===0||xo(n.__last,et)),i=e.__size===0||xo(e.__last,ve);if(r){if(!i){const o=t.__lexicalLineBreak;if(o!=null)try{t.removeChild(o)}catch(s){if(typeof s=="object"&&s!=null){const l=`${s.toString()} Parent: ${t.tagName}, child: ${o.tagName}.`;throw new Error(l)}throw s}t.__lexicalLineBreak=null}}else if(i){const o=document.createElement("br");t.__lexicalLineBreak=o,t.appendChild(o)}}function bo(n,e){const t=e.__lexicalDirTextContent,r=e.__lexicalDir;if(t!==ae||r!==An){const o=ae==="",s=o?An:(i=ae,Sl.test(i)?"rtl":Tl.test(i)?"ltr":null);if(s!==r){const l=e.classList,a=Ke.theme;let c=r!==null?a[r]:void 0,u=s!==null?a[s]:void 0;if(c!==void 0){if(typeof c=="string"){const f=Cn(c);c=a[r]=f}l.remove(...c)}if(s===null||o&&s==="ltr")e.removeAttribute("dir");else{if(u!==void 0){if(typeof u=="string"){const f=Cn(u);u=a[s]=f}u!==void 0&&l.add(...u)}e.dir=s}Kt||(n.getWritable().__dir=s)}An=s,e.__lexicalDirTextContent=ae,e.__lexicalDir=s}var i}function Hl(n,e,t){const r=ae;var i;ae="",ke=null,be="",function(o,s,l){const a=ee,c=o.__size,u=s.__size;if(ee="",c===1&&u===1){const f=o.__first,d=s.__first;if(f===d)Ut(f,l);else{const g=Vr(f),m=In(d,null,null);try{l.replaceChild(m,g)}catch(_){if(typeof _=="object"&&_!=null){const v=`${_.toString()} Parent: ${l.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw _}Ln(f,null)}const h=ve.get(d);j(h)&&(ke===null&&(ke=h.getFormat()),be===""&&(be=h.getStyle()))}else{const f=Fn(o,et),d=Fn(s,ve);if(c===0)u!==0&&Kr(d,s,0,u-1,l,null);else if(u===0){if(c!==0){const h=l.__lexicalLineBreak==null;zr(f,0,c-1,h?null:l),h&&(l.textContent="")}}else(function(h,g,m,_,v,y){const x=_-1,k=v-1;let S,w,P=(F=y,F.firstChild),T=0,N=0;for(var F;T<=x&&N<=k;){const V=g[T],W=m[N];if(V===W)P=Ur(Ut(W,y)),T++,N++;else{S===void 0&&(S=new Set(g)),w===void 0&&(w=new Set(m));const ce=w.has(V),Fe=S.has(W);if(ce)if(Fe){const He=En(le,W);He===P?P=Ur(Ut(W,y)):(P!=null?y.insertBefore(He,P):y.appendChild(He),Ut(W,y)),T++,N++}else In(W,y,P),N++;else P=Ur(Vr(V)),Ln(V,y),T++}const q=ve.get(W);q!==null&&j(q)&&(ke===null&&(ke=q.getFormat()),be===""&&(be=q.getStyle()))}const R=T>x,H=N>k;if(R&&!H){const V=m[k+1];Kr(m,h,N,k,y,V===void 0?null:le.getElementByKey(V))}else H&&!R&&zr(g,T,x,y)})(s,f,d,c,u,l)}kn(s)&&(ee+=De),l.__lexicalTextContent=ee,ee=a+ee}(n,e,t),bo(e,t),ui(i=e)&&ke!=null&&ke!==i.__textFormat&&!Kt&&(i.setTextFormat(ke),i.setTextStyle(be)),function(o){ui(o)&&be!==""&&be!==o.__textStyle&&!Kt&&o.setTextStyle(be)}(e),ae=r}function Fn(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&A(101),t.push(r),r=i.__next}return t}function Ut(n,e){const t=et.get(n);let r=ve.get(n);t!==void 0&&r!==void 0||A(61);const i=mo||Wr.has(n)||Rr.has(n),o=En(le,n);if(t===r&&!i){if(C(t)){const s=o.__lexicalTextContent;s!==void 0&&(ee+=s,Ae+=s);const l=o.__lexicalDirTextContent;l!==void 0&&(ae+=l)}else{const s=t.getTextContent();j(t)&&!t.isDirectionless()&&(ae+=s),Ae+=s,ee+=s}return o}if(t!==r&&i&&Dr(zt,Bt,jn,r,"updated"),r.updateDOM(t,o,Ke)){const s=In(n,null,null);return e===null&&A(62),e.replaceChild(s,o),Ln(n,null),s}if(C(t)&&C(r)){const s=r.__indent;s!==t.__indent&&_o(o,s);const l=r.__format;l!==t.__format&&yo(o,l),i&&(Hl(t,r,o),oe(r)||r.isInline()||vo(t,r,o)),kn(r)&&(ee+=De,Ae+=De)}else{const s=r.getTextContent();if(U(r)){const l=r.decorate(le,Ke);l!==null&&Co(n,l)}else j(r)&&!r.isDirectionless()&&(ae+=s);ee+=s,Ae+=s}if(!Kt&&oe(r)&&r.__cachedText!==Ae){const s=r.getWritable();s.__cachedText=Ae,r=s}return o}function Co(n,e){let t=le._pendingDecorators;const r=le._decorators;if(t===null){if(r[n]===e)return;t=eo(le)}t[n]=e}function Ur(n){let e=n.nextSibling;return e!==null&&e===le._blockCursorElement&&(e=e.nextSibling),e}function ql(n,e,t,r,i,o){ee="",Ae="",ae="",mo=r===dt,An=null,le=t,Ke=t._config,Bt=t._nodes,jn=le._listeners.mutation,Rr=i,Wr=o,et=n._nodeMap,ve=e._nodeMap,Kt=e._readOnly,Br=new Map(t._keyToDOMMap);const s=new Map;return zt=s,Ut("root",null),le=void 0,Bt=void 0,Rr=void 0,Wr=void 0,et=void 0,ve=void 0,Ke=void 0,Br=void 0,zt=void 0,s}function Vr(n){const e=Br.get(n);return e===void 0&&A(75,n),e}const Le=Object.freeze({}),Jr=30,Yr=[["keydown",function(n,e){if(Vt=n.timeStamp,wo=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:o,altKey:s}=n;I(e,il,n)||t!=null&&(function(l,a,c,u){return ao(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Ni,n):function(l,a,c,u,f){return ao(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?I(e,ol,n):function(l,a,c,u){return lo(l)&&!a&&!u&&!c}(t,i,s,o)?I(e,Pi,n):function(l,a,c,u,f){return lo(l)&&!u&&!c&&(a||f)}(t,i,r,s,o)?I(e,sl,n):function(l,a,c){return function(u){return u==="ArrowUp"}(l)&&!a&&!c}(t,i,o)?I(e,Oi,n):function(l,a,c){return function(u){return u==="ArrowDown"}(l)&&!a&&!c}(t,i,o)?I(e,Di,n):function(l,a){return co(l)&&a}(t,r)?(Jt=!0,I(e,pn,n)):function(l){return l===" "}(t)?I(e,ll,n):function(l,a){return xe&&a&&l.toLowerCase()==="o"}(t,i)?(n.preventDefault(),Jt=!0,I(e,ct,!0)):function(l,a){return co(l)&&!a}(t,r)?(Jt=!1,I(e,pn,n)):function(l,a,c,u){return xe?!a&&!c&&(Ft(l)||l.toLowerCase()==="h"&&u):!(u||a||c)&&Ft(l)}(t,s,o,i)?Ft(t)?I(e,ji,n):(n.preventDefault(),I(e,Ge,!0)):function(l){return l==="Escape"}(t)?I(e,Ai,n):function(l,a,c,u,f){return xe?!(c||u||f)&&(Mt(l)||l.toLowerCase()==="d"&&a):!(a||u||f)&&Mt(l)}(t,i,r,s,o)?Mt(t)?I(e,Li,n):(n.preventDefault(),I(e,Ge,!1)):function(l,a,c){return Ft(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,Pt,!0)):function(l,a,c){return Mt(l)&&(xe?a:c)}(t,s,i)?(n.preventDefault(),I(e,Pt,!1)):function(l,a){return xe&&a&&Ft(l)}(t,o)?(n.preventDefault(),I(e,Ot,!0)):function(l,a){return xe&&a&&Mt(l)}(t,o)?(n.preventDefault(),I(e,Ot,!1)):function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"bold")):function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"underline")):function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&It(c,u)}(t,s,o,i)?(n.preventDefault(),I(e,de,"italic")):function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u}(t,s,i,o)?I(e,al,n):function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&It(c,u)}(t,r,o,i)?(n.preventDefault(),I(e,hn,void 0)):function(l,a,c,u){return xe?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a}(t,r,o,i)?(n.preventDefault(),I(e,gn,void 0)):Ce(e._editorState._selection)?function(l,a,c,u){return!a&&l.toLowerCase()==="c"&&(xe?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,mn,n)):function(l,a,c,u){return!a&&l.toLowerCase()==="x"&&(xe?c:u)}(t,r,o,i)?(n.preventDefault(),I(e,dr,n)):uo(t,o,i)&&(n.preventDefault(),I(e,fr,n)):!We&&uo(t,o,i)&&(n.preventDefault(),I(e,fr,n)),function(l,a,c,u){return l||a||c||u}(i,r,s,o)&&I(e,pl,n))}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&ge(e,()=>{U(Ze(t))||(qr=!0)})}],["compositionstart",function(n,e){ge(e,()=>{const t=M();if(O(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();re(r.key),(n.timeStamp<Vt+Jr||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||j(i)&&i.getStyle()!==t.style)&&I(e,ut,wl)}})}],["compositionend",function(n,e){We?Yt=!0:ge(e,()=>{Gr(e,n.data)})}],["input",function(n,e){n.stopPropagation(),ge(e,()=>{const t=M(),r=n.data,i=Po(n);if(r!=null&&O(t)&&ko(t,i,r,n.timeStamp,!1)){Yt&&(Gr(e,r),Yt=!1);const o=t.anchor.getNode(),s=Te(e._window);if(s===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;_n&&!t.isCollapsed()&&j(o)&&s.anchorNode!==null&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+c)===so(s.anchorNode)||I(e,ut,r);const u=r.length;We&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),hr||yn||gr||!e.isComposing()||(Vt=0,re(null))}else Pr(!1,e,r!==null?r:void 0),Yt&&(Gr(e,r||void 0),Yt=!1);he(),Vi(G())}),mt=null}],["click",function(n,e){ge(e,()=>{const t=M(),r=Te(e._window),i=Qt();if(r){if(O(t)){const o=t.anchor,s=o.getNode();o.type==="element"&&o.offset===0&&t.isCollapsed()&&!oe(s)&&Q().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(C(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const o=r.anchorNode;if(o!==null){const s=o.nodeType;(s===At||s===Be)&&Se(ii(i,r,e,n))}}}I(e,Ei,n)})}],["cut",Le],["copy",Le],["dragstart",Le],["dragover",Le],["dragend",Le],["paste",Le],["focus",Le],["blur",Le],["drop",Le]];_n&&Yr.push(["beforeinput",(n,e)=>function(t,r){const i=t.inputType,o=Po(t);i==="deleteCompositionText"||We&&ho(r)||i!=="insertCompositionText"&&ge(r,()=>{const s=M();if(i==="deleteContentBackward"){if(s===null){const h=Qt();if(!O(h))return;Se(h.clone())}if(O(s)){const h=s.anchor.key===s.focus.key;if(l=t.timeStamp,wo==="MediaLast"&&l<Vt+Jr&&r.isComposing()&&h){if(re(null),Vt=0,setTimeout(()=>{ge(r,()=>{re(null)})},Jr),O(s)){const g=s.anchor.getNode();g.markDirty(),s.format=g.getFormat(),j(g)||A(142),s.style=g.getStyle()}}else{re(null),t.preventDefault();const g=s.anchor.getNode().getTextContent(),m=s.anchor.offset===0&&s.focus.offset===g.length;yl&&h&&!m||I(r,Ge,!0)}return}}var l;if(!O(s))return;const a=t.data;mt!==null&&Pr(!1,r,mt),s.dirty&&mt===null||!s.isCollapsed()||oe(s.anchor.getNode())||o===null||s.applyDOMRange(o),mt=null;const c=s.anchor,u=s.focus,f=c.getNode(),d=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":I(r,ut,t);break;case"insertFromComposition":re(null),I(r,ut,t);break;case"insertLineBreak":re(null),I(r,ct,!1);break;case"insertParagraph":re(null),Jt&&!yn?(Jt=!1,I(r,ct,!1)):I(r,fn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":I(r,ar,t);break;case"deleteByComposition":(function(h,g){return h!==g||C(h)||C(g)||!h.isToken()||!g.isToken()})(f,d)&&I(r,cr,t);break;case"deleteByDrag":case"deleteByCut":I(r,cr,t);break;case"deleteContent":I(r,Ge,!1);break;case"deleteWordBackward":I(r,Pt,!0);break;case"deleteWordForward":I(r,Pt,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":I(r,Ot,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":I(r,Ot,!1);break;case"formatStrikeThrough":I(r,de,"strikethrough");break;case"formatBold":I(r,de,"bold");break;case"formatItalic":I(r,de,"italic");break;case"formatUnderline":I(r,de,"underline");break;case"historyUndo":I(r,hn,void 0);break;case"historyRedo":I(r,gn,void 0)}else{if(a===`
|
|
32
|
+
`)t.preventDefault(),I(r,ct,!1);else if(a===De)t.preventDefault(),I(r,fn,void 0);else if(a==null&&t.dataTransfer){const h=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(h)}else a!=null&&ko(s,o,a,t.timeStamp,!0)?(t.preventDefault(),I(r,ut,a)):mt=a;So=t.timeStamp}})}(n,e)]);let Vt=0,wo=null,So=0,mt=null;const Mn=new WeakMap;let Hr=!1,qr=!1,Jt=!1,Yt=!1,To=[0,"",0,"root",0];function ko(n,e,t,r,i){const o=n.anchor,s=n.focus,l=o.getNode(),a=G(),c=Te(a._window),u=c!==null?c.anchorNode:null,f=o.key,d=a.getElementByKey(f),h=t.length;return f!==s.key||!j(l)||(!i&&(!_n||So<r+50)||l.isDirty()&&h<2||io(t))&&o.offset!==s.offset&&!l.isComposing()||ft(l)||l.isDirty()&&h>1||(i||!_n)&&d!==null&&!l.isComposing()&&u!==Sn(d)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||Rl(n,l)}function Eo(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===Be&&e!==0&&e!==n.nodeValue.length}function No(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}=n;Hr&&(Hr=!1,Eo(r,i)&&Eo(o,s))||ge(e,()=>{if(!t)return void Se(null);if(!Lt(e,r,o))return;const l=M();if(O(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Pn(e).event,f=u?u.timeStamp:performance.now(),[d,h,g,m,_]=To,v=Q(),y=e.isComposing()===!1&&v.getTextContent()==="";if(f<_+200&&a.offset===g&&a.key===m)l.format=d,l.style=h;else if(a.type==="text")j(c)||A(141),l.format=c.getFormat(),l.style=c.getStyle();else if(a.type==="element"&&!y){const x=a.getNode();l.style="",x instanceof xt&&x.getChildrenSize()===0?(l.format=x.getTextFormat(),l.style=x.getTextStyle()):l.format=0}}else{const u=a.key,f=l.focus.key,d=l.getNodes(),h=d.length,g=l.isBackward(),m=g?s:i,_=g?i:s,v=g?f:u,y=g?u:f;let x=Cl,k=!1;for(let S=0;S<h;S++){const w=d[S],P=w.getTextContentSize();if(j(w)&&P!==0&&!(S===0&&w.__key===v&&m===P||S===h-1&&w.__key===y&&_===0)&&(k=!0,x&=w.getFormat(),x===0))break}l.format=k?x:0}}I(e,dn,void 0)})}function Po(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Gr(n,e){const t=n._compositionKey;if(re(null),t!==null&&e!=null){if(e===""){const r=se(t),i=Sn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&j(r)&&Or(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
33
|
+
`){const r=M();if(O(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void I(n,pn,null)}}}Pr(!0,n,e)}function Oo(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const _t=new Map;function Do(n){const e=n.target,t=Te(e==null?null:e.nodeType===9?e.defaultView:e.ownerDocument.defaultView);if(t===null)return;const r=Qi(t.anchorNode);if(r===null)return;qr&&(qr=!1,ge(r,()=>{const c=Qt(),u=t.anchorNode;if(u===null)return;const f=u.nodeType;f!==At&&f!==Be||Se(ii(c,t,r,n))}));const i=Nr(r),o=i[i.length-1],s=o._key,l=_t.get(s),a=l||o;a!==r&&No(t,a,!1),No(t,r,!0),r!==o?_t.set(s,r):l&&_t.delete(s)}function jo(n){n._lexicalHandled=!0}function Ao(n){return n._lexicalHandled===!0}function Gl(n){const e=n.ownerDocument,t=Mn.get(e);t===void 0&&A(162);const r=t-1;r>=0||A(164),Mn.set(e,r),r===0&&e.removeEventListener("selectionchange",Do);const i=wn(n);kr(i)?(function(s){if(s._parentEditor!==null){const l=Nr(s),a=l[l.length-1]._key;_t.get(a)===s&&_t.delete(a)}else _t.delete(s._key)}(i),n.__lexicalEditor=null):i&&A(198);const o=Oo(n);for(let s=0;s<o.length;s++)o[s]();n.__lexicalEventHandles=[]}function Xr(n,e,t){he();const r=n.__key,i=n.getParent();if(i===null)return;const o=function(l){const a=M();if(!O(a)||!C(l))return a;const{anchor:c,focus:u}=a,f=c.getNode(),d=u.getNode();return jr(f,l)&&c.set(l.__key,0,"element"),jr(d,l)&&u.set(l.__key,0,"element"),a}(n);let s=!1;if(O(o)&&e){const l=o.anchor,a=o.focus;l.key===r&&(Kn(l,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0),a.key===r&&(Kn(a,n,i,n.getPreviousSibling(),n.getNextSibling()),s=!0)}else Ce(o)&&e&&n.isSelected()&&n.selectPrevious();if(O(o)&&e&&!s){const l=n.getIndexWithinParent();Qe(n),zn(o,i,l,-1)}else Qe(n);t||gt(i)||i.canBeEmpty()||!i.isEmpty()||Xr(i,e),e&&oe(i)&&i.isEmpty()&&i.selectEnd()}class $n{static getType(){A(64,this.name)}static clone(e){A(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,$l(this,e)}getType(){return this.__type}isInline(){A(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=se(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||M();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(j(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(U(this)&&this.isInline()&&i){const o=t.isBackward()?t.focus:t.anchor,s=o.getNode();if(o.offset===s.getChildrenSize()&&s.is(i)&&s.getLastChildOrThrow().is(this))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:se(e)}getParentOrThrow(){const e=this.getParent();return e===null&&A(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(gt(t))return C(e)||e===this&&U(e)||A(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&A(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:se(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:se(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),r=e.getParents();C(this)&&t.unshift(this),C(e)&&r.unshift(e);const i=t.length,o=r.length;if(i===0||o===0||t[i-1]!==r[o-1])return null;const s=new Set(r);for(let l=0;l<i;l++){const a=t[l];if(s.has(a))return a}return null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;const t=this.getCommonAncestor(e);let r=0,i=0,o=this;for(;;){const s=o.getParentOrThrow();if(s===t){r=o.getIndexWithinParent();break}o=s}for(o=e;;){const s=o.getParentOrThrow();if(s===t){i=o.getIndexWithinParent();break}o=s}return r<i}isParentOf(e){const t=this.__key;if(t===e.__key)return!1;let r=e;for(;r!==null;){if(r.__key===t)return!0;r=r.getParent()}return!1}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let o=this;for(;o!==null;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=C(o)?t?o.getFirstChild():o.getLastChild():null;if(l!==null){o=l;continue}const a=t?o.getNextSibling():o.getPreviousSibling();if(a!==null){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,f=c;do{if(f===null&&A(68),u=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||i.has(f.__key)||r.push(f)}while(u===null);o=u}return t||r.reverse(),r}isDirty(){const e=G()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){const e=se(this.__key);return e===null&&A(113),e}getWritable(){he();const e=Ie(),t=G(),r=e._nodeMap,i=this.__key,o=this.getLatest(),s=t._cloneNotNeeded,l=M();if(l!==null&&l.setCachedNodes(null),s.has(i))return Tn(o),o;const a=$r(o);return s.add(i),Tn(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){A(70)}updateDOM(e,t,r){A(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){A(72)}static importJSON(e){A(18,this.name)}static transform(){return null}remove(e){Xr(this,!0,e)}replace(e,t){he();let r=M();r!==null&&(r=r.clone()),Ar(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Qe(l);const u=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(Xr(i,!1,!0),u===null?a.__first=s:u.getWritable().__next=s,l.__prev=d,f===null?a.__last=s:f.getWritable().__prev=s,l.__next=h,l.__parent=g,a.__size=c,t&&(C(this)&&C(l)||A(139),this.getChildren().forEach(m=>{l.append(m)})),O(r)){Se(r);const m=r.anchor,_=r.focus;m.key===o&&Ro(m,l),_.key===o&&Ro(_,l)}return ze()===o&&re(s),l}insertAfter(e,t=!0){he(),Ar(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.getParent(),s=M();let l=!1,a=!1;if(o!==null){const h=e.getIndexWithinParent();if(Qe(i),O(s)){const g=o.__key,m=s.anchor,_=s.focus;l=m.type==="element"&&m.key===g&&m.offset===h+1,a=_.type==="element"&&_.key===g&&_.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=i.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&O(s)){const h=this.getIndexWithinParent();zn(s,u,h+1);const g=u.__key;l&&s.anchor.set(g,h+2,"element"),a&&s.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){he(),Ar(this,e);const r=this.getWritable(),i=e.getWritable(),o=i.__key;Qe(i);const s=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();s===null?l.__first=o:s.getWritable().__next=o,l.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=M();return t&&O(u)&&zn(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return Ne()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){he();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(C(r))return r.select();if(!j(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){he();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(C(r))return r.select(0,0);if(!j(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}}class Ht extends $n{static getType(){return"linebreak"}static clone(e){return new Ht(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
34
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(t){const r=t.parentElement;if(r!==null&&Dn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Rn(i)){const o=r.lastChild;if(o===t||o.previousSibling===t&&Rn(o))return!0}}return!1}(e)||function(t){const r=t.parentElement;if(r!==null&&Dn(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&Rn(i))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&Rn(o))return!0}return!1}(e)?null:{conversion:Xl,priority:0}}}static importJSON(e){return nt()}exportJSON(){return{type:"linebreak",version:1}}}function Xl(n){return{node:nt()}}function nt(){return Wt(new Ht)}function qt(n){return n instanceof Ht}function Rn(n){return n.nodeType===Be&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Qr(n,e){return 16&e?"code":e&pr?"mark":32&e?"sub":64&e?"sup":null}function Zr(n,e){return 1&e?"strong":2&e?"em":"span"}function Lo(n,e,t,r,i){const o=r.classList;let s=$t(i,"base");s!==void 0&&o.add(...s),s=$t(i,"underlineStrikethrough");let l=!1;const a=e&vn&&e&xn;s!==void 0&&(t&vn&&t&xn?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const c in je){const u=je[c];if(s=$t(i,c),s!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&o.remove(...s);continue}e&u&&(!a||c!=="underline")&&c!=="strikethrough"||o.add(...s)}else e&u&&o.remove(...s)}}function Io(n,e,t){const r=e.firstChild,i=t.isComposing(),o=n+(i?bn:"");if(r==null)e.textContent=o;else{const s=r.nodeValue;if(s!==o)if(i||We){const[l,a,c]=function(u,f){const d=u.length,h=f.length;let g=0,m=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;m+g<d&&m+g<h&&u[d-m-1]===f[h-m-1];)m++;return[g,d-g-m,f.slice(g,h-m)]}(s,o);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=o}}function Fo(n,e,t,r,i,o){Io(i,n,e);const s=o.theme.text;s!==void 0&&Lo(0,0,r,n,s)}function Wn(n,e){const t=document.createElement(e);return t.appendChild(n),t}class yt extends $n{static getType(){return"text"}static clone(e){return new yt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),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 Pl[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===ze()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=je[e];return!!(this.getFormat()&t)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Er(this.getLatest().__format,e,t)}canHaveFormat(){return!0}createDOM(e,t){const r=this.__format,i=Qr(0,r),o=Zr(0,r),s=i===null?o:i,l=document.createElement(s);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(o),l.appendChild(a)),Fo(a,this,0,r,this.__text,e);const c=this.__style;return c!==""&&(l.style.cssText=c),l}updateDOM(e,t,r){const i=this.__text,o=e.__format,s=this.__format,l=Qr(0,o),a=Qr(0,s),c=Zr(0,o),u=Zr(0,s);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const m=t.firstChild;m==null&&A(48);const _=document.createElement(u);return Fo(_,this,0,s,i,r),t.replaceChild(_,m),!1}let f=t;a!==null&&l!==null&&(f=t.firstChild,f==null&&A(49)),Io(i,f,this);const d=r.theme.text;d!==void 0&&o!==s&&Lo(0,o,s,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:ta,priority:0}),b:()=>({conversion:Zl,priority:0}),code:()=>({conversion:Ue,priority:0}),em:()=>({conversion:Ue,priority:0}),i:()=>({conversion:Ue,priority:0}),s:()=>({conversion:Ue,priority:0}),span:()=>({conversion:Ql,priority:0}),strong:()=>({conversion:Ue,priority:0}),sub:()=>({conversion:Ue,priority:0}),sup:()=>({conversion:Ue,priority:0}),u:()=>({conversion:Ue,priority:0})}}static importJSON(e){const t=ie(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return t!==null&&On(t)||A(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=Wn(t,"b")),this.hasFormat("italic")&&(t=Wn(t,"i")),this.hasFormat("strikethrough")&&(t=Wn(t,"s")),this.hasFormat("underline")&&(t=Wn(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?je[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?kl[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Er(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=Nl[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){he();let r=e,i=t;const o=M(),s=this.getTextContent(),l=this.__key;if(typeof s=="string"){const a=s.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!O(o))return Jo(l,r,l,i,"text","text");{const a=ze();a!==o.anchor.key&&a!==o.focus.key||re(l),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const o=this.getWritable(),s=o.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=M();if(i&&O(c)){const f=e+l;c.setTextNodeRange(o,f,o,f)}const u=s.slice(0,a)+r+s.slice(a+t);return o.__text=u,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){he();const t=this.getLatest(),r=t.getTextContent(),i=t.__key,o=ze(),s=new Set(e),l=[],a=r.length;let c="";for(let S=0;S<a;S++)c!==""&&s.has(S)&&(l.push(c),c=""),c+=r[S];c!==""&&l.push(c);const u=l.length;if(u===0)return[];if(l[0]===r)return[t];const f=l[0],d=t.getParent();let h;const g=t.getFormat(),m=t.getStyle(),_=t.__detail;let v=!1;t.isSegmented()?(h=ie(f),h.__format=g,h.__style=m,h.__detail=_,v=!0):(h=t.getWritable(),h.__text=f);const y=M(),x=[h];let k=f.length;for(let S=1;S<u;S++){const w=l[S],P=w.length,T=ie(w).getWritable();T.__format=g,T.__style=m,T.__detail=_;const N=T.__key,F=k+P;if(O(y)){const R=y.anchor,H=y.focus;R.key===i&&R.type==="text"&&R.offset>k&&R.offset<=F&&(R.key=N,R.offset-=k,y.dirty=!0),H.key===i&&H.type==="text"&&H.offset>k&&H.offset<=F&&(H.key=N,H.offset-=k,y.dirty=!0)}o===i&&re(N),k=F,x.push(T)}if(d!==null){(function(P){const T=P.getPreviousSibling(),N=P.getNextSibling();T!==null&&Tn(T),N!==null&&Tn(N)})(this);const S=d.getWritable(),w=this.getIndexWithinParent();v?(S.splice(w,0,x),this.remove()):S.splice(w,1,x),O(y)&&zn(y,d,w,u-1)}return x}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||A(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;ze()===i&&re(r);const l=M();if(O(l)){const f=l.anchor,d=l.focus;f!==null&&f.key===i&&(qo(f,t,r,e,s),l.dirty=!0),d!==null&&d.key===i&&(qo(d,t,r,e,s),l.dirty=!0)}const a=e.__text,c=t?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function Ql(n){return{forChild:ei(n.style),node:null}}function Zl(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:ei(e.style,t?void 0:"bold"),node:null}}const Mo=new WeakMap;function ea(n){return n.nodeName==="PRE"||n.nodeType===At&&n.style!==void 0&&n.style.whiteSpace!==void 0&&n.style.whiteSpace.startsWith("pre")}function ta(n){const e=n;n.parentElement===null&&A(129);let t=e.textContent||"";if(function(r){let i,o=r.parentNode;const s=[r];for(;o!==null&&(i=Mo.get(o))===void 0&&!ea(o);)s.push(o),o=o.parentNode;const l=i===void 0?o:i;for(let a=0;a<s.length;a++)Mo.set(s[a],l);return l}(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],o=r.length;for(let s=0;s<o;s++){const l=r[s];l===`
|
|
35
|
+
`||l===`\r
|
|
36
|
+
`?i.push(nt()):l===" "?i.push(Xt()):l!==""&&i.push(ie(l))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=$o(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=$o(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:ie(t)}}function $o(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,t.nodeType===At){const o=t.style.display;if(o===""&&!Fr(t)||o!==""&&!o.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(t.nodeType===Be)return t;if(t.nodeName==="BR")return null}}const na={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ue(n){const e=na[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:ei(n.style,e),node:null}}function ie(n=""){return Wt(new yt(n))}function j(n){return n instanceof yt}function ei(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",o=r.includes("line-through"),s=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(j(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),o&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),l&&!c.hasFormat("underline")&&c.toggleFormat("underline"),a!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),a!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),e&&!c.hasFormat(e)&&c.toggleFormat(e)),c)}class Gt extends yt{static getType(){return"tab"}static clone(e){return new Gt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=Xt();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){A(126)}setDetail(e){A(127)}setMode(e){A(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Xt(){return Wt(new Gt)}function ra(n){return n instanceof Gt}class ia{constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),r=e.getNode();const i=this.offset,o=e.offset;if(C(t)){const s=t.getDescendantByIndex(i);t=s??t}if(C(r)){const s=r.getDescendantByIndex(o);r=s??r}return t===r?i<o:t.isBefore(r)}getNode(){const e=se(this.key);return e===null&&A(20),e}set(e,t,r){const i=this._selection,o=this.key;this.key=e,this.offset=t,this.type=r,Zt()||(ze()===o&&re(e),i!==null&&(i.setCachedNodes(null),i.dirty=!0))}}function Ee(n,e,t){return new ia(n,e,t)}function ti(n,e){let t=e.__key,r=n.offset,i="element";if(j(e)){i="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!C(e)){const o=e.getNextSibling();if(j(o))t=o.__key,r=0,i="text";else{const s=e.getParent();s&&(t=s.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Ro(n,e){if(C(e)){const t=e.getLastDescendant();C(t)||j(t)?ti(n,t):ti(n,e)}else ti(n,e)}function Ve(n,e,t,r){n.key=e,n.offset=t,n.type=r}class Bn{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ce(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}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 Bn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let o;if(j(i))o=i.select();else{const s=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(s,s)}o.insertNodes(e);for(let s=0;s<r;s++)t[s].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const o=se(i);o!==null&&r.push(o)}return Zt()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}}function O(n){return n instanceof Je}class Je{constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(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(e!==null)return e;const t=this.anchor,r=this.focus,i=t.isBefore(r),o=i?t:r,s=i?r:t;let l=o.getNode(),a=s.getNode();const c=o.offset,u=s.offset;if(C(l)){const d=l.getDescendantByIndex(c);l=d??l}if(C(a)){let d=a.getDescendantByIndex(u);d!==null&&d!==l&&a.getChildAtIndex(u)===d&&(d=d.getPreviousSibling()),a=d??a}let f;return f=l.is(a)?C(l)&&l.getChildrenSize()>0?[]:[l]:l.getNodesBetween(a),Zt()||(this._cachedNodes=f),f}setTextNodeRange(e,t,r,i){Ve(this.anchor,e.__key,t,"text"),Ve(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,s=i.isBefore(o),[l,a]=ni(this);let c="",u=!0;for(let f=0;f<e.length;f++){const d=e[f];if(C(d)&&!d.isInline())u||(c+=`
|
|
37
|
+
`),u=!d.isEmpty();else if(u=!1,j(d)){let h=d.getTextContent();d===t?d===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=s?h.slice(l):h.slice(a):d===r&&(h=s?h.slice(0,a):h.slice(0,l)),c+=h}else!U(d)&&!qt(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){const t=G(),r=t.getEditorState()._selection,i=Vo(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[o,s]=i;Ve(this.anchor,o.key,o.offset,o.type),Ve(this.focus,s.key,s.offset,s.type),this._cachedNodes=null}clone(){const e=this.anchor,t=this.focus;return new Je(Ee(e.key,e.offset,e.type),Ee(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Er(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=je[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let o=0;o<i;o++){const s=t[o];s===`
|
|
38
|
+
`||s===`\r
|
|
39
|
+
`?r.push(nt()):s===" "?r.push(Xt()):r.push(ie(s))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,o=this.style;let s=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(s=r,l=t),s.type==="element"&&function(_,v,y,x){const k=_.getNode(),S=k.getChildAtIndex(_.offset),w=ie(),P=oe(k)?Ne().append(w):w;w.setFormat(y),w.setStyle(x),S===null?k.append(P):S.insertBefore(P),_.is(v)&&v.set(w.__key,0,"text"),_.set(w.__key,0,"text")}(s,l,i,o);const a=s.offset;let c=l.offset;const u=this.getNodes(),f=u.length;let d=u[0];j(d)||A(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=u[f-1];if(f===1&&l.type==="element"&&(c=h,l.set(s.key,c,"text")),this.isCollapsed()&&a===h&&(d.isSegmented()||d.isToken()||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let _=d.getNextSibling();if(j(_)&&_.canInsertTextBefore()&&!ft(_)||(_=ie(),_.setFormat(i),_.setStyle(o),g.canInsertTextAfter()?d.insertAfter(_):g.insertAfter(_)),_.select(0,0),d=_,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(d.isSegmented()||d.isToken()||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let _=d.getPreviousSibling();if(j(_)&&!ft(_)||(_=ie(),_.setFormat(i),g.canInsertTextBefore()?d.insertBefore(_):g.insertBefore(_)),_.select(),d=_,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&a!==h){const _=ie(d.getTextContent());_.setFormat(i),d.replace(_),d=_}else if(!this.isCollapsed()&&e!==""){const _=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||C(_)&&(!_.canInsertTextBefore()||!_.canInsertTextAfter()))return this.insertText(""),Uo(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(d.isToken()){const x=ie(e);return x.select(),void d.replace(x)}const _=d.getFormat(),v=d.getStyle();if(a!==c||_===i&&v===o){if(ra(d)){const x=ie(e);return x.setFormat(i),x.setStyle(o),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=ie(e);if(x.setFormat(i),x.setStyle(o),x.select(),a===0)d.insertBefore(x,!1);else{const[k]=d.splitText(a);k.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(o)}const y=c-a;d=d.spliceText(a,y,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=_,this.style=v))}else{const _=new Set([...d.getParentKeys(),...m.getParentKeys()]),v=C(d)?d:d.getParentOrThrow();let y=C(m)?m:m.getParentOrThrow(),x=m;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(l.type==="text"&&(c!==0||m.getTextContent()==="")||l.type==="element"&&m.getIndexWithinParent()<c)if(j(m)&&!m.isToken()&&c!==m.getTextContentSize()){if(m.isSegmented()){const T=ie(m.getTextContent());m.replace(T),m=T}oe(l.getNode())||l.type!=="text"||(m=m.spliceText(0,c,"")),_.add(m.__key)}else{const T=m.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?m.remove():T.remove()}else _.add(m.__key);const k=y.getChildren(),S=new Set(u),w=v.is(y),P=v.isInline()&&d.getNextSibling()===null?v:d;for(let T=k.length-1;T>=0;T--){const N=k[T];if(N.is(d)||C(N)&&N.isParentOf(d))break;N.isAttached()&&(!S.has(N)||N.is(x)?w||P.insertAfter(N,!1):N.remove())}if(!w){let T=y,N=null;for(;T!==null;){const F=T.getChildren(),R=F.length;(R===0||F[R-1].is(N))&&(_.delete(T.__key),N=T),T=T.getParent()}}if(d.isToken())if(a===h)d.select();else{const T=ie(e);T.select(),d.replace(T)}else d=d.spliceText(a,h-a,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<f;T++){const N=u[T],F=N.__key;_.has(F)||N.remove()}}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())return this.toggleFormat(e),void re(null);const t=this.getNodes(),r=[];for(const y of t)j(y)&&r.push(y);const i=r.length;if(i===0)return this.toggleFormat(e),void re(null);const o=this.anchor,s=this.focus,l=this.isBackward(),a=l?s:o,c=l?o:s;let u=0,f=r[0],d=a.type==="element"?0:a.offset;if(a.type==="text"&&d===f.getTextContentSize()&&(u=1,f=r[1],d=0),f==null)return;const h=f.getFormatFlags(e,null),g=i-1;let m=r[g];const _=c.type==="text"?c.offset:m.getTextContentSize();if(f.is(m)){if(d===_)return;if(ft(f)||d===0&&_===f.getTextContentSize())f.setFormat(h);else{const y=f.splitText(d,_),x=d===0?y[0]:y[1];x.setFormat(h),a.type==="text"&&a.set(x.__key,0,"text"),c.type==="text"&&c.set(x.__key,_-d,"text")}return void(this.format=h)}d===0||ft(f)||([,f]=f.splitText(d),d=0),f.setFormat(h);const v=m.getFormatFlags(e,h);_>0&&(_===m.getTextContentSize()||ft(m)||([m]=m.splitText(_)),m.setFormat(v));for(let y=u+1;y<g;y++){const x=r[y],k=x.getFormatFlags(e,v);x.setFormat(k)}a.type==="text"&&a.set(f.__key,d,"text"),c.type==="text"&&c.set(m.__key,_,"text"),this.format=h|v}insertNodes(e){if(e.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const h=M();return O(h)||A(134),h.insertNodes(e)}const t=Mr((this.isBackward()?this.focus:this.anchor).getNode(),pt),r=e[e.length-1];if("__language"in t&&C(t)){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const h=oi(this);t.splice(h,0,e),r.selectEnd()}return}if(!e.some(h=>(C(h)||U(h))&&!h.isInline())){C(t)||A(135);const h=oi(this);return t.splice(h,0,e),void r.selectEnd()}const i=function(h){const g=Ne();let m=null;for(let _=0;_<h.length;_++){const v=h[_],y=qt(v);if(y||U(v)&&v.isInline()||C(v)&&v.isInline()||j(v)||v.isParentRequired()){if(m===null&&(m=v.createParentElementNode(),g.append(m),y))continue;m!==null&&m.append(v)}else g.append(v),m=null}return g}(e),o=i.getLastDescendant(),s=i.getChildren(),l=!C(t)||!t.isEmpty()?this.insertParagraph():null,a=s[s.length-1];let c=s[0];var u;C(u=c)&&pt(u)&&!u.isEmpty()&&C(t)&&(!t.isEmpty()||t.canMergeWhenEmpty())&&(C(t)||A(135),t.append(...c.getChildren()),c=s[1]),c&&function(h,g,m){const _=g.getParentOrThrow().getLastChild();let v=g;const y=[g];for(;v!==_;)v.getNextSibling()||A(140),v=v.getNextSibling(),y.push(v);let x=h;for(const k of y)x=x.insertAfter(k)}(t,c);const f=Mr(o,pt);l&&C(f)&&(l.canMergeWhenEmpty()||pt(a))&&(f.append(...l.getChildren()),l.remove()),C(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const d=C(t)?t.getLastChild():null;qt(d)&&f!==t&&d.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=Ne();return Q().splice(this.anchor.offset,0,[s]),s.select(),s}const e=oi(this),t=Mr(this.anchor.getNode(),pt);C(t)||A(136);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=nt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=this.getNodes(),t=e.length,r=t-1,i=this.anchor,o=this.focus;let s=e[0],l=e[r];const[a,c]=ni(this);if(t===0)return[];if(t===1){if(j(s)&&!this.isCollapsed()){const f=a>c?c:a,d=a>c?a:c,h=s.splitText(f,d),g=f===0?h[0]:h[1];return g!=null?[g]:[]}return[s]}const u=i.isBefore(o);if(j(s)){const f=u?a:c;f===s.getTextContentSize()?e.shift():f!==0&&([,s]=s.splitText(f),e[0]=s)}if(j(l)){const f=l.getTextContent().length,d=u?c:a;d===0?e.pop():d!==f&&([l]=l.splitText(d),e[r]=l)}return e}modify(e,t,r){const i=this.focus,o=this.anchor,s=e==="move",l=Rt(i,t);if(U(l)&&!l.isIsolated()){if(s&&l.isKeyboardSelectable()){const h=Yo();return h.add(l.__key),void Se(h)}const d=t?l.getPreviousSibling():l.getNextSibling();if(j(d)){const h=d.__key,g=t?d.getTextContent().length:0;return i.set(h,g,"text"),void(s&&o.set(h,g,"text"))}{const h=l.getParentOrThrow();let g,m;return C(d)?(m=d.__key,g=t?d.getChildrenSize():0):(g=l.getIndexWithinParent(),m=h.__key,t||g++),i.set(m,g,"element"),void(s&&o.set(m,g,"element"))}}const a=G(),c=Te(a._window);if(!c)return;const u=a._blockCursorElement,f=a._rootElement;if(f===null||u===null||!C(l)||l.isInline()||l.canBeEmpty()||Ir(u,a,f),function(d,h,g,m){d.modify(h,g,m)}(c,e,t?"backward":"forward",r),c.rangeCount>0){const d=c.getRangeAt(0),h=this.anchor.getNode(),g=oe(h)?h:Bl(h);if(this.applyDOMRange(d),this.dirty=!0,!s){const m=this.getNodes(),_=[];let v=!1;for(let y=0;y<m.length;y++){const x=m[y];jr(x,g)?_.push(x):v=!0}if(v&&_.length>0)if(t){const y=_[0];C(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=_[_.length-1];C(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}c.anchorNode===d.startContainer&&c.anchorOffset===d.startOffset||function(y){const x=y.focus,k=y.anchor,S=k.key,w=k.offset,P=k.type;Ve(k,x.key,x.offset,x.type),Ve(x,S,w,P),y._cachedNodes=null}(this)}}}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&C(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),o=t.getNextSibling()||(i===null?null:i.getNextSibling());if(C(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const o=this.focus,s=Rt(o,e);if(U(s)&&!s.isIsolated()){if(s.isKeyboardSelectable()&&C(i)&&i.getChildrenSize()===0){i.remove();const l=Yo();l.add(s.__key),Se(l)}else s.remove(),G().dispatchCommand(dn,void 0);return}if(!e&&C(s)&&C(i)&&i.isEmpty())return i.remove(),void s.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const l=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){const a=o.offset,c=l.getTextContentSize();if(l.is(i)||e&&a!==c||!e&&a!==0)return void Bo(l,e,a)}else if(i!==null&&i.isSegmented()){const a=r.offset,c=i.getTextContentSize();if(i.is(l)||e&&a!==0||!e&&a!==c)return void Bo(i,e,a)}(function(a,c){const u=a.anchor,f=a.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,m=f.offset,_=g<m,v=_?g:m,y=_?m:g,x=y-1;v!==x&&(io(d.getTextContent().slice(v,y))||(c?f.offset=x:u.offset=x))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&oe(r.getParent())&&r.getIndexWithinParent()===0&&r.collapseAtStart(this)}}deleteLine(e){if(this.isCollapsed()){const t=this.anchor.type==="element";if(t&&this.insertText(" "),this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character"),t){const r=e?this.anchor:this.focus;r.set(r.key,r.offset+1,r.type)}}this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ce(n){return n instanceof Bn}function Wo(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function ni(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Wo(t),Wo(r)]}function Bo(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let c=0;c<o;c++){const u=c===o-1;if(l=s,s+=i[c].length,e&&s===t||s>t||u){i.splice(c,1),u&&(l=void 0);break}}const a=i.join("").trim();a===""?r.remove():(r.setTextContent(a),r.select(l,l))}function zo(n,e,t,r){let i,o=e;if(n.nodeType===At){let s=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;o===a&&(s=!0,o=a-1);let u=l[o],f=!1;if(u===c)u=l[o+1],f=!0;else if(c!==null){const d=c.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,c)&&o--}if(i=ht(u),j(i))o=ro(i,s);else{let d=ht(n);if(d===null)return null;if(C(d)){o=Math.min(d.getChildrenSize(),o);let h=d.getChildAtIndex(o);if(C(h)&&function(g,m,_){const v=g.getParent();return _===null||v===null||!v.canBeEmpty()||v!==_.getNode()}(h,0,t)){const g=s?h.getLastDescendant():h.getFirstDescendant();g===null?d=h:(h=g,d=C(h)?h:h.getParentOrThrow()),o=0}j(h)?(i=h,d=null,o=ro(h,s)):h!==d&&s&&!f&&o++}else{const h=d.getIndexWithinParent();o=e===0&&U(d)&&ht(n)===d?h:h+1,d=d.getParentOrThrow()}if(C(d))return Ee(d.__key,o,"element")}}else i=ht(n);return j(i)?Ee(i.__key,o,"text"):null}function Ko(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const o=i.getPreviousSibling(),s=i.getParent();if(e){if((t||!e)&&o===null&&C(s)&&s.isInline()){const l=s.getPreviousSibling();j(l)&&(n.key=l.__key,n.offset=l.getTextContent().length)}}else C(o)&&!t&&o.isInline()?(n.key=o.__key,n.offset=o.getChildrenSize(),n.type="element"):j(o)&&(n.key=o.__key,n.offset=o.getTextContent().length)}else if(r===i.getTextContent().length){const o=i.getNextSibling(),s=i.getParent();if(e&&C(o)&&o.isInline())n.key=o.__key,n.offset=0,n.type="element";else if((t||e)&&o===null&&C(s)&&s.isInline()&&!s.canInsertTextAfter()){const l=s.getNextSibling();j(l)&&(n.key=l.__key,n.offset=0)}}}function Uo(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Ko(n,r,i),Ko(e,!r,i),i&&(e.key=n.key,e.offset=n.offset,e.type=n.type);const o=G();if(o.isComposing()&&o._compositionKey!==n.key&&O(t)){const s=t.anchor,l=t.focus;Ve(n,s.key,s.offset,s.type),Ve(e,l.key,l.offset,l.type)}}}function Vo(n,e,t,r,i,o){if(n===null||t===null||!Lt(i,n,t))return null;const s=zo(n,e,O(o)?o.anchor:null,i);if(s===null)return null;const l=zo(t,r,O(o)?o.focus:null,i);if(l===null)return null;if(s.type==="element"&&l.type==="element"){const a=ht(n),c=ht(t);if(U(a)&&U(c))return null}return Uo(s,l,o),[s,l]}function ri(n){return C(n)&&!n.isInline()}function Jo(n,e,t,r,i,o){const s=Ie(),l=new Je(Ee(n,e,i),Ee(t,r,o),0,"");return l.dirty=!0,s._selection=l,l}function oa(){const n=Ee("root",0,"element"),e=Ee("root",0,"element");return new Je(n,e,0,"")}function Yo(){return new Bn(new Set)}function ii(n,e,t,r){const i=t._window;if(i===null)return null;const o=r||i.event,s=o?o.type:void 0,l=s==="selectionchange",a=!Cr&&(l||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&o&&o.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(O(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,f=e.anchorOffset,d=e.focusOffset,l&&O(n)&&!Lt(t,c,u))return n.clone();const h=Vo(c,f,u,d,t,n);if(h===null)return null;const[g,m]=h;return new Je(g,m,O(n)?n.format:0,O(n)?n.style:"")}function M(){return Ie()._selection}function Qt(){return G()._editorState._selection}function zn(n,e,t,r=1){const i=n.anchor,o=n.focus,s=i.getNode(),l=o.getNode();if(!e.is(s)&&!e.is(l))return;const a=e.__key;if(n.isCollapsed()){const c=i.offset;if(t<=c&&r>0||t<c&&r<0){const u=Math.max(0,c+r);i.set(a,u,"element"),o.set(a,u,"element"),Ho(n)}}else{const c=n.isBackward(),u=c?o:i,f=u.getNode(),d=c?i:o,h=d.getNode();if(e.is(f)){const g=u.offset;(t<=g&&r>0||t<g&&r<0)&&u.set(a,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(a,Math.max(0,g+r),"element")}}Ho(n)}function Ho(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,o=e.getNode(),s=r.getNode();if(n.isCollapsed()){if(!C(o))return;const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}}else{if(C(o)){const l=o.getChildrenSize(),a=t>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(t);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(C(s)){const l=s.getChildrenSize(),a=i>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(i);if(j(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}}function Kn(n,e,t,r,i){let o=null,s=0,l=null;r!==null?(o=r.__key,j(r)?(s=r.getTextContentSize(),l="text"):C(r)&&(s=r.getChildrenSize(),l="element")):i!==null&&(o=i.__key,j(i)?l="text":C(i)&&(l="element")),o!==null&&l!==null?n.set(o,s,l):(s=e.getIndexWithinParent(),s===-1&&(s=t.getChildrenSize()),n.set(t.__key,s,"element"))}function qo(n,e,t,r,i){n.type==="text"?(n.key=t,e||(n.offset+=i)):n.offset>r.getIndexWithinParent()&&(n.offset-=1)}function sa(n,e,t,r,i,o,s){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(i.has("collaboration")&&f!==o||f!==null&&Tr(f))return;if(!O(e))return void(n!==null&&Lt(t,l,a)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,_=En(t,g),v=En(t,m),y=d.offset,x=h.offset,k=e.format,S=e.style,w=e.isCollapsed();let P=_,T=v,N=!1;if(d.type==="text"){P=Sn(_);const q=d.getNode();N=q.getFormat()!==k||q.getStyle()!==S}else O(n)&&n.anchor.type==="text"&&(N=!0);var F,R,H,V,W;if(h.type==="text"&&(T=Sn(v)),P!==null&&T!==null&&(w&&(n===null||N||O(n)&&(n.format!==k||n.style!==S))&&(F=k,R=S,H=y,V=g,W=performance.now(),To=[F,R,H,V,W]),c!==y||u!==x||l!==P||a!==T||r.type==="Range"&&w||(f!==null&&o.contains(f)||o.focus({preventScroll:!0}),d.type==="element"))){try{r.setBaseAndExtent(P,y,T,x)}catch{}if(!i.has("skip-scroll-into-view")&&e.isCollapsed()&&o!==null&&o===document.activeElement){const q=e instanceof Je&&e.anchor.type==="element"?P.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(q!==null){let ce;if(q instanceof Text){const Fe=document.createRange();Fe.selectNode(q),ce=Fe.getBoundingClientRect()}else ce=q.getBoundingClientRect();(function(Fe,He,sn){const ln=sn.ownerDocument,an=ln.defaultView;if(an===null)return;let{top:wt,bottom:St}=He,Tt=0,kt=0,me=sn;for(;me!==null;){const ot=me===ln.body;if(ot)Tt=0,kt=Pn(Fe).innerHeight;else{const qe=me.getBoundingClientRect();Tt=qe.top,kt=qe.bottom}let Oe=0;if(wt<Tt?Oe=-(Tt-wt):St>kt&&(Oe=St-kt),Oe!==0)if(ot)an.scrollBy(0,Oe);else{const qe=me.scrollTop;me.scrollTop+=Oe;const st=me.scrollTop-qe;wt-=st,St-=st}if(ot)break;me=Nn(me)}})(t,ce,o)}}Hr=!0}}function la(n){let e=M()||Qt();e===null&&(e=Q().selectEnd()),e.insertNodes(n)}function oi(n){let e=n;n.isCollapsed()||e.removeText();const t=M();O(t)&&(e=t),O(e)||A(161);const r=e.anchor;let i=r.getNode(),o=r.offset;for(;!pt(i);)[i,o]=aa(i,o);return o}function aa(n,e){const t=n.getParent();if(!t){const i=Ne();return Q().append(i),i.select(),[Q(),0]}if(j(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,i[0].getIndexWithinParent()+o]}if(!C(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Je(Ee(n.__key,e,"element"),Ee(n.__key,e,"element"),0,""),o=n.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}let te=null,ne=null,fe=!1,si=!1,Un=0;const Go={characterData:!0,childList:!0,subtree:!0};function Zt(){return fe||te!==null&&te._readOnly}function he(){fe&&A(13)}function Xo(){Un>99&&A(14)}function Ie(){return te===null&&A(195,Qo()),te}function G(){return ne===null&&A(196,Qo()),ne}function Qo(){let n=0;const e=new Set,t=Jn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const o=wn(i);if(kr(o))n++;else if(o){let s=String(o.constructor.version||"<0.17.1");s===t&&(s+=" (separately built, likely a bundler configuration issue)"),e.add(s)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ca(){return ne}function Zo(n,e,t){const r=e.__type,i=function(l,a){const c=l._nodes.get(a);return c===void 0&&A(30,a),c}(n,r);let o=t.get(r);o===void 0&&(o=Array.from(i.transforms),t.set(r,o));const s=o.length;for(let l=0;l<s&&(o[l](e),e.isAttached());l++);}function es(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function ua(n){return li(n,G()._nodes)}function li(n,e){const t=n.type,r=e.get(t);r===void 0&&A(17,t);const i=r.klass;n.type!==i.getType()&&A(18,i.name);const o=i.importJSON(n),s=n.children;if(C(o)&&Array.isArray(s))for(let l=0;l<s.length;l++){const a=li(s[l],e);o.append(a)}return o}function ts(n,e,t){const r=te,i=fe,o=ne;te=e,fe=!0,ne=n;try{return t()}finally{te=r,fe=i,ne=o}}function Ye(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const o=n._editorState,s=o._selection,l=t._selection,a=n._dirtyType!==Xe,c=te,u=fe,f=ne,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){ne=n,te=t,fe=!1,n._updating=!0;try{const w=n._dirtyType,P=n._dirtyElements,T=n._dirtyLeaves;h.disconnect(),g=ql(o,t,n,w,P,T)}catch(w){if(w instanceof Error&&n._onError(w),si)throw w;return ls(n,null,r,t),Ji(n),n._dirtyType=dt,si=!0,Ye(n,o),void(si=!1)}finally{h.observe(r,Go),n._updating=d,te=c,fe=u,ne=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,_=n._dirtyElements,v=n._normalizedNodes,y=n._updateTags,x=n._deferred;a&&(n._dirtyType=Xe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),function(w,P){const T=w._decorators;let N=w._pendingDecorators||T;const F=P._nodeMap;let R;for(R in N)F.has(R)||(N===T&&(N=eo(w)),delete N[R])}(n,t);const k=i?null:Te(n._window);if(n._editable&&k!==null&&(a||l===null||l.dirty)){ne=n,te=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const w=n._blockCursorElement;w!==null&&Ir(w,n,r),sa(s,l,n,k,y,r)}zl(n,r,l),h!==null&&h.observe(r,Go)}finally{ne=f,te=c}}g!==null&&function(w,P,T,N,F){const R=Array.from(w._listeners.mutation),H=R.length;for(let V=0;V<H;V++){const[W,q]=R[V],ce=P.get(q);ce!==void 0&&W(ce,{dirtyLeaves:N,prevEditorState:F,updateTags:T})}}(n,g,y,m,o),O(l)||l===null||s!==null&&s.is(l)||n.dispatchCommand(dn,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,en("decorator",n,!0,S)),function(w,P,T){const N=to(P),F=to(T);N!==F&&en("textcontent",w,!0,F)}(n,e||o,t),en("update",n,!0,{dirtyElements:_,dirtyLeaves:m,editorState:t,normalizedNodes:v,prevEditorState:e||o,tags:y}),function(w,P){if(w._deferred=[],P.length!==0){const T=w._updating;w._updating=!0;try{for(let N=0;N<P.length;N++)P[N]()}finally{w._updating=T}}}(n,x),function(w){const P=w._updates;if(P.length!==0){const T=P.shift();if(T){const[N,F]=T;is(w,N,F)}}}(n)}function en(n,e,t,...r){const i=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let s=0;s<o.length;s++)o[s].apply(null,r)}finally{e._updating=i}}function ns(n,e,t){if(n._updating===!1||ne!==n){let i=!1;return n.update(()=>{i=ns(n,e,t)}),i}const r=Nr(n);for(let i=4;i>=0;i--)for(let o=0;o<r.length;o++){const s=r[o]._commands.get(e);if(s!==void 0){const l=s[i];if(l!==void 0){const a=Array.from(l),c=a.length;for(let u=0;u<c;u++)if(a[u](t,n)===!0)return!0}}}return!1}function rs(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[o,s]=i;let l,a;if(s!==void 0){if(l=s.onUpdate,a=s.tag,s.skipTransforms&&(r=!0),s.discrete){const c=n._pendingEditorState;c===null&&A(191),c._flushSync=!0}l&&n._deferred.push(l),a&&n._updateTags.add(a)}o()}}return r}function is(n,e,t){const r=n._updateTags;let i,o,s=!1,l=!1;t!==void 0&&(i=t.onUpdate,o=t.tag,o!=null&&r.add(o),s=t.skipTransforms||!1,l=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let c=n._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=n._pendingEditorState=new Vn(new Map((c||a)._nodeMap)),u=!0),c._flushSync=l;const f=te,d=fe,h=ne,g=n._updating;te=c,fe=!1,n._updating=!0,ne=n;try{u&&(n._headless?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=function(y){const x=y.getEditorState()._selection,k=Te(y._window);return O(x)||x==null?ii(x,k,y,null):x.clone()}(n));const _=n._compositionKey;e(),s=rs(n,s),function(y,x){const k=x.getEditorState()._selection,S=y._selection;if(O(S)){const w=S.anchor,P=S.focus;let T;if(w.type==="text"&&(T=w.getNode(),T.selectionTransform(k,S)),P.type==="text"){const N=P.getNode();T!==N&&N.selectionTransform(k,S)}}}(c,n),n._dirtyType!==Xe&&(s?function(y,x){const k=x._dirtyLeaves,S=y._nodeMap;for(const w of k){const P=S.get(w);j(P)&&P.isAttached()&&P.isSimpleText()&&!P.isUnmergeable()&&qi(P)}}(c,n):function(y,x){const k=x._dirtyLeaves,S=x._dirtyElements,w=y._nodeMap,P=ze(),T=new Map;let N=k,F=N.size,R=S,H=R.size;for(;F>0||H>0;){if(F>0){x._dirtyLeaves=new Set;for(const V of N){const W=w.get(V);j(W)&&W.isAttached()&&W.isSimpleText()&&!W.isUnmergeable()&&qi(W),W!==void 0&&es(W,P)&&Zo(x,W,T),k.add(V)}if(N=x._dirtyLeaves,F=N.size,F>0){Un++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map;for(const V of R){const W=V[0],q=V[1];if(W!=="root"&&!q)continue;const ce=w.get(W);ce!==void 0&&es(ce,P)&&Zo(x,ce,T),S.set(W,q)}N=x._dirtyLeaves,F=N.size,R=x._dirtyElements,H=R.size,Un++}x._dirtyLeaves=k,x._dirtyElements=S}(c,n),rs(n),function(y,x,k,S){const w=y._nodeMap,P=x._nodeMap,T=[];for(const[N]of S){const F=P.get(N);F!==void 0&&(F.isAttached()||(C(F)&&po(F,N,w,P,T,S),w.has(N)||S.delete(N),T.push(N)))}for(const N of T)P.delete(N);for(const N of k){const F=P.get(N);F===void 0||F.isAttached()||(w.has(N)||k.delete(N),P.delete(N))}}(a,c,n._dirtyLeaves,n._dirtyElements)),_!==n._compositionKey&&(c._flushSync=!0);const v=c._selection;if(O(v)){const y=c._nodeMap,x=v.anchor.key,k=v.focus.key;y.get(x)!==void 0&&y.get(k)!==void 0||A(19)}else Ce(v)&&v._nodes.size===0&&(c._selection=null)}catch(_){return _ instanceof Error&&n._onError(_),n._pendingEditorState=a,n._dirtyType=dt,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void Ye(n)}finally{te=f,fe=d,ne=h,n._updating=g,Un=0}n._dirtyType!==Xe||function(_,v){const y=v.getEditorState()._selection,x=_._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1}(c,n)?c._flushSync?(c._flushSync=!1,Ye(n)):u&&Fl(()=>{Ye(n)}):(c._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function ge(n,e,t){n._updating?n._updates.push([e,t]):is(n,e,t)}class tn extends $n{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}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}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return El[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=G()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(j(t)&&e.push(t),C(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;C(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;C(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return C(o)&&o.getLastDescendant()||o||null}const i=t[e];return C(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:se(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&A(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:se(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&A(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContent(),C(o)&&i!==r-1&&!o.isInline()&&(e+=De)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const o=t[i];e+=o.getTextContentSize(),C(o)&&i!==r-1&&!o.isInline()&&(e+=De.length)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){if(e!==""){const t=Ki[e];return!!(this.getFormat()&t)}return!1}select(e,t){he();const r=M();let i=e,o=t;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(j(a)||C(a))return a.select(0,0)}else if(!(e!==void 0&&e!==s||t!==void 0&&t!==s)){const a=this.getLastChild();if(j(a)||C(a))return a.select()}}i===void 0&&(i=s),o===void 0&&(o=s);const l=this.__key;return O(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0,r):Jo(l,i,l,o,"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(t=>t.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!==""?Ki[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){const i=r.length,o=this.getChildrenSize(),s=this.getWritable(),l=s.__key,a=[],c=[],u=this.getChildAtIndex(e+t);let f=null,d=o-t+i;if(e!==0)if(e===o)f=this.getLastChild();else{const g=this.getChildAtIndex(e);g!==null&&(f=g.getPreviousSibling())}if(t>0){let g=f===null?this.getFirstChild():f.getNextSibling();for(let m=0;m<t;m++){g===null&&A(100);const _=g.getNextSibling(),v=g.__key;Qe(g.getWritable()),c.push(v),g=_}}let h=f;for(let g=0;g<i;g++){const m=r[g];h!==null&&m.is(h)&&(f=h=h.getPreviousSibling());const _=m.getWritable();_.__parent===l&&d--,Qe(_);const v=m.__key;if(h===null)s.__first=v,_.__prev=null;else{const y=h.getWritable();y.__next=v,_.__prev=y.__key}m.__key===l&&A(76),_.__parent=l,a.push(v),h=m}if(e+t===o)h!==null&&(h.getWritable().__next=null,s.__last=h.__key);else if(u!==null){const g=u.getWritable();if(h!==null){const m=h.getWritable();g.__prev=h.__key,m.__next=u.__key}else g.__prev=null}if(s.__size=d,c.length){const g=M();if(O(g)){const m=new Set(c),_=new Set(a),{anchor:v,focus:y}=g;os(v,m,_)&&Kn(v,v.getNode(),this,f,u),os(y,m,_)&&Kn(y,y.getNode(),this,f,u),d!==0||this.canBeEmpty()||gt(this)||this.remove()}}return s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}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,r){return!1}canMergeWhenEmpty(){return!1}}function C(n){return n instanceof tn}function os(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class da extends $n{constructor(e){super(e)}decorate(e,t){A(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function U(n){return n instanceof da}class nn extends tn{static getType(){return"root"}static clone(){return new nn}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){A(51)}getTextContent(){const e=this.__cachedText;return!Zt()&&G()._dirtyType!==Xe||e===null?super.getTextContent():e}remove(){A(52)}replace(e){A(53)}insertBefore(e){A(54)}insertAfter(e){A(55)}updateDOM(e,t){return!1}append(...e){for(let t=0;t<e.length;t++){const r=e[t];C(r)||U(r)||A(56)}return super.append(...e)}static importJSON(e){const t=Q();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function oe(n){return n instanceof nn}function ai(){return new Vn(new Map([["root",new nn]]))}function ss(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&A(130,t.name),C(n)){const r=e.children;Array.isArray(r)||A(59,t.name);const i=n.getChildren();for(let o=0;o<i.length;o++){const s=ss(i[o]);r.push(s)}}return e}class Vn{constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ts(t&&t.editor||null,this,e)}clone(e){const t=new Vn(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return ts(null,this,()=>({root:ss(Q())}))}}class ci extends tn{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class xt extends tn{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=je[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new xt(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),r=$t(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:fa,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&On(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();t.style.textAlign=r;const i=this.getDirection();i&&(t.dir=i);const o=this.getIndent();o>0&&(t.style.textIndent=20*o+"px")}return{element:t}}static importJSON(e){const t=Ne();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const r=Ne();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getTextStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||j(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function fa(n){const e=Ne();if(n.style){e.setFormat(n.style.textAlign);const t=parseInt(n.style.textIndent,10)/20;t>0&&e.setIndent(t)}return{node:e}}function Ne(){return Wt(new xt)}function ui(n){return n instanceof xt}const K=0,ha=4;function ls(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=ai(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=Xe,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function ga(n){const e=n||{},t=ca(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,s=ai(),l=e.namespace||(i!==null?i._config.namespace:oo()),a=e.editorState,c=[nn,yt,Ht,Gt,xt,ci,...e.nodes||[]],{onError:u,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<c.length;m++){let _=c[m],v=null,y=null;if(typeof _!="function"){const w=_;_=w.replace,v=w.with,y=w.withKlass||null}const x=_.getType(),k=_.transform(),S=new Set;k!==null&&S.add(k),h.set(x,{exportDOM:f&&f.export?f.export.get(_):void 0,klass:_,replace:v,replaceWithKlass:y,transforms:S})}}const g=new Jn(s,i,h,{disableEvents:o,namespace:l,theme:r},u||console.error,function(m,_){const v=new Map,y=new Set,x=k=>{Object.keys(k).forEach(S=>{let w=v.get(S);w===void 0&&(w=[],v.set(S,w)),w.push(k[S])})};return m.forEach(k=>{const S=k.klass.importDOM;if(S==null||y.has(S))return;y.add(S);const w=S.call(k.klass);w!==null&&x(w)}),_&&x(_),v}(h,f?f.import:void 0),d);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=dt),g}class Jn{constructor(e,t,r,i,o,s,l){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=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=Xe,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=oo(),this._onError=o,this._htmlConversions=s,this._editable=l,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}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,r){r===void 0&&A(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=i.get(e);o===void 0&&A(36,String(e));const s=o[r];return s.add(t),()=>{s.delete(t),o.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,i);const s=r&&r.skipInitialization;return s===void 0||s||this.initializeMutationListener(t,i),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&A(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Jl(r).get(t.getType());if(!i)return;const o=new Map;for(const s of i.keys())o.set(s,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),i=[r],o=r.replaceWithKlass;if(o!=null){const a=this.registerNodeTransformToKlass(o,t);i.push(a)}var s,l;return s=this,l=e.getType(),ge(s,()=>{const a=Ie();if(a.isEmpty())return;if(l==="root")return void Q().markDirty();const c=a._nodeMap;for(const[,u]of c)u.markDirty()},s._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{i.forEach(a=>a.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return I(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 r=$t(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,ls(this,t,e,i),t!==null&&(this._config.disableEvents||Gl(t),r!=null&&t.classList.remove(...r)),e!==null){const o=function(l){const a=l.ownerDocument;return a&&a.defaultView||null}(e),s=e.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=dt,Ji(this),this._updateTags.add("history-merge"),Ye(this),this._config.disableEvents||function(l,a){const c=l.ownerDocument,u=Mn.get(c);(u===void 0||u<1)&&c.addEventListener("selectionchange",Do),Mn.set(c,(u||0)+1),l.__lexicalEditor=a;const f=Oo(l);for(let d=0;d<Yr.length;d++){const[h,g]=Yr[d],m=typeof g=="function"?_=>{Ao(_)||(jo(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(Ao(_))return;jo(_);const v=a.isEditable();switch(h){case"cut":return v&&I(a,dr,_);case"copy":return I(a,mn,_);case"paste":return v&&I(a,ar,_);case"dragstart":return v&&I(a,Mi,_);case"dragover":return v&&I(a,$i,_);case"dragend":return v&&I(a,ul,_);case"focus":return v&&I(a,hl,_);case"blur":return v&&I(a,gl,_);case"drop":return v&&I(a,Fi,_)}};l.addEventListener(h,m),f.push(()=>{l.removeEventListener(h,m)})}}(e,this),r!=null&&e.classList.add(...r)}else this._editorState=i,this._pendingEditorState=null,this._window=null;en("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&A(38),Vi(this);const r=this._pendingEditorState,i=this._updateTags,o=t!==void 0?t.tag:null;r===null||r.isEmpty()||(o!=null&&i.add(o),Ye(this)),this._pendingEditorState=e,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&i.add(o),Ye(this)}parseEditorState(e,t){return function(r,i,o){const s=ai(),l=te,a=fe,c=ne,u=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,te=s,fe=!1,ne=i;try{const g=i._nodes;li(r.root,g),o&&o(),s._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=h,te=l,fe=a,ne=c}return s}(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Ye(this),this.getEditorState().read(e,{editor:this})}update(e,t){ge(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),ge(this,()=>{const i=M(),o=Q();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Te(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,en("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Jn.version="0.17.1+prod.esm";const cu="";function pa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ma=pa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const as=D.createContext(null);function _a(n,e){let t=null;return n!=null&&(t=n[1]),{getTheme:function(){return e??(t!=null?t.getTheme():null)}}}function rt(){const n=D.useContext(as);return n==null&&ma(8),n}const cs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ya=cs?D.useLayoutEffect:D.useEffect,Yn={tag:"history-merge"};function xa({initialConfig:n,children:e}){const t=D.useMemo(()=>{const{theme:r,namespace:i,nodes:o,onError:s,editorState:l,html:a}=n,c=_a(null,r),u=ga({editable:n.editable,html:a,namespace:i,nodes:o,onError:f=>s(f,u),theme:r});return function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=Q();if(h.isEmpty()){const g=Ne();h.append(g);const m=cs?document.activeElement:null;(M()!==null||m!==null&&m===f.getRootElement())&&g.select()}},Yn);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Yn);break}case"object":f.setEditorState(d,Yn);break;case"function":f.update(()=>{Q().isEmpty()&&d(f)},Yn)}}}(u,l),[u,c]},[]);return ya(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),b.jsx(as.Provider,{value:t,children:e})}function va({defaultSelection:n}){const[e]=rt();return D.useEffect(()=>{e.focus(()=>{const t=document.activeElement,r=e.getRootElement();r===null||t!==null&&r.contains(t)||r.focus({preventScroll:!0})},{defaultSelection:n})},[n,e]),null}function ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ca=ba(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const di=new Map;function us(n){const e={},t=n.split(";");for(const r of t)if(r!==""){const[i,o]=r.split(/:([^]+)/);i&&o&&(e[i.trim()]=o.trim())}return e}function ds(n){let e=di.get(n);return e===void 0&&(e=us(n),di.set(n,e)),e}function fs(n,e){const t=n.getStartEndPoints();if(e.isSelected(n)&&!e.isSegmented()&&!e.isToken()&&t!==null){const[r,i]=t,o=n.isBackward(),s=r.getNode(),l=i.getNode(),a=e.is(s),c=e.is(l);if(a||c){const[u,f]=ni(n),d=s.is(l),h=e.is(o?l:s),g=e.is(o?s:l);let m,_=0;return d?(_=u>f?f:u,m=u>f?u:f):h?(_=o?f:u,m=void 0):g&&(_=0,m=o?u:f),e.__text=e.__text.slice(_,m),e}}return e}function hs(n){if(n.type==="text")return n.offset===n.getNode().getTextContentSize();const e=n.getNode();return C(e)||Ca(177),n.offset===e.getChildrenSize()}function wa(n){const e=n.getStyle(),t=us(e);di.set(e,t)}function gs(n,e){const t=Rt(n.focus,e);return U(t)&&!t.isIsolated()||C(t)&&!t.isInline()&&!t.canBeEmpty()}function Sa(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ps(n){const e=n.anchor.getNode();return(oe(e)?e:e.getParentOrThrow()).getDirection()==="rtl"}function ms(n,e,t){const r=ps(n);Sa(n,e,t?!r:r,"character")}function Ta(n,e,t){const r=ds(n.getStyle());return r!==null&&r[e]||t}function ka(n,e,t=""){let r=null;const i=n.getNodes(),o=n.anchor,s=n.focus,l=n.isBackward(),a=l?s.offset:o.offset,c=l?s.getNode():o.getNode();if(O(n)&&n.isCollapsed()&&n.style!==""){const u=ds(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const f=i[u];if((u===0||a!==0||!f.is(c))&&j(f)){const d=Ta(f,e,t);if(r===null)r=d;else if(r!==d){r="";break}}}return r===null?t:r}function Ea(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Na=Ea(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const _s=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Pa=_s&&"documentMode"in document?document.documentMode:null;!(!_s||!("InputEvent"in window)||Pa)&&"getTargetRanges"in new window.InputEvent("input");function Oa(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function vt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}function Da(n,...e){const t=Oa(...e);t.length>0&&n.classList.add(...t)}function ja(n){const e=Hn(n,t=>C(t)&&!t.isInline());return C(e)||Na(4,n.__key),e}const Hn=(n,e)=>{let t=n;for(;t!==Q()&&t!=null;){if(e(t))return t;t=t.getParent()}return null};function it(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}const qn=0,fi=1,hi=2,we=0,Aa=1,ys=2,La=3,Ia=4;function Fa(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return we;const o=e._selection,s=n._selection;if(i)return Aa;if(!(O(o)&&O(s)&&s.isCollapsed()&&o.isCollapsed()))return we;const l=function(v,y,x){const k=v._nodeMap,S=[];for(const w of y){const P=k.get(w);P!==void 0&&S.push(P)}for(const[w,P]of x){if(!P)continue;const T=k.get(w);T===void 0||oe(T)||S.push(T)}return S}(e,t,r);if(l.length===0)return we;if(l.length>1){const v=e._nodeMap,y=v.get(o.anchor.key),x=v.get(s.anchor.key);return y&&x&&!n._nodeMap.has(y.__key)&&j(y)&&y.__text.length===1&&o.anchor.offset===1?ys:we}const a=l[0],c=n._nodeMap.get(a.__key);if(!j(c)||!j(a)||c.__mode!==a.__mode)return we;const u=c.__text,f=a.__text;if(u===f)return we;const d=o.anchor,h=s.anchor;if(d.key!==h.key||d.type!=="text")return we;const g=d.offset,m=h.offset,_=f.length-u.length;return _===1&&m===g-1?ys:_===-1&&m===g+1?La:_===-1&&m===g?Ia:we}function Ma(n,e){let t=Date.now(),r=we;return(i,o,s,l,a,c)=>{const u=Date.now();if(c.has("historic"))return r=we,t=u,hi;const f=Fa(i,o,l,a,n.isComposing()),d=(()=>{const h=s===null||s.editor===n,g=c.has("history-push");if(!g&&h&&c.has("history-merge"))return qn;if(i===null)return fi;const m=o._selection;return l.size>0||a.size>0?g===!1&&f!==we&&f===r&&u<t+e&&h||l.size===1&&function(_,v,y){const x=v._nodeMap.get(_),k=y._nodeMap.get(_),S=v._selection,w=y._selection;return!(O(S)&&O(w)&&S.anchor.type==="element"&&S.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"||!j(x)||!j(k)||x.__parent!==k.__parent)&&JSON.stringify(v.read(()=>x.exportJSON()))===JSON.stringify(y.read(()=>k.exportJSON()))}(Array.from(l)[0],i,o)?qn:fi:m!==null?qn:hi})();return t=u,r=f,d}}function xs(n){n.undoStack=[],n.redoStack=[],n.current=null}function $a(n,e,t){const r=Ma(n,t);return vt(n.registerCommand(hn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(a.length!==0){const c=s.current,u=a.pop();c!==null&&(l.push(c),o.dispatchCommand(Dt,!0)),a.length===0&&o.dispatchCommand(jt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(gn,()=>(function(o,s){const l=s.redoStack,a=s.undoStack;if(l.length!==0){const c=s.current;c!==null&&(a.push(c),o.dispatchCommand(jt,!0));const u=l.pop();l.length===0&&o.dispatchCommand(Dt,!1),s.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}}(n,e),!0),K),n.registerCommand(dl,()=>(xs(e),!1),K),n.registerCommand(fl,()=>(xs(e),n.dispatchCommand(Dt,!1),n.dispatchCommand(jt,!1),!0),K),n.registerUpdateListener(({editorState:o,prevEditorState:s,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,f=e.redoStack,d=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&o===h)return;const g=r(s,o,u,l,a,c);if(g===fi)f.length!==0&&(e.redoStack=[],n.dispatchCommand(Dt,!1)),u!==null&&(d.push({...u}),n.dispatchCommand(jt,!0));else if(g===hi)return;e.current={editor:n,editorState:o}}))}function Ra(){return{current:null,redoStack:[],undoStack:[]}}function Wa({delay:n,externalHistoryState:e}){const[t]=rt();return function(r,i,o=1e3){const s=D.useMemo(()=>i||Ra(),[i]);D.useEffect(()=>$a(r,s,o),[o,r,s])}(t,e,n),null}const Ba=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function za(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function Ka(){return function(n){const[e]=rt(),t=D.useMemo(()=>n(e),[e,n]),r=D.useRef(t.initialValueFn()),[i,o]=D.useState(r.current);return Ba(()=>{const{initialValueFn:s,subscribe:l}=t,a=s();return r.current!==a&&(r.current=a,o(a)),l(c=>{r.current=c,o(c)})},[t,n]),i}(za)}function Ua(){return Q().getTextContent()}function Va(n,e=!0){if(n)return!1;let t=Ua();return e&&(t=t.trim()),t===""}function Ja(n){if(!Va(n,!1))return!1;const e=Q().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(U(i))return!1;if(C(i)){if(!ui(i)||i.__indent!==0)return!1;const o=i.getChildren(),s=o.length;for(let l=0;l<s;l++){const a=o[r];if(!j(a))return!1}}}return!0}function vs(n){return()=>Ja(n)}function Ya(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}Ya(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Ha(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const o=r.data;if(typeof o=="string"){let s;try{s=JSON.parse(o)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const l=s.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,f,d,h,g]=a;n.update(()=>{const m=M();if(O(m)){const _=m.anchor;let v=_.getNode(),y=0,x=0;if(j(v)&&c>=0&&u>=0&&(y=c,x=c+u,m.setTextNodeRange(v,y,v,x)),y===x&&f===""||(m.insertRawText(f),v=_.getNode()),j(v)){y=d,x=d+h;const k=v.getTextContentSize();y=y>k?k:y,x=x>k?k:x,m.setTextNodeRange(v,y,v,x)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function qa(n,e){const t=e.body?e.body.childNodes:[];let r=[];const i=[];for(let o=0;o<t.length;o++){const s=t[o];if(!Cs.has(s.nodeName)){const l=ws(s,n,i,!1);l!==null&&(r=r.concat(l))}}return function(o){for(const s of o)s.getNextSibling()instanceof ci&&s.insertAfter(nt());for(const s of o){const l=s.getChildren();for(const a of l)s.insertBefore(a);s.remove()}}(i),r}function Ga(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=Q().getChildren();for(let i=0;i<r.length;i++)bs(n,r[i],t,e);return t.innerHTML}function bs(n,e,t,r=null){let i=r===null||e.isSelected(r);const o=C(e)&&e.excludeFromCopy("html");let s=e;if(r!==null){let h=$r(e);h=j(h)&&r!==null?fs(r,h):h,s=h}const l=C(s)?s.getChildren():[],a=n._nodes.get(s.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,s):s.exportDOM(n);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],m=bs(n,g,d,r);!i&&C(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!o){if(On(u)&&u.append(d),t.append(u),f){const h=f.call(s,u);h&&u.replaceWith(h)}}else t.append(d);return i}const Cs=new Set(["STYLE","SCRIPT"]);function ws(n,e,t,r,i=new Map,o){let s=[];if(Cs.has(n.nodeName))return s;let l=null;const a=function(g,m){const{nodeName:_}=g,v=m._htmlConversions.get(_.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const k=x(g);k!==null&&(y===null||(y.priority||0)<(k.priority||0))&&(y=k)}return y!==null?y.conversion:null}(n,e),c=a?a(n):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(l=Array.isArray(g)?g[g.length-1]:g,l!==null){for(const[,m]of i)if(l=m(l,o),!l)break;l&&s.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const f=n.childNodes;let d=[];const h=(l==null||!gt(l))&&(l!=null&&ri(l)||r);for(let g=0;g<f.length;g++)d.push(...ws(f[g],e,t,h,new Map(i),l));return u!=null&&(d=u(d)),Dn(n)&&(d=Xa(n,d,h?()=>{const g=new ci;return t.push(g),g}:Ne)),l==null?d.length>0?s=s.concat(d):Dn(n)&&function(g){return g.nextSibling==null||g.previousSibling==null?!1:Fr(g.nextSibling)&&Fr(g.previousSibling)}(n)&&(s=s.concat(nt())):C(l)&&l.append(...d),s}function Xa(n,e,t){const r=n.style.textAlign,i=[];let o=[];for(let s=0;s<e.length;s++){const l=e[s];if(ri(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(o.push(l),s===e.length-1||s<e.length-1&&ri(e[s+1])){const a=t();a.setFormat(r),a.append(...o),i.push(a),o=[]}}return i}function Qa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Gn=Qa(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Za=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Ss=n=>Za?(n||window).getSelection():null;function ec(n,e=M()){return e==null&&Gn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":Ga(n,e)}function tc(n,e=M()){return e==null&&Gn(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(nc(n,e))}function Ts(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const s=JSON.parse(r);if(s.namespace===t._config.namespace&&Array.isArray(s.nodes))return ks(t,rc(s.nodes),e)}catch{}const i=n.getData("text/html");if(i)try{const s=new DOMParser().parseFromString(i,"text/html");return ks(t,qa(t,s),e)}catch{}const o=n.getData("text/plain")||n.getData("text/uri-list");if(o!=null)if(O(e)){const s=o.split(/(\r?\n|\t)/);s[s.length-1]===""&&s.pop();for(let l=0;l<s.length;l++){const a=M();if(O(a)){const c=s[l];c===`
|
|
40
|
+
`||c===`\r
|
|
41
|
+
`?a.insertParagraph():c===" "?a.insertNodes([Xt()]):a.insertText(c)}}}else e.insertRawText(o)}function ks(n,e,t){n.dispatchCommand(rl,{nodes:e,selection:t})||t.insertNodes(e)}function Es(n,e,t,r=[]){let i=e===null||t.isSelected(e);const o=C(t)&&t.excludeFromCopy("html");let s=t;if(e!==null){let c=$r(t);c=j(c)&&e!==null?fs(e,c):c,s=c}const l=C(s)?s.getChildren():[],a=function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Gn(58,f.name),C(c)){const d=u.children;Array.isArray(d)||Gn(59,f.name)}return u}(s);if(j(s)){const c=s.__text;c.length>0?a.text=c:i=!1}for(let c=0;c<l.length;c++){const u=l[c],f=Es(n,e,u,a.children);!i&&C(t)&&f&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let c=0;c<a.children.length;c++){const u=a.children[c];r.push(u)}return i}function nc(n,e){const t=[],r=Q().getChildren();for(let i=0;i<r.length;i++)Es(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function rc(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=ua(r);j(i)&&wa(i),e.push(i)}return e}let bt=null;async function Ns(n,e,t){if(bt!==null)return!1;if(e!==null)return new Promise((a,c)=>{n.update(()=>{a(Ps(n,e,t))})});const r=n.getRootElement(),i=n._window==null?window.document:n._window.document,o=Ss(n._window);if(r===null||o===null)return!1;const s=i.createElement("span");s.style.cssText="position: fixed; top: -1000px;",s.append(i.createTextNode("#")),r.append(s);const l=new Range;return l.setStart(s,0),l.setEnd(s,1),o.removeAllRanges(),o.addRange(l),new Promise((a,c)=>{const u=n.registerCommand(mn,f=>(it(f,ClipboardEvent)&&(u(),bt!==null&&(window.clearTimeout(bt),bt=null),a(Ps(n,f,t))),!0),ha);bt=window.setTimeout(()=>{u(),bt=null,a(!1)},50),i.execCommand("copy"),s.remove()})}function Ps(n,e,t){if(t===void 0){const i=Ss(n._window);if(!i)return!1;const o=i.anchorNode,s=i.focusNode;if(o!==null&&s!==null&&!Lt(n,o,s))return!1;const l=M();if(l===null)return!1;t=oc(l)}e.preventDefault();const r=e.clipboardData;return r!==null&&(sc(r,t),!0)}const ic=[["text/html",ec],["application/x-lexical-editor",tc]];function oc(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Ul();for(const[r,i]of ic){const o=i(t,n);o!==null&&(e[r]=o)}}return e}function sc(n,e){for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Os(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Ct=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,lc=Ct&&"documentMode"in document?document.documentMode:null,ac=!(!Ct||!("InputEvent"in window)||lc)&&"getTargetRanges"in new window.InputEvent("input"),cc=Ct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),uc=Ct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,dc=Ct&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fc=Ct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!dc,Ds=nl();function Xn(n){let e=null;if(it(n,DragEvent)?e=n.dataTransfer:it(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function js(n){const e=M();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const o=r[i],s=o.getKey();if(t.has(s))continue;const l=Hn(o,c=>C(c)&&!c.isInline());if(l===null)continue;const a=l.getKey();l.canIndent()&&!t.has(a)&&(t.add(a),n(l))}return t.size>0}function Qn(n){const e=Ze(n);return U(e)}function hc(n){return vt(n.registerCommand(Ei,e=>{const t=M();return!!Ce(t)&&(t.clear(),!0)},0),n.registerCommand(Ge,e=>{const t=M();return!!O(t)&&(t.deleteCharacter(e),!0)},K),n.registerCommand(Pt,e=>{const t=M();return!!O(t)&&(t.deleteWord(e),!0)},K),n.registerCommand(Ot,e=>{const t=M();return!!O(t)&&(t.deleteLine(e),!0)},K),n.registerCommand(ut,e=>{const t=M();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ts(r,t,n);else if(O(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},K),n.registerCommand(cr,()=>{const e=M();return!!O(e)&&(e.removeText(),!0)},K),n.registerCommand(de,e=>{const t=M();return!!O(t)&&(t.formatText(e),!0)},K),n.registerCommand(_e,e=>{const t=M();if(!O(t)&&!Ce(t))return!1;const r=t.getNodes();for(const i of r){const o=Hn(i,s=>C(s)&&!s.isInline());o!==null&&o.setFormat(e)}return!0},K),n.registerCommand(ct,e=>{const t=M();return!!O(t)&&(t.insertLineBreak(e),!0)},K),n.registerCommand(fn,()=>{const e=M();return!!O(e)&&(e.insertParagraph(),!0)},K),n.registerCommand(cl,()=>(la([Xt()]),!0),K),n.registerCommand(Ii,()=>js(e=>{const t=e.getIndent();e.setIndent(t+1)}),K),n.registerCommand(ur,()=>js(e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}),K),n.registerCommand(Oi,e=>{const t=M();if(Ce(t)&&!Qn(e.target)){const r=t.getNodes();if(r.length>0)return r[0].selectPrevious(),!0}else if(O(t)){const r=Rt(t.focus,!0);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},K),n.registerCommand(Di,e=>{const t=M();if(Ce(t)){const r=t.getNodes();if(r.length>0)return r[0].selectNext(0,0),!0}else if(O(t)){if(function(i){const o=i.focus;return o.key==="root"&&o.offset===Q().getChildrenSize()}(t))return e.preventDefault(),!0;const r=Rt(t.focus,!1);if(!e.shiftKey&&U(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},K),n.registerCommand(Pi,e=>{const t=M();if(Ce(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}if(!O(t))return!1;if(gs(t,!0)){const r=e.shiftKey;return e.preventDefault(),ms(t,r,!0),!0}return!1},K),n.registerCommand(Ni,e=>{const t=M();if(Ce(t)&&!Qn(e.target)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),i[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!gs(t,!1)&&(e.preventDefault(),ms(t,r,!1),!0)},K),n.registerCommand(ji,e=>{if(Qn(e.target))return!1;const t=M();if(!O(t))return!1;e.preventDefault();const{anchor:r}=t,i=r.getNode();return t.isCollapsed()&&r.offset===0&&!oe(i)&&ja(i).getIndent()>0?n.dispatchCommand(ur,void 0):n.dispatchCommand(Ge,!0)},K),n.registerCommand(Li,e=>{if(Qn(e.target))return!1;const t=M();return!!O(t)&&(e.preventDefault(),n.dispatchCommand(Ge,!1))},K),n.registerCommand(pn,e=>{const t=M();if(!O(t))return!1;if(e!==null){if((uc||cc||fc)&&ac)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ct,!1)}return n.dispatchCommand(fn,void 0)},K),n.registerCommand(Ai,()=>{const e=M();return!!O(e)&&(n.blur(),!0)},K),n.registerCommand(Fi,e=>{const[,t]=Xn(e);if(t.length>0){const i=Os(e.clientX,e.clientY);if(i!==null){const{offset:o,node:s}=i,l=Ze(s);if(l!==null){const a=oa();if(j(l))a.anchor.set(l.getKey(),o,"text"),a.focus.set(l.getKey(),o,"text");else{const u=l.getParentOrThrow().getKey(),f=l.getIndexWithinParent()+1;a.anchor.set(u,f,"element"),a.focus.set(u,f,"element")}const c=Gi(a);Se(c)}n.dispatchCommand(Ds,t)}return e.preventDefault(),!0}const r=M();return!!O(r)},K),n.registerCommand(Mi,e=>{const[t]=Xn(e),r=M();return!(t&&!O(r))},K),n.registerCommand($i,e=>{const[t]=Xn(e),r=M();if(t&&!O(r))return!1;const i=Os(e.clientX,e.clientY);if(i!==null){const o=Ze(i.node);U(o)&&e.preventDefault()}return!0},K),n.registerCommand(fr,()=>(Wl(),!0),K),n.registerCommand(mn,e=>(Ns(n,it(e,ClipboardEvent)?e:null),!0),K),n.registerCommand(dr,e=>(async function(t,r){await Ns(r,it(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();O(i)?i.removeText():Ce(i)&&i.getNodes().forEach(o=>o.remove())})}(e,n),!0),K),n.registerCommand(ar,e=>{const[,t,r]=Xn(e);return t.length>0&&!r?(n.dispatchCommand(Ds,t),!0):Tr(e.target)?!1:M()!==null&&(function(i,o){i.preventDefault(),o.update(()=>{const s=M(),l=it(i,InputEvent)||it(i,KeyboardEvent)?null:i.clipboardData;l!=null&&s!==null&&Ts(l,s,o)},{tag:"paste"})}(e,n),!0)},K))}const gi=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function As(n){return n.getEditorState().read(vs(n.isComposing()))}function gc({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=rt(),i=function(o,s){const[l,a]=D.useState(()=>o.getDecorators());return gi(()=>o.registerDecoratorListener(c=>{un.flushSync(()=>{a(c)})}),[o]),D.useEffect(()=>{a(o.getDecorators())},[o]),D.useMemo(()=>{const c=[],u=Object.keys(l);for(let f=0;f<u.length;f++){const d=u[f],h=b.jsx(s,{onError:m=>o._onError(m),children:b.jsx(D.Suspense,{fallback:null,children:l[d]})}),g=o.getElementByKey(d);g!==null&&c.push(un.createPortal(h,g,d))}return c},[s,l,o])}(r,t);return function(o){gi(()=>vt(hc(o),Ha(o)),[o])}(r),b.jsxs(b.Fragment,{children:[n,b.jsx(pc,{content:e}),i]})}function pc({content:n}){const[e]=rt(),t=function(i){const[o,s]=D.useState(()=>As(i));return gi(()=>{function l(){const a=As(i);s(a)}return l(),vt(i.registerUpdateListener(()=>{l()}),i.registerEditableListener(()=>{l()}))},[i]),o}(e),r=Ka();return t?typeof n=="function"?n(r):n:null}function pi(n,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},pi(n,e)}var Ls={error:null},mc=function(n){var e,t;function r(){for(var o,s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return(o=n.call.apply(n,[this].concat(l))||this).state=Ls,o.resetErrorBoundary=function(){for(var c,u=arguments.length,f=new Array(u),d=0;d<u;d++)f[d]=arguments[d];o.props.onReset==null||(c=o.props).onReset.apply(c,f),o.reset()},o}t=n,(e=r).prototype=Object.create(t.prototype),e.prototype.constructor=e,pi(e,t),r.getDerivedStateFromError=function(o){return{error:o}};var i=r.prototype;return i.reset=function(){this.setState(Ls)},i.componentDidCatch=function(o,s){var l,a;(l=(a=this.props).onError)==null||l.call(a,o,s)},i.componentDidUpdate=function(o,s){var l,a,c,u,f=this.state.error,d=this.props.resetKeys;f!==null&&s.error!==null&&((c=o.resetKeys)===void 0&&(c=[]),(u=d)===void 0&&(u=[]),c.length!==u.length||c.some(function(h,g){return!Object.is(h,u[g])}))&&((l=(a=this.props).onResetKeysChange)==null||l.call(a,o.resetKeys,d),this.reset())},i.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,a=s.FallbackComponent,c=s.fallback;if(o!==null){var u={error:o,resetErrorBoundary:this.resetErrorBoundary};if(lt.isValidElement(c))return c;if(typeof l=="function")return l(u);if(a)return lt.createElement(a,u);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},r}(lt.Component);function _c({children:n,onError:e}){return b.jsx(mc,{fallback:b.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}var Pe=(n=>(n.normal="1px",n.narrow="48px",n.moderate="96px 72px",n.wide="96px 192px",n))(Pe||{});const yc=D.createContext({margin:{bottom:"",left:"",right:"",top:""},pageMarginValue:"",updateCustomMargin:(n,e)=>{},updatePageMarginValue:n=>{}}),Zn=()=>D.useContext(yc),xc=new Set(["http:","https:","mailto:","sms:","tel:"]);class er extends tn{static getType(){return"link"}static clone(e){return new er(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,t={},r){super(r);const{target:i=null,rel:o=null,title:s=null}=t;this.__url=e,this.__target=i,this.__rel=o,this.__title=s}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),this.__target!==null&&(t.target=this.__target),this.__rel!==null&&(t.rel=this.__rel),this.__title!==null&&(t.title=this.__title),Da(t,e.theme.link),t}updateDOM(e,t,r){if(t instanceof HTMLAnchorElement){const i=this.__url,o=this.__target,s=this.__rel,l=this.__title;i!==e.__url&&(t.href=i),o!==e.__target&&(o?t.target=o:t.removeAttribute("target")),s!==e.__rel&&(s?t.rel=s:t.removeAttribute("rel")),l!==e.__title&&(l?t.title=l:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:vc,priority:1})}}static importJSON(e){const t=mi(e.url,{rel:e.rel,target:e.target,title:e.title});return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}sanitizeUrl(e){try{const t=new URL(e);if(!xc.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,t=!0){const r=mi(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const i=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function vc(n){let e=null;if(Kl(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=mi(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function mi(n,e){return Wt(new er(n,e))}function bc(n){return n instanceof er}function Cc(n){const e=n.anchor,t=n.focus,r=n.anchor.getNode(),i=n.focus.getNode();return r===i?r:n.isBackward()?hs(t)?r:i:hs(e)?r:i}const uu="";function wc({onClose:n,children:e,title:t,closeOnClickOutside:r}){const i=D.useRef(null);return D.useEffect(()=>{i.current!==null&&i.current.focus()},[]),D.useEffect(()=>{let o=null;const s=c=>{c.key==="Escape"&&n()},l=c=>{const u=c.target;i.current!==null&&!i.current.contains(u)&&r&&n()},a=i.current;return a!==null&&(o=a.parentElement,o!==null&&o.addEventListener("click",l)),window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s),o!==null&&(o==null||o.removeEventListener("click",l))}},[r,n]),b.jsx("div",{className:"Modal__overlay",role:"dialog",children:b.jsxs("div",{className:"Modal__modal",tabIndex:-1,ref:i,children:[b.jsx("h2",{className:"Modal__title",children:t}),b.jsx("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:n,children:"X"}),b.jsx("div",{className:"Modal__content",children:e})]})})}function Sc({onClose:n,children:e,title:t,closeOnClickOutside:r=!1}){return un.createPortal(b.jsx(wc,{onClose:n,title:t,closeOnClickOutside:r,children:e}),document.body)}function Tc(){const[n,e]=D.useState(null),t=D.useCallback(()=>{e(null)},[]),r=D.useMemo(()=>{if(n===null)return null;const{title:o,content:s,closeOnClickOutside:l}=n;return b.jsx(Sc,{onClose:t,title:o,closeOnClickOutside:l,children:s})},[n,t]),i=D.useCallback((o,s,l=!1)=>{e({closeOnClickOutside:l,content:s(t),title:o})},[t]);return[r,i]}const Is=lt.createContext(null),Fs=4;function pe({children:n,className:e,onClick:t,title:r}){const i=D.useRef(null),o=lt.useContext(Is);if(o===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:s}=o;return D.useEffect(()=>{i&&i.current&&s(i)},[i,s]),b.jsx("button",{className:e,onClick:t,ref:i,title:r,type:"button",children:n})}function kc({children:n,dropDownRef:e,onClose:t}){const[r,i]=D.useState(),[o,s]=D.useState(),l=D.useCallback(u=>{i(f=>f?[...f,u]:[u])},[i]),a=u=>{if(!r)return;const f=u.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(f)&&u.preventDefault(),f==="Escape"||f==="Tab"?t():f==="ArrowUp"?s(d=>{if(!d)return r[0];const h=r.indexOf(d)-1;return r[h===-1?r.length-1:h]}):f==="ArrowDown"&&s(d=>d?r[r.indexOf(d)+1]:r[0])},c=D.useMemo(()=>({registerItem:l}),[l]);return D.useEffect(()=>{r&&!o&&s(r[0]),o&&o.current&&o.current.focus()},[r,o]),b.jsx(Is.Provider,{value:c,children:b.jsx("div",{className:"dropdown",ref:e,onKeyDown:a,children:n})})}function Ms({disabled:n=!1,buttonLabel:e,buttonAriaLabel:t,buttonClassName:r,buttonIconClassName:i,children:o,stopCloseOnClickSelf:s}){const l=D.useRef(null),a=D.useRef(null),[c,u]=D.useState(!1),f=()=>{u(!1),a&&a.current&&a.current.focus()};return D.useEffect(()=>{const d=a.current,h=l.current;if(c&&d!==null&&h!==null){const{top:g,left:m}=d.getBoundingClientRect();h.style.top=`${g+d.offsetHeight+Fs}px`,h.style.left=`${Math.min(m,window.innerWidth-h.offsetWidth-20)}px`}},[l,a,c]),D.useEffect(()=>{const d=a.current;if(d!==null&&c){const h=g=>{const m=g.target;s&&l.current&&l.current.contains(m)||d.contains(m)||u(!1)};return document.addEventListener("click",h),()=>{document.removeEventListener("click",h)}}},[l,a,c,s]),D.useEffect(()=>{const d=()=>{if(c){const h=a.current,g=l.current;if(h!==null&&g!==null){const{top:m}=h.getBoundingClientRect(),_=m+h.offsetHeight+Fs;_!==g.getBoundingClientRect().top&&(g.style.top=`${_}px`)}}};return document.addEventListener("scroll",d),()=>{document.removeEventListener("scroll",d)}},[a,l,c]),b.jsxs(b.Fragment,{children:[b.jsxs("button",{type:"button",disabled:n,"aria-label":t||e,className:r,onClick:()=>u(!c),ref:a,children:[i&&b.jsx("span",{className:i}),e&&b.jsx("span",{className:"text dropdown-button-text",children:e}),b.jsx("i",{className:"chevron-down"})]}),c&&un.createPortal(b.jsx(kc,{dropDownRef:l,onClose:f,children:o}),document.body)]})}const du="";function Ec(...n){return n.filter(Boolean).join(" ")}function Nc({"data-test-id":n,children:e,className:t,onClick:r,disabled:i,small:o,title:s}){return b.jsx("button",{disabled:i,className:Ec("Button__root",i&&"Button__disabled",o&&"Button__small",t),onClick:r,title:s,"aria-label":s,...n&&{"data-test-id":n},children:e})}const fu="";function Pc({"data-test-id":n,children:e}){return b.jsx("div",{className:"DialogActions","data-test-id":n,children:e})}const hu="";function tr({label:n,value:e,onChange:t,placeholder:r="","data-test-id":i,type:o="text",name:s=""}){return b.jsxs("div",{className:"Input__wrapper",children:[b.jsx("label",{className:"Input__label",children:n}),b.jsx("input",{type:o,className:"Input__input",placeholder:r,value:e,name:s,onChange:l=>{t(l.target.value,l.target.name)},"data-test-id":i})]})}const Oc=({onClose:n})=>{const{margin:e,updatePageMarginValue:t,updateCustomMargin:r}=Zn(),[i,o]=lt.useState(""),s=()=>{const{top:f,right:d,bottom:h,left:g}=e,m=(816-100)/2,_=(1156-25)/2,v=[];if(+f*96>_&&v.push(`*Top margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+d*96>m&&v.push(`*Right margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),+h*96>_&&v.push(`*Bottom margin is too large, maximum allowed is ${(_/96).toFixed(2)} inches.`),+g*96>m&&v.push(`*Left margin is too large, maximum allowed is ${(m/96).toFixed(2)} inches.`),v!=null&&v.length){o(v.join(`
|
|
42
|
+
`));return}else{const y=`${+f*96}px ${+d*96}px ${+h*96}px ${+g*96}px`;t(y),n()}};return b.jsxs(b.Fragment,{children:[b.jsx(tr,{label:"Top",onChange:r,value:e.top,"data-test-id":"custom-margin-top",type:"number",name:"top"}),b.jsx(tr,{label:"Right",onChange:r,value:e.right,"data-test-id":"table-modal-right",type:"number",name:"right"}),b.jsx(tr,{label:"Bottom",onChange:r,value:e.bottom,"data-test-id":"table-modal-bottom",type:"number",name:"bottom"}),b.jsx(tr,{label:"Left",onChange:r,value:e.left,"data-test-id":"table-modal-left",type:"number",name:"left"}),b.jsx("div",{style:{color:"red",whiteSpace:"pre-line"},children:i}),b.jsx(Pc,{"data-test-id":"table-model-confirm-insert",children:b.jsx(Nc,{onClick:s,children:"Confirm"})})]})},nr=n=>n?"active dropdown-item-active":"",Dc=({isEditable:n})=>{const{pageMarginValue:e,updatePageMarginValue:t}=Zn(),[r,i]=Tc();return b.jsxs(b.Fragment,{children:[b.jsxs(Ms,{disabled:!n,buttonClassName:"toolbar-item spaced",buttonLabel:"Page Margin",buttonAriaLabel:"Page margin",buttonIconClassName:" plus",children:[b.jsx(pe,{onClick:()=>t(Pe.normal),className:"item "+nr(e===Pe.normal),children:b.jsx("span",{className:"text",children:"Normal"})}),b.jsx(pe,{onClick:()=>t(Pe.narrow),className:"item "+nr(e===Pe.narrow),children:b.jsx("span",{className:"text",children:"Narrow"})}),b.jsx(pe,{onClick:()=>t(Pe.moderate),className:"item "+nr(e===Pe.moderate),children:b.jsx("span",{className:"text",children:"Moderate"})}),b.jsx(pe,{onClick:()=>t(Pe.wide),className:"item "+nr(e===Pe.wide),children:b.jsx("span",{className:"text",children:"Wide"})}),b.jsx(pe,{onClick:()=>{i("Custom Margin",o=>b.jsx(Oc,{onClose:o}))},className:"item ",children:b.jsx("span",{className:"text",children:"Custom"})})]}),r]})};function jc(){return b.jsx("div",{className:"divider"})}const rn={center:{icon:"center-align",iconRTL:"center-align",name:"Center Align"},end:{icon:"right-align",iconRTL:"left-align",name:"End Align"},justify:{icon:"justify-align",iconRTL:"justify-align",name:"Justify Align"},left:{icon:"left-align",iconRTL:"left-align",name:"Left Align"},right:{icon:"right-align",iconRTL:"right-align",name:"Right Align"},start:{icon:"left-align",iconRTL:"right-align",name:"Start Align"}},Ac=({editor:n,value:e,isRTL:t,disabled:r=!1})=>{const i=rn[e||"left"];return b.jsxs(Ms,{disabled:r,buttonLabel:i.name,buttonIconClassName:`icon ${t?i.iconRTL:i.icon}`,buttonClassName:"toolbar-item spaced alignment",buttonAriaLabel:"Formatting options for text alignment",children:[b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"left")},className:"item",children:[b.jsx("i",{className:"icon left-align"}),b.jsx("span",{className:"text",children:"Left Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"center")},className:"item",children:[b.jsx("i",{className:"icon center-align"}),b.jsx("span",{className:"text",children:"Center Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"right")},className:"item",children:[b.jsx("i",{className:"icon right-align"}),b.jsx("span",{className:"text",children:"Right Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"justify")},className:"item",children:[b.jsx("i",{className:"icon justify-align"}),b.jsx("span",{className:"text",children:"Justify Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"start")},className:"item",children:[b.jsx("i",{className:`icon ${t?rn.start.iconRTL:rn.start.icon}`}),b.jsx("span",{className:"text",children:"Start Align"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(_e,"end")},className:"item",children:[b.jsx("i",{className:`icon ${t?rn.end.iconRTL:rn.end.icon}`}),b.jsx("span",{className:"text",children:"End Align"})]}),b.jsx(jc,{}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(ur,void 0)},className:"item",children:[b.jsx("i",{className:"icon "+(t?"indent":"outdent")}),b.jsx("span",{className:"text",children:"Outdent"})]}),b.jsxs(pe,{onClick:()=>{n.dispatchCommand(Ii,void 0)},className:"item",children:[b.jsx("i",{className:"icon "+(t?"outdent":"indent")}),b.jsx("span",{className:"text",children:"Indent"})]})]})},_i=1;function on(){return b.jsx("div",{className:"divider"})}function Lc(){const{updatePageMarginValue:n}=Zn(),[e]=rt(),t=D.useRef(null),[r,i]=D.useState(!1),[o,s]=D.useState(!1),[l,a]=D.useState(!1),[c,u]=D.useState(!1),[f,d]=D.useState(!1),[h,g]=D.useState(!1),[m,_]=D.useState(!1),[v,y]=D.useState(!1),[x,k]=D.useState("14px"),[S,w]=D.useState("left"),[P,T]=D.useState(!1),N=D.useCallback(()=>{const F=M();if(O(F)){const R=Cc(F),H=R.getParent();a(F.hasFormat("bold")),u(F.hasFormat("italic")),d(F.hasFormat("underline")),g(F.hasFormat("strikethrough")),_(F.hasFormat("subscript")),y(F.hasFormat("superscript")),T(ps(F)),k(ka(F,"font-size","14px"));let V;bc(H)&&(V=Hn(R,W=>C(W)&&!W.isInline())),w(C(V)?V.getFormatType():C(R)?R.getFormatType():(H==null?void 0:H.getFormatType())||"left"),n(Pe)}},[]);return D.useEffect(()=>vt(e.registerUpdateListener(({editorState:F})=>{F.read(()=>{N()})}),e.registerCommand(dn,(F,R)=>(N(),!1),_i),e.registerCommand(jt,F=>(i(F),!1),_i),e.registerCommand(Dt,F=>(s(F),!1),_i)),[e,N]),b.jsxs("div",{className:"toolbar",ref:t,children:[b.jsx("button",{disabled:!r,onClick:()=>{e.dispatchCommand(hn,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:b.jsx("i",{className:"format undo"})}),b.jsx("button",{disabled:!o,onClick:()=>{e.dispatchCommand(gn,void 0)},className:"toolbar-item","aria-label":"Redo",children:b.jsx("i",{className:"format redo"})}),b.jsx(on,{}),b.jsx(on,{}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"bold")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Bold",children:b.jsx("i",{className:"format bold"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"italic")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Italics",children:b.jsx("i",{className:"format italic"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"underline")},className:"toolbar-item spaced "+(f?"active":""),"aria-label":"Format Underline",children:b.jsx("i",{className:"format underline"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"strikethrough")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format Strikethrough",children:b.jsx("i",{className:"format strikethrough"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"subscript")},className:"toolbar-item spaced "+(m?"active":""),title:"Subscript","aria-label":"Format text with a subscript",type:"button",children:b.jsx("i",{className:"format subscript"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(de,"superscript")},className:"toolbar-item spaced "+(v?"active":""),title:"Superscript","aria-label":"Format text with a superscript",type:"button",children:b.jsx("i",{className:"format superscript"})}),b.jsx(on,{}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:b.jsx("i",{className:"format left-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:b.jsx("i",{className:"format center-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:b.jsx("i",{className:"format right-align"})}),b.jsx("button",{onClick:()=>{e.dispatchCommand(_e,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:b.jsx("i",{className:"format justify-align"})})," ",b.jsx(on,{}),b.jsx(Dc,{isEditable:!0}),b.jsx(on,{}),b.jsx(Ac,{value:S,editor:e,isRTL:P})]})}const gu="",$s=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?D.useLayoutEffect:D.useEffect;function Ic({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaExpanded:o,ariaLabel:s,ariaLabelledBy:l,ariaMultiline:a,ariaOwns:c,ariaRequired:u,autoCapitalize:f,className:d,id:h,role:g="textbox",spellCheck:m=!0,style:_,tabIndex:v,"data-testid":y,...x},k){const[S,w]=D.useState(n.isEditable()),P=D.useCallback(N=>{N&&N.ownerDocument&&N.ownerDocument.defaultView?n.setRootElement(N):n.setRootElement(null)},[n]),T=D.useMemo(()=>function(...N){return F=>{N.forEach(R=>{typeof R=="function"?R(F):R!=null&&(R.current=F)})}}(k,P),[P,k]);return $s(()=>(w(n.isEditable()),n.registerEditableListener(N=>{w(N)})),[n]),b.jsx("div",{...x,"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":i,"aria-expanded":S&&g==="combobox"?!!o:void 0,"aria-label":s,"aria-labelledby":l,"aria-multiline":a,"aria-owns":S?c:void 0,"aria-readonly":!S||void 0,"aria-required":u,autoCapitalize:f,className:d,contentEditable:S,"data-testid":y,id:h,ref:T,role:S?g:void 0,spellCheck:m,style:_,tabIndex:v})}const Fc=D.forwardRef(Ic);function Rs(n){return n.getEditorState().read(vs(n.isComposing()))}const Mc=D.forwardRef($c);function $c(n,e){const{placeholder:t,...r}=n,[i]=rt();return b.jsxs(b.Fragment,{children:[b.jsx(Fc,{editor:i,...r,ref:e}),t!=null&&b.jsx(Rc,{editor:i,content:t})]})}function Rc({content:n,editor:e}){const t=function(s){const[l,a]=D.useState(()=>Rs(s));return $s(()=>{function c(){const u=Rs(s);a(u)}return c(),vt(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),l}(e),[r,i]=D.useState(e.isEditable());if(D.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(s=>{i(s)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:b.jsx("div",{"aria-hidden":!0,children:o})}function Wc({className:n,style:e}){return b.jsx(Mc,{className:n||"ContentEditable__root",style:e})}const Bc={};function zc(n){console.error(n)}function Kc({isCollab:n,ckey:e}){const{pageMarginValue:t}=Zn(),r={namespace:"MyEditor",theme:Bc,onError:zc};return b.jsx(xa,{initialConfig:r,children:b.jsxs("div",{className:"editor-shell",children:[b.jsx(Lc,{}),b.jsx("div",{className:"editor-container",children:b.jsxs("div",{className:"editor-inner",children:[b.jsx(gc,{contentEditable:b.jsx("div",{className:"editor-scroller",children:b.jsx("div",{className:"editor",children:b.jsx(Wc,{style:{margin:t}})})}),ErrorBoundary:_c}),b.jsx(Wa,{}),b.jsx(va,{})]})})]})})}Re.Editor=Kc,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
|
|
61
43
|
//# sourceMappingURL=index.umd.js.map
|