@tempots/beatui 0.89.0 → 0.91.0
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/dist/{ar-MUKILk4c.js → ar-8Cko5i-Z.js} +18 -10
- package/dist/{ar-CBrjAlIY.cjs → ar-D2DjoXta.cjs} +1 -1
- package/dist/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +1 -1
- package/dist/{auth-divider-DvVmqjnk.js → auth-divider-B4n8lGx5.js} +7 -7
- package/dist/{auth-divider-Cj-xJxF_.cjs → auth-divider-VzrKnv2d.cjs} +1 -1
- package/dist/beatui.css +88 -79
- package/dist/beatui.tailwind.css +88 -79
- package/dist/better-auth/index.cjs.js +1 -1
- package/dist/better-auth/index.es.js +5 -5
- package/dist/{de-CEsW1rVX.js → de-Bt-d2iKj.js} +12 -4
- package/dist/{de-CrBw41po.cjs → de-Cdf3432J.cjs} +1 -1
- package/dist/{deep-merge-OvVqSLSN.js → deep-merge-BdRgguFO.js} +38 -38
- package/dist/deep-merge-CI1g9sjh.cjs +1 -0
- package/dist/{duration-input-BCXujp0V.js → duration-input-BZhzeELL.js} +4 -4
- package/dist/{duration-input-MJz6UO6E.cjs → duration-input-a1fCTfKl.cjs} +1 -1
- package/dist/{editor-toolbar-group-Cnta0SOa.js → editor-toolbar-group-CzdBZ1yr.js} +2 -2
- package/dist/{editor-toolbar-group-BgWLVgMZ.cjs → editor-toolbar-group-DhKJdqER.cjs} +1 -1
- package/dist/{es-ChP-aFwC.js → es-2llfNFX2.js} +10 -2
- package/dist/{es-Ca5xT3NE.cjs → es-6fFPkKHL.cjs} +1 -1
- package/dist/{fa-CNsrlIqh.js → fa-CQVIBjKP.js} +18 -10
- package/dist/{fa-DhZJYuC6.cjs → fa-GXyNzAXz.cjs} +1 -1
- package/dist/{fr-1nSKSIlw.cjs → fr-C6EYTwSH.cjs} +1 -1
- package/dist/{fr-DgEFKpML.js → fr-CC3smTlW.js} +19 -11
- package/dist/{he-DhcurPt5.cjs → he-CJUgxvi8.cjs} +1 -1
- package/dist/{he-B4TqfISZ.js → he-CZilsN75.js} +16 -8
- package/dist/{hi-TSoDsngT.js → hi-CAZjwGv-.js} +16 -8
- package/dist/{hi-CxsIxbfM.cjs → hi-DqIR4VtX.cjs} +1 -1
- package/dist/{index-D4ZFV8Rs.cjs → index-B-cwxUsP.cjs} +1 -1
- package/dist/{index-DOc1_-Nm.js → index-BFzxpY7y.js} +1 -1
- package/dist/{index-D3QVPAme.cjs → index-BOC0cVoY.cjs} +2 -2
- package/dist/{index-D_aTUfqS.js → index-DJ9YIJcG.js} +6 -6
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +1847 -1822
- package/dist/{input-container-BBWCDGTv.js → input-container-9r1F3KuX.js} +1 -1
- package/dist/{input-container-B31Seozh.cjs → input-container-DiYEl_y8.cjs} +1 -1
- package/dist/{it-D_IcaYxp.cjs → it-BvHsJ7fH.cjs} +1 -1
- package/dist/{it-BrbebXg4.js → it-D6RXFIL6.js} +19 -11
- package/dist/{ja-CMGqpPo7.cjs → ja-B2gP7OHY.cjs} +1 -1
- package/dist/{ja-DcfOktrV.js → ja-D7zsz4Ij.js} +15 -7
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +11 -12
- package/dist/json-schema-display/index.cjs.js +1 -1
- package/dist/json-schema-display/index.es.js +1 -1
- package/dist/json-structure/index.cjs.js +1 -1
- package/dist/json-structure/index.es.js +6 -6
- package/dist/{ko-BPl5rP97.cjs → ko-BddhddIA.cjs} +1 -1
- package/dist/{ko-73e6t369.js → ko-taN2Npr4.js} +12 -4
- package/dist/lexical/index.cjs.js +30 -30
- package/dist/lexical/index.es.js +5741 -5527
- package/dist/lexical.css +31 -28
- package/dist/{modal-jJMS0ZlW.cjs → modal-C-d5Btti.cjs} +1 -1
- package/dist/{modal-BBJWY7NB.js → modal-DTz98Dk7.js} +3 -3
- package/dist/{nl-BSfaHFt0.cjs → nl-COrtZUnH.cjs} +1 -1
- package/dist/{nl-Bq-1-ulc.js → nl-CRC6r4Q4.js} +22 -14
- package/dist/{notice-9lpZ-VDn.cjs → notice-BDTfBGtx.cjs} +1 -1
- package/dist/{notice-AUVH8Lho.js → notice-CZuh-h6a.js} +4 -4
- package/dist/{oneof-branch-detection-BsGhMslW.cjs → oneof-branch-detection-D6Xa8qNR.cjs} +1 -1
- package/dist/{oneof-branch-detection-BQnRjp9P.js → oneof-branch-detection-DCPwyutI.js} +1 -1
- package/dist/{pl-D-O4sCnr.cjs → pl-BHI4zBgV.cjs} +1 -1
- package/dist/{pl-Du9-VCfW.js → pl-C6qNs0Lq.js} +19 -11
- package/dist/prosemirror/index.cjs.js +1 -1
- package/dist/prosemirror/index.es.js +1 -1
- package/dist/{pt-chEEYLlt.cjs → pt-BGzC9MhU.cjs} +1 -1
- package/dist/{pt-B2UqqSAB.js → pt-CcWPLqBh.js} +20 -12
- package/dist/{ru-B46hVpFF.cjs → ru-CXeFbIPb.cjs} +1 -1
- package/dist/{ru-DiWa2inw.js → ru-Dt9-9m0E.js} +20 -12
- package/dist/tailwind/vite-plugin.es.js +0 -1
- package/dist/{text-input-6FD7p7hN.js → text-input-BgPx8BbG.js} +1 -1
- package/dist/{text-input-w0eVcqk5.cjs → text-input-DUnhBUd6.cjs} +1 -1
- package/dist/{toolbar-Cr0JGj5h.js → toolbar-DKOh_gbA.js} +1 -1
- package/dist/{toolbar-BR8In7O0.cjs → toolbar-Dkc2y1dI.cjs} +1 -1
- package/dist/{tr-Culcm2Zb.js → tr-CDTWeRY0.js} +14 -6
- package/dist/{tr-CaMaflJL.cjs → tr-CdOtQAtA.cjs} +1 -1
- package/dist/{translations-CZ0KOii3.cjs → translations-BdCtLBZt.cjs} +1 -1
- package/dist/{translations-uEUkO6gJ.js → translations-CiBhB2FV.js} +135 -127
- package/dist/translations-Cy9hoMGV.cjs +1 -0
- package/dist/{translations-Cttn6w0G.js → translations-NBY7SubC.js} +1 -1
- package/dist/types/beatui-i18n/default.d.ts +8 -0
- package/dist/types/beatui-i18n/locales/en.d.ts +8 -0
- package/dist/types/beatui-i18n/translations.d.ts +8 -0
- package/dist/types/components/form/input/index.d.ts +2 -0
- package/dist/types/components/form/input/nullable-color-input.d.ts +31 -0
- package/dist/types/components/form/input/nullable-color-swatch-input.d.ts +39 -0
- package/dist/types/components/lexical/table/table-controls.d.ts +3 -1
- package/dist/types/components/lexical/toolbar/index.d.ts +1 -0
- package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +16 -0
- package/dist/types/lexical/index.d.ts +2 -1
- package/dist/types/lexical/plugins/element-style.d.ts +29 -0
- package/dist/types/lexical/plugins/index.d.ts +1 -0
- package/dist/types/lexical/types.d.ts +43 -2
- package/dist/{ur-CvGP14xo.cjs → ur-C7itXvnC.cjs} +1 -1
- package/dist/{ur-Deb-uH6b.js → ur-CLrK5FPQ.js} +16 -8
- package/dist/{use-form-lg6-7Brc.js → use-form-Cd8YFWaN.js} +3 -3
- package/dist/{use-form-i97PToWB.cjs → use-form-DQVN_Zjb.cjs} +2 -2
- package/dist/{vi-CUsCVh3n.js → vi-B1_QDUQJ.js} +21 -13
- package/dist/{vi-Df4WZe9y.cjs → vi-CQrUWB3y.cjs} +1 -1
- package/dist/{widget-customization-CDD72zYs.js → widget-customization-BY4Ox_4e.js} +25 -25
- package/dist/{widget-customization-BLvD4Lqt.cjs → widget-customization-eyQ2pxvu.cjs} +1 -1
- package/dist/{zh-C5a9NGFW.cjs → zh-DWswYYTS.cjs} +1 -1
- package/dist/{zh-Dil2Jft8.js → zh-rDtQ92Pp.js} +12 -4
- package/package.json +1 -1
- package/dist/deep-merge-Dgy9xj6w.cjs +0 -1
- package/dist/translations-gVgMyNno.cjs +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Wu=require("../_commonjsHelpers-DKOUU3wS.cjs"),E=require("@tempots/dom"),yc=require("../link-portal-_tiDFZqh.cjs"),bc=require("../theme-DogY9oT1.cjs"),vt=require("../menu-De_-sGeb.cjs"),He=require("../translations-Cy9hoMGV.cjs"),kh=require("../editor-toolbar-group-DhKJdqER.cjs"),Eh=require("../toolbar-Dkc2y1dI.cjs"),v_=require("../input-container-DiYEl_y8.cjs"),k_={separator:!0};function L(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Th(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ft=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,E_=Ft&&"documentMode"in document?document.documentMode:null,Et=Ft&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),On=Ft&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),to=!(!Ft||!("InputEvent"in window)||E_)&&"getTargetRanges"in new window.InputEvent("input"),ds=Ft&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ti=Ft&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T_=Ft&&/Android/.test(navigator.userAgent),Nh=Ft&&/^(?=.*Chrome).*/i.test(navigator.userAgent),ju=Ft&&T_&&Nh,fs=Ft&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Et&&!Nh,N_=0,A_=1,O_=2,M_=1,$_=2,I_=4,F_=8,D_=16,L_=32,R_=64,xc=128,P_=2047,z_=1,B_=2,U_=3,K_=4,W_=5,j_=6,zo=ds||ti||fs?" ":"",Bo=`
|
|
2
2
|
|
|
3
|
-
`,ly=$n?" ":jo,Fh="֑-߿יִ-﷽ﹰ-ﻼ",Dh="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",ay=new RegExp("^[^"+Dh+"]*["+Fh+"]"),cy=new RegExp("^[^"+Fh+"]*["+Dh+"]"),Pe={bold:1,capitalize:1024,code:16,highlight:Ec,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},uy={directionless:1,unmergeable:2},Xu={center:2,end:6,justify:4,left:1,right:3,start:5},dy={[ny]:"center",[oy]:"end",[iy]:"justify",[ty]:"left",[ry]:"right",[sy]:"start"},fy={normal:0,segmented:2,token:1},hy={[j_]:"normal",[J_]:"segmented",[H_]:"token"},gy="$",Qu="$config";function Lh(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(A(o)&&Lh(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Ma=!1,kc=0;function py(n){kc=n.timeStamp}function Yl(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&cl(n,t)!==void 0}function my(n,e,t){const r=kt(Et(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Zc(e,o,i,s,!1)}function _y(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return qt(e)&&t.isAttached()}function yy(n,e,t,r){for(let i=n;i&&!jg(i);i=vs(i)){const s=cl(i,e);if(s!==void 0){const o=q(s,t);if(o)return V(o)||!re(i)?void 0:[i,o]}else if(i===r)return[r,Mg(t)]}}function Rh(n,e,t){Ma=!0;const r=performance.now()-kc>100;try{Wt(n,()=>{const i=O()||(function(f){return f.getEditorState().read(()=>{const h=O();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,p=h.target,m=yy(p,n,l,o);if(!m)continue;const[b,_]=m;if(g==="characterData")r&&D(_)&&qt(p)&&_y(i,p,_)&&my(p,_,n);else if(g==="childList"){c=!0;const y=h.addedNodes;for(let x=0;x<y.length;x++){const v=y[x],k=Vc(v),E=v.parentNode;if(E!=null&&v!==a&&k===null&&!Yl(v,E,n)){if($n){const M=(re(v)?v.innerText:null)||v.nodeValue;M&&(u+=M)}E.removeChild(v)}}const S=h.removedNodes,C=S.length;if(C>0){let x=0;for(let v=0;v<C;v++){const k=S[v];(Yl(k,p,n)||a===k)&&(p.appendChild(k),x++)}C!==x&&s.set(b,_)}}}if(s.size>0)for(const[f,h]of s)h.reconcileObservedMutation(f,n);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const b=g[m],_=b.parentNode;_==null||b.nodeName!=="BR"||Yl(b,p,n)||_.removeChild(b)}}t.takeRecords()}i!==null&&(c&&Fe(i),$n&&Lg(n)&&i.insertRawText(u))})}finally{Ma=!1}}function Ph(n){const e=n._observer;e!==null&&Rh(n,e.takeRecords(),e)}function Bh(n){(function(e){kc===0&&Et(e).addEventListener("textInput",py,!0)})(n),n._observer=new MutationObserver((e,t)=>{Rh(n,e,t)})}let by=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Cy).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Tc(n,e){return new by(n,e)}function qi(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function xy(n,e,t){const r=qi(n,t,"direct"),i=qi(e,t,"direct");return t.isEqual(r,i)?null:[r,i]}function Ys(n,e,t){let r;if(Oe(),typeof t=="function"){const s=n.getLatest(),o=qi(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return Jo(i).updateFromKnown(e,r),i}function zh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=Es(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let Sy=class Uh{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,l=s!==void 0?s:(function(a,c,u){let d=u.size;if(c)for(const f in c){const h=a.get(f);h&&u.has(h)||d++}return d})(o,r,i);this.size=l}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return ed(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new Uh(e,t,(function(s,o,l){let a;if(l)for(const[c,u]of Object.entries(l)){const d=s.get(c);d?o.has(d)||o.set(d,d.parse(u)):(a=a||{},a[c]=u)}return a})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=ed(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Jo(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Sy(e,Kh(e));return e.__state=t,t}function Kh(n){return n.__state?n.__state.sharedNodeState:Hc(mi(),n.getType()).sharedNodeState}function ed(n){if(n)for(const e in n)return n}function Cy(n){return n}function td(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function nd(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function rd(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function id(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;const f=new Set;return!(u&&td(f,u,d)||d&&td(f,d,u)||u&&nd(f,u,d)||d&&nd(f,d,u))})(a,c))}function sd(n,e){const t=n.mergeWithSibling(e),r=ie()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function od(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(id(e,r)){r=sd(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(id(r,t)){r=sd(r,t);break}break}t.remove()}}else r.remove()}function In(n){return ld(n.anchor),ld(n.focus),n}function ld(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),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!A(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let lr,Ge,Zi,Go,$a,Ia,ar,At,Fa,Xi,ke="",Pt=null,qn=null,Ur=!1,lo=!1;function ao(n,e){const t=ar.get(n);if(e!==null){const r=Pa(n);r.parentNode===e&&e.removeChild(r)}if(At.has(n)||Ge._keyToDOMMap.delete(n),A(t)){const r=uo(t,ar);Da(r,0,r.length-1,null)}t!==void 0&&Qc(Xi,Zi,Go,t,"destroyed")}function Da(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&ao(s,r)}}function Vn(n,e){n.setProperty("text-align",e)}const wy="40px";function Wh(n,e){const t=lr.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")||wy;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function jh(n,e){const t=n.style;e===0?Vn(t,""):e===1?Vn(t,"left"):e===2?Vn(t,"center"):e===3?Vn(t,"right"):e===4?Vn(t,"justify"):e===5?Vn(t,"start"):e===6&&Vn(t,"end")}function La(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(be(r))return null;const s=r.getParentOrThrow();return be(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function co(n,e){const t=At.get(n);t===void 0&&L(60);const r=t.createDOM(lr,Ge);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const d=`__lexicalKey_${c._key}`;a[d]=u})(s,o,i),l.set(i,s)})(n,r,Ge),D(t)?r.setAttribute("data-lexical-text","true"):V(t)&&r.setAttribute("data-lexical-decorator","true"),A(t)){const i=t.__indent,s=t.__size;if(La(r,t),i!==0&&Wh(r,i),s!==0){const l=s-1;Ra(uo(t,At),t,0,l,t.getDOMSlot(r))}const o=t.__format;o!==0&&jh(r,o),t.isInline()||Hh(null,t,r)}else{const i=t.getTextContent();if(V(t)){const s=t.decorate(Ge,lr);s!==null&&Jh(n,s),r.contentEditable="false"}ke+=i}return e!==null&&e.insertChild(r),Qc(Xi,Zi,Go,t,"created"),r}function Ra(n,e,t,r,i){const s=ke;ke="";let o=t;for(;o<=r;++o){co(n[o],i);const l=At.get(n[o]);l!==null&&D(l)?Pt===null&&(Pt=l.getFormat(),qn=l.getStyle()):A(l)&&o<r&&!l.isInline()&&(ke+=Ho)}i.element.__lexicalTextContent=ke,ke=s+ke}function ad(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return ue(r)?"line-break":V(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Hh(n,e,t){const r=ad(n,ar),i=ad(e,At);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function vy(n,e,t){var r;Pt=null,qn=null,(function(i,s,o){const l=ke,a=i.__size,c=s.__size;ke="";const u=o.element;if(a===1&&c===1){const d=i.__first,f=s.__first;if(d===f)qs(d,u);else{const g=Pa(d),p=co(f,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const b=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(b)}throw m}ao(d,null)}const h=At.get(f);D(h)&&Pt===null&&(Pt=h.getFormat(),qn=h.getStyle())}else{const d=uo(i,ar),f=uo(s,At);if(d.length!==a&&L(227),f.length!==c&&L(228),a===0)c!==0&&Ra(f,0,0,c-1,o);else if(c===0){if(a!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Da(d,0,a-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,b,_){const y=m-1,S=b-1;let C,x,v=_.getFirstChild(),k=0,E=0;for(;k<=y&&E<=S;){const I=g[k],K=p[E];if(I===K)v=ql(qs(K,_.element)),k++,E++;else{if(x===void 0&&(x=cd(p,E)),C===void 0)C=cd(g,k);else if(!C.has(I)){k++;continue}if(!x.has(I)){v=ql(Pa(I)),ao(I,_.element),k++,C.delete(I);continue}if(C.has(K)){const R=hr(Ge,K);R!==v&&_.withBefore(v).insertChild(R),v=ql(qs(K,_.element)),k++,E++}else co(K,_.withBefore(v)),E++}const $=At.get(K);$!==null&&D($)?Pt===null&&(Pt=$.getFormat(),qn=$.getStyle()):A($)&&E<=S&&!$.isInline()&&(ke+=Ho)}const M=k>y,T=E>S;if(M&&!T){const I=p[S+1],K=I===void 0?null:Ge.getElementByKey(I);Ra(p,0,E,S,_.withBefore(K))}else T&&!M&&Da(g,k,y,_.element)})(0,d,f,a,c,o)}u.__lexicalTextContent=ke,ke=l+ke})(n,e,e.getDOMSlot(t)),r=e,Pt==null||Pt===r.__textFormat||lo||r.setTextFormat(Pt),(function(i){qn==null||qn===i.__textStyle||lo||i.setTextStyle(qn)})(e)}function uo(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&L(101),t.push(r),r=i.__next}return t}function qs(n,e){const t=ar.get(n);let r=At.get(n);t!==void 0&&r!==void 0||L(61);const i=Ur||Ia.has(n)||$a.has(n),s=hr(Ge,n);if(t===r&&!i){let o;if(A(t)){const l=s.__lexicalTextContent;typeof l=="string"?o=l:(o=t.getTextContent(),s.__lexicalTextContent=o)}else o=t.getTextContent();return ke+=o,s}if(t!==r&&i&&Qc(Xi,Zi,Go,r,"updated"),r.updateDOM(t,s,lr)){const o=co(n,null);return e===null&&L(62),e.replaceChild(o,s),ao(n,null),o}if(A(t)){A(r)||L(334,n);const o=r.__indent;(Ur||o!==t.__indent)&&Wh(s,o);const l=r.__format;if((Ur||l!==t.__format)&&jh(s,l),i)vy(t,r,s),be(r)||r.isInline()||Hh(t,r,s);else{const a=s.__lexicalTextContent;let c;typeof a=="string"?c=a:(c=t.getTextContent(),s.__lexicalTextContent=c),ke+=c}if((Ur||r.__dir!==t.__dir)&&(La(s,r),be(r)&&!Ur))for(const a of r.getChildren())A(a)&&La(hr(Ge,a.getKey()),a)}else{const o=r.getTextContent();if(V(r)){const l=r.decorate(Ge,lr);l!==null&&Jh(n,l)}ke+=o}if(!lo&&be(r)&&r.__cachedText!==ke){const o=r.getWritable();o.__cachedText=ke,r=o}return s}function Jh(n,e){let t=Ge._pendingDecorators;const r=Ge._decorators;if(t===null){if(r[n]===e)return;t=Og(Ge)}t[n]=e}function ql(n){let e=n.nextSibling;return e!==null&&e===Ge._blockCursorElement&&(e=e.nextSibling),e}function cd(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function Ey(n,e,t,r,i,s){ke="",Ur=r===2,Ge=t,lr=t._config,Zi=t._nodes,Go=Ge._listeners.mutation,$a=i,Ia=s,ar=n._nodeMap,At=e._nodeMap,lo=e._readOnly,Fa=new Map(t._keyToDOMMap);const o=new Map;return Xi=o,qs("root",null),Ge=void 0,Zi=void 0,$a=void 0,Ia=void 0,ar=void 0,At=void 0,lr=void 0,Fa=void 0,Xi=void 0,o}function Pa(n){const e=Fa.get(n);return e===void 0&&L(75,n),e}function z(n){return{type:n}}const oi=z("SELECTION_CHANGE_COMMAND"),Nc=z("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),br=z("CLICK_COMMAND"),Ac=z("BEFORE_INPUT_COMMAND"),Oc=z("INPUT_COMMAND"),Mc=z("COMPOSITION_START_COMMAND"),$c=z("COMPOSITION_END_COMMAND"),Ot=z("DELETE_CHARACTER_COMMAND"),cn=z("INSERT_LINE_BREAK_COMMAND"),Fn=z("INSERT_PARAGRAPH_COMMAND"),An=z("CONTROLLED_TEXT_INSERTION_COMMAND"),li=z("PASTE_COMMAND"),Qi=z("REMOVE_TEXT_COMMAND"),cr=z("DELETE_WORD_COMMAND"),ur=z("DELETE_LINE_COMMAND"),ve=z("FORMAT_TEXT_COMMAND"),ai=z("UNDO_COMMAND"),ci=z("REDO_COMMAND"),Ic=z("KEYDOWN_COMMAND"),Vo=z("KEY_ARROW_RIGHT_COMMAND"),fo=z("MOVE_TO_END"),bs=z("KEY_ARROW_LEFT_COMMAND"),es=z("MOVE_TO_START"),dn=z("KEY_ARROW_UP_COMMAND"),dr=z("KEY_ARROW_DOWN_COMMAND"),Dn=z("KEY_ENTER_COMMAND"),Yo=z("KEY_SPACE_COMMAND"),qo=z("KEY_BACKSPACE_COMMAND"),ui=z("KEY_ESCAPE_COMMAND"),Zo=z("KEY_DELETE_COMMAND"),xs=z("KEY_TAB_COMMAND"),ho=z("INSERT_TAB_COMMAND"),Ut=z("INDENT_CONTENT_COMMAND"),sn=z("OUTDENT_CONTENT_COMMAND"),Xo=z("DROP_COMMAND"),Fc=z("FORMAT_ELEMENT_COMMAND"),Qo=z("DRAGSTART_COMMAND"),Dc=z("DRAGOVER_COMMAND"),Gh=z("DRAGEND_COMMAND"),xr=z("COPY_COMMAND"),di=z("CUT_COMMAND"),Xr=z("SELECT_ALL_COMMAND"),Lc=z("CLEAR_EDITOR_COMMAND"),Vh=z("CLEAR_HISTORY_COMMAND"),Fi=z("CAN_REDO_COMMAND"),Di=z("CAN_UNDO_COMMAND"),Rc=z("FOCUS_COMMAND"),fi=z("BLUR_COMMAND"),Yh=z("KEY_MODIFIER_COMMAND"),Xt=Object.freeze({}),Ba=[["keydown",function(n,e){ts=n.timeStamp,qh=n.key,!e.isComposing()&&P(e,Ic,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;jn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Wt(e,()=>{Tg(t)||(Ka=!0)})}],["compositionstart",function(n,e){P(e,Mc,n)}],["compositionend",function(n,e){$n?Li=!0:si||!_s&&!ys?P(e,$c,n):(Wa=!0,ja=n.data)}],["input",function(n,e){n.stopPropagation(),Wt(e,()=>{e.dispatchCommand(Oc,n)},{event:n}),Kr=null}],["click",function(n,e){Wt(e,()=>{const t=O(),r=kt(Et(e)),i=bn();if(r){if(N(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!be(o)&&fe().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=le(o,a=>A(a)&&!a.isInline());A(l)&&l.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(re(s)||qt(s))&&Fe(tl(i,r,e,n))}}P(e,br,n)})}],["cut",Xt],["copy",Xt],["dragstart",Xt],["dragover",Xt],["dragend",Xt],["paste",Xt],["focus",Xt],["blur",Xt],["drop",Xt]];oo&&Ba.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||$n&&Lg(r)||i!=="insertCompositionText"&&P(r,Ac,t)})(n,e)]);let ts=0,qh=null,Zh=0,Kr=null;const za=new WeakMap,go=new WeakMap;let Ua=!1,Ka=!1,Ki=!1,Li=!1,Wa=!1,ja="",Xn=null,Xh=[0,"",0,"root",0];function Qh(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=ie(),c=kt(Et(a)),u=c!==null?c.anchorNode:null,d=s.key,f=a.getElementByKey(d),h=t.length;return d!==o.key||!D(l)||(!i&&(!oo||Zh<r+50)||l.isDirty()&&h<2||$g(t))&&s.offset!==o.offset&&!l.isComposing()||Tt(l)||l.isDirty()&&h>1||(i||!oo)&&f!==null&&!l.isComposing()&&u!==fr(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,b=p.getParentOrThrow(),_=On(p);return m===0?!p.canInsertTextBefore()||!b.canInsertTextBefore()&&!p.isComposing()||_||(function(y){const S=y.getPreviousSibling();return(D(S)||A(S)&&S.isInline())&&!S.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!b.canInsertTextAfter()&&!p.isComposing()||_)})(n,l)}function ud(n,e){return qt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function dd(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Ua&&(Ua=!1,ud(r,i)&&ud(s,o)&&!Xn)||Wt(e,()=>{if(!t)return void Fe(null);if(!pi(e,r,s))return;let l=O();if(Xn&&N(l)&&l.isCollapsed()){const a=l.anchor,c=Xn.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Xn.clone(),Fe(l))}if(Xn=null,N(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=Et(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,m]=Xh,b=fe(),_=e.isComposing()===!1&&b.getTextContent()==="";if(d<m+200&&a.offset===g&&a.key===p)Zs(l,f,h);else if(a.type==="text")D(c)||L(141),eg(l,c);else if(a.type==="element"&&!_){A(c)||L(259);const y=a.getNode();y.isEmpty()?(function(S,C){const x=C.getTextFormat(),v=C.getTextStyle();Zs(S,x,v)})(l,y):Zs(l,0,"")}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),p=g?o:i,m=g?i:o,b=g?d:u,_=g?u:d;let y=2047,S=!1;for(let C=0;C<h;C++){const x=f[C],v=x.getTextContentSize();if(D(x)&&v!==0&&!(C===0&&x.__key===b&&p===v||C===h-1&&x.__key===_&&m===0)&&(S=!0,y&=x.getFormat(),y===0))break}l.format=S?y:0}}P(e,oi,void 0)})}function Zs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function eg(n,e){Zs(n,e.getFormat(),e.getStyle())}function tg(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function ky(n){const e=n.inputType,t=tg(n),r=ie(),i=O();if(e==="deleteContentBackward"){if(i===null){const d=bn();if(!N(d))return!0;Fe(d.clone())}if(N(i)){const d=i.anchor.key===i.focus.key;if(s=n.timeStamp,qh==="MediaLast"&&s<ts+30&&r.isComposing()&&d){if(Me(null),ts=0,setTimeout(()=>{Wt(r,()=>{Me(null)})},30),N(i)){const f=i.anchor.getNode();f.markDirty(),D(f)||L(142),eg(i,f)}}else{Me(null),n.preventDefault();const f=i.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),p=i.anchor.offset===0&&i.focus.offset===h.length;let m=Zu&&d&&!p&&g;if(m&&i.isCollapsed()&&(m=!V(vo(i.anchor,!0))),!m){P(r,Ot,!0);const b=O();Zu&&N(b)&&b.isCollapsed()&&(Xn=b,setTimeout(()=>Xn=null))}}return!0}}var s;if(!N(i))return!0;const o=n.data;Kr!==null&&qc(!1,r,Kr),i.dirty&&Kr===null||!i.isCollapsed()||be(i.anchor.getNode())||t===null||i.applyDOMRange(t),Kr=null;const l=i.anchor,a=i.focus,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
|
|
4
|
-
`)n.preventDefault(),P(r,
|
|
5
|
-
`){const r=O();if(N(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void P(n,Dn,null)}}}qc(!0,n,e)}function Oy(n){const e=ie();if(n.key==null)return!0;if(Wa&&Ld(n))return Wt(e,()=>{po(e,ja)}),Wa=!1,ja="",!0;if((function(t){return te(t,"ArrowRight",{shiftKey:"any"})})(n))P(e,Vo,n);else if((function(t){return te(t,"ArrowRight",tn)})(n))P(e,fo,n);else if((function(t){return te(t,"ArrowLeft",{shiftKey:"any"})})(n))P(e,bs,n);else if((function(t){return te(t,"ArrowLeft",tn)})(n))P(e,es,n);else if((function(t){return te(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))P(e,dn,n);else if((function(t){return te(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))P(e,dr,n);else if((function(t){return te(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Ki=!0,P(e,Dn,n);else if((function(t){return t.key===" "})(n))P(e,Yo,n);else if((function(t){return Nt&&te(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Ki=!0,P(e,cn,!0);else if((function(t){return te(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Ki=!1,P(e,Dn,n);else if((function(t){return te(t,"Backspace",{shiftKey:"any"})||Nt&&te(t,"h",{ctrlKey:!0})})(n))Ld(n)?P(e,qo,n):(n.preventDefault(),P(e,Ot,!0));else if((function(t){return t.key==="Escape"})(n))P(e,ui,n);else if((function(t){return te(t,"Delete",{})||Nt&&te(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?P(e,Zo,n):(n.preventDefault(),P(e,Ot,!1));else if((function(t){return te(t,"Backspace",Dd)})(n))n.preventDefault(),P(e,cr,!0);else if((function(t){return te(t,"Delete",Dd)})(n))n.preventDefault(),P(e,cr,!1);else if((function(t){return Nt&&te(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),P(e,ur,!0);else if((function(t){return Nt&&(te(t,"Delete",{metaKey:!0})||te(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),P(e,ur,!1);else if((function(t){return te(t,"b",tn)})(n))n.preventDefault(),P(e,ve,"bold");else if((function(t){return te(t,"u",tn)})(n))n.preventDefault(),P(e,ve,"underline");else if((function(t){return te(t,"i",tn)})(n))n.preventDefault(),P(e,ve,"italic");else if((function(t){return te(t,"Tab",{shiftKey:"any"})})(n))P(e,xs,n);else if((function(t){return te(t,"z",tn)})(n))n.preventDefault(),P(e,ai,void 0);else if((function(t){return Nt?te(t,"z",{metaKey:!0,shiftKey:!0}):te(t,"y",{ctrlKey:!0})||te(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),P(e,ci,void 0);else{const t=e._editorState._selection;t===null||N(t)?Rd(n)&&(n.preventDefault(),P(e,Xr,n)):(function(r){return te(r,"c",tn)})(n)?(n.preventDefault(),P(e,xr,n)):(function(r){return te(r,"x",tn)})(n)?(n.preventDefault(),P(e,di,n)):Rd(n)&&(n.preventDefault(),P(e,Xr,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(Yh,n),!0}function ng(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Jr=new Map;function rg(n){const e=Ug(n.target);if(e===null)return;const t=al(e.anchorNode);if(t===null)return;Ka&&(Ka=!1,Wt(t,()=>{const a=bn(),c=e.anchorNode;(re(c)||qt(c))&&Fe(tl(a,e,t,n))}));const r=Yc(t),i=r[r.length-1],s=i._key,o=Jr.get(s),l=o||i;l!==t&&dd(e,l,!1),dd(e,t,!0),t!==i?Jr.set(s,t):o&&Jr.delete(s)}function fd(n){n._lexicalHandled=!0}function hd(n){return n._lexicalHandled===!0}function My(n){const e=za.get(n);if(e===void 0)return;const t=go.get(e);if(t===void 0)return;const r=t-1;r>=0||L(164),za.delete(n),go.set(e,r),r===0&&e.removeEventListener("selectionchange",rg);const i=ws(n);ll(i)?((function(o){if(o._parentEditor!==null){const l=Yc(o),a=l[l.length-1]._key;Jr.get(a)===o&&Jr.delete(a)}else Jr.delete(o._key)})(i),n.__lexicalEditor=null):i&&L(198);const s=ng(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function Ha(n,e,t){Oe();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(l){const a=O();if(!N(a)||!A(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return Eo(d,l)&&c.set(l.__key,0,"element"),Eo(f,l)&&u.set(l.__key,0,"element"),a})(n);let o=!1;if(N(s)&&e){const l=s.anchor,a=s.focus;l.key===r&&(So(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),a.key===r&&(So(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else je(s)&&e&&n.isSelected()&&n.selectPrevious();if(N(s)&&e&&!o){const l=n.getIndexWithinParent();jt(n),xo(s,i,l,-1)}else jt(n);t||ze(i)||i.canBeEmpty()||!i.isEmpty()||Ha(i,e),e&&s&&be(i)&&i.isEmpty()&&i.selectEnd()}function $y(n){return n}const ig=Symbol.for("ephemeral");function mo(n){return n[ig]||!1}class Kt{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=Es(this);return e===void 0&&L(64,this.name),e}static clone(e){L(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Ag(this,e)}getType(){return this.__type}isInline(){L(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=q(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||O();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if(D(this))return r;if(N(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(V(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.getLastChild()))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:q(e)}getParentOrThrow(){const e=this.getParent();return e===null&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ze(t))return A(e)||e===this&&V(e)||L(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(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:q(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:q(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=A(this)?this:this.getParent(),r=A(e)?e:e.getParent(),i=t&&r?Hi(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=Hi(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?cu(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&L(279),!1)))}isParentOf(e){const t=Hi(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const l=A(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const a=t?s.getNextSibling():s.getPreviousSibling();if(a!==null){s=a;continue}const c=s.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&L(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);s=u}return t||r.reverse(),r}isDirty(){const e=ie()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(mo(this))return this;const e=q(this.__key);return e===null&&L(113),e}getWritable(){if(mo(this))return this;Oe();const e=xn(),t=ie(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,l=O();if(l!==null&&l.setCachedNodes(null),o.has(i))return wo(s),s;const a=iu(s);return o.add(i),wo(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){L(70)}updateDOM(e,t,r){L(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){L(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const l of Kh(i).flatKeys)l in r&&(o!==void 0&&o!==s||(o={...s}),o[l]=r[l]);return(i.__state||o)&&Jo(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){Ha(this,!0,e)}replace(e,t){Oe();let r=O();r!==null&&(r=r.clone()),na(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;jt(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(Ha(i,!1,!0),u===null?a.__first=o:u.getWritable().__next=o,l.__prev=f,d===null?a.__last=o:d.getWritable().__prev=o,l.__next=h,l.__parent=g,a.__size=c,t&&(A(this)&&A(l)||L(139),this.getChildren().forEach(p=>{l.append(p)})),N(r)){Fe(r);const p=r.anchor,m=r.focus;p.key===s&&_d(p,l),m.key===s&&_d(m,l)}return kn()===s&&Me(o),l}insertAfter(e,t=!0){Oe(),na(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=O();let l=!1,a=!1;if(s!==null){const h=e.getIndexWithinParent();if(jt(i),N(o)){const g=s.__key,p=o.anchor,m=o.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,a=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&N(o)){const h=this.getIndexWithinParent();xo(o,u,h+1);const g=u.__key;l&&o.anchor.set(g,h+2,"element"),a&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Oe(),na(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;jt(i);const o=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();o===null?l.__first=s:o.getWritable().__next=s,l.__size++,r.__prev=s,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=O();return t&&N(u)&&xo(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return H()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Oe();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(A(r))return r.select();if(!D(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){Oe();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(A(r))return r.select(0,0);if(!D(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const _o="historic",sg="history-push",Gr="history-merge",Pc="paste",og="collaboration",Iy="skip-collab",lg="skip-scroll-into-view",ag="skip-dom-selection",Ja="skip-selection-focus";class Sr extends Kt{static getType(){return"linebreak"}static clone(e){return new Sr(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
6
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&
|
|
3
|
+
`,H_=On?" ":zo,Ah="֑-߿יִ-﷽ﹰ-ﻼ",Oh="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",J_=new RegExp("^[^"+Oh+"]*["+Ah+"]"),V_=new RegExp("^[^"+Ah+"]*["+Oh+"]"),ze={bold:1,capitalize:1024,code:16,highlight:xc,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},G_={directionless:1,unmergeable:2},Hu={center:2,end:6,justify:4,left:1,right:3,start:5},Y_={[B_]:"center",[j_]:"end",[K_]:"justify",[z_]:"left",[U_]:"right",[W_]:"start"},q_={normal:0,segmented:2,token:1},Z_={[N_]:"normal",[O_]:"segmented",[A_]:"token"},X_="$",Ju="$config";function Mh(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(A(o)&&Mh(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}let Ea=!1,Sc=0;function Q_(n){Sc=n.timeStamp}function Wl(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&il(n,t)!==void 0}function ey(n,e,t){const r=Ct(St(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Jc(e,o,i,s,!1)}function ty(n,e,t){if(N(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Yt(e)&&t.isAttached()}function ny(n,e,t,r){for(let i=n;i&&!zg(i);i=ys(i)){const s=il(i,e);if(s!==void 0){const o=Z(s,t);if(o)return Y(o)||!te(i)?void 0:[i,o]}else if(i===r)return[r,Eg(t)]}}function $h(n,e,t){Ea=!0;const r=performance.now()-Sc>100;try{Kt(n,()=>{const i=M()||(function(f){return f.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const h=e[f],g=h.type,p=h.target,m=ny(p,n,l,o);if(!m)continue;const[b,_]=m;if(g==="characterData")r&&D(_)&&Yt(p)&&ty(i,p,_)&&ey(p,_,n);else if(g==="childList"){c=!0;const y=h.addedNodes;for(let x=0;x<y.length;x++){const w=y[x],k=Wc(w),v=w.parentNode;if(v!=null&&w!==a&&k===null&&!Wl(w,v,n)){if(On){const I=(te(w)?w.innerText:null)||w.nodeValue;I&&(u+=I)}v.removeChild(w)}}const C=h.removedNodes,S=C.length;if(S>0){let x=0;for(let w=0;w<S;w++){const k=C[w];(Wl(k,p,n)||a===k)&&(p.appendChild(k),x++)}S!==x&&s.set(b,_)}}}if(s.size>0)for(const[f,h]of s)h.reconcileObservedMutation(f,n);const d=t.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const b=g[m],_=b.parentNode;_==null||b.nodeName!=="BR"||Wl(b,p,n)||_.removeChild(b)}}t.takeRecords()}i!==null&&(c&&De(i),On&&Mg(n)&&i.insertRawText(u))})}finally{Ea=!1}}function Ih(n){const e=n._observer;e!==null&&$h(n,e.takeRecords(),e)}function Fh(n){(function(e){Sc===0&&St(e).addEventListener("textInput",Q_,!0)})(n),n._observer=new MutationObserver((e,t)=>{$h(n,e,t)})}let ry=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||oy).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Cc(n,e){return new ry(n,e)}function ji(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function iy(n,e,t){const r=ji(n,t,"direct"),i=ji(e,t,"direct");return t.isEqual(r,i)?null:[r,i]}function js(n,e,t){let r;if(Me(),typeof t=="function"){const s=n.getLatest(),o=ji(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return Uo(i).updateFromKnown(e,r),i}function Dh(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:i}=bs(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let sy=class Lh{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,l=s!==void 0?s:(function(a,c,u){let d=u.size;if(c)for(const f in c){const h=a.get(f);h&&u.has(h)||d++}return d})(o,r,i);this.size=l}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return Vu(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new Lh(e,t,(function(s,o,l){let a;if(l)for(const[c,u]of Object.entries(l)){const d=s.get(c);d?o.has(d)||o.set(d,d.parse(u)):(a=a||{},a[c]=u)}return a})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=Vu(s)),this.size++),i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function Uo(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new sy(e,Rh(e));return e.__state=t,t}function Rh(n){return n.__state?n.__state.sharedNodeState:Bc(fi(),n.getType()).sharedNodeState}function Vu(n){if(n)for(const e in n)return n}function oy(n){return n}function Gu(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function Yu(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function qu(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function Zu(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,d){if(u===d)return!0;if(u&&d&&u.size!==d.size)return!1;const f=new Set;return!(u&&Gu(f,u,d)||d&&Gu(f,d,u)||u&&Yu(f,u,d)||d&&Yu(f,d,u))})(a,c))}function Xu(n,e){const t=n.mergeWithSibling(e),r=ie()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Qu(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&D(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Zu(e,r)){r=Xu(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&D(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Zu(r,t)){r=Xu(r,t);break}break}t.remove()}}else r.remove()}function Mn(n){return ed(n.anchor),ed(n.focus),n}function ed(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),D(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!A(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let ir,Ge,Hi,Ko,Ta,Na,sr,Tt,Aa,Ji,Ee="",Rt=null,Gn=null,Rr=!1,no=!1;function ro(n,e){const t=sr.get(n);if(e!==null){const r=Ia(n);r.parentNode===e&&e.removeChild(r)}if(Tt.has(n)||Ge._keyToDOMMap.delete(n),A(t)){const r=so(t,sr);Oa(r,0,r.length-1,null)}t!==void 0&&Gc(Ji,Hi,Ko,t,"destroyed")}function Oa(n,e,t,r){for(let i=e;i<=t;++i){const s=n[i];s!==void 0&&ro(s,r)}}function Vn(n,e){n.setProperty("text-align",e)}const ly="40px";function Ph(n,e){const t=ir.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")||ly;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function zh(n,e){const t=n.style;e===0?Vn(t,""):e===1?Vn(t,"left"):e===2?Vn(t,"center"):e===3?Vn(t,"right"):e===4?Vn(t,"justify"):e===5?Vn(t,"start"):e===6&&Vn(t,"end")}function Ma(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(ye(r))return null;const s=r.getParentOrThrow();return ye(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function io(n,e){const t=Tt.get(n);t===void 0&&L(60);const r=t.createDOM(ir,Ge);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const d=`__lexicalKey_${c._key}`;a[d]=u})(s,o,i),l.set(i,s)})(n,r,Ge),D(t)?r.setAttribute("data-lexical-text","true"):Y(t)&&r.setAttribute("data-lexical-decorator","true"),A(t)){const i=t.__indent,s=t.__size;if(Ma(r,t),i!==0&&Ph(r,i),s!==0){const l=s-1;$a(so(t,Tt),t,0,l,t.getDOMSlot(r))}const o=t.__format;o!==0&&zh(r,o),t.isInline()||Bh(null,t,r)}else{const i=t.getTextContent();if(Y(t)){const s=t.decorate(Ge,ir);s!==null&&Uh(n,s),r.contentEditable="false"}Ee+=i}return e!==null&&e.insertChild(r),Gc(Ji,Hi,Ko,t,"created"),r}function $a(n,e,t,r,i){const s=Ee;Ee="";let o=t;for(;o<=r;++o){io(n[o],i);const l=Tt.get(n[o]);l!==null&&D(l)?Rt===null&&(Rt=l.getFormat(),Gn=l.getStyle()):A(l)&&o<r&&!l.isInline()&&(Ee+=Bo)}i.element.__lexicalTextContent=Ee,Ee=s+Ee}function td(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return ue(r)?"line-break":Y(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Bh(n,e,t){const r=td(n,sr),i=td(e,Tt);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function ay(n,e,t){var r;Rt=null,Gn=null,(function(i,s,o){const l=Ee,a=i.__size,c=s.__size;Ee="";const u=o.element;if(a===1&&c===1){const d=i.__first,f=s.__first;if(d===f)Hs(d,u);else{const g=Ia(d),p=io(f,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const b=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${d}}.`;throw new Error(b)}throw m}ro(d,null)}const h=Tt.get(f);D(h)&&Rt===null&&(Rt=h.getFormat(),Gn=h.getStyle())}else{const d=so(i,sr),f=so(s,Tt);if(d.length!==a&&L(227),f.length!==c&&L(228),a===0)c!==0&&$a(f,0,0,c-1,o);else if(c===0){if(a!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Oa(d,0,a-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,b,_){const y=m-1,C=b-1;let S,x,w=_.getFirstChild(),k=0,v=0;for(;k<=y&&v<=C;){const O=g[k],z=p[v];if(O===z)w=jl(Hs(z,_.element)),k++,v++;else{if(x===void 0&&(x=nd(p,v)),S===void 0)S=nd(g,k);else if(!S.has(O)){k++;continue}if(!x.has(O)){w=jl(Ia(O)),ro(O,_.element),k++,S.delete(O);continue}if(S.has(z)){const B=ur(Ge,z);B!==w&&_.withBefore(w).insertChild(B),w=jl(Hs(z,_.element)),k++,v++}else io(z,_.withBefore(w)),v++}const F=Tt.get(z);F!==null&&D(F)?Rt===null&&(Rt=F.getFormat(),Gn=F.getStyle()):A(F)&&v<=C&&!F.isInline()&&(Ee+=Bo)}const I=k>y,T=v>C;if(I&&!T){const O=p[C+1],z=O===void 0?null:Ge.getElementByKey(O);$a(p,0,v,C,_.withBefore(z))}else T&&!I&&Oa(g,k,y,_.element)})(0,d,f,a,c,o)}u.__lexicalTextContent=Ee,Ee=l+Ee})(n,e,e.getDOMSlot(t)),r=e,Rt==null||Rt===r.__textFormat||no||r.setTextFormat(Rt),(function(i){Gn==null||Gn===i.__textStyle||no||i.setTextStyle(Gn)})(e)}function so(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&L(101),t.push(r),r=i.__next}return t}function Hs(n,e){const t=sr.get(n);let r=Tt.get(n);t!==void 0&&r!==void 0||L(61);const i=Rr||Na.has(n)||Ta.has(n),s=ur(Ge,n);if(t===r&&!i){let o;if(A(t)){const l=s.__lexicalTextContent;typeof l=="string"?o=l:(o=t.getTextContent(),s.__lexicalTextContent=o)}else o=t.getTextContent();return Ee+=o,s}if(t!==r&&i&&Gc(Ji,Hi,Ko,r,"updated"),r.updateDOM(t,s,ir)){const o=io(n,null);return e===null&&L(62),e.replaceChild(o,s),ro(n,null),o}if(A(t)){A(r)||L(334,n);const o=r.__indent;(Rr||o!==t.__indent)&&Ph(s,o);const l=r.__format;if((Rr||l!==t.__format)&&zh(s,l),i)ay(t,r,s),ye(r)||r.isInline()||Bh(t,r,s);else{const a=s.__lexicalTextContent;let c;typeof a=="string"?c=a:(c=t.getTextContent(),s.__lexicalTextContent=c),Ee+=c}if((Rr||r.__dir!==t.__dir)&&(Ma(s,r),ye(r)&&!Rr))for(const a of r.getChildren())A(a)&&Ma(ur(Ge,a.getKey()),a)}else{const o=r.getTextContent();if(Y(r)){const l=r.decorate(Ge,ir);l!==null&&Uh(n,l)}Ee+=o}if(!no&&ye(r)&&r.__cachedText!==Ee){const o=r.getWritable();o.__cachedText=Ee,r=o}return s}function Uh(n,e){let t=Ge._pendingDecorators;const r=Ge._decorators;if(t===null){if(r[n]===e)return;t=kg(Ge)}t[n]=e}function jl(n){let e=n.nextSibling;return e!==null&&e===Ge._blockCursorElement&&(e=e.nextSibling),e}function nd(n,e){const t=new Set;for(let r=e;r<n.length;r++)t.add(n[r]);return t}function cy(n,e,t,r,i,s){Ee="",Rr=r===2,Ge=t,ir=t._config,Hi=t._nodes,Ko=Ge._listeners.mutation,Ta=i,Na=s,sr=n._nodeMap,Tt=e._nodeMap,no=e._readOnly,Aa=new Map(t._keyToDOMMap);const o=new Map;return Ji=o,Hs("root",null),Ge=void 0,Hi=void 0,Ta=void 0,Na=void 0,sr=void 0,Tt=void 0,ir=void 0,Aa=void 0,Ji=void 0,o}function Ia(n){const e=Aa.get(n);return e===void 0&&L(75,n),e}function K(n){return{type:n}}const ni=K("SELECTION_CHANGE_COMMAND"),wc=K("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),mr=K("CLICK_COMMAND"),vc=K("BEFORE_INPUT_COMMAND"),kc=K("INPUT_COMMAND"),Ec=K("COMPOSITION_START_COMMAND"),Tc=K("COMPOSITION_END_COMMAND"),Nt=K("DELETE_CHARACTER_COMMAND"),ln=K("INSERT_LINE_BREAK_COMMAND"),$n=K("INSERT_PARAGRAPH_COMMAND"),Tn=K("CONTROLLED_TEXT_INSERTION_COMMAND"),ri=K("PASTE_COMMAND"),Vi=K("REMOVE_TEXT_COMMAND"),or=K("DELETE_WORD_COMMAND"),lr=K("DELETE_LINE_COMMAND"),ve=K("FORMAT_TEXT_COMMAND"),ii=K("UNDO_COMMAND"),si=K("REDO_COMMAND"),Nc=K("KEYDOWN_COMMAND"),Wo=K("KEY_ARROW_RIGHT_COMMAND"),oo=K("MOVE_TO_END"),hs=K("KEY_ARROW_LEFT_COMMAND"),Gi=K("MOVE_TO_START"),cn=K("KEY_ARROW_UP_COMMAND"),ar=K("KEY_ARROW_DOWN_COMMAND"),In=K("KEY_ENTER_COMMAND"),jo=K("KEY_SPACE_COMMAND"),Ho=K("KEY_BACKSPACE_COMMAND"),oi=K("KEY_ESCAPE_COMMAND"),Jo=K("KEY_DELETE_COMMAND"),gs=K("KEY_TAB_COMMAND"),lo=K("INSERT_TAB_COMMAND"),Bt=K("INDENT_CONTENT_COMMAND"),nn=K("OUTDENT_CONTENT_COMMAND"),Vo=K("DROP_COMMAND"),Ac=K("FORMAT_ELEMENT_COMMAND"),Go=K("DRAGSTART_COMMAND"),Oc=K("DRAGOVER_COMMAND"),Kh=K("DRAGEND_COMMAND"),_r=K("COPY_COMMAND"),li=K("CUT_COMMAND"),Gr=K("SELECT_ALL_COMMAND"),Mc=K("CLEAR_EDITOR_COMMAND"),Wh=K("CLEAR_HISTORY_COMMAND"),Ni=K("CAN_REDO_COMMAND"),Ai=K("CAN_UNDO_COMMAND"),$c=K("FOCUS_COMMAND"),ai=K("BLUR_COMMAND"),jh=K("KEY_MODIFIER_COMMAND"),qt=Object.freeze({}),Fa=[["keydown",function(n,e){Yi=n.timeStamp,Hh=n.key,!e.isComposing()&&P(e,Nc,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Wn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Kt(e,()=>{Cg(t)||(Ra=!0)})}],["compositionstart",function(n,e){P(e,Ec,n)}],["compositionend",function(n,e){On?Oi=!0:ti||!ds&&!fs?P(e,Tc,n):(Pa=!0,za=n.data)}],["input",function(n,e){n.stopPropagation(),Kt(e,()=>{e.dispatchCommand(kc,n)},{event:n}),Pr=null}],["click",function(n,e){Kt(e,()=>{const t=M(),r=Ct(St(e)),i=_n();if(r){if(N(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!ye(o)&&de().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=le(o,a=>A(a)&&!a.isInline());A(l)&&l.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(te(s)||Yt(s))&&De(qo(i,r,e,n))}}P(e,mr,n)})}],["cut",qt],["copy",qt],["dragstart",qt],["dragover",qt],["dragend",qt],["paste",qt],["focus",qt],["blur",qt],["drop",qt]];to&&Fa.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||On&&Mg(r)||i!=="insertCompositionText"&&P(r,vc,t)})(n,e)]);let Yi=0,Hh=null,Jh=0,Pr=null;const Da=new WeakMap,ao=new WeakMap;let La=!1,Ra=!1,Li=!1,Oi=!1,Pa=!1,za="",qn=null,Vh=[0,"",0,"root",0];function Gh(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=ie(),c=Ct(St(a)),u=c!==null?c.anchorNode:null,d=s.key,f=a.getElementByKey(d),h=t.length;return d!==o.key||!D(l)||(!i&&(!to||Jh<r+50)||l.isDirty()&&h<2||Tg(t))&&s.offset!==o.offset&&!l.isComposing()||kt(l)||l.isDirty()&&h>1||(i||!to)&&f!==null&&!l.isComposing()&&u!==cr(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,b=p.getParentOrThrow(),_=Nn(p);return m===0?!p.canInsertTextBefore()||!b.canInsertTextBefore()&&!p.isComposing()||_||(function(y){const C=y.getPreviousSibling();return(D(C)||A(C)&&C.isInline())&&!C.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!b.canInsertTextAfter()&&!p.isComposing()||_)})(n,l)}function rd(n,e){return Yt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function id(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;La&&(La=!1,rd(r,i)&&rd(s,o)&&!qn)||Kt(e,()=>{if(!t)return void De(null);if(!di(e,r,s))return;let l=M();if(qn&&N(l)&&l.isCollapsed()){const a=l.anchor,c=qn.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=qn.clone(),De(l))}if(qn=null,N(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=St(e).event,d=u?u.timeStamp:performance.now(),[f,h,g,p,m]=Vh,b=de(),_=e.isComposing()===!1&&b.getTextContent()==="";if(d<m+200&&a.offset===g&&a.key===p)Js(l,f,h);else if(a.type==="text")D(c)||L(141),Yh(l,c);else if(a.type==="element"&&!_){A(c)||L(259);const y=a.getNode();y.isEmpty()?(function(C,S){const x=S.getTextFormat(),w=S.getTextStyle();Js(C,x,w)})(l,y):Js(l,0,"")}}else{const u=a.key,d=l.focus.key,f=l.getNodes(),h=f.length,g=l.isBackward(),p=g?o:i,m=g?i:o,b=g?d:u,_=g?u:d;let y=2047,C=!1;for(let S=0;S<h;S++){const x=f[S],w=x.getTextContentSize();if(D(x)&&w!==0&&!(S===0&&x.__key===b&&p===w||S===h-1&&x.__key===_&&m===0)&&(C=!0,y&=x.getFormat(),y===0))break}l.format=C?y:0}}P(e,ni,void 0)})}function Js(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Yh(n,e){Js(n,e.getFormat(),e.getStyle())}function qh(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function uy(n){const e=n.inputType,t=qh(n),r=ie(),i=M();if(e==="deleteContentBackward"){if(i===null){const d=_n();if(!N(d))return!0;De(d.clone())}if(N(i)){const d=i.anchor.key===i.focus.key;if(s=n.timeStamp,Hh==="MediaLast"&&s<Yi+30&&r.isComposing()&&d){if($e(null),Yi=0,setTimeout(()=>{Kt(r,()=>{$e(null)})},30),N(i)){const f=i.anchor.getNode();f.markDirty(),D(f)||L(142),Yh(i,f)}}else{$e(null),n.preventDefault();const f=i.anchor.getNode(),h=f.getTextContent(),g=f.canInsertTextAfter(),p=i.anchor.offset===0&&i.focus.offset===h.length;let m=ju&&d&&!p&&g;if(m&&i.isCollapsed()&&(m=!Y(bo(i.anchor,!0))),!m){P(r,Nt,!0);const b=M();ju&&N(b)&&b.isCollapsed()&&(qn=b,setTimeout(()=>qn=null))}}return!0}}var s;if(!N(i))return!0;const o=n.data;Pr!==null&&Hc(!1,r,Pr),i.dirty&&Pr===null||!i.isCollapsed()||ye(i.anchor.getNode())||t===null||i.applyDOMRange(t),Pr=null;const l=i.anchor,a=i.focus,c=l.getNode(),u=a.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
|
|
4
|
+
`)n.preventDefault(),P(r,ln,!1);else if(o===Bo)n.preventDefault(),P(r,$n,void 0);else if(o==null&&n.dataTransfer){const d=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(d)}else o!=null&&Gh(i,t,o,n.timeStamp,!0)?(n.preventDefault(),P(r,Tn,o)):Pr=o;return Jh=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":P(r,Tn,n);break;case"insertFromComposition":$e(null),P(r,Tn,n);break;case"insertLineBreak":$e(null),P(r,ln,!1);break;case"insertParagraph":$e(null),Li&&!ti?(Li=!1,P(r,ln,!1)):P(r,$n,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":P(r,ri,n);break;case"deleteByComposition":(function(d,f){return d!==f||A(d)||A(f)||!Nn(d)||!Nn(f)})(c,u)&&P(r,Vi,n);break;case"deleteByDrag":case"deleteByCut":P(r,Vi,n);break;case"deleteContent":P(r,Nt,!1);break;case"deleteWordBackward":P(r,or,!0);break;case"deleteWordForward":P(r,or,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":P(r,lr,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":P(r,lr,!1);break;case"formatStrikeThrough":P(r,ve,"strikethrough");break;case"formatBold":P(r,ve,"bold");break;case"formatItalic":P(r,ve,"italic");break;case"formatUnderline":P(r,ve,"underline");break;case"historyUndo":P(r,ii,void 0);break;case"historyRedo":P(r,si,void 0)}return!0}function dy(n){if(te(n.target)&&Cg(n.target))return!0;const e=ie(),t=M(),r=n.data,i=qh(n);if(r!=null&&N(t)&&Gh(t,i,r,n.timeStamp,!1)){Oi&&(co(e,r),Oi=!1);const s=t.anchor.getNode(),o=Ct(St(e));if(o===null)return!0;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;to&&!t.isCollapsed()&&D(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===Ag(o.anchorNode)||P(e,Tn,r);const u=r.length;On&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),ds||ti||fs||!e.isComposing()||(Yi=0,$e(null))}else Hc(!1,e,r!==null?r:void 0),Oi&&(co(e,r||void 0),Oi=!1);return(function(){Me();const s=ie();Ih(s)})(),!0}function fy(n){const e=ie(),t=M();if(N(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();$e(r.key),(n.timeStamp<Yi+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||D(i)&&i.getStyle()!==t.style)&&P(e,Tn,H_)}return!0}function hy(n){return co(ie(),n.data),!0}function co(n,e){const t=n._compositionKey;if($e(null),t!==null&&e!=null){if(e===""){const r=Z(t),i=cr(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&D(r)&&Jc(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
5
|
+
`){const r=M();if(N(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void P(n,In,null)}}}Hc(!0,n,e)}function gy(n){const e=ie();if(n.key==null)return!0;if(Pa&&Ad(n))return Kt(e,()=>{co(e,za)}),Pa=!1,za="",!0;if((function(t){return ne(t,"ArrowRight",{shiftKey:"any"})})(n))P(e,Wo,n);else if((function(t){return ne(t,"ArrowRight",Qt)})(n))P(e,oo,n);else if((function(t){return ne(t,"ArrowLeft",{shiftKey:"any"})})(n))P(e,hs,n);else if((function(t){return ne(t,"ArrowLeft",Qt)})(n))P(e,Gi,n);else if((function(t){return ne(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))P(e,cn,n);else if((function(t){return ne(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))P(e,ar,n);else if((function(t){return ne(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Li=!0,P(e,In,n);else if((function(t){return t.key===" "})(n))P(e,jo,n);else if((function(t){return Et&&ne(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Li=!0,P(e,ln,!0);else if((function(t){return ne(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Li=!1,P(e,In,n);else if((function(t){return ne(t,"Backspace",{shiftKey:"any"})||Et&&ne(t,"h",{ctrlKey:!0})})(n))Ad(n)?P(e,Ho,n):(n.preventDefault(),P(e,Nt,!0));else if((function(t){return t.key==="Escape"})(n))P(e,oi,n);else if((function(t){return ne(t,"Delete",{})||Et&&ne(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?P(e,Jo,n):(n.preventDefault(),P(e,Nt,!1));else if((function(t){return ne(t,"Backspace",Nd)})(n))n.preventDefault(),P(e,or,!0);else if((function(t){return ne(t,"Delete",Nd)})(n))n.preventDefault(),P(e,or,!1);else if((function(t){return Et&&ne(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),P(e,lr,!0);else if((function(t){return Et&&(ne(t,"Delete",{metaKey:!0})||ne(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),P(e,lr,!1);else if((function(t){return ne(t,"b",Qt)})(n))n.preventDefault(),P(e,ve,"bold");else if((function(t){return ne(t,"u",Qt)})(n))n.preventDefault(),P(e,ve,"underline");else if((function(t){return ne(t,"i",Qt)})(n))n.preventDefault(),P(e,ve,"italic");else if((function(t){return ne(t,"Tab",{shiftKey:"any"})})(n))P(e,gs,n);else if((function(t){return ne(t,"z",Qt)})(n))n.preventDefault(),P(e,ii,void 0);else if((function(t){return Et?ne(t,"z",{metaKey:!0,shiftKey:!0}):ne(t,"y",{ctrlKey:!0})||ne(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),P(e,si,void 0);else{const t=e._editorState._selection;t===null||N(t)?Od(n)&&(n.preventDefault(),P(e,Gr,n)):(function(r){return ne(r,"c",Qt)})(n)?(n.preventDefault(),P(e,_r,n)):(function(r){return ne(r,"x",Qt)})(n)?(n.preventDefault(),P(e,li,n)):Od(n)&&(n.preventDefault(),P(e,Gr,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(jh,n),!0}function Zh(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Kr=new Map;function Xh(n){const e=Lg(n.target);if(e===null)return;const t=rl(e.anchorNode);if(t===null)return;Ra&&(Ra=!1,Kt(t,()=>{const a=_n(),c=e.anchorNode;(te(c)||Yt(c))&&De(qo(a,e,t,n))}));const r=jc(t),i=r[r.length-1],s=i._key,o=Kr.get(s),l=o||i;l!==t&&id(e,l,!1),id(e,t,!0),t!==i?Kr.set(s,t):o&&Kr.delete(s)}function sd(n){n._lexicalHandled=!0}function od(n){return n._lexicalHandled===!0}function py(n){const e=Da.get(n);if(e===void 0)return;const t=ao.get(e);if(t===void 0)return;const r=t-1;r>=0||L(164),Da.delete(n),ao.set(e,r),r===0&&e.removeEventListener("selectionchange",Xh);const i=_s(n);nl(i)?((function(o){if(o._parentEditor!==null){const l=jc(o),a=l[l.length-1]._key;Kr.get(a)===o&&Kr.delete(a)}else Kr.delete(o._key)})(i),n.__lexicalEditor=null):i&&L(198);const s=Zh(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function Ba(n,e,t){Me();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(l){const a=M();if(!N(a)||!A(l))return a;const{anchor:c,focus:u}=a,d=c.getNode(),f=u.getNode();return xo(d,l)&&c.set(l.__key,0,"element"),xo(f,l)&&u.set(l.__key,0,"element"),a})(n);let o=!1;if(N(s)&&e){const l=s.anchor,a=s.focus;l.key===r&&(mo(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),a.key===r&&(mo(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else je(s)&&e&&n.isSelected()&&n.selectPrevious();if(N(s)&&e&&!o){const l=n.getIndexWithinParent();Wt(n),po(s,i,l,-1)}else Wt(n);t||Ue(i)||i.canBeEmpty()||!i.isEmpty()||Ba(i,e),e&&s&&ye(i)&&i.isEmpty()&&i.selectEnd()}function my(n){return n}const Qh=Symbol.for("ephemeral");function uo(n){return n[Qh]||!1}class Ut{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=bs(this);return e===void 0&&L(64,this.name),e}static clone(e){L(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),vg(this,e)}getType(){return this.__type}isInline(){L(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Z(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(D(this))return r;if(N(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(Y(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.getLastChild()))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:Z(e)}getParentOrThrow(){const e=this.getParent();return e===null&&L(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(Ue(t))return A(e)||e===this&&Y(e)||L(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&L(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:Z(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:Z(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=A(this)?this:this.getParent(),r=A(e)?e:e.getParent(),i=t&&r?zi(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=zi(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?iu(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&L(279),!1)))}isParentOf(e){const t=zi(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const l=A(s)?t?s.getFirstChild():s.getLastChild():null;if(l!==null){s=l;continue}const a=t?s.getNextSibling():s.getPreviousSibling();if(a!==null){s=a;continue}const c=s.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;do{if(d===null&&L(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||i.has(d.__key)||r.push(d)}while(u===null);s=u}return t||r.reverse(),r}isDirty(){const e=ie()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(uo(this))return this;const e=Z(this.__key);return e===null&&L(113),e}getWritable(){if(uo(this))return this;Me();const e=yn(),t=ie(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,l=M();if(l!==null&&l.setCachedNodes(null),o.has(i))return yo(s),s;const a=Qc(s);return o.add(i),yo(a),r.set(i,a),a}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){L(70)}updateDOM(e,t,r){L(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){L(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const l of Rh(i).flatKeys)l in r&&(o!==void 0&&o!==s||(o={...s}),o[l]=r[l]);return(i.__state||o)&&Uo(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){Ba(this,!0,e)}replace(e,t){Me();let r=M();r!==null&&(r=r.clone()),ql(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Wt(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),f=i.__prev,h=i.__next,g=i.__parent;if(Ba(i,!1,!0),u===null?a.__first=o:u.getWritable().__next=o,l.__prev=f,d===null?a.__last=o:d.getWritable().__prev=o,l.__next=h,l.__parent=g,a.__size=c,t&&(A(this)&&A(l)||L(139),this.getChildren().forEach(p=>{l.append(p)})),N(r)){De(r);const p=r.anchor,m=r.focus;p.key===s&&ud(p,l),m.key===s&&ud(m,l)}return vn()===s&&$e(o),l}insertAfter(e,t=!0){Me(),ql(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=M();let l=!1,a=!1;if(s!==null){const h=e.getIndexWithinParent();if(Wt(i),N(o)){const g=s.__key,p=o.anchor,m=o.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,a=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=i.__key,f=r.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,r.__next=d,i.__next=f,i.__prev=r.__key,i.__parent=r.__parent,t&&N(o)){const h=this.getIndexWithinParent();po(o,u,h+1);const g=u.__key;l&&o.anchor.set(g,h+2,"element"),a&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Me(),ql(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;Wt(i);const o=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),a=r.__prev,c=this.getIndexWithinParent();o===null?l.__first=s:o.getWritable().__next=s,l.__size++,r.__prev=s,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent;const u=M();return t&&N(u)&&po(u,this.getParentOrThrow(),c),e}isParentRequired(){return!1}createParentElementNode(){return J()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Me();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(A(r))return r.select();if(!D(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){Me();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(A(r))return r.select(0,0);if(!D(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const fo="historic",eg="history-push",Wr="history-merge",Ic="paste",tg="collaboration",_y="skip-collab",ng="skip-scroll-into-view",rg="skip-dom-selection",Ua="skip-selection-focus";class yr extends Ut{static getType(){return"linebreak"}static clone(e){return new yr(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
6
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&qi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&As(i)){const s=r.lastChild;if(s===t||s.previousSibling===t&&As(s))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&qi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&As(i))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&As(s))return!0}return!1})(e)?null:{conversion:yy,priority:0}}}static importJSON(e){return ot().updateFromJSON(e)}}function yy(n){return{node:ot()}}function ot(){return Re(new yr)}function ue(n){return n instanceof yr}function As(n){return Yt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function Hl(n,e){return 16&e?"code":e&xc?"mark":32&e?"sub":64&e?"sup":null}function Jl(n,e){return 1&e?"strong":2&e?"em":"span"}function ig(n,e,t,r,i){const s=r.classList;let o=jr(i,"base");o!==void 0&&s.add(...o),o=jr(i,"underlineStrikethrough");let l=!1;const a=8&e&&4&e;o!==void 0&&(8&t&&4&t?(l=!0,a||s.add(...o)):a&&s.remove(...o));for(const c in ze){const u=ze[c];if(o=jr(i,c),o!==void 0)if(t&u){if(l&&(c==="underline"||c==="strikethrough")){e&u&&s.remove(...o);continue}((e&u)===0||a&&c==="underline"||c==="strikethrough")&&s.add(...o)}else e&u&&s.remove(...o)}}function sg(n,e,t){const r=e.firstChild,i=t.isComposing(),s=n+(i?zo:"");if(r==null)e.textContent=s;else{const o=r.nodeValue;if(o!==s)if(i||On){const[l,a,c]=(function(u,d){const f=u.length,h=d.length;let g=0,p=0;for(;g<f&&g<h&&u[g]===d[g];)g++;for(;p+g<f&&p+g<h&&u[f-p-1]===d[h-p-1];)p++;return[g,f-g-p,d.slice(g,h-p)]})(o,s);a!==0&&r.deleteData(l,a),r.insertData(l,c)}else r.nodeValue=s}}function ld(n,e,t,r,i,s){sg(i,n,e);const o=s.theme.text;o!==void 0&&ig(0,0,r,n,o)}function Os(n,e){const t=document.createElement(e);return t.appendChild(n),t}class qe extends Ut{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new qe(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Z_[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===vn()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=ze[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return _o(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=Hl(0,r),s=Jl(0,r),o=i===null?s:i,l=document.createElement(o);let a=l;this.hasFormat("code")&&l.setAttribute("spellcheck","false"),i!==null&&(a=document.createElement(s),l.appendChild(a)),ld(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,s=e.__format,o=this.__format,l=Hl(0,s),a=Hl(0,o),c=Jl(0,s),u=Jl(0,o);if((l===null?c:l)!==(a===null?u:a))return!0;if(l===a&&c!==u){const p=t.firstChild;p==null&&L(48);const m=document.createElement(u);return ld(m,this,0,o,i,r),t.replaceChild(m,p),!1}let d=t;a!==null&&l!==null&&(d=t.firstChild,d==null&&L(49)),sg(i,d,this);const f=r.theme.text;f!==void 0&&s!==o&&ig(0,s,o,d,f);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:Cy,priority:0}),b:()=>({conversion:xy,priority:0}),code:()=>({conversion:Zt,priority:0}),em:()=>({conversion:Zt,priority:0}),i:()=>({conversion:Zt,priority:0}),mark:()=>({conversion:Zt,priority:0}),s:()=>({conversion:Zt,priority:0}),span:()=>({conversion:by,priority:0}),strong:()=>({conversion:Zt,priority:0}),sub:()=>({conversion:Zt,priority:0}),sup:()=>({conversion:Zt,priority:0}),u:()=>({conversion:Zt,priority:0})}}static importJSON(e){return he().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return te(t)||L(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=Os(t,"b")),this.hasFormat("italic")&&(t=Os(t,"i")),this.hasFormat("strikethrough")&&(t=Os(t,"s")),this.hasFormat("underline")&&(t=Os(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?ze[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?G_[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=_o(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=q_[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){Me();let r=e,i=t;const s=M(),o=this.getTextContent(),l=this.__key;if(typeof o=="string"){const a=o.length;r===void 0&&(r=a),i===void 0&&(i=a)}else r=0,i=0;if(!N(s))return ag(l,r,l,i,"text","text");{const a=vn();a!==s.anchor.key&&a!==s.focus.key||$e(l),s.setTextNodeRange(this,r,this,i)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const s=this.getWritable(),o=s.__text,l=r.length;let a=e;a<0&&(a=l+a,a<0&&(a=0));const c=M();if(i&&N(c)){const d=e+l;c.setTextNodeRange(s,d,s,d)}const u=o.slice(0,a)+r+o.slice(a+t);return s.__text=u,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Me();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,s=vn(),o=r.length;e.sort((k,v)=>k-v),e.push(o);const l=[],a=e.length;for(let k=0,v=0;k<o&&v<=a;v++){const I=e[v];I>k&&(l.push(r.slice(k,I)),k=I)}const c=l.length;if(c===1)return[t];const u=l[0],d=t.getParent();let f;const h=t.getFormat(),g=t.getStyle(),p=t.__detail;let m=!1,b=null,_=null;const y=M();if(N(y)){const[k,v]=y.isBackward()?[y.focus,y.anchor]:[y.anchor,y.focus];k.type==="text"&&k.key===i&&(b=k),v.type==="text"&&v.key===i&&(_=v)}t.isSegmented()?(f=he(u),f.__format=h,f.__style=g,f.__detail=p,f.__state=qu(t,f),m=!0):f=t.setTextContent(u);const C=[f];for(let k=1;k<c;k++){const v=he(l[k]);v.__format=h,v.__style=g,v.__detail=p,v.__state=qu(t,v);const I=v.__key;s===i&&$e(I),C.push(v)}const S=b?b.offset:null,x=_?_.offset:null;let w=0;for(const k of C){if(!b&&!_)break;const v=w+k.getTextContentSize();if(b!==null&&S!==null&&S<=v&&S>=w&&(b.set(k.getKey(),S-w,"text"),S<v&&(b=null)),_!==null&&x!==null&&x<=v&&x>=w){_.set(k.getKey(),x-w,"text");break}w=v}if(d!==null){(function(I){const T=I.getPreviousSibling(),O=I.getNextSibling();T!==null&&yo(T),O!==null&&yo(O)})(this);const k=d.getWritable(),v=this.getIndexWithinParent();m?(k.splice(v,0,C),this.remove()):k.splice(v,1,C),N(y)&&po(y,d,v,c-1)}return C}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||L(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;vn()===i&&$e(r);const l=M();if(N(l)){const d=l.anchor,f=l.focus;d!==null&&d.key===i&&_d(d,t,r,e,o),f!==null&&f.key===i&&_d(f,t,r,e,o)}const a=e.__text,c=t?a+s:s+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}function by(n){return{forChild:Fc(n.style),node:null}}function xy(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Fc(e.style,t?void 0:"bold"),node:null}}const ad=new WeakMap;function Sy(n){if(!te(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function Cy(n){const e=n;n.parentElement===null&&L(129);let t=e.textContent||"";if((function(r){let i,s=r.parentNode;const o=[r];for(;s!==null&&(i=ad.get(s))===void 0&&!Sy(s);)o.push(s),s=s.parentNode;const l=i===void 0?s:i;for(let a=0;a<o.length;a++)ad.set(o[a],l);return l})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],s=r.length;for(let o=0;o<s;o++){const l=r[o];l===`
|
|
7
7
|
`||l===`\r
|
|
8
|
-
`?i.push(
|
|
9
|
-
`),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=o?h.slice(l):h.slice(a):f===r&&(h=o?h.slice(0,a):h.slice(0,l)),c+=h}else!
|
|
8
|
+
`?i.push(ot()):l===" "?i.push(yt()):l!==""&&i.push(he(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=cd(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(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=cd(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:he(t)}}function cd(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,te(t)){const s=t.style.display;if(s===""&&!Co(t)||s!==""&&!s.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(Yt(t))return t;if(t.nodeName==="BR")return null}}const wy={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Zt(n){const e=wy[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Fc(n.style,e),node:null}}function he(n=""){return Re(new qe(n))}function D(n){return n instanceof qe}function Fc(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",s=r.includes("line-through"),o=n.fontStyle==="italic",l=r.includes("underline"),a=n.verticalAlign;return c=>(D(c)&&(i&&!c.hasFormat("bold")&&c.toggleFormat("bold"),s&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),o&&!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 br extends qe{static getType(){return"tab"}static clone(e){return new br(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=jr(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return yt().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Th(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||L(286),this}setDetail(e){return e!==2&&L(127),this}setMode(e){return e!=="normal"&&L(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function yt(){return Re(new br)}function Je(n){return n instanceof br}class vy{key;offset;type;_selection;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){return this.key===e.key?this.offset<e.offset:ru(et(It(this,"next")),et(It(e,"next")))<0}getNode(){const e=Z(this.key);return e===null&&L(20),e}set(e,t,r,i){const s=this._selection,o=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,Sr()||(vn()===o&&$e(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}}function Ae(n,e,t){return new vy(n,e,t)}function Vl(n,e){let t=e.__key,r=n.offset,i="element";if(D(e)){i="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!A(e)){const s=e.getNextSibling();if(D(s))t=s.__key,r=0,i="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function ud(n,e){if(A(e)){const t=e.getLastDescendant();A(t)||D(t)?Vl(n,t):Vl(n,e)}else Vl(n,e)}class Yo{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!je(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 Yo(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 s;if(D(i))s=i.select();else{const o=i.getIndexWithinParent()+1;s=i.getParentOrThrow().select(o,o)}s.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const s=Z(i);s!==null&&r.push(s)}return Sr()||(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}deleteNodes(){const e=this.getNodes();if((M()||_n())===this&&e[0]){const t=xe(e[0],"next");cl(Vt(t,t))}for(const t of e)t.remove()}}function N(n){return n instanceof xr}class xr{format;style;anchor;focus;_cachedNodes;dirty;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!!N(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=(function(r){const i=[],[s,o]=r.getTextSlices();s&&i.push(s.caret.origin);const l=new Set,a=new Set;for(const c of r)if(ut(c)){const{origin:u}=c;i.length===0?l.add(u):(a.add(u),i.push(u))}else{const{origin:u}=c;A(u)&&a.has(u)||i.push(u)}if(o&&i.push(o.caret.origin),Fn(r.focus)&&A(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=lt(r.focus.origin,"previous");ut(c)&&l.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(i[i.length-1]);c=hr(c))l.delete(c.origin),i.pop();for(;i.length>1;){const c=i[i.length-1];if(!A(c)||a.has(c)||c.isEmpty()||l.has(c))break;i.pop()}if(i.length===0&&r.isCollapsed()){const c=et(r.anchor),u=et(r.anchor.getFlipped()),d=h=>At(h)?h.origin:h.getNodeAtCaret(),f=d(c)||d(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);i.push(f)}return i})(ul(wo(this),"next"));return Sr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,s=this.focus,o=i.isBefore(s),[l,a]=ho(this);let c="",u=!0;for(let d=0;d<e.length;d++){const f=e[d];if(A(f)&&!f.isInline())u||(c+=`
|
|
9
|
+
`),u=!f.isEmpty();else if(u=!1,D(f)){let h=f.getTextContent();f===t?f===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=l<a?h.slice(l,a):h.slice(a,l)):h=o?h.slice(l):h.slice(a):f===r&&(h=o?h.slice(0,a):h.slice(0,l)),c+=h}else!Y(f)&&!ue(f)||f===r&&this.isCollapsed()||(c+=f.getTextContent())}return c}applyDOMRange(e){const t=ie(),r=t.getEditorState()._selection,i=lg(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[s,o]=i;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(o.key,o.offset,o.type,!0),Mn(this)}clone(){const e=this.anchor,t=this.focus;return new xr(Ae(e.key,e.offset,e.type),Ae(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=_o(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=ze[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];o===`
|
|
10
10
|
`||o===`\r
|
|
11
|
-
`?r.push(lt()):o===" "?r.push(Ct()):r.push(de(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,l=t),o.type==="element"&&(function(m,b,_,y){const S=m.getNode(),C=S.getChildAtIndex(m.offset),x=de();if(x.setFormat(_),x.setStyle(y),Tr(C))C.splice(0,0,[x]);else{const v=be(S)?H().append(x):x;C===null?S.append(v):C.insertBefore(v)}m.is(b)&&b.set(x.__key,0,"text"),m.set(x.__key,0,"text")})(o,l,i,s),l.type==="element"&&Rn(l,tt(Dt(l,"next")));const a=o.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||L(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(o.key,c,"text")),this.isCollapsed()&&a===h&&(Tt(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(D(m)&&m.canInsertTextBefore()&&!Tt(m)||(m=de(),m.setFormat(i),m.setStyle(s),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(Tt(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(D(m)&&!Tt(m)||(m=de(),m.setFormat(i),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=de(f.getTextContent());m.setFormat(i),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||A(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),dg(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(On(f)){const y=de(e);return y.select(),void f.replace(y)}const m=f.getFormat(),b=f.getStyle();if(a!==c||m===i&&b===s){if(He(f)){const y=de(e);return y.setFormat(i),y.setStyle(s),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=de(e);if(y.setFormat(i),y.setStyle(s),y.select(),a===0)f.insertBefore(y,!1);else{const[S]=f.splitText(a);S.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(s)}const _=c-a;f=f.spliceText(a,_,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=b))}else{const m=new Set([...f.getParentKeys(),...p.getParentKeys()]),b=A(f)?f:f.getParentOrThrow();let _=A(p)?p:p.getParentOrThrow(),y=p;if(!b.is(_)&&_.isInline())do y=_,_=_.getParentOrThrow();while(_.isInline());if(l.type==="text"&&(c!==0||p.getTextContent()==="")||l.type==="element"&&p.getIndexWithinParent()<c)if(D(p)&&!On(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const k=de(p.getTextContent());p.replace(k),p=k}be(l.getNode())||l.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const k=p.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?p.remove():k.remove()}else m.add(p.__key);const S=_.getChildren(),C=new Set(u),x=b.is(_),v=b.isInline()&&f.getNextSibling()===null?b:f;for(let k=S.length-1;k>=0;k--){const E=S[k];if(E.is(f)||A(E)&&E.isParentOf(f))break;E.isAttached()&&(!C.has(E)||E.is(y)?x||v.insertAfter(E,!1):E.remove())}if(!x){let k=_,E=null;for(;k!==null;){const M=k.getChildren(),T=M.length;(T===0||M[T-1].is(E))&&(m.delete(k.__key),E=k),k=k.getParent()}}if(On(f))if(a===h)f.select();else{const k=de(e);k.select(),f.replace(k)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=f.getFormat(),this.style=f.getStyle()));for(let k=1;k<d;k++){const E=u[k],M=E.__key;m.has(M)||E.remove()}}}removeText(){const e=O()===this;Ji(this,Vg(No(this))),e&&O()!==this&&Fe(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Me(null);const r=this.getNodes(),i=[];for(const S of r)D(S)&&i.push(S);const s=S=>{r.forEach(C=>{if(A(C)){const x=C.getFormatFlags(e,S);C.setTextFormat(x)}})},o=i.length;if(o===0)return this.toggleFormat(e),Me(null),void s(t);const l=this.anchor,a=this.focus,c=this.isBackward(),u=c?a:l,d=c?l:a;let f=0,h=i[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(f=1,h=i[1],g=0),h==null)return;const p=h.getFormatFlags(e,t);s(p);const m=o-1;let b=i[m];const _=d.type==="text"?d.offset:b.getTextContentSize();if(h.is(b)){if(g===_)return;if(Tt(h)||g===0&&_===h.getTextContentSize())h.setFormat(p);else{const S=h.splitText(g,_),C=g===0?S[0]:S[1];C.setFormat(p),u.type==="text"&&u.set(C.__key,0,"text"),d.type==="text"&&d.set(C.__key,_-g,"text")}return void(this.format=p)}g===0||Tt(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const y=b.getFormatFlags(e,p);_>0&&(_===b.getTextContentSize()||Tt(b)||([b]=b.splitText(_)),b.setFormat(y));for(let S=f+1;S<m;S++){const C=i[S],x=C.getFormatFlags(e,y);C.setFormat(x)}u.type==="text"&&u.set(h.__key,g,"text"),d.type==="text"&&d.set(b.__key,_,"text"),this.format=p|y}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=O();return N(g)||L(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=le(t,dt),i=e[e.length-1];if(A(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=ea(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(A(g)||V(g))&&!g.isInline())){A(r)||L(211,t.constructor.name,t.getType());const g=ea(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const p=H();let m=null;for(let b=0;b<g.length;b++){const _=g[b],y=ue(_);if(y||V(_)&&_.isInline()||A(_)&&_.isInline()||D(_)||_.isParentRequired()){if(m===null&&(m=_.createParentElementNode(),p.append(m),y))continue;m!==null&&m.append(_)}else p.append(_),m=null}return p})(e),o=s.getLastDescendant(),l=s.getChildren(),a=!A(r)||!r.isEmpty()?this.insertParagraph():null,c=l[l.length-1];let u=l[0];var d;A(d=u)&&dt(d)&&!d.isEmpty()&&A(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(A(r)||L(211,t.constructor.name,t.getType()),r.append(...u.getChildren()),u=l[1]),u&&(r===null&&L(212,t.constructor.name,t.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let b=p;const _=[p];for(;b!==m;)b.getNextSibling()||L(140),b=b.getNextSibling(),_.push(b);let y=g;for(const S of _)y=y.insertAfter(S)})(r,u));const f=le(o,dt);a&&A(f)&&(a.canMergeWhenEmpty()||dt(c))&&(f.append(...a.getChildren()),a.remove()),A(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=A(r)?r.getLastChild():null;ue(h)&&f!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=H();return fe().splice(this.anchor.offset,0,[o]),o.select(),o}const e=ea(this),t=le(this.anchor.getNode(),dt);A(t)||L(213);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=lt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=yo(this),l=this.isBackward(),[a,c]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=l?[o,s]:[s,o];if(t===0)return[];if(t===1){if(D(r)&&!this.isCollapsed()){const f=r.splitText(u,d),h=u===0?f[0]:f[1];return h?(a.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(D(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,a.set(r.getKey(),0,"text"))),D(i)){const f=i.getTextContent().length;d===0?e.pop():d!==f&&([i]=i.splitText(d),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(Ed(this,e,t,r))return;const i=e==="move",s=ie(),o=kt(Et(s));if(!o)return;const l=s._blockCursorElement,a=s._rootElement,c=this.focus.getNode();if(a===null||l===null||!A(c)||c.isInline()||c.canBeEmpty()||Va(l,s,a),this.dirty){let u=hr(s,this.anchor.key),d=hr(s,this.focus.key);this.anchor.type==="text"&&(u=fr(u)),this.focus.type==="text"&&(d=fr(d)),u&&d&&gg(o,u,this.anchor.offset,d,this.focus.offset)}if((function(u,d,f,h){u.modify(d,f,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const u=o.getRangeAt(0),d=this.anchor.getNode(),f=be(d)?d:zg(d);if(this.applyDOMRange(u),this.dirty=!0,!i){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const b=h[m];Eo(b,f)?g.push(b):p=!0}if(p&&g.length>0)if(t){const m=g[0];A(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];A(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}o.anchorNode===u.startContainer&&o.anchorOffset===u.startOffset||(function(m){const b=m.focus,_=m.anchor,y=_.key,S=_.offset,C=_.type;_.set(b.key,b.offset,b.type,!0),b.set(y,S,C,!0)})(this)}}r==="lineboundary"&&Ed(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&A(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(A(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=fl(Dt(r,e?"previous":"next"));if(s.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(const a of s.iterNodeCarets("shadowRoot"))if(ht(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(A(s.anchor.origin)&&s.anchor.origin.isEmpty()){const c=tt(a);Ji(this,Vt(c,c)),s.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Ln(a)){if(A(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(s.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(V(a.origin)){if(!a.origin.isIsolated())if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&A(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const c=zc();c.add(a.origin.getKey()),Fe(c)}else a.origin.remove();return}break}}if(l.type==="merge-block"){const{caret:a,block:c}=l;return Ji(this,Vt(!a.origin.isEmpty()&&c.isEmpty()?_i(ye(c,a.direction)):s.anchor,a)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&bd(this,r.getNode()))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 xd(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 xd(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,p=d.offset,m=g<p,b=m?g:p,_=m?p:g,y=_-1;b!==y&&(function(S){return!($g(S)||Uy(S))})(f.getTextContent().slice(b,_))&&(c?d.set(d.key,y,d.type):u.set(u.key,y,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&be(r.getParent())&&r.getPreviousSibling()===null&&bd(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,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 je(n){return n instanceof el}function yd(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function yo(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]:[yd(t),yd(r)]}function bd(n,e){for(let t=e;t;t=t.getParent()){if(A(t)){if(t.collapseAtStart(n))return!0;if(ze(t))break}if(t.getPreviousSibling())break}return!1}const Uy=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function xd(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let c=0;c<s;c++){const u=c===s-1;if(l=o,o+=i[c].length,e&&o===t||o>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 Sd(n,e,t,r){let i,s=e;if(re(n)){let o=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;s===a&&(o=!0,s=a-1);let u=l[s],d=!1;if(u===c)u=l[s+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&s--}if(i=Hr(u),D(i))s=$t(i,o?"next":"previous");else{let f=Hr(n);if(f===null)return null;if(A(f)){const h=r.getElementByKey(f.getKey());h===null&&L(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,n,e),A(f)||L(215),o&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let p=f.getChildAtIndex(s);if(A(p)&&(function(m,b,_){const y=m.getParent();return _===null||y===null||!y.canBeEmpty()||y!==_.getNode()})(p,0,t)){const m=o?p.getLastDescendant():p.getFirstDescendant();m===null?f=p:(p=m,f=A(p)?p:p.getParentOrThrow()),s=0}D(p)?(i=p,f=null,s=$t(p,o?"next":"previous")):p!==f&&o&&!d&&(A(f)||L(216),s=Math.min(f.getChildrenSize(),s+1))}else{const h=f.getIndexWithinParent();s=e===0&&V(f)&&Hr(n)===f?h:h+1,f=f.getParentOrThrow()}if(A(f))return Ne(f.__key,s,"element")}}else i=Hr(n);return D(i)?Ne(i.__key,$t(i,s,"clamp"),"text"):null}function Cd(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&&A(o)&&o.isInline()){const l=o.getPreviousSibling();D(l)&&n.set(l.__key,l.getTextContent().length,"text")}}else A(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):D(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&A(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&A(o)&&o.isInline()&&!o.canInsertTextAfter()){const l=o.getNextSibling();D(l)&&n.set(l.__key,0,"text")}}}function dg(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);Cd(n,r,i),Cd(e,!r,i),i&&e.set(n.key,n.offset,n.type);const s=ie();if(s.isComposing()&&s._compositionKey!==n.key&&N(t)){const o=t.anchor,l=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(l.key,l.offset,l.type,!0)}}}function fg(n,e,t,r,i,s){if(n===null||t===null||!pi(i,n,t))return null;const o=Sd(n,e,N(s)?s.anchor:null,i);if(o===null)return null;const l=Sd(t,r,N(s)?s.focus:null,i);if(l===null)return null;if(o.type==="element"&&l.type==="element"){const a=Hr(n),c=Hr(t);if(V(a)&&V(c))return null}return dg(o,l,s),[o,l]}function bo(n){return A(n)&&!n.isInline()}function hg(n,e,t,r,i,s){const o=xn(),l=new wr(Ne(n,e,i),Ne(t,r,s),0,"");return l.dirty=!0,o._selection=l,l}function hi(){const n=Ne("root",0,"element"),e=Ne("root",0,"element");return new wr(n,e,0,"")}function zc(){return new el(new Set)}function Ky(n,e){return tl(null,n,e,null)}function tl(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,l=o==="selectionchange",a=!Ma&&(l||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let c,u,d,f;if(N(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||o===void 0)&&N(n)&&!pi(t,c,u))return n.clone();const h=fg(c,d,u,f,t,n);if(h===null)return null;const[g,p]=h;return new wr(g,p,N(n)?n.format:0,N(n)?n.style:"")}function O(){return xn()._selection}function bn(){return ie()._editorState._selection}function xo(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!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"),s.set(a,u,"element"),wd(n)}}else{const c=n.isBackward(),u=c?s:i,d=u.getNode(),f=c?i:s,h=f.getNode();if(e.is(d)){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=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}wd(n)}function wd(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!A(s))return;const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(A(s)){const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(A(o)){const l=o.getChildrenSize(),a=i>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(i);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function So(n,e,t,r,i){let s=null,o=0,l=null;r!==null?(s=r.__key,D(r)?(o=r.getTextContentSize(),l="text"):A(r)&&(o=r.getChildrenSize(),l="element")):i!==null&&(s=i.__key,D(i)?l="text":A(i)&&(l="element")),s!==null&&l!==null?n.set(s,o,l):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function vd(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function gg(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function Wy(n,e,t,r,i,s,o){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(og)&&d!==s||d!==null&&ol(d))return;if(!N(e))return void(n!==null&&pi(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,p=h.key,m=hr(t,g),b=hr(t,p),_=f.offset,y=h.offset,S=e.format,C=e.style,x=e.isCollapsed();let v=m,k=b,E=!1;if(f.type==="text"){v=fr(m);const R=f.getNode();E=R.getFormat()!==S||R.getStyle()!==C}else N(n)&&n.anchor.type==="text"&&(E=!0);var M,T,I,K,$;if(h.type==="text"&&(k=fr(b)),v!==null&&k!==null&&(x&&(n===null||E||N(n)&&(n.format!==S||n.style!==C))&&(M=S,T=C,I=_,K=g,$=performance.now(),Xh=[M,T,I,K,$]),c!==_||u!==y||l!==v||a!==k||r.type==="Range"&&x||(d!==null&&s.contains(d)||i.has(Ja)||s.focus({preventScroll:!0}),f.type==="element"))){if(gg(r,v,_,k,y),!$n||!e.isCollapsed()||s===null||i.has(Ja)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!i.has(lg)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const R=N(e)&&e.anchor.type==="element"?v.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(R!==null){let W;if(R instanceof Text){const Z=document.createRange();Z.selectNode(R),W=Z.getBoundingClientRect()}else W=R.getBoundingClientRect();(function(Z,Y,se){const Ke=eu(se),qe=tu(Ke);if(Ke===null||qe===null)return;let{top:j,bottom:pe}=Y,oe=0,Ze=0,Se=se;for(;Se!==null;){const We=Se===Ke.body;if(We)oe=0,Ze=Et(Z).innerHeight;else{const bt=Se.getBoundingClientRect();oe=bt.top,Ze=bt.bottom}let Xe=0;if(j<oe?Xe=-(oe-j):pe>Ze&&(Xe=pe-Ze),Xe!==0)if(We)qe.scrollBy(0,Xe);else{const bt=Se.scrollTop;Se.scrollTop+=Xe;const Ce=Se.scrollTop-bt;j-=Ce,pe-=Ce}if(We)break;Se=vs(Se)}})(t,W,s)}}Ua=!0}}function nl(n){let e=O()||bn();e===null&&(e=fe().selectEnd()),e.insertNodes(n)}function jy(){const n=O();return n===null?"":n.getTextContent()}function ea(n){let e=n;n.isCollapsed()||e.removeText();const t=O();N(t)&&(e=t),N(e)||L(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!dt(i);){const o=i;if([i,s]=Hy(i,s),o.is(i))break}return s}function Hy(n,e){const t=n.getParent();if(!t){const i=H();return fe().append(i),i.select(),[fe(),0]}if(D(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(!A(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new wr(Ne(n.__key,e,"element"),Ne(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function Ed(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}const s=Dt(n.focus,t?"previous":"next"),o=r==="lineboundary",l=e==="move";let a=s,c=i==="decorators-and-blocks";if(!uu(a)){for(const u of a){c=!1;const{origin:d}=u;if(!V(d)||d.isIsolated()||(a=u,!o||!d.isInline()))break}if(c)for(const u of fl(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(ht(u))u.origin.isInline()||(a=u);else{if(A(u.origin))continue;V(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===s)return!1;if(l&&!o&&V(a.origin)&&a.origin.isKeyboardSelectable()){const u=zc();return u.add(a.origin.getKey()),Fe(u),!0}return a=tt(a),l&&Rn(n.anchor,a),Rn(n.focus,a),c||!o}let $e=null,Ie=null,st=!1,ta=!1,Xs=0;const kd={characterData:!0,childList:!0,subtree:!0};function vr(){return st||$e!==null&&$e._readOnly}function Oe(){st&&L(13)}function pg(){Xs>99&&L(14)}function xn(){return $e===null&&L(195,mg()),$e}function ie(){return Ie===null&&L(196,mg()),Ie}function mg(){let n=0;const e=new Set,t=Qr.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=ws(i);if(ll(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 Jy(){return Ie}function Td(n,e,t){const r=e.__type,i=Hc(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 l=0;l<o&&(s[l](e),e.isAttached());l++);}function Nd(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function _g(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function yg(n){return Uc(n,ie()._nodes)}function Uc(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(18,i.name);const s=i.importJSON(n),o=n.children;if(A(s)&&Array.isArray(o))for(let l=0;l<o.length;l++){const a=Uc(o[l],e);s.append(a)}return s}function Ad(n,e,t){const r=$e,i=st,s=Ie;$e=e,st=!0,Ie=n;try{return t()}finally{$e=r,st=i,Ie=s}}function nn(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,l=t._selection,a=n._dirtyType!==0,c=$e,u=st,d=Ie,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){Ie=n,$e=t,st=!1,n._updating=!0;try{const x=n._dirtyType,v=n._dirtyElements,k=n._dirtyLeaves;h.disconnect(),g=Ey(s,t,n,x,v,k)}catch(x){if(x instanceof Error&&n._onError(x),ta)throw x;return vg(n,null,r,t),Bh(n),n._dirtyType=2,ta=!0,nn(n,s),void(ta=!1)}finally{h.observe(r,kd),n._updating=f,$e=c,st=u,Ie=d}}t._readOnly||(t._readOnly=!0);const p=n._dirtyLeaves,m=n._dirtyElements,b=n._normalizedNodes,_=n._updateTags,y=n._deferred;a&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(x,v){const k=x._decorators;let E=x._pendingDecorators||k;const M=v._nodeMap;let T;for(T in E)M.has(T)||(E===k&&(E=Og(x)),delete E[T])})(n,t);const S=i?null:kt(Et(n));if(n._editable&&S!==null&&(a||l===null||l.dirty||!l.is(o))&&r!==null&&!_.has(ag)){Ie=n,$e=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const x=n._blockCursorElement;x!==null&&Va(x,n,r),Wy(o,l,n,S,_,r)}(function(x,v,k){let E=x._blockCursorElement;if(N(k)&&k.isCollapsed()&&k.anchor.type==="element"&&v.contains(document.activeElement)){const M=k.anchor,T=M.getNode(),I=M.offset;let K=!1,$=null;if(I===T.getChildrenSize())ra(T.getChildAtIndex(I-1))&&(K=!0);else{const R=T.getChildAtIndex(I);if(R!==null&&ra(R)){const W=R.getPreviousSibling();(W===null||ra(W))&&(K=!0,$=x.getElementByKey(R.__key))}}if(K){const R=x.getElementByKey(T.__key);return E===null&&(x._blockCursorElement=E=(function(W){const Z=W.theme,Y=document.createElement("div");Y.contentEditable="false",Y.setAttribute("data-lexical-cursor","true");let se=Z.blockCursor;if(se!==void 0){if(typeof se=="string"){const Ke=hn(se);se=Z.blockCursor=Ke}se!==void 0&&Y.classList.add(...se)}return Y})(x._config)),v.style.caretColor="transparent",void($===null?R.appendChild(E):R.insertBefore(E,$))}}E!==null&&Va(E,x,v)})(n,r,l)}finally{h!==null&&h.observe(r,kd),Ie=d,$e=c}}g!==null&&(function(x,v,k,E,M){const T=Array.from(x._listeners.mutation),I=T.length;for(let K=0;K<I;K++){const[$,R]=T[K];for(const W of R){const Z=v.get(W);Z!==void 0&&$(Z,{dirtyLeaves:E,prevEditorState:M,updateTags:k})}}})(n,g,_,p,s),N(l)||l===null||o!==null&&o.is(l)||n.dispatchCommand(oi,void 0);const C=n._pendingDecorators;C!==null&&(n._decorators=C,n._pendingDecorators=null,Wi("decorator",n,!0,C)),(function(x,v,k){const E=Id(v),M=Id(k);E!==M&&Wi("textcontent",x,!0,M)})(n,e||s,t),Wi("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:g,normalizedNodes:b,prevEditorState:e||s,tags:_}),(function(x,v){if(x._deferred=[],v.length!==0){const k=x._updating;x._updating=!0;try{for(let E=0;E<v.length;E++)v[E]()}finally{x._updating=k}}})(n,y),(function(x){const v=x._updates;if(v.length!==0){const k=v.shift();if(k){const[E,M]=k;rl(x,E,M)}}})(n)}function Wi(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 Od(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,l=n._pendingEditorState;let a;o!==void 0&&(a=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(l===null&&L(191),l._flushSync=!0),a&&n._deferred.push(a),_g(n,o.tag)),l==null?rl(n,s,o):s()}}return r}function rl(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,_g(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const l=n._editorState;let a=n._pendingEditorState,c=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=bg(a||l),c=!0),a._flushSync=o;const u=$e,d=st,f=Ie,h=n._updating;$e=a,st=!1,n._updating=!0,Ie=n;const g=n._headless||n.getRootElement()===null;jc(null);try{c&&(g?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(_,y){const S=_.getEditorState()._selection,C=kt(Et(_));return N(S)||S==null?tl(S,C,_,y):S.clone()})(n,t&&t.event||null));const m=n._compositionKey;e(),s=Od(n,s),(function(_,y){const S=y.getEditorState()._selection,C=_._selection;if(N(C)){const x=C.anchor,v=C.focus;let k;if(x.type==="text"&&(k=x.getNode(),k.selectionTransform(S,C)),v.type==="text"){const E=v.getNode();k!==E&&E.selectionTransform(S,C)}}})(a,n),n._dirtyType!==0&&(s?(function(_,y){const S=y._dirtyLeaves,C=_._nodeMap;for(const x of S){const v=C.get(x);D(v)&&v.isAttached()&&v.isSimpleText()&&!v.isUnmergeable()&&od(v)}})(a,n):(function(_,y){const S=y._dirtyLeaves,C=y._dirtyElements,x=_._nodeMap,v=kn(),k=new Map;let E=S,M=E.size,T=C,I=T.size;for(;M>0||I>0;){if(M>0){y._dirtyLeaves=new Set;for(const K of E){const $=x.get(K);D($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&od($),$!==void 0&&Nd($,v)&&Td(y,$,k),S.add(K)}if(E=y._dirtyLeaves,M=E.size,M>0){Xs++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map,T.delete("root")&&T.set("root",!0);for(const K of T){const $=K[0],R=K[1];if(C.set($,R),!R)continue;const W=x.get($);W!==void 0&&Nd(W,v)&&Td(y,W,k)}E=y._dirtyLeaves,M=E.size,T=y._dirtyElements,I=T.size,Xs++}y._dirtyLeaves=S,y._dirtyElements=C})(a,n),Od(n),(function(_,y,S,C){const x=_._nodeMap,v=y._nodeMap,k=[];for(const[E]of C){const M=v.get(E);M!==void 0&&(M.isAttached()||(A(M)&&Lh(M,E,x,v,k,C),x.has(E)||C.delete(E),k.push(E)))}for(const E of k)v.delete(E);for(const E of S){const M=v.get(E);M===void 0||M.isAttached()||(x.has(E)||S.delete(E),v.delete(E))}})(l,a,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(a._flushSync=!0);const b=a._selection;if(N(b)){const _=a._nodeMap,y=b.anchor.key,S=b.focus.key;_.get(y)!==void 0&&_.get(S)!==void 0||L(19)}else je(b)&&b._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=l,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void nn(n)}finally{$e=u,st=d,Ie=f,n._updating=h,Xs=0}n._dirtyType!==0||n._deferred.length>0||(function(m,b){const _=b.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(_))return!0}else if(_!==null)return!0;return!1})(a,n)?a._flushSync?(a._flushSync=!1,nn(n)):c&&Yy(()=>{nn(n)}):(a._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Wt(n,e,t){Ie===n&&t===void 0?e():rl(n,e,t)}class ji{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new ji(this.element,e,this.after)}withAfter(e){return new ji(this.element,this.before,e)}withElement(e){return this.element===e?this:new ji(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&L(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&L(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&L(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(ys||si||_s);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,i))]}const s=Md(t,r);s.push(i);const o=Md(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const c=s[a],u=o[a];if(c===void 0||c<u)break;if(c>u){l+=1;break}}return[e.getParentOrThrow(),l]}}function Md(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&L(225),t.reverse()}class xe extends Kt{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return dy[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=ie()._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(D(t)&&e.push(t),A(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;A(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;A(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 A(s)&&s.getLastDescendant()||s||null}const i=t[e];return A(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:q(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:q(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(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(),A(s)&&i!==r-1&&!s.isInline()&&(e+=Ho)}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(),A(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Xu[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=Pe[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Co(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Oe();const r=O();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||A(a))return a.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const a=this.getLastChild();if(D(a)||A(a))return a.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const l=this.__key;return N(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,s,"element"),r.dirty=!0,r):hg(l,i,l,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!==""?Xu[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){mo(this)&&L(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||L(226,String(e),String(t),String(i));const o=s.__key,l=[],a=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r.length;if(e!==0)if(e===i)u=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&L(100);const p=h.getNextSibling(),m=h.__key;jt(h.getWritable()),a.push(m),h=p}}let f=u;for(const h of r){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());const g=h.getWritable();g.__parent===o&&d--,jt(g);const p=h.__key;if(f===null)s.__first=p,g.__prev=null;else{const m=f.getWritable();m.__next=p,g.__prev=m.__key}h.__key===o&&L(76),g.__parent=o,l.push(p),f=h}if(e+t===i)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(c!==null){const h=c.getWritable();if(f!==null){const g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(s.__size=d,a.length){const h=O();if(N(h)){const g=new Set(a),p=new Set(l),{anchor:m,focus:b}=h;$d(m,g,p)&&So(m,m.getNode(),this,u,c),$d(b,g,p)&&So(b,b.getNode(),this,u,c),d!==0||this.canBeEmpty()||ze(this)||this.remove()}}return s}getDOMSlot(e){return new ji(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||ze(this)||this.getChildren().some(D)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function A(n){return n instanceof xe}function $d(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 Ss extends Kt{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function V(n){return n instanceof Ss}class Er extends xe{__cachedText;static getType(){return"root"}static clone(){return new Er}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!vr()&&ie()._dirtyType!==0||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)A(i)||V(i)||L(282);return super.splice(e,t,r)}static importJSON(e){return fe().updateFromJSON(e)}collapseAtStart(){return!0}}function be(n){return n instanceof Er}function bg(n){return new Cs(new Map(n._nodeMap))}function Kc(){return new Cs(new Map([["root",new Er]]))}function xg(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),A(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=xg(i[s]);r.push(o)}}return e}function Sg(n){return n instanceof Cs}class Cs{_nodeMap;_selection;_flushSync;_readOnly;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 Ad(t&&t.editor||null,this,e)}clone(e){const t=new Cs(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Ad(null,this,()=>({root:xg(fe())}))}}class il extends xe{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class kr extends xe{static getType(){return"paragraph"}static clone(e){return new kr(e.__key)}createDOM(e){const t=document.createElement("p"),r=Vr(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Gy,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return H().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(D);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=H();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(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 Gy(n){const e=H();return n.style&&(e.setFormat(n.style.textAlign),ul(n,e)),{node:e}}function H(){return Le(new kr)}function Tr(n){return n instanceof kr}const B=0,G=1,Cg=2,wg=3,Wc=4;function vg(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Kc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,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 Eg(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=Es(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof Kt&&o!==Kt?o:void 0}}return e}function gi(n){const e=n||{},t=Jy(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=Kc(),l=e.namespace||(i!==null?i._config.namespace:Ig()),a=e.editorState,c=[Er,Ye,Sr,Cr,kr,il,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],b=null,_=null;if(typeof m!="function"){const C=m;m=C.replace,b=C.with,_=C.withKlass||null}Es(m);const y=m.getType(),S=Eg(m);h.set(y,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:b,replaceWithKlass:_,sharedNodeState:zh(c[p]),transforms:S})}}const g=new Qr(o,i,h,{disableEvents:s,namespace:l,theme:r},u||console.error,(function(p,m){const b=new Map,_=new Set,y=S=>{Object.keys(S).forEach(C=>{let x=b.get(C);x===void 0&&(x=[],b.set(C,x)),x.push(S[C])})};return p.forEach(S=>{const C=S.klass.importDOM;if(C==null||_.has(C))return;_.add(C);const x=C.call(S.klass);x!==null&&y(x)}),m&&y(m),b})(h,d?d.import:void 0),f,n);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=2),(function(p){p.registerCommand(Ac,ky,B),p.registerCommand(Oc,Ty,B),p.registerCommand(Mc,Ny,B),p.registerCommand($c,Ay,B),p.registerCommand(Ic,Oy,B)})(g),g}class Qr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,s,o,l,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ig(),this._onError=s,this._htmlConversions=o,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&&L(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&&L(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=Ya(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 o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,l){const a=Ya(o.getEditorState()),c=[];for(const u of l){const d=a.get(u);d&&c.push(d)}c.length!==0&&o.update(()=>{for(const u of c)for(const d of u.keys()){const f=q(d);f&&f.markDirty()}},o._pendingEditorState===null?{tag:Gr}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return P(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=Vr(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,vg(this,t,e,i),t!==null&&(this._config.disableEvents||My(t),r!=null&&t.classList.remove(...r)),e!==null){const s=tu(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=2,Bh(this),this._updateTags.add(Gr),nn(this),this._config.disableEvents||(function(l,a){const c=l.ownerDocument;za.set(l,c);const u=go.get(c)??0;u<1&&c.addEventListener("selectionchange",rg),go.set(c,u+1),l.__lexicalEditor=a;const d=ng(l);for(let f=0;f<Ba.length;f++){const[h,g]=Ba[f],p=typeof g=="function"?m=>{hd(m)||(fd(m),(a.isEditable()||h==="click")&&g(m,a))}:m=>{if(hd(m))return;fd(m);const b=a.isEditable();switch(h){case"cut":return b&&P(a,di,m);case"copy":return P(a,xr,m);case"paste":return b&&P(a,li,m);case"dragstart":return b&&P(a,Qo,m);case"dragover":return b&&P(a,Dc,m);case"dragend":return b&&P(a,Gh,m);case"focus":return b&&P(a,Rc,m);case"blur":return b&&P(a,fi,m);case"drop":return b&&P(a,Xo,m)}};l.addEventListener(h,p),d.push(()=>{l.removeEventListener(h,p)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Gr),nn(this);Wi("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38);let r=e;r._readOnly&&(r=bg(e),r._selection=e._selection?e._selection.clone():null),Ph(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),nn(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||nn(this)}parseEditorState(e,t){return(function(r,i,s){const o=Kc(),l=$e,a=st,c=Ie,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,$e=o,st=!1,Ie=i,jc(null);try{const g=i._nodes;Uc(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,$e=l,st=a,Ie=c}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return nn(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):rl(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Wt(this,()=>{const i=O(),s=fe();i!==null?i.dirty||Fe(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),Rg("focus"),Pg(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=kt(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Wi("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Qr.version="0.40.0+prod.esm";let Ga=null;function jc(n){Ga=n}let kg=1;function Vy(){kg=1}function Hc(n,e){const t=sl(n,e);return t===void 0&&L(30,e),t}function sl(n,e){return n._nodes.get(e)}const Yy=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Tg(n){return V(gt(n))}function ol(n){const e=document.activeElement;if(!re(e))return!1;const t=e.nodeName;return V(gt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&ws(e)==null)}function pi(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!ol(e)&&al(e)===n}catch{return!1}}function ll(n){return n instanceof Qr}function al(n){let e=n;for(;e!=null;){const t=ws(e);if(ll(t))return t;e=vs(e)}return null}function ws(n){return n?n.__lexicalEditor:null}function Ng(n){return ay.test(n)?"rtl":cy.test(n)?"ltr":null}function On(n){return He(n)||n.isToken()}function Tt(n){return On(n)||n.isSegmented()}function qt(n){return jn(n)&&n.nodeType===3}function Jc(n){return jn(n)&&n.nodeType===9}function fr(n){let e=n;for(;e!=null;){if(qt(e))return e;e=e.firstChild}return null}function Co(n,e,t){const r=Pe[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=~Pe.superscript:e==="superscript"?i&=~Pe.subscript:e==="lowercase"?(i&=~Pe.uppercase,i&=~Pe.capitalize):e==="uppercase"?(i&=~Pe.lowercase,i&=~Pe.capitalize):e==="capitalize"&&(i&=~Pe.lowercase,i&=~Pe.uppercase),i}function Gc(n){return D(n)||ue(n)||V(n)}function Ag(n,e){const t=(function(){const o=Ga;return Ga=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Oe(),pg();const r=ie(),i=xn(),s=""+kg++;i._nodeMap.set(s,n),A(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function jt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,l=i!==null?i.__key:null,a=i!==null?i.getWritable():null,c=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=l),a!==null&&(a.__next=o),c!==null&&(c.__prev=l),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function wo(n){pg(),mo(n)&&L(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=xn(),i=ie(),s=r._nodeMap,o=i._dirtyElements;t!==null&&(function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}})(t,s,o);const l=e.__key;i._dirtyType=1,A(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function Me(n){Oe();const e=ie(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=q(t);r!==null&&r.getWritable()}if(n!==null){const r=q(n);r!==null&&r.getWritable()}}}function kn(){return vr()?null:ie()._compositionKey}function q(n,e){const t=(e||xn())._nodeMap.get(n);return t===void 0?null:t}function Vc(n,e){const t=cl(n,ie());return t!==void 0?q(t,e):null}function cl(n,e){return n[`__lexicalKey_${e._key}`]}function gt(n,e){let t=n;for(;t!=null;){const r=Vc(t,e);if(r!==null)return r;t=vs(t)}return null}function Og(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Id(n){return n.read(()=>fe().getTextContent())}function fe(){return Mg(xn())}function Mg(n){return n._nodeMap.get("root")}function Fe(n){Oe();const e=xn();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Hr(n){const e=ie(),t=(function(r,i){let s=r;for(;s!=null;){const o=cl(s,i);if(o!==void 0)return o;s=vs(s)}return null})(n,e);return t===null?n===e.getRootElement()?q("root"):null:q(t)}function $g(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Yc(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ig(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Fg(n){return qt(n)?n.nodeValue:null}function qc(n,e,t){const r=kt(Et(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=Fg(i);const a=gt(i);if(l!==null&&D(a)){if(l===jo&&t){const c=t.length;l=t,s=c,o=c}l!==null&&Zc(a,l,s,o,n)}}}function Zc(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===jo&&(l=e.slice(0,-1));const a=s.getTextContent();if(i||l!==a){if(l===""){if(Me(null),_s||si||ys)s.remove();else{const p=ie();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}const c=s.getParent(),u=bn(),d=s.getTextContentSize(),f=kn(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!o||N(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=O();if(!N(g)||t===null||r===null)return void Fd(s,l,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const p=de(s.getTextContent());s.replace(p),s=p}Fd(s,l,g)}}}function Fd(n,e,t){if(n.setTextContent(e),N(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=$t(n,s.offset,"clamp"))}}}function Ls(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Dg(n,e){return Ls(n,e,"altKey")&&Ls(n,e,"ctrlKey")&&Ls(n,e,"shiftKey")&&Ls(n,e,"metaKey")}function te(n,e,t){return Dg(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const tn={ctrlKey:!Nt,metaKey:Nt},Dd={altKey:Nt,ctrlKey:!Nt};function Ld(n){return n.key==="Backspace"}function Rd(n){return te(n,"a",tn)}function Xc(n){const e=fe();if(N(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),In(n),n}{const t=e.select(0,e.getChildrenSize());return Fe(In(t)),t}}function Vr(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=hn(i);return t[e]=s,s}return i}function Qc(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&L(33,s);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(o),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(o,d?"updated":i)}function qy(n){const e=n.getType(),t=xn();if(t._readOnly){const s=Ya(t).get(e);return s?Array.from(s.values()):[]}const r=t._nodeMap,i=[];for(const[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&i.push(s);return i}function Pd(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 vo(n,e){const t=n.offset;if(n.type==="element")return Pd(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?Pd(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function Lg(n){const e=Et(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function P(n,e,t){return(function(r,i,s){const o=Yc(r);for(let l=4;l>=0;l--)for(let a=0;a<o.length;a++){const c=o[a],u=c._commands.get(i);if(u!==void 0){const d=u[l];if(d!==void 0){const f=Array.from(d),h=f.length;let g=!1;if(Wt(c,()=>{for(let p=0;p<h;p++)if(f[p](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function hr(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&L(75,e),t}function vs(n){const e=n.assignedSlot||n.parentElement;return ko(e)?e.host:e}function eu(n){return Jc(n)?n:re(n)?n.ownerDocument:null}function Zy(n){return ie()._updateTags.has(n)}function Rg(n){Oe(),ie()._updateTags.add(n)}function Pg(n){Oe(),ie()._deferred.push(n)}function Eo(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function tu(n){const e=eu(n);return e?e.defaultView:null}function Et(n){const e=n._window;return e===null&&L(78),e}function Bg(n){return A(n)&&n.isInline()||V(n)&&n.isInline()}function zg(n){let e=n.getParentOrThrow();for(;e!==null;){if(ze(e))return e;e=e.getParentOrThrow()}return e}function ze(n){return be(n)||A(n)&&n.isShadowRoot()}function nu(n){const e=n.constructor.clone(n);return Ag(e,null),e.afterCloneFrom(n),e}function Le(n){const e=ie(),t=n.getType(),r=sl(e,t);r===void 0&&L(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),l=o.constructor;return s!==null?o instanceof s||L(201,s.name,s.getType(),l.name,l.getType(),n.constructor.name,t):o instanceof n.constructor&&l!==n.constructor||L(202,l.name,l.getType(),n.constructor.name,t),o.__key===n.__key&&L(203,n.constructor.name,t,l.name,l.getType()),o}return n}function na(n,e){!be(n.getParent())||A(e)||V(e)||L(99)}function Qn(n){const e=q(n);return e===null&&L(63,n),e}function ra(n){return(V(n)||A(n)&&!n.canBeEmpty())&&!n.isInline()}function Va(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function kt(n){return Lt?(n||window).getSelection():null}function Ug(n){const e=tu(n);return e?e.getSelection():null}function Xy(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),ze(n)&&L(102);const r=o=>{const l=o.getParentOrThrow(),a=ze(l),c=o!==t||a?nu(o):o;if(a)return A(o)&&A(c)||L(133),o.insertAfter(c),[o,c,c];{const[u,d,f]=r(l),h=o.getNextSiblings();return f.append(c,...h),[u,d,c]}},[i,s]=r(t);return[i,s]}function ru(n){return re(n)&&n.tagName==="A"}function re(n){return jn(n)&&n.nodeType===1}function jn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function ko(n){return jn(n)&&n.nodeType===11}function To(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function ns(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 dt(n){if(V(n)&&!n.isInline())return!0;if(!A(n)||ze(n))return!1;const e=n.getFirstChild(),t=e===null||ue(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function mi(){return ie()}const Bd=new WeakMap,Qy=new Map;function Ya(n){if(!n._readOnly&&n.isEmpty())return Qy;n._readOnly||L(192);let e=Bd.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let l=r.get(o);l||(l=new Map,r.set(o,l)),l.set(i,s)}return r})(n),Bd.set(n,e)),e}function iu(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Kg(n){return(e=iu(n))[ig]=!0,e;var e}function ul(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Wg(n){n.__lexicalUnmanaged=!0}function jg(n){return n.__lexicalUnmanaged===!0}function Ai(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==Kt[e]}function Es(n){const e=Qu in n.prototype?n.prototype[Qu]():void 0,t=(function(o){if(!(o===Kt||o.prototype instanceof Kt)){let l="<unknown>",a="<unknown>";try{l=o.getType()}catch{}try{Qr.version&&(a=JSON.parse(Qr.version))}catch{}L(290,o.name,l,a)}return o===Ss||o===xe||o===Kt})(n),r=!t&&Ai(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,l]of Object.entries(e))s=o,i=l;if(!t&&s&&(Ai(n,"getType")||(n.getType=()=>s),Ai(n,"clone")||(n.clone=o=>(jc(o),new n)),Ai(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!Ai(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Hg(n){const e=mi();return Oe(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const le=(n,e)=>{let t=n;for(;t!=null&&!be(t);){if(e(t))return t;t=t.getParent()}return null},eb={next:"previous",previous:"next"};class dl{origin;constructor(e){this.origin=e}[Symbol.iterator](){return hl({hasNext:Ln,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return ye(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return ye(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),l=new Map;for(let a=s.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const c=a.origin.getWritable();l.set(c.getKey(),c)}for(const a of i){if(l.size>0){const c=s.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||s.origin.is(a))){const u=a.getParent();u&&u.is(o)&&a.remove(),c.replace(a)}}else c===null&&L(263,Array.from(l).join(" "))}else s.insert(a);s=ye(a,this.direction)}for(const a of l.values())a.remove();return this}}class rs extends dl{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:at(e,this.direction)}getParentCaret(e="root"){return ye(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Hn(this.direction);return ye(this.getNodeAtCaret(),e)||at(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof rs&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const tb={root:be,shadowRoot:ze};function Hn(n){return eb[n]}function su(n,e="root"){return tb[e](n)?null:n}class gr extends dl{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:ye(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return A(this.origin)?at(this.origin,this.direction):null}getParentCaret(e="root"){return ye(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Hn(this.direction);return ye(this.getNodeAtCaret(),e)||at(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof gr&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof gr||e instanceof pr)&&this.direction===e.direction&&this.origin.is(e.origin)}}class pr extends dl{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:fn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return ye(su(this.getParentAtCaret(),e),this.direction)}getFlipped(){return fn(this.origin,Hn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof pr&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof gr||e instanceof pr)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return ye(this.origin,this.direction)}}function Mt(n){return n instanceof pr}function nb(n){return n instanceof dl}function Ln(n){return n instanceof gr}function ht(n){return n instanceof rs}const rb={next:class extends pr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends pr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},ib={next:class extends gr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends gr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},sb={next:class extends rs{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends rs{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function ye(n,e){return n?new ib[e](n):null}function fn(n,e,t){return n?new rb[e](n,$t(n,t)):null}function $t(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&$h(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function qa(n,e){return new Gg(n,e)}function at(n,e){return A(n)?new sb[e](n):null}function Jg(n){return n&&n.getChildCaret()||n}function mr(n){return n&&Jg(n.getAdjacentCaret())}class ou{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new ou(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return Mt(s)?(function(o,l){const{direction:a,origin:c}=o,u=$t(c,l==="focus"?Hn(a):a);return qa(o,u-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[qa(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Mt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=Mt(r),s=o=>o.isSameNodeCaret(r)?null:mr(o)||o.getParentCaret(e);return hl({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Gg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),s=e.getTextContent();return fn(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function ob(n){return n instanceof Gg}function fl(n){return Vt(n,ye(fe(),n.direction))}function lu(n){return Vt(n,n)}function Vt(n,e){return n.direction!==e.direction&&L(265),new ou(n,e,n.direction)}function hl(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function au(n,e){const t=Hi(n.origin,e.origin);switch(t===null&&L(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return cu(t)}}function cu(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function Rs(n,e){return e.is(n)}function zd(n){return A(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function Hi(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=zd(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=zd(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?(Rs(n,r)||L(276),{commonAncestor:r,type:"ancestor"}):i===null?(Rs(e,r)||L(277),{commonAncestor:r,type:"descendant"}):((A(s)||Rs(n,s))&&(A(i)||Rs(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||L(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function Dt(n,e){const{type:t,key:r,offset:i}=n,s=Qn(n.key);return t==="text"?(D(s)||L(266,s.getType(),r),fn(s,e,i)):(A(s)||L(267,s.getType(),r),Yg(s,n.offset,e))}function Rn(n,e){const{origin:t,direction:r}=e,i=r==="next";Mt(e)?n.set(t.getKey(),e.offset,"text"):Ln(e)?D(t)?n.set(t.getKey(),$t(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(ht(e)&&A(t)||L(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function gl(n){const e=O(),t=N(e)?e:hi();return Ji(t,n),Fe(t),t}function Ji(n,e){Rn(n.anchor,e.anchor),Rn(n.focus,e.focus)}function No(n){const{anchor:e,focus:t}=n,r=Dt(e,"next"),i=Dt(t,"next"),s=au(r,i)<=0?"next":"previous";return Vt(Yt(r,s),Yt(i,s))}function _i(n){const{direction:e,origin:t}=n,r=ye(t,Hn(e)).getNodeAtCaret();return r?ye(r,e):at(t.getParentOrThrow(),e)}function Ud(n,e="root"){const t=[n];for(let r=ht(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(_i(r));return t}function ia(n){return!!n&&n.origin.isAttached()}function Vg(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=pl(n,r),o=Ud(s.anchor,t),l=Ud(s.focus.getFlipped(),t),a=new Set,c=[];for(const g of s.iterNodeCarets(t))if(ht(g))a.add(g.origin.getKey());else if(Ln(g)){const{origin:p}=g;A(p)&&!a.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),b=_i(ye(p,r)),_=p.getMode();if(Math.abs(g.distance)===m&&i==="removeEmptySlices"||_==="token"&&g.distance!==0)b.remove();else if(g.distance!==0){i="removeEmptySlices";let y=g.removeTextSlice();const S=g.caret.origin;if(_==="segmented"){const C=y.origin,x=de(C.getTextContent()).setStyle(C.getStyle()).setFormat(C.getFormat());b.replaceOrInsert(x),y=fn(x,r,y.offset)}S.is(o[0].origin)&&(o[0]=y),S.is(l[0].origin)&&(l[0]=y.getFlipped())}}let u,d;for(const g of o)if(ia(g)){u=tt(g);break}for(const g of l)if(ia(g)){d=tt(g);break}const f=(function(g,p,m){if(!g||!p)return null;const b=g.getParentAtCaret(),_=p.getParentAtCaret();if(!b||!_)return null;const y=b.getParents().reverse();y.push(b);const S=_.getParents().reverse();S.push(_);const C=Math.min(y.length,S.length);let x;for(x=0;x<C&&y[x]===S[x];x++);const v=(M,T)=>{let I;for(let K=x;K<M.length;K++){const $=M[K];if(ze($))return;!I&&T($)&&(I=$)}return I},k=v(y,dt),E=k&&v(S,M=>m.has(M.getKey())&&dt(M));return k&&E?[k,E]:null})(u,d,a);if(f){const[g,p]=f;at(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,d,...o,...l].find(ia);if(h)return lu(Yt(tt(h),n.direction));L(269,JSON.stringify(o.map(g=>g.origin.__key)))}function tt(n){const e=(function(i){let s=i;for(;ht(s);){const o=mr(s);if(!ht(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if(D(e.origin))return Mt(e)?e:fn(e.origin,t,t);const r=e.getAdjacentCaret();return Ln(r)&&D(r.origin)?fn(r.origin,t,Hn(t)):e}function uu(n){return Mt(n)&&n.offset!==$t(n.origin,n.direction)}function Yt(n,e){return n.direction===e?n:n.getFlipped()}function pl(n,e){return n.direction===e?n:Vt(Yt(n.focus,e),Yt(n.anchor,e))}function Yg(n,e,t){let r=at(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Yt(r,t)}function lb(n,e="root"){let t=0,r=n,i=mr(r);for(;i===null;){if(t--,i=r.getParentCaret(e),!i)return null;r=i,i=mr(r)}return i&&[i,t]}function ab(n){const{origin:e,offset:t,direction:r}=n;if(t===$t(e,r))return n.getSiblingCaret();if(t===$t(e,Hn(r)))return _i(n.getSiblingCaret());const[i]=e.splitText(t);return D(i)||L(281),Yt(ye(i,"next"),r)}function cb(n,e){return!0}function qg(n,{$copyElementNode:e=nu,$splitTextPointCaretNext:t=ab,rootMode:r="shadowRoot",$shouldSplit:i=cb}={}){if(Mt(n))return t(n);const s=n.getParentCaret(r);if(s){const{origin:o}=s;if(ht(n)&&(!o.canBeEmpty()||!i(o,"first")))return _i(s);const l=(function(a){const c=[];for(let u=a.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(l.length>0||o.canBeEmpty()&&i(o,"last"))&&s.insert(e(o).splice(0,0,l))}return s}function ub(n){return n}function Zg(...n){return n}function db(n,e){return[n,e]}function fb(n){return n}function Xg(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function hn(...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 me(n,...e){const t=hn(...e);t.length>0&&n.classList.add(...t)}function un(n,...e){const t=hn(...e);t.length>0&&n.classList.remove(...t)}function pt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const hb=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:Rg,$applyNodeReplacement:Le,$caretFromPoint:Dt,$caretRangeFromSelection:No,$cloneWithProperties:iu,$cloneWithPropertiesEphemeral:Kg,$comparePointCaretNext:au,$copyNode:nu,$create:Hg,$createLineBreakNode:lt,$createNodeSelection:zc,$createParagraphNode:H,$createPoint:Ne,$createRangeSelection:hi,$createRangeSelectionFromDom:Ky,$createTabNode:Ct,$createTextNode:de,$extendCaretToRange:fl,$findMatchingParent:le,$getAdjacentChildCaret:mr,$getAdjacentNode:vo,$getAdjacentSiblingOrParentSiblingCaret:lb,$getCaretInDirection:Yt,$getCaretRange:Vt,$getCaretRangeInDirection:pl,$getCharacterOffsets:yo,$getChildCaret:at,$getChildCaretAtIndex:Yg,$getChildCaretOrSelf:Jg,$getCollapsedCaretRange:lu,$getCommonAncestor:Hi,$getCommonAncestorResultBranchOrder:cu,$getEditor:mi,$getNearestNodeFromDOMNode:gt,$getNearestRootOrShadowRoot:zg,$getNodeByKey:q,$getNodeByKeyOrThrow:Qn,$getNodeFromDOMNode:Vc,$getPreviousSelection:bn,$getRoot:fe,$getSelection:O,$getSiblingCaret:ye,$getState:qi,$getStateChange:xy,$getTextContent:jy,$getTextNodeOffset:$t,$getTextPointCaret:fn,$getTextPointCaretSlice:qa,$getWritableNodeState:Jo,$hasAncestor:Eo,$hasUpdateTag:Zy,$insertNodes:nl,$isBlockElementNode:bo,$isChildCaret:ht,$isDecoratorNode:V,$isEditorState:Sg,$isElementNode:A,$isExtendableTextPointCaret:uu,$isInlineElementOrDecoratorNode:Bg,$isLeafNode:Gc,$isLineBreakNode:ue,$isNodeCaret:nb,$isNodeSelection:je,$isParagraphNode:Tr,$isRangeSelection:N,$isRootNode:be,$isRootOrShadowRoot:ze,$isSiblingCaret:Ln,$isTabNode:He,$isTextNode:D,$isTextPointCaret:Mt,$isTextPointCaretSlice:ob,$isTokenOrSegmented:Tt,$isTokenOrTab:On,$nodesOfType:qy,$normalizeCaret:tt,$normalizeSelection__EXPERIMENTAL:In,$onUpdate:Pg,$parseSerializedNode:yg,$removeTextFromCaretRange:Vg,$rewindSiblingCaret:_i,$selectAll:Xc,$setCompositionKey:Me,$setPointFromCaret:Rn,$setSelection:Fe,$setSelectionFromCaretRange:gl,$setState:Ys,$splitAtPointCaretNext:qg,$splitNode:Xy,$updateRangeSelectionFromCaretRange:Ji,ArtificialNode__DO_NOT_USE:il,BEFORE_INPUT_COMMAND:Ac,BLUR_COMMAND:fi,CAN_REDO_COMMAND:Fi,CAN_UNDO_COMMAND:Di,CLEAR_EDITOR_COMMAND:Lc,CLEAR_HISTORY_COMMAND:Vh,CLICK_COMMAND:br,COLLABORATION_TAG:og,COMMAND_PRIORITY_CRITICAL:Wc,COMMAND_PRIORITY_EDITOR:B,COMMAND_PRIORITY_HIGH:wg,COMMAND_PRIORITY_LOW:G,COMMAND_PRIORITY_NORMAL:Cg,COMPOSITION_END_COMMAND:$c,COMPOSITION_START_COMMAND:Mc,CONTROLLED_TEXT_INSERTION_COMMAND:An,COPY_COMMAND:xr,CUT_COMMAND:di,DELETE_CHARACTER_COMMAND:Ot,DELETE_LINE_COMMAND:ur,DELETE_WORD_COMMAND:cr,DRAGEND_COMMAND:Gh,DRAGOVER_COMMAND:Dc,DRAGSTART_COMMAND:Qo,DROP_COMMAND:Xo,DecoratorNode:Ss,ElementNode:xe,FOCUS_COMMAND:Rc,FORMAT_ELEMENT_COMMAND:Fc,FORMAT_TEXT_COMMAND:ve,HISTORIC_TAG:_o,HISTORY_MERGE_TAG:Gr,HISTORY_PUSH_TAG:sg,INDENT_CONTENT_COMMAND:Ut,INPUT_COMMAND:Oc,INSERT_LINE_BREAK_COMMAND:cn,INSERT_PARAGRAPH_COMMAND:Fn,INSERT_TAB_COMMAND:ho,INTERNAL_$isBlock:dt,IS_ALL_FORMATTING:ey,IS_BOLD:G_,IS_CODE:Z_,IS_HIGHLIGHT:Ec,IS_ITALIC:V_,IS_STRIKETHROUGH:Y_,IS_SUBSCRIPT:X_,IS_SUPERSCRIPT:Q_,IS_UNDERLINE:q_,KEY_ARROW_DOWN_COMMAND:dr,KEY_ARROW_LEFT_COMMAND:bs,KEY_ARROW_RIGHT_COMMAND:Vo,KEY_ARROW_UP_COMMAND:dn,KEY_BACKSPACE_COMMAND:qo,KEY_DELETE_COMMAND:Zo,KEY_DOWN_COMMAND:Ic,KEY_ENTER_COMMAND:Dn,KEY_ESCAPE_COMMAND:ui,KEY_MODIFIER_COMMAND:Yh,KEY_SPACE_COMMAND:Yo,KEY_TAB_COMMAND:xs,LineBreakNode:Sr,MOVE_TO_END:fo,MOVE_TO_START:es,NODE_STATE_KEY:gy,OUTDENT_CONTENT_COMMAND:sn,PASTE_COMMAND:li,PASTE_TAG:Pc,ParagraphNode:kr,REDO_COMMAND:ci,REMOVE_TEXT_COMMAND:Qi,RootNode:Er,SELECTION_CHANGE_COMMAND:oi,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:Nc,SELECT_ALL_COMMAND:Xr,SKIP_COLLAB_TAG:Iy,SKIP_DOM_SELECTION_TAG:ag,SKIP_SCROLL_INTO_VIEW_TAG:lg,SKIP_SELECTION_FOCUS_TAG:Ja,TEXT_TYPE_TO_FORMAT:Pe,TabNode:Cr,TextNode:Ye,UNDO_COMMAND:ai,addClassNamesToElement:me,buildImportMap:$y,configExtension:Zg,createCommand:z,createEditor:gi,createSharedNodeState:zh,createState:Tc,declarePeerDependency:db,defineExtension:ub,flipDirection:Hn,getDOMOwnerDocument:eu,getDOMSelection:kt,getDOMSelectionFromTarget:Ug,getDOMTextNode:fr,getEditorPropertyFromDOMNode:ws,getNearestEditorFromDOMNode:al,getRegisteredNode:sl,getRegisteredNodeOrThrow:Hc,getStaticNodeConfig:Es,getTextDirection:Ng,getTransformSetFromKlass:Eg,isBlockDomNode:ns,isCurrentlyReadOnlyMode:vr,isDOMDocumentNode:Jc,isDOMNode:jn,isDOMTextNode:qt,isDOMUnmanaged:jg,isDocumentFragment:ko,isExactShortcutMatch:te,isHTMLAnchorElement:ru,isHTMLElement:re,isInlineDomNode:To,isLexicalEditor:ll,isModifierMatch:Dg,isSelectionCapturedInDecoratorInput:ol,isSelectionWithinEditor:pi,makeStepwiseIterator:hl,mergeRegister:pt,normalizeClassNames:hn,removeClassNamesFromElement:un,removeFromParent:jt,resetRandomKey:Vy,safeCast:fb,setDOMUnmanaged:Wg,setNodeIndentFromDOM:ul,shallowMergeConfig:Xg},Symbol.toStringTag,{value:"Module"}));function gb(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ao=new Map;function Qg(n){const e={};if(!n)return e;const 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 is(n){let e=Ao.get(n);return e===void 0&&(e=Qg(n),Ao.set(n,e)),e}function pb(n){let e="";for(const t in n)t&&(e+=`${t}: ${n[t]};`);return e}function ep(n){const e=mi().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function tp(n){return ep(be(n)?n:n.getParentOrThrow())}function Kd(n){const e=tp(n);return e!==null&&e.direction==="rtl"}function np(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!Tt(e)&&r!==null){const[i,s]=r,o=n.isBackward(),l=i.getNode(),a=s.getNode(),c=e.is(l),u=e.is(a);if(c||u){const[d,f]=yo(n),h=l.is(a),g=e.is(o?a:l),p=e.is(o?l:a);let m,b=0;h?(b=d>f?f:d,m=d>f?d:f):g?(b=o?f:d,m=void 0):p&&(b=0,m=o?d:f);const _=e.__text.slice(b,m);_!==e.__text&&(t==="clone"&&(e=Kg(e)),e.__text=_)}}return e}function mb(n){const e=n.getStyle(),t=Qg(e);Ao.set(e,t)}function Ps(n,e){(N(n)?n.isCollapsed():D(n)||A(n))||gb(280);const t=is(N(n)?n.style:D(n)?n.getStyle():n.getTextStyle()),r=Object.entries(e).reduce((s,[o,l])=>(typeof l=="function"?s[o]=l(t[o],n):l===null?delete s[o]:s[o]=l,s),{...t}),i=pb(r);N(n)||D(n)?n.setStyle(i):n.setTextStyle(i),Ao.set(i,r)}function Bs(n,e){if(N(n)&&n.isCollapsed()){Ps(n,e);const r=n.anchor.getNode();A(r)&&r.isEmpty()&&Ps(r,e)}_b(r=>{Ps(r,e)});const t=n.getNodes();if(t.length>0){const r=new Set;for(const i of t){if(!A(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;const s=i.getKey();r.has(s)||(r.add(s),Ps(i,e))}}}function _b(n){const e=O();if(!e)return;const t=new Map,r=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(N(e))for(const s of No(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());const i=e.getNodes();for(const s of i){if(!D(s)||!s.canHaveFormat())continue;const[o,l]=r(s);l!==o&&(Tt(s)||o===0&&l===s.getTextContentSize()?n(s):n(s.splitText(o,l)[o===0?0:1]))}N(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&yb(e)}function yb(n){if(n.isBackward()){const{anchor:e,focus:t}=n,{key:r,offset:i,type:s}=e;e.set(t.key,t.offset,t.type),t.set(r,i,s)}}function bb(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function et(n,e,t=bb){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let s=null;if(r){const[o,l]=r;s=hi(),s.anchor.set(o.key,o.offset,o.type),s.focus.set(l.key,l.offset,l.type);const a=le(o.getNode(),dt),c=le(l.getNode(),dt);A(a)&&i.set(a.getKey(),a),A(c)&&i.set(c.getKey(),c)}for(const o of n.getNodes())if(A(o)&&dt(o))i.set(o.getKey(),o);else if(r===null){const l=le(o,dt);A(l)&&i.set(l.getKey(),l)}for(const[o,l]of i){const a=e();t(l,a),l.replace(a,!0),s&&(o===s.anchor.key&&s.anchor.set(a.getKey(),s.anchor.offset,s.anchor.type),o===s.focus.key&&s.focus.set(a.getKey(),s.focus.offset,s.focus.type))}s&&n.is(O())&&Fe(s)}function rp(n){const e=ip(n);return e!==null&&e.writingMode==="vertical-rl"}function ip(n){const e=n.anchor.getNode();return A(e)?ep(e):tp(e)}function Oo(n,e){let t=rp(n)?!e:e;sp(n)&&(t=!t);const r=Dt(n.focus,t?"previous":"next");if(uu(r))return!1;for(const i of fl(r)){if(ht(i))return!i.origin.isInline();if(!A(i.origin)){if(V(i.origin))return!0;break}}return!1}function xb(n,e,t,r){n.modify(e?"extend":"move",t,r)}function sp(n){const e=ip(n);return e!==null&&e.direction==="rtl"}function Mo(n,e,t){const r=sp(n);let i;i=rp(n)||r?!t:t,xb(n,e,i,"character")}function Sb(n,e,t){const r=is(n.getStyle());return r!==null&&r[e]||t}function zs(n,e,t=""){let r=null;const i=n.getNodes(),s=n.anchor,o=n.focus,l=n.isBackward(),a=l?o.offset:s.offset,c=l?o.getNode():s.getNode();if(N(n)&&n.isCollapsed()&&n.style!==""){const u=is(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&D(d)){const f=Sb(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function op(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const ml=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cb=ml&&"documentMode"in document?document.documentMode:null,wb=ml&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!ml||!("InputEvent"in window)||Cb)&&"getTargetRanges"in new window.InputEvent("input");const vb=ml,Eb=wb;function kb(n){return n?n.getAdjacentCaret():null}function Tb(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function Nb(n){const e=le(n,t=>A(t)&&!t.isInline());return A(e)||op(4,n.__key),e}function Ab(n){const e=O()||bn();let t;if(N(e))t=Dt(e.focus,"next");else{if(e!=null){const o=e.getNodes(),l=o[o.length-1];l&&(t=ye(l,"next"))}t=t||at(fe(),"previous").getFlipped().insert(H())}const r=Ob(n,t),i=mr(r),s=ht(i)?tt(i):r;return gl(lu(s)),n.getLatest()}function Ob(n,e,t){let r=Yt(e,"next");for(let i=r;i;i=qg(i,t))r=i;return Mt(r)&&op(283),r.insert(n.isInline()?H().append(n):n),Yt(ye(n.getLatest(),"next"),e.direction)}function on(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}let sa=!(Eb||!vb)&&void 0;function Mb(n,e=!1){let t=1;if((function(){if(sa===void 0){const r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),sa=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return sa})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function lp(n,e){return ap(n,e,null)}function ap(n,e,t){let r=!1;for(const i of up(n))e(i)?t!==null&&t(i):(r=!0,A(i)&&ap(i,e,t||(s=>i.insertAfter(s))),i.remove());return r}function cp(n,e){const t=[],r=Array.from(n).reverse();for(let i=r.pop();i!==void 0;i=r.pop())if(e(i))t.push(i);else if(A(i))for(const s of up(i))r.push(s);return t}function up(n){return $b(at(n,"previous"))}function $b(n){return hl({hasNext:Ln,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function dp(n,e){const t=Jc(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!gp.has(s.nodeName)){const o=pp(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof il&&o.insertAfter(lt());for(const o of s){const l=o.getChildren();for(const a of l)o.insertBefore(a);o.remove()}})(i),r}function fp(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=fe().getChildren();for(let i=0;i<r.length;i++)hp(n,r[i],t,e);return t.innerHTML}function hp(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=A(e)&&e.excludeFromCopy("html");let o=e;r!==null&&D(e)&&(o=np(r,e,"clone"));const l=A(o)?o.getChildren():[],a=sl(n,o.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,o):o.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],p=hp(n,g,f,r);!i&&A(e)&&p&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((re(u)||ko(u))&&u.append(f),t.append(u),d){const h=d.call(o,u);h&&(ko(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(f);return i}const gp=new Set(["STYLE","SCRIPT"]);function pp(n,e,t,r,i=new Map,s){let o=[];if(gp.has(n.nodeName))return o;let l=null;const a=(function(g,p){const{nodeName:m}=g,b=p._htmlConversions.get(m.toLowerCase());let _=null;if(b!==void 0)for(const y of b){const S=y(g);S!==null&&(_===null||(_.priority||0)<=(S.priority||0))&&(_=S)}return _!==null?_.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[,p]of i)if(l=p(l,s),!l)break;l&&o.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!ze(l))&&(l!=null&&bo(l)||r);for(let g=0;g<d.length;g++)f.push(...pp(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),ns(n)&&(f=Ib(n,f,h?()=>{const g=new il;return t.push(g),g}:H)),l==null?f.length>0?o=o.concat(f):ns(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:To(g.nextSibling)&&To(g.previousSibling)})(n)&&(o=o.concat(lt())):A(l)&&l.append(...f),o}function Ib(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const l=e[o];if(bo(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(s.push(l),o===e.length-1||o<e.length-1&&bo(e[o+1])){const a=t();a.setFormat(r),a.append(...s),i.push(a),s=[]}}return i}function $o(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function mp(n,e=O()){return e==null&&$o(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?"":fp(n,e)}function Fb(n,e=O()){return e==null&&$o(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Db(n,e))}function Wd(n,e){const t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function jd(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const l=JSON.parse(r);if(l.namespace===t._config.namespace&&Array.isArray(l.nodes))return Hd(t,Lb(l.nodes),e)}catch(l){console.error(l)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const l=new DOMParser().parseFromString((function(a){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(a):a})(i),"text/html");return Hd(t,dp(t,l),e)}catch(l){console.error(l)}const o=s||n.getData("text/uri-list");if(o!=null)if(N(e)){const l=o.split(/(\r?\n|\t)/);l[l.length-1]===""&&l.pop();for(let a=0;a<l.length;a++){const c=O();if(N(c)){const u=l[a];u===`
|
|
11
|
+
`?r.push(ot()):o===" "?r.push(yt()):r.push(he(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,l=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,l=t),o.type==="element"&&(function(m,b,_,y){const C=m.getNode(),S=C.getChildAtIndex(m.offset),x=he();if(x.setFormat(_),x.setStyle(y),wr(S))S.splice(0,0,[x]);else{const w=ye(C)?J().append(x):x;S===null?C.append(w):S.insertBefore(w)}m.is(b)&&b.set(x.__key,0,"text"),m.set(x.__key,0,"text")})(o,l,i,s),l.type==="element"&&Dn(l,et(It(l,"next")));const a=o.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let f=u[0];D(f)||L(26);const h=f.getTextContent().length,g=f.getParentOrThrow();let p=u[d-1];if(d===1&&l.type==="element"&&(c=h,l.set(o.key,c,"text")),this.isCollapsed()&&a===h&&(kt(f)||!f.canInsertTextAfter()||!g.canInsertTextAfter()&&f.getNextSibling()===null)){let m=f.getNextSibling();if(D(m)&&m.canInsertTextBefore()&&!kt(m)||(m=he(),m.setFormat(i),m.setStyle(s),g.canInsertTextAfter()?f.insertAfter(m):g.insertAfter(m)),m.select(0,0),f=m,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&a===0&&(kt(f)||!f.canInsertTextBefore()||!g.canInsertTextBefore()&&f.getPreviousSibling()===null)){let m=f.getPreviousSibling();if(D(m)&&!kt(m)||(m=he(),m.setFormat(i),g.canInsertTextBefore()?f.insertBefore(m):g.insertBefore(m)),m.select(),f=m,e!=="")return void this.insertText(e)}else if(f.isSegmented()&&a!==h){const m=he(f.getTextContent());m.setFormat(i),f.replace(m),f=m}else if(!this.isCollapsed()&&e!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||A(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),og(this.anchor,this.focus,null),void this.insertText(e)}if(d===1){if(Nn(f)){const y=he(e);return y.select(),void f.replace(y)}const m=f.getFormat(),b=f.getStyle();if(a!==c||m===i&&b===s){if(Je(f)){const y=he(e);return y.setFormat(i),y.setStyle(s),y.select(),void f.replace(y)}}else{if(f.getTextContent()!==""){const y=he(e);if(y.setFormat(i),y.setStyle(s),y.select(),a===0)f.insertBefore(y,!1);else{const[C]=f.splitText(a);C.insertAfter(y,!1)}return void(y.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}f.setFormat(i),f.setStyle(s)}const _=c-a;f=f.spliceText(a,_,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=m,this.style=b))}else{const m=new Set([...f.getParentKeys(),...p.getParentKeys()]),b=A(f)?f:f.getParentOrThrow();let _=A(p)?p:p.getParentOrThrow(),y=p;if(!b.is(_)&&_.isInline())do y=_,_=_.getParentOrThrow();while(_.isInline());if(l.type==="text"&&(c!==0||p.getTextContent()==="")||l.type==="element"&&p.getIndexWithinParent()<c)if(D(p)&&!Nn(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const k=he(p.getTextContent());p.replace(k),p=k}ye(l.getNode())||l.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const k=p.getParentOrThrow();k.canBeEmpty()||k.getChildrenSize()!==1?p.remove():k.remove()}else m.add(p.__key);const C=_.getChildren(),S=new Set(u),x=b.is(_),w=b.isInline()&&f.getNextSibling()===null?b:f;for(let k=C.length-1;k>=0;k--){const v=C[k];if(v.is(f)||A(v)&&v.isParentOf(f))break;v.isAttached()&&(!S.has(v)||v.is(y)?x||w.insertAfter(v,!1):v.remove())}if(!x){let k=_,v=null;for(;k!==null;){const I=k.getChildren(),T=I.length;(T===0||I[T-1].is(v))&&(m.delete(k.__key),v=k),k=k.getParent()}}if(Nn(f))if(a===h)f.select();else{const k=he(e);k.select(),f.replace(k)}else f=f.spliceText(a,h-a,e,!0),f.getTextContent()===""?f.remove():this.anchor.type==="text"&&(f.isComposing()?this.anchor.offset-=e.length:(this.format=f.getFormat(),this.style=f.getStyle()));for(let k=1;k<d;k++){const v=u[k],I=v.__key;m.has(I)||v.remove()}}}removeText(){const e=M()===this;Bi(this,Wg(wo(this))),e&&M()!==this&&De(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void $e(null);const r=this.getNodes(),i=[];for(const C of r)D(C)&&i.push(C);const s=C=>{r.forEach(S=>{if(A(S)){const x=S.getFormatFlags(e,C);S.setTextFormat(x)}})},o=i.length;if(o===0)return this.toggleFormat(e),$e(null),void s(t);const l=this.anchor,a=this.focus,c=this.isBackward(),u=c?a:l,d=c?l:a;let f=0,h=i[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(f=1,h=i[1],g=0),h==null)return;const p=h.getFormatFlags(e,t);s(p);const m=o-1;let b=i[m];const _=d.type==="text"?d.offset:b.getTextContentSize();if(h.is(b)){if(g===_)return;if(kt(h)||g===0&&_===h.getTextContentSize())h.setFormat(p);else{const C=h.splitText(g,_),S=g===0?C[0]:C[1];S.setFormat(p),u.type==="text"&&u.set(S.__key,0,"text"),d.type==="text"&&d.set(S.__key,_-g,"text")}return void(this.format=p)}g===0||kt(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const y=b.getFormatFlags(e,p);_>0&&(_===b.getTextContentSize()||kt(b)||([b]=b.splitText(_)),b.setFormat(y));for(let C=f+1;C<m;C++){const S=i[C],x=S.getFormatFlags(e,y);S.setFormat(x)}u.type==="text"&&u.set(h.__key,g,"text"),d.type==="text"&&d.set(b.__key,_,"text"),this.format=p|y}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=M();return N(g)||L(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=le(t,ct),i=e[e.length-1];if(A(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=Gl(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(A(g)||Y(g))&&!g.isInline())){A(r)||L(211,t.constructor.name,t.getType());const g=Gl(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const p=J();let m=null;for(let b=0;b<g.length;b++){const _=g[b],y=ue(_);if(y||Y(_)&&_.isInline()||A(_)&&_.isInline()||D(_)||_.isParentRequired()){if(m===null&&(m=_.createParentElementNode(),p.append(m),y))continue;m!==null&&m.append(_)}else p.append(_),m=null}return p})(e),o=s.getLastDescendant(),l=s.getChildren(),a=!A(r)||!r.isEmpty()?this.insertParagraph():null,c=l[l.length-1];let u=l[0];var d;A(d=u)&&ct(d)&&!d.isEmpty()&&A(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(A(r)||L(211,t.constructor.name,t.getType()),r.append(...u.getChildren()),u=l[1]),u&&(r===null&&L(212,t.constructor.name,t.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let b=p;const _=[p];for(;b!==m;)b.getNextSibling()||L(140),b=b.getNextSibling(),_.push(b);let y=g;for(const C of _)y=y.insertAfter(C)})(r,u));const f=le(o,ct);a&&A(f)&&(a.canMergeWhenEmpty()||ct(c))&&(f.append(...a.getChildren()),a.remove()),A(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=A(r)?r.getLastChild():null;ue(h)&&f!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=J();return de().splice(this.anchor.offset,0,[o]),o.select(),o}const e=Gl(this),t=le(this.anchor.getNode(),ct);A(t)||L(213);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=ot();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=ho(this),l=this.isBackward(),[a,c]=l?[this.focus,this.anchor]:[this.anchor,this.focus],[u,d]=l?[o,s]:[s,o];if(t===0)return[];if(t===1){if(D(r)&&!this.isCollapsed()){const f=r.splitText(u,d),h=u===0?f[0]:f[1];return h?(a.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(D(r)&&(u===r.getTextContentSize()?e.shift():u!==0&&([,r]=r.splitText(u),e[0]=r,a.set(r.getKey(),0,"text"))),D(i)){const f=i.getTextContent().length;d===0?e.pop():d!==f&&([i]=i.splitText(d),e[e.length-1]=i,c.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(yd(this,e,t,r))return;const i=e==="move",s=ie(),o=Ct(St(s));if(!o)return;const l=s._blockCursorElement,a=s._rootElement,c=this.focus.getNode();if(a===null||l===null||!A(c)||c.isInline()||c.canBeEmpty()||Wa(l,s,a),this.dirty){let u=ur(s,this.anchor.key),d=ur(s,this.focus.key);this.anchor.type==="text"&&(u=cr(u)),this.focus.type==="text"&&(d=cr(d)),u&&d&&cg(o,u,this.anchor.offset,d,this.focus.offset)}if((function(u,d,f,h){u.modify(d,f,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const u=o.getRangeAt(0),d=this.anchor.getNode(),f=ye(d)?d:Dg(d);if(this.applyDOMRange(u),this.dirty=!0,!i){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const b=h[m];xo(b,f)?g.push(b):p=!0}if(p&&g.length>0)if(t){const m=g[0];A(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];A(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}o.anchorNode===u.startContainer&&o.anchorOffset===u.startOffset||(function(m){const b=m.focus,_=m.anchor,y=_.key,C=_.offset,S=_.type;_.set(b.key,b.offset,b.type,!0),b.set(y,C,S,!0)})(this)}}r==="lineboundary"&&yd(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&A(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(A(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=ll(It(r,e?"previous":"next"));if(s.getTextSlices().every(l=>l===null||l.distance===0)){let l={type:"initial"};for(const a of s.iterNodeCarets("shadowRoot"))if(ut(a)){if(!a.origin.isInline()){if(a.origin.isShadowRoot()){if(l.type==="merge-block")break;if(A(s.anchor.origin)&&s.anchor.origin.isEmpty()){const c=et(a);Bi(this,Vt(c,c)),s.anchor.origin.remove()}return}l.type!=="merge-next-block"&&l.type!=="merge-block"||(l={block:l.block,caret:a,type:"merge-block"})}}else{if(l.type==="merge-block")break;if(Fn(a)){if(A(a.origin)){if(a.origin.isInline()){if(!a.origin.isParentOf(s.anchor.origin))break}else l={block:a.origin,type:"merge-next-block"};continue}if(Y(a.origin)){if(!a.origin.isIsolated())if(l.type==="merge-next-block"&&(a.origin.isKeyboardSelectable()||!a.origin.isInline())&&A(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const c=Dc();c.add(a.origin.getKey()),De(c)}else a.origin.remove();return}break}}if(l.type==="merge-block"){const{caret:a,block:c}=l;return Bi(this,Vt(!a.origin.isEmpty()&&c.isEmpty()?hi(xe(c,a.direction)):s.anchor,a)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&fd(this,r.getNode()))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 hd(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 hd(i,e,a)}(function(a,c){const u=a.anchor,d=a.focus,f=u.getNode(),h=d.getNode();if(f===h&&u.type==="text"&&d.type==="text"){const g=u.offset,p=d.offset,m=g<p,b=m?g:p,_=m?p:g,y=_-1;b!==y&&(function(C){return!(Tg(C)||ky(C))})(f.getTextContent().slice(b,_))&&(c?d.set(d.key,y,d.type):u.set(u.key,y,u.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&ye(r.getParent())&&r.getPreviousSibling()===null&&fd(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,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 je(n){return n instanceof Yo}function dd(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function ho(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]:[dd(t),dd(r)]}function fd(n,e){for(let t=e;t;t=t.getParent()){if(A(t)){if(t.collapseAtStart(n))return!0;if(Ue(t))break}if(t.getPreviousSibling())break}return!1}const ky=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function hd(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,l=0;for(let c=0;c<s;c++){const u=c===s-1;if(l=o,o+=i[c].length,e&&o===t||o>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 gd(n,e,t,r){let i,s=e;if(te(n)){let o=!1;const l=n.childNodes,a=l.length,c=r._blockCursorElement;s===a&&(o=!0,s=a-1);let u=l[s],d=!1;if(u===c)u=l[s+1],d=!0;else if(c!==null){const f=c.parentNode;n===f&&e>Array.prototype.indexOf.call(f.children,c)&&s--}if(i=Ur(u),D(i))s=Ot(i,o?"next":"previous");else{let f=Ur(n);if(f===null)return null;if(A(f)){const h=r.getElementByKey(f.getKey());h===null&&L(214),[f,s]=f.getDOMSlot(h).resolveChildIndex(f,h,n,e),A(f)||L(215),o&&s>=f.getChildrenSize()&&(s=Math.max(0,f.getChildrenSize()-1));let p=f.getChildAtIndex(s);if(A(p)&&(function(m,b,_){const y=m.getParent();return _===null||y===null||!y.canBeEmpty()||y!==_.getNode()})(p,0,t)){const m=o?p.getLastDescendant():p.getFirstDescendant();m===null?f=p:(p=m,f=A(p)?p:p.getParentOrThrow()),s=0}D(p)?(i=p,f=null,s=Ot(p,o?"next":"previous")):p!==f&&o&&!d&&(A(f)||L(216),s=Math.min(f.getChildrenSize(),s+1))}else{const h=f.getIndexWithinParent();s=e===0&&Y(f)&&Ur(n)===f?h:h+1,f=f.getParentOrThrow()}if(A(f))return Ae(f.__key,s,"element")}}else i=Ur(n);return D(i)?Ae(i.__key,Ot(i,s,"clamp"),"text"):null}function pd(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&&A(o)&&o.isInline()){const l=o.getPreviousSibling();D(l)&&n.set(l.__key,l.getTextContent().length,"text")}}else A(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):D(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&A(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&A(o)&&o.isInline()&&!o.canInsertTextAfter()){const l=o.getNextSibling();D(l)&&n.set(l.__key,0,"text")}}}function og(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);pd(n,r,i),pd(e,!r,i),i&&e.set(n.key,n.offset,n.type);const s=ie();if(s.isComposing()&&s._compositionKey!==n.key&&N(t)){const o=t.anchor,l=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(l.key,l.offset,l.type,!0)}}}function lg(n,e,t,r,i,s){if(n===null||t===null||!di(i,n,t))return null;const o=gd(n,e,N(s)?s.anchor:null,i);if(o===null)return null;const l=gd(t,r,N(s)?s.focus:null,i);if(l===null)return null;if(o.type==="element"&&l.type==="element"){const a=Ur(n),c=Ur(t);if(Y(a)&&Y(c))return null}return og(o,l,s),[o,l]}function go(n){return A(n)&&!n.isInline()}function ag(n,e,t,r,i,s){const o=yn(),l=new xr(Ae(n,e,i),Ae(t,r,s),0,"");return l.dirty=!0,o._selection=l,l}function ci(){const n=Ae("root",0,"element"),e=Ae("root",0,"element");return new xr(n,e,0,"")}function Dc(){return new Yo(new Set)}function Ey(n,e){return qo(null,n,e,null)}function qo(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,l=o==="selectionchange",a=!Ea&&(l||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let c,u,d,f;if(N(n)&&!a)return n.clone();if(e===null)return null;if(c=e.anchorNode,u=e.focusNode,d=e.anchorOffset,f=e.focusOffset,(l||o===void 0)&&N(n)&&!di(t,c,u))return n.clone();const h=lg(c,d,u,f,t,n);if(h===null)return null;const[g,p]=h;return new xr(g,p,N(n)?n.format:0,N(n)?n.style:"")}function M(){return yn()._selection}function _n(){return ie()._editorState._selection}function po(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),l=s.getNode();if(!e.is(o)&&!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"),s.set(a,u,"element"),md(n)}}else{const c=n.isBackward(),u=c?s:i,d=u.getNode(),f=c?i:s,h=f.getNode();if(e.is(d)){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=f.offset;(t<=g&&r>0||t<g&&r<0)&&f.set(a,Math.max(0,g+r),"element")}}md(n)}function md(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!A(s))return;const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(A(s)){const l=s.getChildrenSize(),a=t>=l,c=a?s.getChildAtIndex(l-1):s.getChildAtIndex(t);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),e.set(c.__key,u,"text")}}if(A(o)){const l=o.getChildrenSize(),a=i>=l,c=a?o.getChildAtIndex(l-1):o.getChildAtIndex(i);if(D(c)){let u=0;a&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function mo(n,e,t,r,i){let s=null,o=0,l=null;r!==null?(s=r.__key,D(r)?(o=r.getTextContentSize(),l="text"):A(r)&&(o=r.getChildrenSize(),l="element")):i!==null&&(s=i.__key,D(i)?l="text":A(i)&&(l="element")),s!==null&&l!==null?n.set(s,o,l):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function _d(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function cg(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function Ty(n,e,t,r,i,s,o){const l=r.anchorNode,a=r.focusNode,c=r.anchorOffset,u=r.focusOffset,d=document.activeElement;if(i.has(tg)&&d!==s||d!==null&&tl(d))return;if(!N(e))return void(n!==null&&di(t,l,a)&&r.removeAllRanges());const f=e.anchor,h=e.focus,g=f.key,p=h.key,m=ur(t,g),b=ur(t,p),_=f.offset,y=h.offset,C=e.format,S=e.style,x=e.isCollapsed();let w=m,k=b,v=!1;if(f.type==="text"){w=cr(m);const B=f.getNode();v=B.getFormat()!==C||B.getStyle()!==S}else N(n)&&n.anchor.type==="text"&&(v=!0);var I,T,O,z,F;if(h.type==="text"&&(k=cr(b)),w!==null&&k!==null&&(x&&(n===null||v||N(n)&&(n.format!==C||n.style!==S))&&(I=C,T=S,O=_,z=g,F=performance.now(),Vh=[I,T,O,z,F]),c!==_||u!==y||l!==w||a!==k||r.type==="Range"&&x||(d!==null&&s.contains(d)||i.has(Ua)||s.focus({preventScroll:!0}),f.type==="element"))){if(cg(r,w,_,k,y),!On||!e.isCollapsed()||s===null||i.has(Ua)||document.activeElement!==null&&s.contains(document.activeElement)||s.focus({preventScroll:!0}),!i.has(ng)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const B=N(e)&&e.anchor.type==="element"?w.childNodes[_]||null:r.rangeCount>0?r.getRangeAt(0):null;if(B!==null){let W;if(B instanceof Text){const X=document.createRange();X.selectNode(B),W=X.getBoundingClientRect()}else W=B.getBoundingClientRect();(function(X,se,oe){const We=Yc(oe),wt=qc(We);if(We===null||wt===null)return;let{top:j,bottom:Ce}=se,fe=0,Ze=0,H=oe;for(;H!==null;){const $=H===We.body;if($)fe=0,Ze=St(X).innerHeight;else{const q=H.getBoundingClientRect();fe=q.top,Ze=q.bottom}let R=0;if(j<fe?R=-(fe-j):Ce>Ze&&(R=Ce-Ze),R!==0)if($)wt.scrollBy(0,R);else{const q=H.scrollTop;H.scrollTop+=R;const pe=H.scrollTop-q;j-=pe,Ce-=pe}if($)break;H=ys(H)}})(t,W,s)}}La=!0}}function Zo(n){let e=M()||_n();e===null&&(e=de().selectEnd()),e.insertNodes(n)}function Ny(){const n=M();return n===null?"":n.getTextContent()}function Gl(n){let e=n;n.isCollapsed()||e.removeText();const t=M();N(t)&&(e=t),N(e)||L(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!ct(i);){const o=i;if([i,s]=Ay(i,s),o.is(i))break}return s}function Ay(n,e){const t=n.getParent();if(!t){const i=J();return de().append(i),i.select(),[de(),0]}if(D(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(!A(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new xr(Ae(n.__key,e,"element"),Ae(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function yd(n,e,t,r,i="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[u,d]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return d.set(u.key,u.offset,u.type),!0}const s=It(n.focus,t?"previous":"next"),o=r==="lineboundary",l=e==="move";let a=s,c=i==="decorators-and-blocks";if(!su(a)){for(const u of a){c=!1;const{origin:d}=u;if(!Y(d)||d.isIsolated()||(a=u,!o||!d.isInline()))break}if(c)for(const u of ll(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(ut(u))u.origin.isInline()||(a=u);else{if(A(u.origin))continue;Y(u.origin)&&!u.origin.isInline()&&(a=u)}break}}if(a===s)return!1;if(l&&!o&&Y(a.origin)&&a.origin.isKeyboardSelectable()){const u=Dc();return u.add(a.origin.getKey()),De(u),!0}return a=et(a),l&&Dn(n.anchor,a),Dn(n.focus,a),c||!o}let Ie=null,Fe=null,it=!1,Yl=!1,Vs=0;const bd={characterData:!0,childList:!0,subtree:!0};function Sr(){return it||Ie!==null&&Ie._readOnly}function Me(){it&&L(13)}function ug(){Vs>99&&L(14)}function yn(){return Ie===null&&L(195,dg()),Ie}function ie(){return Fe===null&&L(196,dg()),Fe}function dg(){let n=0;const e=new Set,t=Yr.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=_s(i);if(nl(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 Oy(){return Fe}function xd(n,e,t){const r=e.__type,i=Bc(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 l=0;l<o&&(s[l](e),e.isAttached());l++);}function Sd(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function fg(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function hg(n){return Lc(n,ie()._nodes)}function Lc(n,e){const t=n.type,r=e.get(t);r===void 0&&L(17,t);const i=r.klass;n.type!==i.getType()&&L(18,i.name);const s=i.importJSON(n),o=n.children;if(A(s)&&Array.isArray(o))for(let l=0;l<o.length;l++){const a=Lc(o[l],e);s.append(a)}return s}function Cd(n,e,t){const r=Ie,i=it,s=Fe;Ie=e,it=!0,Fe=n;try{return t()}finally{Ie=r,it=i,Fe=s}}function en(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,l=t._selection,a=n._dirtyType!==0,c=Ie,u=it,d=Fe,f=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&a&&h!==null){Fe=n,Ie=t,it=!1,n._updating=!0;try{const x=n._dirtyType,w=n._dirtyElements,k=n._dirtyLeaves;h.disconnect(),g=cy(s,t,n,x,w,k)}catch(x){if(x instanceof Error&&n._onError(x),Yl)throw x;return bg(n,null,r,t),Fh(n),n._dirtyType=2,Yl=!0,en(n,s),void(Yl=!1)}finally{h.observe(r,bd),n._updating=f,Ie=c,it=u,Fe=d}}t._readOnly||(t._readOnly=!0);const p=n._dirtyLeaves,m=n._dirtyElements,b=n._normalizedNodes,_=n._updateTags,y=n._deferred;a&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(x,w){const k=x._decorators;let v=x._pendingDecorators||k;const I=w._nodeMap;let T;for(T in v)I.has(T)||(v===k&&(v=kg(x)),delete v[T])})(n,t);const C=i?null:Ct(St(n));if(n._editable&&C!==null&&(a||l===null||l.dirty||!l.is(o))&&r!==null&&!_.has(rg)){Fe=n,Ie=t;try{if(h!==null&&h.disconnect(),a||l===null||l.dirty){const x=n._blockCursorElement;x!==null&&Wa(x,n,r),Ty(o,l,n,C,_,r)}(function(x,w,k){let v=x._blockCursorElement;if(N(k)&&k.isCollapsed()&&k.anchor.type==="element"&&w.contains(document.activeElement)){const I=k.anchor,T=I.getNode(),O=I.offset;let z=!1,F=null;if(O===T.getChildrenSize())Zl(T.getChildAtIndex(O-1))&&(z=!0);else{const B=T.getChildAtIndex(O);if(B!==null&&Zl(B)){const W=B.getPreviousSibling();(W===null||Zl(W))&&(z=!0,F=x.getElementByKey(B.__key))}}if(z){const B=x.getElementByKey(T.__key);return v===null&&(x._blockCursorElement=v=(function(W){const X=W.theme,se=document.createElement("div");se.contentEditable="false",se.setAttribute("data-lexical-cursor","true");let oe=X.blockCursor;if(oe!==void 0){if(typeof oe=="string"){const We=dn(oe);oe=X.blockCursor=We}oe!==void 0&&se.classList.add(...oe)}return se})(x._config)),w.style.caretColor="transparent",void(F===null?B.appendChild(v):B.insertBefore(v,F))}}v!==null&&Wa(v,x,w)})(n,r,l)}finally{h!==null&&h.observe(r,bd),Fe=d,Ie=c}}g!==null&&(function(x,w,k,v,I){const T=Array.from(x._listeners.mutation),O=T.length;for(let z=0;z<O;z++){const[F,B]=T[z];for(const W of B){const X=w.get(W);X!==void 0&&F(X,{dirtyLeaves:v,prevEditorState:I,updateTags:k})}}})(n,g,_,p,s),N(l)||l===null||o!==null&&o.is(l)||n.dispatchCommand(ni,void 0);const S=n._pendingDecorators;S!==null&&(n._decorators=S,n._pendingDecorators=null,Ri("decorator",n,!0,S)),(function(x,w,k){const v=Ed(w),I=Ed(k);v!==I&&Ri("textcontent",x,!0,I)})(n,e||s,t),Ri("update",n,!0,{dirtyElements:m,dirtyLeaves:p,editorState:t,mutatedNodes:g,normalizedNodes:b,prevEditorState:e||s,tags:_}),(function(x,w){if(x._deferred=[],w.length!==0){const k=x._updating;x._updating=!0;try{for(let v=0;v<w.length;v++)w[v]()}finally{x._updating=k}}})(n,y),(function(x){const w=x._updates;if(w.length!==0){const k=w.shift();if(k){const[v,I]=k;Xo(x,v,I)}}})(n)}function Ri(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 wd(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,l=n._pendingEditorState;let a;o!==void 0&&(a=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(l===null&&L(191),l._flushSync=!0),a&&n._deferred.push(a),fg(n,o.tag)),l==null?Xo(n,s,o):s()}}return r}function Xo(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,fg(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const l=n._editorState;let a=n._pendingEditorState,c=!1;(a===null||a._readOnly)&&(a=n._pendingEditorState=gg(a||l),c=!0),a._flushSync=o;const u=Ie,d=it,f=Fe,h=n._updating;Ie=a,it=!1,n._updating=!0,Fe=n;const g=n._headless||n.getRootElement()===null;zc(null);try{c&&(g?l._selection!==null&&(a._selection=l._selection.clone()):a._selection=(function(_,y){const C=_.getEditorState()._selection,S=Ct(St(_));return N(C)||C==null?qo(C,S,_,y):C.clone()})(n,t&&t.event||null));const m=n._compositionKey;e(),s=wd(n,s),(function(_,y){const C=y.getEditorState()._selection,S=_._selection;if(N(S)){const x=S.anchor,w=S.focus;let k;if(x.type==="text"&&(k=x.getNode(),k.selectionTransform(C,S)),w.type==="text"){const v=w.getNode();k!==v&&v.selectionTransform(C,S)}}})(a,n),n._dirtyType!==0&&(s?(function(_,y){const C=y._dirtyLeaves,S=_._nodeMap;for(const x of C){const w=S.get(x);D(w)&&w.isAttached()&&w.isSimpleText()&&!w.isUnmergeable()&&Qu(w)}})(a,n):(function(_,y){const C=y._dirtyLeaves,S=y._dirtyElements,x=_._nodeMap,w=vn(),k=new Map;let v=C,I=v.size,T=S,O=T.size;for(;I>0||O>0;){if(I>0){y._dirtyLeaves=new Set;for(const z of v){const F=x.get(z);D(F)&&F.isAttached()&&F.isSimpleText()&&!F.isUnmergeable()&&Qu(F),F!==void 0&&Sd(F,w)&&xd(y,F,k),C.add(z)}if(v=y._dirtyLeaves,I=v.size,I>0){Vs++;continue}}y._dirtyLeaves=new Set,y._dirtyElements=new Map,T.delete("root")&&T.set("root",!0);for(const z of T){const F=z[0],B=z[1];if(S.set(F,B),!B)continue;const W=x.get(F);W!==void 0&&Sd(W,w)&&xd(y,W,k)}v=y._dirtyLeaves,I=v.size,T=y._dirtyElements,O=T.size,Vs++}y._dirtyLeaves=C,y._dirtyElements=S})(a,n),wd(n),(function(_,y,C,S){const x=_._nodeMap,w=y._nodeMap,k=[];for(const[v]of S){const I=w.get(v);I!==void 0&&(I.isAttached()||(A(I)&&Mh(I,v,x,w,k,S),x.has(v)||S.delete(v),k.push(v)))}for(const v of k)w.delete(v);for(const v of C){const I=w.get(v);I===void 0||I.isAttached()||(x.has(v)||C.delete(v),w.delete(v))}})(l,a,n._dirtyLeaves,n._dirtyElements)),m!==n._compositionKey&&(a._flushSync=!0);const b=a._selection;if(N(b)){const _=a._nodeMap,y=b.anchor.key,C=b.focus.key;_.get(y)!==void 0&&_.get(C)!==void 0||L(19)}else je(b)&&b._nodes.size===0&&(a._selection=null)}catch(m){return m instanceof Error&&n._onError(m),n._pendingEditorState=l,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void en(n)}finally{Ie=u,it=d,Fe=f,n._updating=h,Vs=0}n._dirtyType!==0||n._deferred.length>0||(function(m,b){const _=b.getEditorState()._selection,y=m._selection;if(y!==null){if(y.dirty||!y.is(_))return!0}else if(_!==null)return!0;return!1})(a,n)?a._flushSync?(a._flushSync=!1,en(n)):c&&Iy(()=>{en(n)}):(a._flushSync=!1,c&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Kt(n,e,t){Fe===n&&t===void 0?e():Xo(n,e,t)}class Pi{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new Pi(this.element,e,this.after)}withAfter(e){return new Pi(this.element,this.before,e)}withElement(e){return this.element===e?this:new Pi(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&L(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&L(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&L(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(fs||ti||ds);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const a=this.getFirstChildOffset();return[e,Math.min(a+e.getChildrenSize(),Math.max(a,i))]}const s=vd(t,r);s.push(i);const o=vd(t,this.element);let l=e.getIndexWithinParent();for(let a=0;a<o.length;a++){const c=s[a],u=o[a];if(c===void 0||c<u)break;if(c>u){l+=1;break}}return[e.getParentOrThrow(),l]}}function vd(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&L(225),t.reverse()}class Se extends Ut{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Y_[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=ie()._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(D(t)&&e.push(t),A(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;A(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;A(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 A(s)&&s.getLastDescendant()||s||null}const i=t[e];return A(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Z(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&L(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Z(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&L(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(),A(s)&&i!==r-1&&!s.isInline()&&(e+=Bo)}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(),A(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Hu[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=ze[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return _o(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Me();const r=M();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(D(a)||A(a))return a.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const a=this.getLastChild();if(D(a)||A(a))return a.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const l=this.__key;return N(r)?(r.anchor.set(l,i,"element"),r.focus.set(l,s,"element"),r.dirty=!0,r):ag(l,i,l,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!==""?Hu[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){uo(this)&&L(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||L(226,String(e),String(t),String(i));const o=s.__key,l=[],a=[],c=this.getChildAtIndex(e+t);let u=null,d=i-t+r.length;if(e!==0)if(e===i)u=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&L(100);const p=h.getNextSibling(),m=h.__key;Wt(h.getWritable()),a.push(m),h=p}}let f=u;for(const h of r){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());const g=h.getWritable();g.__parent===o&&d--,Wt(g);const p=h.__key;if(f===null)s.__first=p,g.__prev=null;else{const m=f.getWritable();m.__next=p,g.__prev=m.__key}h.__key===o&&L(76),g.__parent=o,l.push(p),f=h}if(e+t===i)f!==null&&(f.getWritable().__next=null,s.__last=f.__key);else if(c!==null){const h=c.getWritable();if(f!==null){const g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(s.__size=d,a.length){const h=M();if(N(h)){const g=new Set(a),p=new Set(l),{anchor:m,focus:b}=h;kd(m,g,p)&&mo(m,m.getNode(),this,u,c),kd(b,g,p)&&mo(b,b.getNode(),this,u,c),d!==0||this.canBeEmpty()||Ue(this)||this.remove()}}return s}getDOMSlot(e){return new Pi(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(te(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||Ue(this)||this.getChildren().some(D)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function A(n){return n instanceof Se}function kd(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 ps extends Ut{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Y(n){return n instanceof ps}class Cr extends Se{__cachedText;static getType(){return"root"}static clone(){return new Cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){L(51)}getTextContent(){const e=this.__cachedText;return!Sr()&&ie()._dirtyType!==0||e===null?super.getTextContent():e}remove(){L(52)}replace(e){L(53)}insertBefore(e){L(54)}insertAfter(e){L(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)A(i)||Y(i)||L(282);return super.splice(e,t,r)}static importJSON(e){return de().updateFromJSON(e)}collapseAtStart(){return!0}}function ye(n){return n instanceof Cr}function gg(n){return new ms(new Map(n._nodeMap))}function Rc(){return new ms(new Map([["root",new Cr]]))}function pg(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&L(130,t.name),A(n)){const r=e.children;Array.isArray(r)||L(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=pg(i[s]);r.push(o)}}return e}function mg(n){return n instanceof ms}class ms{_nodeMap;_selection;_flushSync;_readOnly;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 Cd(t&&t.editor||null,this,e)}clone(e){const t=new ms(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Cd(null,this,()=>({root:pg(de())}))}}class Qo extends Se{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Kn extends Se{static getType(){return"paragraph"}static clone(e){return new Kn(e.__key)}createDOM(e){const t=document.createElement("p"),r=jr(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:My,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(te(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return J().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(D);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=J();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||D(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 My(n){const e=J();return n.style&&(e.setFormat(n.style.textAlign),sl(n,e)),{node:e}}function J(){return Re(new Kn)}function wr(n){return n instanceof Kn}const U=0,G=1,_g=2,yg=3,Pc=4;function bg(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Rc(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,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 xg(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=bs(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof Ut&&o!==Ut?o:void 0}}return e}function ui(n){const e=n||{},t=Oy(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=Rc(),l=e.namespace||(i!==null?i._config.namespace:Ng()),a=e.editorState,c=[Cr,qe,yr,br,Kn,Qo,...e.nodes||[]],{onError:u,html:d}=e,f=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],b=null,_=null;if(typeof m!="function"){const S=m;m=S.replace,b=S.with,_=S.withKlass||null}bs(m);const y=m.getType(),C=xg(m);h.set(y,{exportDOM:d&&d.export?d.export.get(m):void 0,klass:m,replace:b,replaceWithKlass:_,sharedNodeState:Dh(c[p]),transforms:C})}}const g=new Yr(o,i,h,{disableEvents:s,namespace:l,theme:r},u||console.error,(function(p,m){const b=new Map,_=new Set,y=C=>{Object.keys(C).forEach(S=>{let x=b.get(S);x===void 0&&(x=[],b.set(S,x)),x.push(C[S])})};return p.forEach(C=>{const S=C.klass.importDOM;if(S==null||_.has(S))return;_.add(S);const x=S.call(C.klass);x!==null&&y(x)}),m&&y(m),b})(h,d?d.import:void 0),f,n);return a!==void 0&&(g._pendingEditorState=a,g._dirtyType=2),(function(p){p.registerCommand(vc,uy,U),p.registerCommand(kc,dy,U),p.registerCommand(Ec,fy,U),p.registerCommand(Tc,hy,U),p.registerCommand(Nc,gy,U)})(g),g}class Yr{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,i,s,o,l,a){this._createEditorArgs=a,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ng(),this._onError=s,this._htmlConversions=o,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&&L(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&&L(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(l=>l.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const l=r&&r.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&L(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=ja(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 o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,l){const a=ja(o.getEditorState()),c=[];for(const u of l){const d=a.get(u);d&&c.push(d)}c.length!==0&&o.update(()=>{for(const u of c)for(const d of u.keys()){const f=Z(d);f&&f.markDirty()}},o._pendingEditorState===null?{tag:Wr}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return P(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=jr(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,bg(this,t,e,i),t!==null&&(this._config.disableEvents||py(t),r!=null&&t.classList.remove(...r)),e!==null){const s=qc(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=2,Fh(this),this._updateTags.add(Wr),en(this),this._config.disableEvents||(function(l,a){const c=l.ownerDocument;Da.set(l,c);const u=ao.get(c)??0;u<1&&c.addEventListener("selectionchange",Xh),ao.set(c,u+1),l.__lexicalEditor=a;const d=Zh(l);for(let f=0;f<Fa.length;f++){const[h,g]=Fa[f],p=typeof g=="function"?m=>{od(m)||(sd(m),(a.isEditable()||h==="click")&&g(m,a))}:m=>{if(od(m))return;sd(m);const b=a.isEditable();switch(h){case"cut":return b&&P(a,li,m);case"copy":return P(a,_r,m);case"paste":return b&&P(a,ri,m);case"dragstart":return b&&P(a,Go,m);case"dragover":return b&&P(a,Oc,m);case"dragend":return b&&P(a,Kh,m);case"focus":return b&&P(a,$c,m);case"blur":return b&&P(a,ai,m);case"drop":return b&&P(a,Vo,m)}};l.addEventListener(h,p),d.push(()=>{l.removeEventListener(h,p)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(Wr),en(this);Ri("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&L(38);let r=e;r._readOnly&&(r=gg(e),r._selection=e._selection?e._selection.clone():null),Ih(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),en(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||en(this)}parseEditorState(e,t){return(function(r,i,s){const o=Rc(),l=Ie,a=it,c=Fe,u=i._dirtyElements,d=i._dirtyLeaves,f=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,Ie=o,it=!1,Fe=i,zc(null);try{const g=i._nodes;Lc(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=u,i._dirtyLeaves=d,i._cloneNotNeeded=f,i._dirtyType=h,Ie=l,it=a,Fe=c}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return en(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):Xo(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Kt(this,()=>{const i=M(),s=de();i!==null?i.dirty||De(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),$g("focus"),Ig(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Ct(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Ri("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Yr.version="0.40.0+prod.esm";let Ka=null;function zc(n){Ka=n}let Sg=1;function $y(){Sg=1}function Bc(n,e){const t=el(n,e);return t===void 0&&L(30,e),t}function el(n,e){return n._nodes.get(e)}const Iy=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function Cg(n){return Y(dt(n))}function tl(n){const e=document.activeElement;if(!te(e))return!1;const t=e.nodeName;return Y(dt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&_s(e)==null)}function di(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!tl(e)&&rl(e)===n}catch{return!1}}function nl(n){return n instanceof Yr}function rl(n){let e=n;for(;e!=null;){const t=_s(e);if(nl(t))return t;e=ys(e)}return null}function _s(n){return n?n.__lexicalEditor:null}function wg(n){return J_.test(n)?"rtl":V_.test(n)?"ltr":null}function Nn(n){return Je(n)||n.isToken()}function kt(n){return Nn(n)||n.isSegmented()}function Yt(n){return Wn(n)&&n.nodeType===3}function Uc(n){return Wn(n)&&n.nodeType===9}function cr(n){let e=n;for(;e!=null;){if(Yt(e))return e;e=e.firstChild}return null}function _o(n,e,t){const r=ze[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=~ze.superscript:e==="superscript"?i&=~ze.subscript:e==="lowercase"?(i&=~ze.uppercase,i&=~ze.capitalize):e==="uppercase"?(i&=~ze.lowercase,i&=~ze.capitalize):e==="capitalize"&&(i&=~ze.lowercase,i&=~ze.uppercase),i}function Kc(n){return D(n)||ue(n)||Y(n)}function vg(n,e){const t=(function(){const o=Ka;return Ka=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Me(),ug();const r=ie(),i=yn(),s=""+Sg++;i._nodeMap.set(s,n),A(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function Wt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,l=i!==null?i.__key:null,a=i!==null?i.getWritable():null,c=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=l),a!==null&&(a.__next=o),c!==null&&(c.__prev=l),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function yo(n){ug(),uo(n)&&L(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=yn(),i=ie(),s=r._nodeMap,o=i._dirtyElements;t!==null&&(function(a,c,u){let d=a;for(;d!==null;){if(u.has(d))return;const f=c.get(d);if(f===void 0)break;u.set(d,!1),d=f.__parent}})(t,s,o);const l=e.__key;i._dirtyType=1,A(n)?o.set(l,!0):i._dirtyLeaves.add(l)}function $e(n){Me();const e=ie(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Z(t);r!==null&&r.getWritable()}if(n!==null){const r=Z(n);r!==null&&r.getWritable()}}}function vn(){return Sr()?null:ie()._compositionKey}function Z(n,e){const t=(e||yn())._nodeMap.get(n);return t===void 0?null:t}function Wc(n,e){const t=il(n,ie());return t!==void 0?Z(t,e):null}function il(n,e){return n[`__lexicalKey_${e._key}`]}function dt(n,e){let t=n;for(;t!=null;){const r=Wc(t,e);if(r!==null)return r;t=ys(t)}return null}function kg(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Ed(n){return n.read(()=>de().getTextContent())}function de(){return Eg(yn())}function Eg(n){return n._nodeMap.get("root")}function De(n){Me();const e=yn();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Ur(n){const e=ie(),t=(function(r,i){let s=r;for(;s!=null;){const o=il(s,i);if(o!==void 0)return o;s=ys(s)}return null})(n,e);return t===null?n===e.getRootElement()?Z("root"):null:Z(t)}function Tg(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function jc(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Ng(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Ag(n){return Yt(n)?n.nodeValue:null}function Hc(n,e,t){const r=Ct(St(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let l=Ag(i);const a=dt(i);if(l!==null&&D(a)){if(l===zo&&t){const c=t.length;l=t,s=c,o=c}l!==null&&Jc(a,l,s,o,n)}}}function Jc(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let l=e;(o||i)&&e[e.length-1]===zo&&(l=e.slice(0,-1));const a=s.getTextContent();if(i||l!==a){if(l===""){if($e(null),ds||ti||fs)s.remove();else{const p=ie();setTimeout(()=>{p.update(()=>{s.isAttached()&&s.remove()})},20)}return}const c=s.getParent(),u=_n(),d=s.getTextContentSize(),f=vn(),h=s.getKey();if(s.isToken()||f!==null&&h===f&&!o||N(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===n.__key&&u.anchor.offset===0&&!s.canInsertTextBefore()&&!o||u.focus.key===n.__key&&u.focus.offset===d&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=M();if(!N(g)||t===null||r===null)return void Td(s,l,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const p=he(s.getTextContent());s.replace(p),s=p}Td(s,l,g)}}}function Td(n,e,t){if(n.setTextContent(e),N(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=Ot(n,s.offset,"clamp"))}}}function Ms(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Og(n,e){return Ms(n,e,"altKey")&&Ms(n,e,"ctrlKey")&&Ms(n,e,"shiftKey")&&Ms(n,e,"metaKey")}function ne(n,e,t){return Og(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const Qt={ctrlKey:!Et,metaKey:Et},Nd={altKey:Et,ctrlKey:!Et};function Ad(n){return n.key==="Backspace"}function Od(n){return ne(n,"a",Qt)}function Vc(n){const e=de();if(N(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),Mn(n),n}{const t=e.select(0,e.getChildrenSize());return De(Mn(t)),t}}function jr(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=dn(i);return t[e]=s,s}return i}function Gc(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,l=e.get(s);l===void 0&&L(33,s);const a=l.klass;let c=n.get(a);c===void 0&&(c=new Map,n.set(a,c));const u=c.get(o),d=u==="destroyed"&&i==="created";(u===void 0||d)&&c.set(o,d?"updated":i)}function Fy(n){const e=n.getType(),t=yn();if(t._readOnly){const s=ja(t).get(e);return s?Array.from(s.values()):[]}const r=t._nodeMap,i=[];for(const[,s]of r)s instanceof n&&s.__type===e&&s.isAttached()&&i.push(s);return i}function Md(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 bo(n,e){const t=n.offset;if(n.type==="element")return Md(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?Md(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function Mg(n){const e=St(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function P(n,e,t){return(function(r,i,s){const o=jc(r);for(let l=4;l>=0;l--)for(let a=0;a<o.length;a++){const c=o[a],u=c._commands.get(i);if(u!==void 0){const d=u[l];if(d!==void 0){const f=Array.from(d),h=f.length;let g=!1;if(Kt(c,()=>{for(let p=0;p<h;p++)if(f[p](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function ur(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&L(75,e),t}function ys(n){const e=n.assignedSlot||n.parentElement;return So(e)?e.host:e}function Yc(n){return Uc(n)?n:te(n)?n.ownerDocument:null}function Dy(n){return ie()._updateTags.has(n)}function $g(n){Me(),ie()._updateTags.add(n)}function Ig(n){Me(),ie()._deferred.push(n)}function xo(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function qc(n){const e=Yc(n);return e?e.defaultView:null}function St(n){const e=n._window;return e===null&&L(78),e}function Fg(n){return A(n)&&n.isInline()||Y(n)&&n.isInline()}function Dg(n){let e=n.getParentOrThrow();for(;e!==null;){if(Ue(e))return e;e=e.getParentOrThrow()}return e}function Ue(n){return ye(n)||A(n)&&n.isShadowRoot()}function Zc(n){const e=n.constructor.clone(n);return vg(e,null),e.afterCloneFrom(n),e}function Re(n){const e=ie(),t=n.getType(),r=el(e,t);r===void 0&&L(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),l=o.constructor;return s!==null?o instanceof s||L(201,s.name,s.getType(),l.name,l.getType(),n.constructor.name,t):o instanceof n.constructor&&l!==n.constructor||L(202,l.name,l.getType(),n.constructor.name,t),o.__key===n.__key&&L(203,n.constructor.name,t,l.name,l.getType()),o}return n}function ql(n,e){!ye(n.getParent())||A(e)||Y(e)||L(99)}function Zn(n){const e=Z(n);return e===null&&L(63,n),e}function Zl(n){return(Y(n)||A(n)&&!n.canBeEmpty())&&!n.isInline()}function Wa(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Ct(n){return Ft?(n||window).getSelection():null}function Lg(n){const e=qc(n);return e?e.getSelection():null}function Ly(n,e){let t=n.getChildAtIndex(e);t==null&&(t=n),Ue(n)&&L(102);const r=o=>{const l=o.getParentOrThrow(),a=Ue(l),c=o!==t||a?Zc(o):o;if(a)return A(o)&&A(c)||L(133),o.insertAfter(c),[o,c,c];{const[u,d,f]=r(l),h=o.getNextSiblings();return f.append(c,...h),[u,d,c]}},[i,s]=r(t);return[i,s]}function Xc(n){return te(n)&&n.tagName==="A"}function te(n){return Wn(n)&&n.nodeType===1}function Wn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function So(n){return Wn(n)&&n.nodeType===11}function Co(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function qi(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 ct(n){if(Y(n)&&!n.isInline())return!0;if(!A(n)||Ue(n))return!1;const e=n.getFirstChild(),t=e===null||ue(e)||D(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function fi(){return ie()}const $d=new WeakMap,Ry=new Map;function ja(n){if(!n._readOnly&&n.isEmpty())return Ry;n._readOnly||L(192);let e=$d.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let l=r.get(o);l||(l=new Map,r.set(o,l)),l.set(i,s)}return r})(n),$d.set(n,e)),e}function Qc(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Rg(n){return(e=Qc(n))[Qh]=!0,e;var e}function sl(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Pg(n){n.__lexicalUnmanaged=!0}function zg(n){return n.__lexicalUnmanaged===!0}function wi(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==Ut[e]}function bs(n){const e=Ju in n.prototype?n.prototype[Ju]():void 0,t=(function(o){if(!(o===Ut||o.prototype instanceof Ut)){let l="<unknown>",a="<unknown>";try{l=o.getType()}catch{}try{Yr.version&&(a=JSON.parse(Yr.version))}catch{}L(290,o.name,l,a)}return o===ps||o===Se||o===Ut})(n),r=!t&&wi(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,l]of Object.entries(e))s=o,i=l;if(!t&&s&&(wi(n,"getType")||(n.getType=()=>s),wi(n,"clone")||(n.clone=o=>(zc(o),new n)),wi(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!wi(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Bg(n){const e=fi();return Me(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const le=(n,e)=>{let t=n;for(;t!=null&&!ye(t);){if(e(t))return t;t=t.getParent()}return null},Py={next:"previous",previous:"next"};class ol{origin;constructor(e){this.origin=e}[Symbol.iterator](){return al({hasNext:Fn,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return xe(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return xe(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),l=new Map;for(let a=s.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const c=a.origin.getWritable();l.set(c.getKey(),c)}for(const a of i){if(l.size>0){const c=s.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||s.origin.is(a))){const u=a.getParent();u&&u.is(o)&&a.remove(),c.replace(a)}}else c===null&&L(263,Array.from(l).join(" "))}else s.insert(a);s=xe(a,this.direction)}for(const a of l.values())a.remove();return this}}class Zi extends ol{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:lt(e,this.direction)}getParentCaret(e="root"){return xe(eu(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=jn(this.direction);return xe(this.getNodeAtCaret(),e)||lt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Zi&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const zy={root:ye,shadowRoot:Ue};function jn(n){return Py[n]}function eu(n,e="root"){return zy[e](n)?null:n}class dr extends ol{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:xe(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return A(this.origin)?lt(this.origin,this.direction):null}getParentCaret(e="root"){return xe(eu(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=jn(this.direction);return xe(this.getNodeAtCaret(),e)||lt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof dr&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof dr||e instanceof fr)&&this.direction===e.direction&&this.origin.is(e.origin)}}class fr extends ol{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:un(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return xe(eu(this.getParentAtCaret(),e),this.direction)}getFlipped(){return un(this.origin,jn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof fr&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof dr||e instanceof fr)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return xe(this.origin,this.direction)}}function At(n){return n instanceof fr}function By(n){return n instanceof ol}function Fn(n){return n instanceof dr}function ut(n){return n instanceof Zi}const Uy={next:class extends fr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends fr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Ky={next:class extends dr{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends dr{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Wy={next:class extends Zi{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Zi{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function xe(n,e){return n?new Ky[e](n):null}function un(n,e,t){return n?new Uy[e](n,Ot(n,t)):null}function Ot(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&Th(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function Ha(n,e){return new Kg(n,e)}function lt(n,e){return A(n)?new Wy[e](n):null}function Ug(n){return n&&n.getChildCaret()||n}function hr(n){return n&&Ug(n.getAdjacentCaret())}class tu{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new tu(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return At(s)?(function(o,l){const{direction:a,origin:c}=o,u=Ot(c,l==="focus"?jn(a):a);return Ha(o,u-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[Ha(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=At(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=At(r),s=o=>o.isSameNodeCaret(r)?null:hr(o)||o.getParentCaret(e);return al({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Kg{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,i]=this.getSliceIndices(),s=e.getTextContent();return un(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function jy(n){return n instanceof Kg}function ll(n){return Vt(n,xe(de(),n.direction))}function nu(n){return Vt(n,n)}function Vt(n,e){return n.direction!==e.direction&&L(265),new tu(n,e,n.direction)}function al(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function ru(n,e){const t=zi(n.origin,e.origin);switch(t===null&&L(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return iu(t)}}function iu(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function $s(n,e){return e.is(n)}function Id(n){return A(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function zi(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=Id(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=Id(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?($s(n,r)||L(276),{commonAncestor:r,type:"ancestor"}):i===null?($s(e,r)||L(277),{commonAncestor:r,type:"descendant"}):((A(s)||$s(n,s))&&(A(i)||$s(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||L(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function It(n,e){const{type:t,key:r,offset:i}=n,s=Zn(n.key);return t==="text"?(D(s)||L(266,s.getType(),r),un(s,e,i)):(A(s)||L(267,s.getType(),r),jg(s,n.offset,e))}function Dn(n,e){const{origin:t,direction:r}=e,i=r==="next";At(e)?n.set(t.getKey(),e.offset,"text"):Fn(e)?D(t)?n.set(t.getKey(),Ot(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(ut(e)&&A(t)||L(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function cl(n){const e=M(),t=N(e)?e:ci();return Bi(t,n),De(t),t}function Bi(n,e){Dn(n.anchor,e.anchor),Dn(n.focus,e.focus)}function wo(n){const{anchor:e,focus:t}=n,r=It(e,"next"),i=It(t,"next"),s=ru(r,i)<=0?"next":"previous";return Vt(Gt(r,s),Gt(i,s))}function hi(n){const{direction:e,origin:t}=n,r=xe(t,jn(e)).getNodeAtCaret();return r?xe(r,e):lt(t.getParentOrThrow(),e)}function Fd(n,e="root"){const t=[n];for(let r=ut(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(hi(r));return t}function Xl(n){return!!n&&n.origin.isAttached()}function Wg(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=ul(n,r),o=Fd(s.anchor,t),l=Fd(s.focus.getFlipped(),t),a=new Set,c=[];for(const g of s.iterNodeCarets(t))if(ut(g))a.add(g.origin.getKey());else if(Fn(g)){const{origin:p}=g;A(p)&&!a.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),b=hi(xe(p,r)),_=p.getMode();if(Math.abs(g.distance)===m&&i==="removeEmptySlices"||_==="token"&&g.distance!==0)b.remove();else if(g.distance!==0){i="removeEmptySlices";let y=g.removeTextSlice();const C=g.caret.origin;if(_==="segmented"){const S=y.origin,x=he(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());b.replaceOrInsert(x),y=un(x,r,y.offset)}C.is(o[0].origin)&&(o[0]=y),C.is(l[0].origin)&&(l[0]=y.getFlipped())}}let u,d;for(const g of o)if(Xl(g)){u=et(g);break}for(const g of l)if(Xl(g)){d=et(g);break}const f=(function(g,p,m){if(!g||!p)return null;const b=g.getParentAtCaret(),_=p.getParentAtCaret();if(!b||!_)return null;const y=b.getParents().reverse();y.push(b);const C=_.getParents().reverse();C.push(_);const S=Math.min(y.length,C.length);let x;for(x=0;x<S&&y[x]===C[x];x++);const w=(I,T)=>{let O;for(let z=x;z<I.length;z++){const F=I[z];if(Ue(F))return;!O&&T(F)&&(O=F)}return O},k=w(y,ct),v=k&&w(C,I=>m.has(I.getKey())&&ct(I));return k&&v?[k,v]:null})(u,d,a);if(f){const[g,p]=f;lt(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,d,...o,...l].find(Xl);if(h)return nu(Gt(et(h),n.direction));L(269,JSON.stringify(o.map(g=>g.origin.__key)))}function et(n){const e=(function(i){let s=i;for(;ut(s);){const o=hr(s);if(!ut(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if(D(e.origin))return At(e)?e:un(e.origin,t,t);const r=e.getAdjacentCaret();return Fn(r)&&D(r.origin)?un(r.origin,t,jn(t)):e}function su(n){return At(n)&&n.offset!==Ot(n.origin,n.direction)}function Gt(n,e){return n.direction===e?n:n.getFlipped()}function ul(n,e){return n.direction===e?n:Vt(Gt(n.focus,e),Gt(n.anchor,e))}function jg(n,e,t){let r=lt(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Gt(r,t)}function Hy(n,e="root"){let t=0,r=n,i=hr(r);for(;i===null;){if(t--,i=r.getParentCaret(e),!i)return null;r=i,i=hr(r)}return i&&[i,t]}function Jy(n){const{origin:e,offset:t,direction:r}=n;if(t===Ot(e,r))return n.getSiblingCaret();if(t===Ot(e,jn(r)))return hi(n.getSiblingCaret());const[i]=e.splitText(t);return D(i)||L(281),Gt(xe(i,"next"),r)}function Vy(n,e){return!0}function Hg(n,{$copyElementNode:e=Zc,$splitTextPointCaretNext:t=Jy,rootMode:r="shadowRoot",$shouldSplit:i=Vy}={}){if(At(n))return t(n);const s=n.getParentCaret(r);if(s){const{origin:o}=s;if(ut(n)&&(!o.canBeEmpty()||!i(o,"first")))return hi(s);const l=(function(a){const c=[];for(let u=a.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(n);(l.length>0||o.canBeEmpty()&&i(o,"last"))&&s.insert(e(o).splice(0,0,l))}return s}function Gy(n){return n}function Jg(...n){return n}function Yy(n,e){return[n,e]}function qy(n){return n}function Vg(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}function dn(...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 _e(n,...e){const t=dn(...e);t.length>0&&n.classList.add(...t)}function an(n,...e){const t=dn(...e);t.length>0&&n.classList.remove(...t)}function ft(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const Zy=Object.freeze(Object.defineProperty({__proto__:null,$addUpdateTag:$g,$applyNodeReplacement:Re,$caretFromPoint:It,$caretRangeFromSelection:wo,$cloneWithProperties:Qc,$cloneWithPropertiesEphemeral:Rg,$comparePointCaretNext:ru,$copyNode:Zc,$create:Bg,$createLineBreakNode:ot,$createNodeSelection:Dc,$createParagraphNode:J,$createPoint:Ae,$createRangeSelection:ci,$createRangeSelectionFromDom:Ey,$createTabNode:yt,$createTextNode:he,$extendCaretToRange:ll,$findMatchingParent:le,$getAdjacentChildCaret:hr,$getAdjacentNode:bo,$getAdjacentSiblingOrParentSiblingCaret:Hy,$getCaretInDirection:Gt,$getCaretRange:Vt,$getCaretRangeInDirection:ul,$getCharacterOffsets:ho,$getChildCaret:lt,$getChildCaretAtIndex:jg,$getChildCaretOrSelf:Ug,$getCollapsedCaretRange:nu,$getCommonAncestor:zi,$getCommonAncestorResultBranchOrder:iu,$getEditor:fi,$getNearestNodeFromDOMNode:dt,$getNearestRootOrShadowRoot:Dg,$getNodeByKey:Z,$getNodeByKeyOrThrow:Zn,$getNodeFromDOMNode:Wc,$getPreviousSelection:_n,$getRoot:de,$getSelection:M,$getSiblingCaret:xe,$getState:ji,$getStateChange:iy,$getTextContent:Ny,$getTextNodeOffset:Ot,$getTextPointCaret:un,$getTextPointCaretSlice:Ha,$getWritableNodeState:Uo,$hasAncestor:xo,$hasUpdateTag:Dy,$insertNodes:Zo,$isBlockElementNode:go,$isChildCaret:ut,$isDecoratorNode:Y,$isEditorState:mg,$isElementNode:A,$isExtendableTextPointCaret:su,$isInlineElementOrDecoratorNode:Fg,$isLeafNode:Kc,$isLineBreakNode:ue,$isNodeCaret:By,$isNodeSelection:je,$isParagraphNode:wr,$isRangeSelection:N,$isRootNode:ye,$isRootOrShadowRoot:Ue,$isSiblingCaret:Fn,$isTabNode:Je,$isTextNode:D,$isTextPointCaret:At,$isTextPointCaretSlice:jy,$isTokenOrSegmented:kt,$isTokenOrTab:Nn,$nodesOfType:Fy,$normalizeCaret:et,$normalizeSelection__EXPERIMENTAL:Mn,$onUpdate:Ig,$parseSerializedNode:hg,$removeTextFromCaretRange:Wg,$rewindSiblingCaret:hi,$selectAll:Vc,$setCompositionKey:$e,$setPointFromCaret:Dn,$setSelection:De,$setSelectionFromCaretRange:cl,$setState:js,$splitAtPointCaretNext:Hg,$splitNode:Ly,$updateRangeSelectionFromCaretRange:Bi,ArtificialNode__DO_NOT_USE:Qo,BEFORE_INPUT_COMMAND:vc,BLUR_COMMAND:ai,CAN_REDO_COMMAND:Ni,CAN_UNDO_COMMAND:Ai,CLEAR_EDITOR_COMMAND:Mc,CLEAR_HISTORY_COMMAND:Wh,CLICK_COMMAND:mr,COLLABORATION_TAG:tg,COMMAND_PRIORITY_CRITICAL:Pc,COMMAND_PRIORITY_EDITOR:U,COMMAND_PRIORITY_HIGH:yg,COMMAND_PRIORITY_LOW:G,COMMAND_PRIORITY_NORMAL:_g,COMPOSITION_END_COMMAND:Tc,COMPOSITION_START_COMMAND:Ec,CONTROLLED_TEXT_INSERTION_COMMAND:Tn,COPY_COMMAND:_r,CUT_COMMAND:li,DELETE_CHARACTER_COMMAND:Nt,DELETE_LINE_COMMAND:lr,DELETE_WORD_COMMAND:or,DRAGEND_COMMAND:Kh,DRAGOVER_COMMAND:Oc,DRAGSTART_COMMAND:Go,DROP_COMMAND:Vo,DecoratorNode:ps,ElementNode:Se,FOCUS_COMMAND:$c,FORMAT_ELEMENT_COMMAND:Ac,FORMAT_TEXT_COMMAND:ve,HISTORIC_TAG:fo,HISTORY_MERGE_TAG:Wr,HISTORY_PUSH_TAG:eg,INDENT_CONTENT_COMMAND:Bt,INPUT_COMMAND:kc,INSERT_LINE_BREAK_COMMAND:ln,INSERT_PARAGRAPH_COMMAND:$n,INSERT_TAB_COMMAND:lo,INTERNAL_$isBlock:ct,IS_ALL_FORMATTING:P_,IS_BOLD:M_,IS_CODE:D_,IS_HIGHLIGHT:xc,IS_ITALIC:$_,IS_STRIKETHROUGH:I_,IS_SUBSCRIPT:L_,IS_SUPERSCRIPT:R_,IS_UNDERLINE:F_,KEY_ARROW_DOWN_COMMAND:ar,KEY_ARROW_LEFT_COMMAND:hs,KEY_ARROW_RIGHT_COMMAND:Wo,KEY_ARROW_UP_COMMAND:cn,KEY_BACKSPACE_COMMAND:Ho,KEY_DELETE_COMMAND:Jo,KEY_DOWN_COMMAND:Nc,KEY_ENTER_COMMAND:In,KEY_ESCAPE_COMMAND:oi,KEY_MODIFIER_COMMAND:jh,KEY_SPACE_COMMAND:jo,KEY_TAB_COMMAND:gs,LineBreakNode:yr,MOVE_TO_END:oo,MOVE_TO_START:Gi,NODE_STATE_KEY:X_,OUTDENT_CONTENT_COMMAND:nn,PASTE_COMMAND:ri,PASTE_TAG:Ic,ParagraphNode:Kn,REDO_COMMAND:si,REMOVE_TEXT_COMMAND:Vi,RootNode:Cr,SELECTION_CHANGE_COMMAND:ni,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:wc,SELECT_ALL_COMMAND:Gr,SKIP_COLLAB_TAG:_y,SKIP_DOM_SELECTION_TAG:rg,SKIP_SCROLL_INTO_VIEW_TAG:ng,SKIP_SELECTION_FOCUS_TAG:Ua,TEXT_TYPE_TO_FORMAT:ze,TabNode:br,TextNode:qe,UNDO_COMMAND:ii,addClassNamesToElement:_e,buildImportMap:my,configExtension:Jg,createCommand:K,createEditor:ui,createSharedNodeState:Dh,createState:Cc,declarePeerDependency:Yy,defineExtension:Gy,flipDirection:jn,getDOMOwnerDocument:Yc,getDOMSelection:Ct,getDOMSelectionFromTarget:Lg,getDOMTextNode:cr,getEditorPropertyFromDOMNode:_s,getNearestEditorFromDOMNode:rl,getRegisteredNode:el,getRegisteredNodeOrThrow:Bc,getStaticNodeConfig:bs,getTextDirection:wg,getTransformSetFromKlass:xg,isBlockDomNode:qi,isCurrentlyReadOnlyMode:Sr,isDOMDocumentNode:Uc,isDOMNode:Wn,isDOMTextNode:Yt,isDOMUnmanaged:zg,isDocumentFragment:So,isExactShortcutMatch:ne,isHTMLAnchorElement:Xc,isHTMLElement:te,isInlineDomNode:Co,isLexicalEditor:nl,isModifierMatch:Og,isSelectionCapturedInDecoratorInput:tl,isSelectionWithinEditor:di,makeStepwiseIterator:al,mergeRegister:ft,normalizeClassNames:dn,removeClassNamesFromElement:an,removeFromParent:Wt,resetRandomKey:$y,safeCast:qy,setDOMUnmanaged:Pg,setNodeIndentFromDOM:sl,shallowMergeConfig:Vg},Symbol.toStringTag,{value:"Module"}));function Xy(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const vo=new Map;function Gg(n){const e={};if(!n)return e;const 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 Xi(n){let e=vo.get(n);return e===void 0&&(e=Gg(n),vo.set(n,e)),e}function Qy(n){let e="";for(const t in n)t&&(e+=`${t}: ${n[t]};`);return e}function Yg(n){const e=fi().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function qg(n){return Yg(ye(n)?n:n.getParentOrThrow())}function Dd(n){const e=qg(n);return e!==null&&e.direction==="rtl"}function Zg(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!kt(e)&&r!==null){const[i,s]=r,o=n.isBackward(),l=i.getNode(),a=s.getNode(),c=e.is(l),u=e.is(a);if(c||u){const[d,f]=ho(n),h=l.is(a),g=e.is(o?a:l),p=e.is(o?l:a);let m,b=0;h?(b=d>f?f:d,m=d>f?d:f):g?(b=o?f:d,m=void 0):p&&(b=0,m=o?d:f);const _=e.__text.slice(b,m);_!==e.__text&&(t==="clone"&&(e=Rg(e)),e.__text=_)}}return e}function eb(n){const e=n.getStyle(),t=Gg(e);vo.set(e,t)}function Is(n,e){(N(n)?n.isCollapsed():D(n)||A(n))||Xy(280);const t=Xi(N(n)?n.style:D(n)?n.getStyle():n.getTextStyle()),r=Object.entries(e).reduce((s,[o,l])=>(typeof l=="function"?s[o]=l(t[o],n):l===null?delete s[o]:s[o]=l,s),{...t}),i=Qy(r);N(n)||D(n)?n.setStyle(i):n.setTextStyle(i),vo.set(i,r)}function Fs(n,e){if(N(n)&&n.isCollapsed()){Is(n,e);const r=n.anchor.getNode();A(r)&&r.isEmpty()&&Is(r,e)}tb(r=>{Is(r,e)});const t=n.getNodes();if(t.length>0){const r=new Set;for(const i of t){if(!A(i)||!i.canBeEmpty()||i.getChildrenSize()!==0)continue;const s=i.getKey();r.has(s)||(r.add(s),Is(i,e))}}}function tb(n){const e=M();if(!e)return;const t=new Map,r=s=>t.get(s.getKey())||[0,s.getTextContentSize()];if(N(e))for(const s of wo(e).getTextSlices())s&&t.set(s.caret.origin.getKey(),s.getSliceIndices());const i=e.getNodes();for(const s of i){if(!D(s)||!s.canHaveFormat())continue;const[o,l]=r(s);l!==o&&(kt(s)||o===0&&l===s.getTextContentSize()?n(s):n(s.splitText(o,l)[o===0?0:1]))}N(e)&&e.anchor.type==="text"&&e.focus.type==="text"&&e.anchor.key===e.focus.key&&nb(e)}function nb(n){if(n.isBackward()){const{anchor:e,focus:t}=n,{key:r,offset:i,type:s}=e;e.set(t.key,t.offset,t.type),t.set(r,i,s)}}function rb(n,e){const t=n.getFormatType(),r=n.getIndent();t!==e.getFormatType()&&e.setFormat(t),r!==e.getIndent()&&e.setIndent(r)}function Qe(n,e,t=rb){if(n===null)return;const r=n.getStartEndPoints(),i=new Map;let s=null;if(r){const[o,l]=r;s=ci(),s.anchor.set(o.key,o.offset,o.type),s.focus.set(l.key,l.offset,l.type);const a=le(o.getNode(),ct),c=le(l.getNode(),ct);A(a)&&i.set(a.getKey(),a),A(c)&&i.set(c.getKey(),c)}for(const o of n.getNodes())if(A(o)&&ct(o))i.set(o.getKey(),o);else if(r===null){const l=le(o,ct);A(l)&&i.set(l.getKey(),l)}for(const[o,l]of i){const a=e();t(l,a),l.replace(a,!0),s&&(o===s.anchor.key&&s.anchor.set(a.getKey(),s.anchor.offset,s.anchor.type),o===s.focus.key&&s.focus.set(a.getKey(),s.focus.offset,s.focus.type))}s&&n.is(M())&&De(s)}function Xg(n){const e=Qg(n);return e!==null&&e.writingMode==="vertical-rl"}function Qg(n){const e=n.anchor.getNode();return A(e)?Yg(e):qg(e)}function ko(n,e){let t=Xg(n)?!e:e;ep(n)&&(t=!t);const r=It(n.focus,t?"previous":"next");if(su(r))return!1;for(const i of ll(r)){if(ut(i))return!i.origin.isInline();if(!A(i.origin)){if(Y(i.origin))return!0;break}}return!1}function ib(n,e,t,r){n.modify(e?"extend":"move",t,r)}function ep(n){const e=Qg(n);return e!==null&&e.direction==="rtl"}function Eo(n,e,t){const r=ep(n);let i;i=Xg(n)||r?!t:t,ib(n,e,i,"character")}function sb(n,e,t){const r=Xi(n.getStyle());return r!==null&&r[e]||t}function Ds(n,e,t=""){let r=null;const i=n.getNodes(),s=n.anchor,o=n.focus,l=n.isBackward(),a=l?o.offset:s.offset,c=l?o.getNode():s.getNode();if(N(n)&&n.isCollapsed()&&n.style!==""){const u=Xi(n.style);if(u!==null&&e in u)return u[e]}for(let u=0;u<i.length;u++){const d=i[u];if((u===0||a!==0||!d.is(c))&&D(d)){const f=sb(d,e,t);if(r===null)r=f;else if(r!==f){r="";break}}}return r===null?t:r}function tp(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const dl=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,ob=dl&&"documentMode"in document?document.documentMode:null,lb=dl&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!dl||!("InputEvent"in window)||ob)&&"getTargetRanges"in new window.InputEvent("input");const ab=dl,cb=lb;function ub(n){return n?n.getAdjacentCaret():null}function db(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function fb(n){const e=le(n,t=>A(t)&&!t.isInline());return A(e)||tp(4,n.__key),e}function hb(n){const e=M()||_n();let t;if(N(e))t=It(e.focus,"next");else{if(e!=null){const o=e.getNodes(),l=o[o.length-1];l&&(t=xe(l,"next"))}t=t||lt(de(),"previous").getFlipped().insert(J())}const r=gb(n,t),i=hr(r),s=ut(i)?et(i):r;return cl(nu(s)),n.getLatest()}function gb(n,e,t){let r=Gt(e,"next");for(let i=r;i;i=Hg(i,t))r=i;return At(r)&&tp(283),r.insert(n.isInline()?J().append(n):n),Gt(xe(n.getLatest(),"next"),e.direction)}function rn(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}let Ql=!(cb||!ab)&&void 0;function pb(n,e=!1){let t=1;if((function(){if(Ql===void 0){const r=document.createElement("div");r.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),Ql=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return Ql})()||e)for(;n;)t*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return t}function np(n,e){return rp(n,e,null)}function rp(n,e,t){let r=!1;for(const i of sp(n))e(i)?t!==null&&t(i):(r=!0,A(i)&&rp(i,e,t||(s=>i.insertAfter(s))),i.remove());return r}function ip(n,e){const t=[],r=Array.from(n).reverse();for(let i=r.pop();i!==void 0;i=r.pop())if(e(i))t.push(i);else if(A(i))for(const s of sp(i))r.push(s);return t}function sp(n){return mb(lt(n,"previous"))}function mb(n){return al({hasNext:Fn,initial:n.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function op(n,e){const t=Uc(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!cp.has(s.nodeName)){const o=up(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof Qo&&o.insertAfter(ot());for(const o of s){const l=o.getChildren();for(const a of l)o.insertBefore(a);o.remove()}})(i),r}function lp(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=de().getChildren();for(let i=0;i<r.length;i++)ap(n,r[i],t,e);return t.innerHTML}function ap(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=A(e)&&e.excludeFromCopy("html");let o=e;r!==null&&D(e)&&(o=Zg(r,e,"clone"));const l=A(o)?o.getChildren():[],a=el(n,o.getType());let c;c=a&&a.exportDOM!==void 0?a.exportDOM(n,o):o.exportDOM(n);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let h=0;h<l.length;h++){const g=l[h],p=ap(n,g,f,r);!i&&A(e)&&p&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((te(u)||So(u))&&u.append(f),t.append(u),d){const h=d.call(o,u);h&&(So(u)?u.replaceChildren(h):u.replaceWith(h))}}else t.append(f);return i}const cp=new Set(["STYLE","SCRIPT"]);function up(n,e,t,r,i=new Map,s){let o=[];if(cp.has(n.nodeName))return o;let l=null;const a=(function(g,p){const{nodeName:m}=g,b=p._htmlConversions.get(m.toLowerCase());let _=null;if(b!==void 0)for(const y of b){const C=y(g);C!==null&&(_===null||(_.priority||0)<=(C.priority||0))&&(_=C)}return _!==null?_.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[,p]of i)if(l=p(l,s),!l)break;l&&o.push(...Array.isArray(g)?g:[l])}c.forChild!=null&&i.set(n.nodeName,c.forChild)}const d=n.childNodes;let f=[];const h=(l==null||!Ue(l))&&(l!=null&&go(l)||r);for(let g=0;g<d.length;g++)f.push(...up(d[g],e,t,h,new Map(i),l));return u!=null&&(f=u(f)),qi(n)&&(f=_b(n,f,h?()=>{const g=new Qo;return t.push(g),g}:J)),l==null?f.length>0?o=o.concat(f):qi(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Co(g.nextSibling)&&Co(g.previousSibling)})(n)&&(o=o.concat(ot())):A(l)&&l.append(...f),o}function _b(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const l=e[o];if(go(l))r&&!l.getFormat()&&l.setFormat(r),i.push(l);else if(s.push(l),o===e.length-1||o<e.length-1&&go(e[o+1])){const a=t();a.setFormat(r),a.append(...s),i.push(a),s=[]}}return i}function To(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function dp(n,e=M()){return e==null&&To(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?"":lp(n,e)}function yb(n,e=M()){return e==null&&To(166),N(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(bb(n,e))}function Ld(n,e){const t=n.getData("text/plain")||n.getData("text/uri-list");t!=null&&e.insertRawText(t)}function Rd(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const l=JSON.parse(r);if(l.namespace===t._config.namespace&&Array.isArray(l.nodes))return Pd(t,xb(l.nodes),e)}catch(l){console.error(l)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const l=new DOMParser().parseFromString((function(a){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(a):a})(i),"text/html");return Pd(t,op(t,l),e)}catch(l){console.error(l)}const o=s||n.getData("text/uri-list");if(o!=null)if(N(e)){const l=o.split(/(\r?\n|\t)/);l[l.length-1]===""&&l.pop();for(let a=0;a<l.length;a++){const c=M();if(N(c)){const u=l[a];u===`
|
|
12
12
|
`||u===`\r
|
|
13
|
-
`?c.insertParagraph():u===" "?c.insertNodes([Ct()]):c.insertText(u)}}}else e.insertRawText(o)}function Hd(n,e,t){n.dispatchCommand(Nc,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(N(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=Dt(i,"previous");if(o)if(Mt(o))s=o.origin;else{const l=Vt(o,at(fe(),"next").getFlipped());for(const a of l){if(D(a.origin)){s=a.origin;break}if(A(a.origin)&&!a.origin.isInline())break}}if(s&&D(s)){const l=s.getFormat(),a=s.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(t))}function _p(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=A(t)&&t.excludeFromCopy("html");let o=t;e!==null&&D(o)&&(o=np(e,o,"clone"));const l=A(o)?o.getChildren():[],a=(function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&$o(58,d.name),A(c)){const f=u.children;Array.isArray(f)||$o(59,d.name)}return u})(o);D(o)&&o.getTextContentSize()===0&&(i=!1);for(let c=0;c<l.length;c++){const u=l[c],d=_p(n,e,u,a.children);!i&&A(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!s)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 Db(n,e){const t=[],r=fe().getChildren();for(let i=0;i<r.length;i++)_p(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Lb(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=yg(r);D(i)&&mb(i),e.push(i)}return e}let Dr=null;async function Jd(n,e,t){if(Dr!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(Gd(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=kt(i);if(r===null||o===null)return!1;const l=s.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(s.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),o.removeAllRanges(),o.addRange(a),new Promise((c,u)=>{const d=n.registerCommand(xr,f=>(on(f,ClipboardEvent)&&(d(),Dr!==null&&(i.clearTimeout(Dr),Dr=null),c(Gd(n,f,t))),!0),Wc);Dr=i.setTimeout(()=>{d(),Dr=null,c(!1)},50),s.execCommand("copy"),l.remove()})}function Gd(n,e,t){if(t===void 0){const i=kt(n._window),s=O();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,l=i.focusNode;if(o!==null&&l!==null&&!pi(n,o,l))return!1;t=Rb(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Pb(r,t),!0)}const yp=[["text/html",mp],["application/x-lexical-editor",Fb]];function Rb(n=O()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=mi();for(const[r,i]of yp){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Pb(n,e){for(const[t]of yp)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const Bb=Symbol.for("preact-signals");function _l(){if(Mn>1)return void Mn--;let n,e=!1;for(;Gi!==void 0;){let t=Gi;for(Gi=void 0,Za++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&xp(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(Za=0,Mn--,e)throw n}function zb(n){if(Mn>0)return n();Mn++;try{return n()}finally{_l()}}let ne,Gi;function Vd(n){const e=ne;ne=void 0;try{return n()}finally{ne=e}}let Mn=0,Za=0,Qs=0;function Yd(n){if(ne===void 0)return;let e=n.n;return e===void 0||e.t!==ne?(e={i:0,S:n,p:ne.s,n:void 0,t:ne,e:void 0,x:void 0,r:e},ne.s!==void 0&&(ne.s.n=e),ne.s=e,n.n=e,32&ne.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ne.s,e.n=void 0,ne.s.n=e,ne.s=e),e):void 0}function Qe(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function bp(n,e){return new Qe(n,e)}function xp(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function qd(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function Sp(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Lr(n,e){Qe.call(this,void 0),this.x=n,this.s=void 0,this.g=Qs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Cp(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Mn++;const t=ne;ne=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,du(n),r}finally{ne=t,_l()}}}function du(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Cp(n)}function Ub(n){if(ne!==this)throw new Error("Out-of-order effect");Sp(this),ne=n,this.f&=-2,8&this.f&&du(this),_l()}function Wr(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function fu(n,e){const t=new Wr(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Kb(n,e={}){const t={};for(const r in n){const i=e[r],s=bp(i===void 0?n[r]:i);t[r]=s}return t}Qe.prototype.brand=Bb,Qe.prototype.h=function(){return!0},Qe.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:Vd(()=>{var t;(t=this.W)==null||t.call(this)}))},Qe.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&Vd(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Qe.prototype.subscribe=function(n){return fu(()=>{const e=this.value,t=ne;ne=void 0;try{n(e)}finally{ne=t}},{name:"sub"})},Qe.prototype.valueOf=function(){return this.value},Qe.prototype.toString=function(){return this.value+""},Qe.prototype.toJSON=function(){return this.value},Qe.prototype.peek=function(){const n=ne;ne=void 0;try{return this.value}finally{ne=n}},Object.defineProperty(Qe.prototype,"value",{get(){const n=Yd(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Za>100)throw new Error("Cycle detected");this.v=n,this.i++,Qs++,Mn++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{_l()}}}}),Lr.prototype=new Qe,Lr.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Qs))return!0;if(this.g=Qs,this.f|=1,this.i>0&&!xp(this))return this.f&=-2,!0;const n=ne;try{qd(this),ne=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ne=n,Sp(this),this.f&=-2,!0},Lr.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Qe.prototype.S.call(this,n)},Lr.prototype.U=function(n){if(this.t!==void 0&&(Qe.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Lr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Lr.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=Yd(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Wr.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Wr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Cp(this),qd(this),Mn++;const n=ne;return ne=this,Ub.bind(this,n)},Wr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Gi,Gi=this)},Wr.prototype.d=function(){this.f|=8,1&this.f||du(this)},Wr.prototype.dispose=function(){this.d()};function Wb(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function ae(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function wp(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=wp(t[i],r[i]);return n}return e}const hu=0,Xa=1,vp=2,oa=3,Us=4,Rr=5,la=6,Oi=7;function aa(n){return n.id===hu}function Ep(n){return n.id===vp}function jb(n){return(function(e){return e.id===Xa})(n)||ae(305,String(n.id),String(Xa)),Object.assign(n,{id:vp})}const Hb=new Set;let Jb=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:hu}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Xg;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Ep(t)||ae(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(l,a,c){return Object.assign(l,{config:a,id:oa,registerState:c})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(l,a,c){return Object.assign(l,{id:Us,initResult:a,registerState:c})})(s,o,i)}build(e){const t=this.state;let r;t.id!==Us&&ae(307,String(t.id),String(Rr)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,l){return Object.assign(s,{id:Rr,output:o,registerState:l})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==Rr&&ae(308,String(r.id),String(Rr));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:la})})(r),()=>{const s=this.state;s.id!==Oi&&ae(309,String(r.id),String(Oi)),this.state=(function(o){return Object.assign(o,{id:Rr})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==la&&ae(310,String(t.id),String(la)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:Oi})})(t),r}getSignal(){return this._signal===void 0&&ae(311),this._signal}getInitResult(){this.extension.init===void 0&&ae(312,this.extension.name);const e=this.state;return(function(t){return t.id>=Us})(e)||ae(313,String(e.id),String(Us)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=oa})(e)||ae(314,String(e.id),String(oa)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=Oi})(e)||ae(316,String(e.id),String(Oi)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Hb}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Rr})(e)||ae(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const Zd={tag:Gr};function Gb(){const n=fe();n.isEmpty()&&n.append(H())}const Vb={config:{setOptions:Zd,updateOptions:Zd},init:({$initialEditorState:n=Gb})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(Sg(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Er,Ye,Sr,Cr,kr]},Xd=Symbol.for("@lexical/extension/LexicalBuilder");function Qd(){}function Yb(n){throw n}function Ks(n){return Array.isArray(n)?n:[n]}const ca="0.40.0+prod.esm";let qb=class eo{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ca,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Ks(Vb)];for(const r of e)t.push(Ks(r));return new eo(t)}static maybeFromEditor(e){const t=e[Xd];return t&&(t.PACKAGE_VERSION!==ca&&ae(292,t.PACKAGE_VERSION,ca),t instanceof eo||ae(293)),t}static fromEditor(e){const t=eo.maybeFromEditor(e);return t===void 0&&ae(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(gi({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[Xd]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Qd;function t(){try{e()}finally{e=Qd}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=pt(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ae(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ae(296);const t=Ks(e),[r]=t;typeof r.name!="string"&&ae(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&ae(298,r.name),!i){i=new Jb(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&ae(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&ae(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const l=Ks(o);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[o,l]of r.peerDependencies||[])this.addEdge(r.name,o,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(Ep(s))return;const o=r.extension.name;var l;aa(s)||ae(300,o,i||"[unknown]"),aa(l=s)||ae(304,String(l.id),String(hu)),s=Object.assign(l,{id:Xa}),r.state=s;const a=this.outgoingConfigEdges.get(o);if(a)for(const c of a.keys()){const u=this.extensionNameMap.get(c);u&&t(u,o)}s=jb(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())aa(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const l of s)o.configs.add(l)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&ae(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const l=o.register(e,s);l&&i.push(l)}for(const o of t){const l=o.afterRegistration(e);l&&i.push(l)}return pt(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},l=this.sortedExtensionReps();for(const u of l){const{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(const f of Wb(d)){if(typeof f!="function"){const h=r.get(f.replace);h&&ae(302,d.name,f.replace.name,h.extension.name),r.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(const[f,h]of d.html.export.entries())i.set(f,h);d.html.import&&Object.assign(s,d.html.import)}d.theme&&wp(o,d.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(s).length>0,c=i.size>0;(a||c)&&(e.html={},a&&(e.html.import=s),c&&(e.html.export=i));for(const u of l)u.init(e);return e.onError||(e.onError=Yb),e}};function Zb(n,e){const t=qb.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function ef(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 l=o.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h]=a;n.update(()=>{const g=O();if(N(g)){const p=g.anchor;let m=p.getNode(),b=0,_=0;if(D(m)&&c>=0&&u>=0&&(b=c,_=c+u,g.setTextNodeRange(m,b,m,_)),b===_&&d===""||(g.insertRawText(d),m=p.getNode()),D(m)){b=f,_=f+h;const y=m.getTextContentSize();b=b>y?y:b,_=_>y?y:_,g.setTextNodeRange(m,b,m,_)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function tf(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 Nr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Xb=Nr&&"documentMode"in document?document.documentMode:null,Qb=Nr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ex=!(!Nr||!("InputEvent"in window)||Xb)&&"getTargetRanges"in new window.InputEvent("input"),tx=Nr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),nf=Nr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nx=Nr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),rx=Nr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Qb&&!nx,rf=z("DRAG_DROP_PASTE_FILE");let yl=class kp extends xe{static getType(){return"quote"}static clone(e){return new kp(e.__key)}createDOM(e){const t=document.createElement("blockquote");return me(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:ix,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return yi().updateFromJSON(e)}insertNewAfter(e,t){const r=H(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=H();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function yi(){return Le(new yl)}function Qa(n){return n instanceof yl}let bl=class Tp extends xe{__tag;static getType(){return"heading"}static clone(e){return new Tp(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];me(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Pr,priority:0}),h2:e=>({conversion:Pr,priority:0}),h3:e=>({conversion:Pr,priority:0}),h4:e=>({conversion:Pr,priority:0}),h5:e=>({conversion:Pr,priority:0}),h6:e=>({conversion:Pr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&sf(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>sf(e)?{conversion:t=>({node:ft("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(re(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return ft(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?H():ft(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const l=H();l.select(),this.replace(l,!0)}return s}collapseAtStart(){const e=this.isEmpty()?H():ft(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function sf(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Pr(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=ft(e),n.style!==null&&(ul(n,t),t.setFormat(n.style.textAlign))),{node:t}}function ix(n){const e=yi();return n.style!==null&&(e.setFormat(n.style.textAlign),ul(n,e)),{node:e}}function ft(n="h1"){return Le(new bl(n))}function sx(n){return n instanceof bl}function Ws(n){let e=null;if(on(n,DragEvent)?e=n.dataTransfer:on(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 of(n){const e=O();if(!N(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 l=le(s,c=>A(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 lf(n){const e=gt(n);return V(e)}function ua(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function ox(n){return pt(n.registerCommand(br,e=>{const t=O();return!!je(t)&&(t.clear(),!0)},B),n.registerCommand(Ot,e=>{const t=O();return N(t)?(t.deleteCharacter(e),!0):!!je(t)&&(t.deleteNodes(),!0)},B),n.registerCommand(cr,e=>{const t=O();return!!N(t)&&(t.deleteWord(e),!0)},B),n.registerCommand(ur,e=>{const t=O();return!!N(t)&&(t.deleteLine(e),!0)},B),n.registerCommand(An,e=>{const t=O();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)jd(r,t,n);else if(N(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},B),n.registerCommand(Qi,()=>{const e=O();return!!N(e)&&(e.removeText(),!0)},B),n.registerCommand(ve,e=>{const t=O();return!!N(t)&&(t.formatText(e),!0)},B),n.registerCommand(Fc,e=>{const t=O();if(!N(t)&&!je(t))return!1;const r=t.getNodes();for(const i of r){const s=le(i,o=>A(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},B),n.registerCommand(cn,e=>{const t=O();return!!N(t)&&(t.insertLineBreak(e),!0)},B),n.registerCommand(Fn,()=>{const e=O();return!!N(e)&&(e.insertParagraph(),!0)},B),n.registerCommand(ho,()=>(nl([Ct()]),!0),B),n.registerCommand(Ut,()=>of(e=>{const t=e.getIndent();e.setIndent(t+1)}),B),n.registerCommand(sn,()=>of(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),B),n.registerCommand(dn,e=>{const t=O();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(N(t)){const r=vo(t.focus,!0);if(!e.shiftKey&&V(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},B),n.registerCommand(dr,e=>{const t=O();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(N(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===fe().getChildrenSize()})(t))return e.preventDefault(),!0;const r=vo(t.focus,!1);if(!e.shiftKey&&V(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},B),n.registerCommand(bs,e=>{const t=O();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),Kd(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!N(t))return!1;if(Oo(t,!0)){const r=e.shiftKey;return e.preventDefault(),Mo(t,r,!0),!0}return!1},B),n.registerCommand(Vo,e=>{const t=O();if(je(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),Kd(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!N(t))return!1;const r=e.shiftKey;return!!Oo(t,!1)&&(e.preventDefault(),Mo(t,r,!1),!0)},B),n.registerCommand(qo,e=>{if(lf(e.target))return!1;const t=O();if(N(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(be(s))return!1;const o=Nb(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(sn,void 0);if(nf&&navigator.language==="ko-KR")return!1}else if(!je(t))return!1;return e.preventDefault(),n.dispatchCommand(Ot,!0)},B),n.registerCommand(Zo,e=>{if(lf(e.target))return!1;const t=O();return!(!N(t)&&!je(t))&&(e.preventDefault(),n.dispatchCommand(Ot,!1))},B),n.registerCommand(Dn,e=>{const t=O();if(!N(t))return!1;if(ua(t),e!==null){if((nf||tx||rx)&&ex)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(cn,!1)}return n.dispatchCommand(Fn,void 0)},B),n.registerCommand(ui,()=>{const e=O();return!!N(e)&&(n.blur(),!0)},B),n.registerCommand(Xo,e=>{const[,t]=Ws(e);if(t.length>0){const i=tf(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,l=gt(o);if(l!==null){const a=hi();if(D(l))a.anchor.set(l.getKey(),s,"text"),a.focus.set(l.getKey(),s,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=In(a);Fe(c)}n.dispatchCommand(rf,t)}return e.preventDefault(),!0}const r=O();return!!N(r)},B),n.registerCommand(Qo,e=>{const[t]=Ws(e),r=O();return!(t&&!N(r))},B),n.registerCommand(Dc,e=>{const[t]=Ws(e),r=O();if(t&&!N(r))return!1;const i=tf(e.clientX,e.clientY);if(i!==null){const s=gt(i.node);V(s)&&e.preventDefault()}return!0},B),n.registerCommand(Xr,()=>(Xc(),!0),B),n.registerCommand(xr,e=>(Jd(n,on(e,ClipboardEvent)?e:null),!0),B),n.registerCommand(di,e=>((async function(t,r){await Jd(r,on(t,ClipboardEvent)?t:null),r.update(()=>{const i=O();N(i)?i.removeText():je(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),B),n.registerCommand(li,e=>{const[,t,r]=Ws(e);return t.length>0&&!r?(n.dispatchCommand(rf,t),!0):jn(e.target)&&ol(e.target)?!1:O()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=O(),l=on(i,InputEvent)||on(i,KeyboardEvent)?null:i.clipboardData;l!=null&&o!==null&&jd(l,o,s)},{tag:Pc})})(e,n),!0)},B),n.registerCommand(Yo,e=>{const t=O();return N(t)&&ua(t),!1},B),n.registerCommand(xs,e=>{const t=O();return N(t)&&ua(t),!1},B))}function Tn(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lx(n){let e=1,t=n.getParent();for(;t!=null;){if(Q(t)){const r=t.getParent();if(J(r)){e++,t=r.getParent();continue}Tn(40)}return e}return e}function ec(n){let e=n.getParent();J(e)||Tn(40);let t=e;for(;t!==null;)t=t.getParent(),J(t)&&(e=t);return e}function Np(n){let e=[];const t=n.getChildren().filter(Q);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();J(s)?e=e.concat(Np(s)):e.push(i)}return e}function zt(n){return Q(n)&&J(n.getFirstChild())}function af(n){return mt().append(n)}function Ap(n,e){return Q(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Io(n){const e=O();if(e!==null){let t=e.getNodes();if(N(e)){const i=e.getStartEndPoints();i===null&&Tn(143);const[s]=i,o=s.getNode(),l=o.getParent();if(ze(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const c=H();o.append(c),t=c.select().getNodes()}}else if(Ap(o,t)){const a=ot(n);if(ze(l)){o.replace(a);const c=mt();A(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(Q(o)){const c=o.getParentOrThrow();_r(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(A(s)&&s.isEmpty()&&!Q(s)&&!r.has(s.getKey())){cf(s,n);continue}let o=Gc(s)?s.getParent():Q(s)&&s.isEmpty()?s:null;for(;o!=null;){const l=o.getKey();if(J(o)){if(!r.has(l)){const a=ot(n);_r(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(ze(a)&&!r.has(l)){r.add(l),cf(o,n);break}o=a}}}}}function _r(n,e){n.splice(n.getChildrenSize(),0,e)}function cf(n,e){if(J(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=mt();let s;if(_r(i,n.getChildren()),J(t)&&e===t.getListType())t.append(i),J(r)&&e===r.getListType()&&(_r(t,r.getChildren()),r.remove()),s=t;else if(J(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const l=ot(e);l.append(i),n.replace(l),s=l}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const o=O();return N(o)&&(s.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,"element"),s.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,"element")),n.remove(),s}function gu(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&zt(t)&&zt(r)&&(gu(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function Op(){const n=O();if(N(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(Ap(r,t))e.add(ec(r));else for(let i=0;i<t.length;i++){const s=t[i];if(Gc(s)){const o=Tb(s,Ar);o!=null&&e.add(ec(o))}}for(const i of e){let s=i;const o=Np(i);for(const l of o){const a=H().setTextStyle(n.style).setTextFormat(n.format);_r(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&Rn(n.anchor,tt(at(a,"next"))),l.__key===n.focus.key&&Rn(n.focus,tt(at(a,"next"))),l.remove()}i.remove()}}}function Mp(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())Q(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),J(r.getFirstChild())||t++)}function ax(n){const e=new Set;if(zt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(zt(r)&&zt(i)){const s=i.getFirstChild();if(J(s)){s.append(n);const o=r.getFirstChild();J(o)&&(_r(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(zt(r)){const s=r.getFirstChild();if(J(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(zt(i)){const s=i.getFirstChild();J(s)&&s.append(n)}else if(J(t)){const s=mt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=ot(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function cx(n){if(zt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(J(t?t.getParent():void 0)&&Q(t)&&J(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=mt(),l=ot(s);o.append(l),n.getPreviousSiblings().forEach(u=>l.append(u));const a=mt(),c=ot(s);a.append(c),_r(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function ux(){const n=O();if(!N(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();let t=null;if(Q(e)&&e.getChildrenSize()===0)t=e;else if(D(e)){const a=e.getParent();Q(a)&&a.getChildren().every(c=>D(c)&&c.getTextContent().trim()==="")&&(t=a)}if(t===null)return!1;const r=ec(t),i=t.getParent();J(i)||Tn(40);const s=i.getParent();let o;if(ze(s))o=H(),r.insertAfter(o);else{if(!Q(s))return!1;o=mt(),s.insertAfter(o)}o.setTextStyle(n.style).setTextFormat(n.format).select();const l=t.getNextSiblings();if(l.length>0){const a=ot(i.getListType());if(Q(o)){const c=mt();c.append(a),o.insertAfter(c)}else o.insertAfter(a);a.append(...l)}return(function(a){let c=a;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const u=c.getParent();if(u==null||!Q(u)&&!J(u))break;c=u}c.remove()})(t),!0}let Ar=class extends xe{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();J(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:xe,importDOM:{li:()=>({conversion:dx,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,l,a){const c=l.getParent();!J(c)||c.getListType()!=="check"||J(l.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),a&&l.__checked===a.__checked||o.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,l,a){const c=[],u=[],d=l.list,f=d?d.listitem:void 0;let h;if(d&&d.nested&&(h=d.nested.listitem),f!==void 0&&c.push(...hn(f)),d){const g=a.getParent(),p=J(g)&&g.getListType()==="check",m=a.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(h!==void 0){const g=hn(h);a.getChildren().some(p=>J(p))?c.push(...g):u.push(...g)}u.length>0&&un(o,...u),c.length>0&&me(o,...c)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,l,a){const c=is(l.__textStyle);for(const u in c)o.style.setProperty(`--listitem-marker-${u}`,c[u]);if(a)for(const u in is(a.__textStyle))u in c||o.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(A(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(Q(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!J(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=ot(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&&(A(e)||Tn(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(J(r)||Tn(39),Q(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=ot(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&&zt(t)&&zt(r)&&(gu(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=mt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=H();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=Q(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return J(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;Q(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Tn(117),(e=Math.floor(e))>=0||Tn(199);let t=this.getIndent();for(;t!==e;)t<e?(ax(this),t++):(cx(this),t--);return this}canInsertAfter(e){return Q(e)}canReplaceWith(e){return Q(e)}canMergeWith(e){return Q(e)||Tr(e)}extractWithChild(e,t){if(!N(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 ot("bullet")}canMergeWhenEmpty(){return!0}};function dx(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return uf(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return uf(t.children[0])}const e=n.getAttribute("aria-checked");return{node:mt(e==="true"||e!=="false"&&void 0)}}function uf(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:mt(n.hasAttribute("checked"))}}function mt(n){return Le(new Ar(void 0,n))}function Q(n){return n instanceof Ar}let ks=class extends xe{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();J(r)&&t.getListType()===r.getListType()&&gu(t,r)})(e),Mp(e)},extends:xe,importDOM:{ol:()=>({conversion:ff,priority:0}),ul:()=>({conversion:ff,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=hx[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,df(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(df(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return re(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()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let s=0;s<r.length;s++){const o=r[s];Q(o)||(i===r&&(i=[...r]),i[s]=mt().append(!A(o)||J(o)||o.isInline()?o:de(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return Q(e)}};function df(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=lx(t)-1,a=l%o.length,c=o[a],u=s[t.__tag];let d;const f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&r.push(u),h!==void 0&&t.__listType==="check"&&r.push(h),c!==void 0){r.push(...hn(c));for(let g=0;g<o.length;g++)g!==a&&i.push(t.__tag+g)}if(d!==void 0){const g=hn(d);l>1?r.push(...g):i.push(...g)}}i.length>0&&un(n,...i),r.length>0&&me(n,...r)}function fx(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(Q(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{J(s)&&e.push(af(s))})}else e.push(af(r))}return e}function ff(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=ot("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(re(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?ot("check"):ot("bullet")),{after:fx,node:t}}const hx={ol:"number",ul:"bullet"};function ot(n="number",e=1){return Le(new ks(n,e))}function J(n){return n instanceof ks}const xl=z("INSERT_CHECK_LIST_COMMAND");function hf(n){return pt(n.registerCommand(xl,()=>(Io("check"),!0),G),n.registerCommand(dr,e=>mf(e,n,!1),G),n.registerCommand(dn,e=>mf(e,n,!0),G),n.registerCommand(ui,()=>{if(tc()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},G),n.registerCommand(Yo,e=>{const t=tc();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=gt(t);Q(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},G),n.registerCommand(bs,e=>n.getEditorState().read(()=>{const t=O();if(N(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=le(s,l=>A(l)&&!l.isInline());if(Q(o)){const l=o.getParent();if(J(l)&&l.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const a=n.getElementByKey(o.__key);if(a!=null&&document.activeElement!==a)return a.focus(),e.preventDefault(),!0}}}}return!1}),G),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",gf),e.addEventListener("pointerdown",pf)),t!==null&&(t.removeEventListener("click",gf),t.removeEventListener("pointerdown",pf))}))}function $p(n,e){const t=n.target;if(!re(t))return;const r=t.firstChild;if(re(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=Mb(t),l=n.clientX/o,a=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},c=parseFloat(a.width),u=n.pointerType==="touch"?32:0;(t.dir==="rtl"?l<s.right+u&&l>s.right-c-u:l>s.left-u&&l<s.left+c+u)&&e()}function gf(n){$p(n,()=>{if(re(n.target)){const e=n.target,t=al(e);t!=null&&t.isEditable()&&t.update(()=>{const r=gt(e);Q(r)&&(e.focus(),r.toggleChecked())})}})}function pf(n){$p(n,()=>{n.preventDefault()})}function tc(){const n=document.activeElement;return re(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function mf(n,e,t){const r=tc();return r!=null&&e.update(()=>{const i=gt(r);if(!Q(i))return;const s=(function(o,l){let a=l?o.getPreviousSibling():o.getNextSibling(),c=o;for(;a==null&&Q(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;Q(a);){const u=l?a.getLastChild():a.getFirstChild();if(!J(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const gx=z("UPDATE_LIST_START_COMMAND"),bi=z("INSERT_UNORDERED_LIST_COMMAND"),xi=z("INSERT_ORDERED_LIST_COMMAND"),pu=z("REMOVE_LIST_COMMAND");function da(n){return pt(n.registerCommand(xi,()=>(Io("number"),!0),G),n.registerCommand(gx,e=>{const{listNodeKey:t,newStart:r}=e,i=q(t);return!!J(i)&&(i.getListType()==="number"&&(i.setStart(r),Mp(i)),!0)},G),n.registerCommand(bi,()=>(Io("bullet"),!0),G),n.registerCommand(pu,()=>(Op(),!0),G),n.registerCommand(Fn,()=>ux(),G),n.registerNodeTransform(Ar,e=>{const t=e.getFirstChild();if(t){if(D(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=O();N(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Ye,e=>{const t=e.getParent();if(Q(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function fa(n,e){n.update(()=>Io(e))}function px(n){n.update(()=>Op())}const mu=/^(\d+(?:\.\d+)?)px$/,Te={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Or extends xe{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(e){return new Or(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:_f,priority:0}),th:e=>({conversion:_f,priority:0})}}static importJSON(e){return Ht().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=Te.NO_STATUS,t=1,r,i){super(i),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}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),nc(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),me(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const t=super.exportDOM(e);if(re(t.element)){const r=t.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),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=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...nc(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){const t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){const t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=Te.BOTH){const r=this.getWritable();return r.__headerState=e&t|r.__headerState&~t,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){const t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){const t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){const t=this.getWritable();return t.__verticalAlign=e||void 0,t}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!==Te.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||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function nc(n){return n==="middle"||n==="bottom"}function _f(n){const e=n,t=n.nodeName.toLowerCase();let r;mu.test(e.style.width)&&(r=parseFloat(e.style.width));const i=Ht(t==="th"?Te.ROW:Te.NO_STATUS,e.colSpan,r);i.__rowSpan=e.rowSpan;const s=e.style.backgroundColor;s!==""&&(i.__backgroundColor=s);const o=e.style.verticalAlign;nc(o)&&(i.__verticalAlign=o);const l=e.style,a=(l&&l.textDecoration||"").split(" "),c=l.fontWeight==="700"||l.fontWeight==="bold",u=a.includes("line-through"),d=l.fontStyle==="italic",f=a.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const b=p.getFirstChild();ue(b)&&p.getChildrenSize()===1&&b.remove()}};for(const b of h)Bg(b)||D(b)||ue(b)?(D(b)&&(c&&b.toggleFormat("bold"),u&&b.toggleFormat("strikethrough"),d&&b.toggleFormat("italic"),f&&b.toggleFormat("underline")),p?p.append(b):(p=H().append(b),g.push(p))):(g.push(b),m(),p=null);return m(),g.length===0&&g.push(H()),g},node:i}}function Ht(n=Te.NO_STATUS,e=1,t){return Le(new Or(n,e,t))}function ge(n){return n instanceof Or}const Ts=z("INSERT_TABLE_COMMAND");function ee(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class Si extends xe{__height;static getType(){return"tablerow"}static clone(e){return new Si(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:mx,priority:0})}}static importJSON(e){return ss().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){const e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),me(t,e.theme.tableRow),t}extractWithChild(e,t,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){const t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function mx(n){const e=n;let t;return mu.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:r=>cp(r,ge),node:ss(t)}}function ss(n){return Le(new Si(n))}function nt(n){return n instanceof Si}const Ip=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_x=Ip&&"documentMode"in document?document.documentMode:null;function yx(n,e,t=!0){const r=yu();for(let i=0;i<n;i++){const s=ss();for(let o=0;o<e;o++){let l=Te.NO_STATUS;typeof t=="object"?(i===0&&t.rows&&(l|=Te.ROW),o===0&&t.columns&&(l|=Te.COLUMN)):t&&(i===0&&(l|=Te.ROW),o===0&&(l|=Te.COLUMN));const a=Ht(l),c=H();c.append(de()),a.append(c),s.append(a)}r.append(s)}return r}function bx(n){const e=le(n,t=>ge(t));return ge(e)?e:null}function Fp(n){const e=le(n,t=>Jt(t));if(Jt(e))return e;throw new Error("Expected table cell to be inside of table.")}Ip&&"InputEvent"in window&&!_x&&new window.InputEvent("input");const rc=(n,e)=>n===Te.BOTH||n===e?e:Te.NO_STATUS;function yf(n=!0){const e=O();N(e)||Mr(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=_t(t),[s,,o]=_t(r),[,l,a]=Sn(o,s,i),{startRow:c}=a,{startRow:u}=l;return n?ic(c+i.__rowSpan>u+s.__rowSpan?i:s,!0):ic(u<c?s:i,!1)}function ic(n,e=!0){const[,,t]=_t(n),[r,i]=Sn(t,n,n),s=r[0].length,{startRow:o}=i;let l=null;if(e){const a=o+n.__rowSpan-1,c=r[a],u=ss();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g+h.__rowSpan-1<=a){const p=c[f].cell.__headerState,m=rc(p,Te.COLUMN);u.append(Ht(m).append(H()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);nt(d)||ee(256),d.insertAfter(u),l=u}else{const a=o,c=r[a],u=ss();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g===a){const p=c[f].cell.__headerState,m=rc(p,Te.COLUMN);u.append(Ht(m).append(H()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);nt(d)||ee(257),d.insertBefore(u),l=u}return l}function bf(n=!0){const e=O();N(e)||Mr(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=_t(t),[s,,o]=_t(r),[,l,a]=Sn(o,s,i),{startColumn:c}=a,{startColumn:u}=l;return n?sc(c+i.__colSpan>u+s.__colSpan?i:s,!0):sc(u<c?s:i,!1)}function sc(n,e=!0,t=!0){const[,,r]=_t(n),[i,s]=Sn(r,n,n),o=i.length,{startColumn:l}=s,a=e?l+n.__colSpan-1:l-1,c=r.getFirstChild();nt(c)||ee(120);let u=null;function d(g=Te.NO_STATUS){const p=Ht(g).append(H());return u===null&&(u=p),p}let f=c;e:for(let g=0;g<o;g++){if(g!==0){const C=f.getNextSibling();nt(C)||ee(121),f=C}const p=i[g],m=p[a<0?0:a].cell.__headerState,b=rc(m,Te.ROW);if(a<0){_u(f,d(b));continue}const{cell:_,startColumn:y,startRow:S}=p[a];if(y+_.__colSpan-1<=a){let C=_,x=S,v=a;for(;x!==g&&C.__rowSpan>1;){if(v-=_.__colSpan,!(v>=0)){f.append(d(b));continue e}{const{cell:k,startRow:E}=p[v];C=k,x=E}}C.insertAfter(d(b))}else _.setColSpan(_.__colSpan+1)}u!==null&&t&&os(u);const h=r.getColWidths();if(h){const g=[...h],p=a<0?0:a,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function xx(){const n=O();N(n)||Mr(n)||ee(188);const[e,t]=n.isBackward()?[n.focus.getNode(),n.anchor.getNode()]:[n.anchor.getNode(),n.focus.getNode()],[r,,i]=_t(e),[s]=_t(t),[o,l,a]=Sn(i,r,s),{startRow:c}=l,{startRow:u}=a,d=u+s.__rowSpan-1;if(o.length===d-c+1)return void i.remove();const f=o[0].length,h=o[d+1],g=i.getChildAtIndex(d+1);for(let p=d;p>=c;p--){for(let b=f-1;b>=0;b--){const{cell:_,startRow:y,startColumn:S}=o[p][b];if(S===b){if(y<c||y+_.__rowSpan-1>d){const C=Math.max(y,c),x=Math.min(_.__rowSpan+y-1,d),v=C<=x?x-C+1:0;_.setRowSpan(_.__rowSpan-v)}if(y>=c&&y+_.__rowSpan-1>d&&p===d){g===null&&ee(122);let C=null;for(let x=0;x<b;x++){const v=h[x],k=v.cell;v.startRow===p+1&&(C=k),k.__colSpan>1&&(x+=k.__colSpan-1)}C===null?_u(g,_):C.insertAfter(_)}}}const m=i.getChildAtIndex(p);nt(m)||ee(206,String(p)),m.remove()}if(h!==void 0){const{cell:p}=h[0];os(p)}else{const p=o[c-1],{cell:m}=p[0];os(m)}}function Sx(){const n=O();N(n)||Mr(n)||ee(188);const e=n.anchor.getNode(),t=n.focus.getNode(),[r,,i]=_t(e),[s]=_t(t),[o,l,a]=Sn(i,r,s),{startColumn:c}=l,{startRow:u,startColumn:d}=a,f=Math.min(c,d),h=Math.max(c+r.__colSpan-1,d+s.__colSpan-1),g=h-f+1;if(o[0].length===h-f+1)return i.selectPrevious(),void i.remove();const p=o.length;for(let y=0;y<p;y++)for(let S=f;S<=h;S++){const{cell:C,startColumn:x}=o[y][S];if(x<f){if(S===f){const v=f-x;C.setColSpan(C.__colSpan-Math.min(g,C.__colSpan-v))}}else if(x+C.__colSpan-1>h){if(S===h){const v=h-x+1;C.setColSpan(C.__colSpan-v)}}else C.remove()}const m=o[u],b=c>d?m[c+r.__colSpan]:m[d+s.__colSpan];if(b!==void 0){const{cell:y}=b;os(y)}else{const y=d<c?m[d-1]:m[c-1],{cell:S}=y;os(S)}const _=i.getColWidths();if(_){const y=[..._];y.splice(f,g),i.setColWidths(y)}}function os(n){const e=n.getFirstDescendant();e==null?n.selectStart():e.getParentOrThrow().selectStart()}function _u(n,e){const t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function Cx(n){if(n.length===0)return null;const e=Fp(n[0]),[t]=ln(e,null,null);let r=1/0,i=-1/0,s=1/0,o=-1/0;const l=new Set;for(const h of t)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!l.has(p)&&n.some(m=>m.is(g.cell))){l.add(p);const m=g.startRow,b=g.startColumn,_=g.cell.__rowSpan||1,y=g.cell.__colSpan||1;r=Math.min(r,m),i=Math.max(i,m+_-1),s=Math.min(s,b),o=Math.max(o,b+y-1)}}if(r===1/0||s===1/0)return null;const a=i-r+1,c=o-s+1,u=t[r][s];if(!u.cell)return null;const d=u.cell;d.setColSpan(c),d.setRowSpan(a);const f=new Set([d.getKey()]);for(let h=r;h<=i;h++)for(let g=s;g<=o;g++){const p=t[h][g];if(!p.cell)continue;const m=p.cell,b=m.getKey();f.has(b)||(f.add(b),wx(m)||d.append(...m.getChildren()),m.remove())}return d.getChildrenSize()===0&&d.append(H()),d}function wx(n){if(n.getChildrenSize()!==1)return!1;const e=n.getFirstChildOrThrow();return!(!Tr(e)||!e.isEmpty())}function vx(n){const[e,t,r]=_t(n),i=e.__colSpan,s=e.__rowSpan;if(i===1&&s===1)return;const[o,l]=Sn(r,e,e),{startColumn:a,startRow:c}=l,u=e.__headerState&Te.COLUMN,d=Array.from({length:i},(g,p)=>{let m=u;for(let b=0;m!==0&&b<o.length;b++)m&=o[b][p+a].cell.__headerState;return m}),f=e.__headerState&Te.ROW,h=Array.from({length:s},(g,p)=>{let m=f;for(let b=0;m!==0&&b<o[0].length;b++)m&=o[p+c][b].cell.__headerState;return m});if(i>1){for(let g=1;g<i;g++)e.insertAfter(Ht(d[g]|h[0]).append(H()));e.setColSpan(1)}if(s>1){let g;for(let p=1;p<s;p++){const m=c+p,b=o[m];g=(g||t).getNextSibling(),nt(g)||ee(125);let _=null;for(let y=0;y<a;y++){const S=b[y],C=S.cell;S.startRow===m&&(_=C),C.__colSpan>1&&(y+=C.__colSpan-1)}if(_===null)for(let y=i-1;y>=0;y--)_u(g,Ht(d[y]|h[p]).append(H()));else for(let y=i-1;y>=0;y--)_.insertAfter(Ht(d[y]|h[p]).append(H()))}e.setRowSpan(1)}}function Sn(n,e,t){const[r,i,s]=ln(n,e,t);return i===null&&ee(207),s===null&&ee(208),[r,i,s]}function ln(n,e,t){const r=[];let i=null,s=null;function o(a){let c=r[a];return c===void 0&&(r[a]=c=[]),c}const l=n.getChildren();for(let a=0;a<l.length;a++){const c=l[a];nt(c)||ee(209);const u=o(a);for(let d=c.getFirstChild(),f=0;d!=null;d=d.getNextSibling()){for(ge(d)||ee(147);u[f]!==void 0;)f++;const h={cell:d,startColumn:f,startRow:a},{__rowSpan:g,__colSpan:p}=d;for(let m=0;m<g&&!(a+m>=l.length);m++){const b=o(a+m);for(let _=0;_<p;_++)b[f+_]=h}e!==null&&i===null&&e.is(d)&&(i=h),t!==null&&s===null&&t.is(d)&&(s=h)}}return[r,i,s]}function _t(n){let e;if(n instanceof Or)e=n;else if("__type"in n){const i=le(n,ge);ge(i)||ee(148),e=i}else{const i=le(n.getNode(),ge);ge(i)||ee(148),e=i}const t=e.getParent();nt(t)||ee(149);const r=t.getParent();return Jt(r)||ee(210),[e,t,r]}function Dp(n,e,t){let r,i=Math.min(e.startColumn,t.startColumn),s=Math.min(e.startRow,t.startRow),o=Math.max(e.startColumn+e.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1),l=Math.max(e.startRow+e.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);do{r=!1;for(let a=0;a<n.length;a++)for(let c=0;c<n[0].length;c++){const u=n[a][c];if(!u)continue;const d=u.startColumn+u.cell.__colSpan-1,f=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=o&&d>=i,g=u.startRow<=l&&f>=s;if(h&&g){const p=Math.min(i,u.startColumn),m=Math.max(o,d),b=Math.min(s,u.startRow),_=Math.max(l,f);p===i&&m===o&&b===s&&_===l||(i=p,o=m,s=b,l=_,r=!0)}}}while(r);return{maxColumn:o,maxRow:l,minColumn:i,minRow:s}}function xf(n){const[e,,t]=_t(n),r=t.getChildren(),i=r.length,s=r[0].getChildren().length,o=new Array(i);for(let l=0;l<i;l++)o[l]=new Array(s);for(let l=0;l<i;l++){const a=r[l].getChildren();let c=0;for(let u=0;u<a.length;u++){for(;o[l][c];)c++;const d=a[u],f=d.__rowSpan||1,h=d.__colSpan||1;for(let g=0;g<f;g++)for(let p=0;p<h;p++)o[l+g][c+p]=d;if(e===d)return{colSpan:h,columnIndex:c,rowIndex:l,rowSpan:f};c+=h}}return null}function Sf(n){const[[e,t,r,i],[s,o,l,a]]=["anchor","focus"].map(c=>{const u=n[c].getNode(),d=le(u,ge);ge(d)||ee(238,c,u.getKey(),u.getType());const f=d.getParent();nt(f)||ee(239,c);const h=f.getParent();return Jt(h)||ee(240,c),[u,d,f,h]});return i.is(a)||ee(241),{anchorCell:t,anchorNode:e,anchorRow:r,anchorTable:i,focusCell:o,focusNode:s,focusRow:l,focusTable:a}}let Lp=class Rp{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,r){this.anchor=t,this.focus=r,t._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const e=q(this.tableKey),t=q(this.anchor.key),r=q(this.focus.key);return e!==null&&t!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Mr(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,r){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=r,this._cachedNodes=null}clone(){return new Rp(this.tableKey,Ne(this.anchor.key,this.anchor.offset,this.anchor.type),Ne(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(ge).forEach(i=>{const s=i.getFirstChild();Tr(s)&&(t|=s.getTextFormat())});const r=Pe[e];return(t&r)!==0}insertNodes(e){const t=this.focus.getNode();A(t)||ee(151),In(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const{anchorCell:e,focusCell:t}=Sf(this),r=xf(e);r===null&&ee(153);const i=xf(t);i===null&&ee(155);const s=Math.min(r.columnIndex,i.columnIndex),o=Math.max(r.columnIndex+r.colSpan-1,i.columnIndex+i.colSpan-1),l=Math.min(r.rowIndex,i.rowIndex),a=Math.max(r.rowIndex+r.rowSpan-1,i.rowIndex+i.rowSpan-1);return{fromX:Math.min(s,o),fromY:Math.min(l,a),toX:Math.max(s,o),toY:Math.max(l,a)}}getNodes(){if(!this.isValid())return[];const e=this._cachedNodes;if(e!==null)return e;const{anchorTable:t,anchorCell:r,focusCell:i}=Sf(this),s=i.getParents()[1];if(s!==t){if(t.isParentOf(i)){const m=s.getParent();m==null&&ee(159),this.set(this.tableKey,i.getKey(),m.getKey())}else{const m=t.getParent();m==null&&ee(158),this.set(this.tableKey,m.getKey(),i.getKey())}return this.getNodes()}const[o,l,a]=Sn(t,r,i),{minColumn:c,maxColumn:u,minRow:d,maxRow:f}=Dp(o,l,a),h=new Map([[t.getKey(),t]]);let g=null;for(let m=d;m<=f;m++)for(let b=c;b<=u;b++){const{cell:_}=o[m][b],y=_.getParent();nt(y)||ee(160),y!==g&&(h.set(y.getKey(),y),g=y),h.has(_.getKey())||Tx(_,S=>{h.set(S.getKey(),S)})}const p=Array.from(h.values());return vr()||(this._cachedNodes=p),p}getTextContent(){const e=this.getNodes().filter(r=>ge(r));let t="";for(let r=0;r<e.length;r++){const i=e[r],s=i.__parent,o=(e[r+1]||{}).__parent;t+=i.getTextContent()+(o!==s?`
|
|
14
|
-
`:" ")}return t}};function Mr(n){return n instanceof Lp}function Ex(){const n=Ne("root",0,"element"),e=Ne("root",0,"element");return new Lp("root",n,e)}function kx(n,e,t){n.getKey(),e.getKey(),t.getKey();const r=O(),i=Mr(r)?r.clone():Ex();return i.set(n.getKey(),e.getKey(),t.getKey()),i}function Tx(n,e){const t=[[n]];for(let r=t.at(-1);r!==void 0&&t.length>0;r=t.at(-1)){const i=r.pop();i===void 0?t.pop():e(i)!==!1&&A(i)&&t.push(i.getChildren())}}function Mi(n){return re(n)&&n.nodeName==="TABLE"}function Nx(n,e){for(let t=e,r=null;t!==null;t=t.getParent()){if(n.is(t))return r;ge(t)&&(r=t)}return null}function oc(n){const e=le(n,Jt);return Jt(e)?e:null}function Ax(n,e,t){return Nx(n,gt(e,t))}function Cf(n,e,t){if(!e.theme.tableAlignment)return;const r=[],i=[];for(const s of["center","right"]){const o=e.theme.tableAlignment[s];o&&(s===t?i:r).push(o)}un(n,...r),me(n,...i)}const Ox=new WeakSet;function wf(n=mi()){return Ox.has(n)}class yr extends xe{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){const t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new yr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:e=>({conversion:Mx,priority:1})}}static importJSON(e){return yu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,r){return r==="html"}getDOMSlot(e){const t=Mi(e)?e:e.querySelector("table");return Mi(t)||ee(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const i=document.createElement("colgroup");if(r.appendChild(i),Wg(i),me(r,e.theme.table),this.updateTableElement(null,r,e),wf(t)){const s=document.createElement("div"),o=e.theme.tableScrollableWrapper;return o?me(s,o):s.style.cssText="overflow-x: auto;",s.appendChild(r),this.updateTableWrapper(null,s,r,e),s}return r}updateTableWrapper(e,t,r,i){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&(function(s,o,l,a){a>0?(me(s,l.theme.tableFrozenColumn),o.setAttribute("data-lexical-frozen-column","true")):(un(s,l.theme.tableFrozenColumn),o.removeAttribute("data-lexical-frozen-column"))})(t,r,i,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&(function(s,o,l,a){a>0?(me(s,l.theme.tableFrozenRow),o.setAttribute("data-lexical-frozen-row","true")):(un(s,l.theme.tableFrozenRow),o.removeAttribute("data-lexical-frozen-row"))})(t,r,i,this.__frozenRowCount)}updateTableElement(e,t,r){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&(function(i,s,o){o?(me(i,s.theme.tableRowStriping),i.setAttribute("data-lexical-row-striping","true")):(un(i,s.theme.tableRowStriping),i.removeAttribute("data-lexical-row-striping"))})(t,r,this.__rowStriping),(function(i,s,o,l){const a=i.querySelector("colgroup");if(!a)return;const c=[];for(let u=0;u<o;u++){const d=document.createElement("col"),f=l&&l[u];f&&(d.style.width=`${f}px`),c.push(d)}a.replaceChildren(...c)})(t,0,this.getColumnCount(),this.getColWidths()),Cf(t,r,this.getFormatType())}updateDOM(e,t,r){const i=this.getDOMSlot(t).element;return t===i===wf()||(re(s=t)&&s.nodeName==="DIV"&&this.updateTableWrapper(e,t,i,r),this.updateTableElement(e,i,r),!1);var s}exportDOM(e){const t=super.exportDOM(e),{element:r}=t;return{after:i=>{if(t.after&&(i=t.after(i)),!Mi(i)&&re(i)&&(i=i.querySelector("table")),!Mi(i))return null;Cf(i,e._config,this.getFormatType());const[s]=ln(this,null,null),o=new Map;for(const u of s)for(const d of u){const f=d.cell.getKey();o.has(f)||o.set(f,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}const l=new Set;for(const u of i.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){const f=o.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),f){o.delete(d);for(let h=0;h<f.colSpan;h++)l.add(h+f.startColumn)}}}const a=i.querySelector(":scope > colgroup");if(a){const u=Array.from(i.querySelectorAll(":scope > colgroup > col")).filter((d,f)=>l.has(f));a.replaceChildren(...u)}const c=i.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const d of c)u.appendChild(d);i.append(u)}return i},element:!Mi(r)&&re(r)?r.querySelector("table"):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)for(let l=0;l<o.length;l++){const a=o[l];if(a==null)continue;const{elem:c}=a,u=Ax(this,c);if(u!==null&&e.is(u))return{x:l,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=gt(i.elem);return ge(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}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){const t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){const t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){const t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const e=this.getFirstChild();if(!e)return 0;let t=0;return e.getChildren().forEach(r=>{ge(r)&&(t+=r.getColSpan())}),t}}function Mx(n){const e=yu();n.hasAttribute("data-lexical-row-striping")&&e.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&e.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&e.setFrozenRows(1);const t=n.querySelector(":scope > colgroup");if(t){let r=[];for(const i of t.querySelectorAll(":scope > col")){let s=i.style.width||"";if(!mu.test(s)&&(s=i.getAttribute("width")||"",!/^\d+$/.test(s))){r=void 0;break}r.push(parseFloat(s))}r&&e.setColWidths(r)}return{after:r=>cp(r,nt),node:e}}function yu(){return Le(new yr)}function Jt(n){return n instanceof yr}function $x(n){nt(n.getParent())?n.isEmpty()&&n.append(H()):n.remove()}function Ix(n){Jt(n.getParent())?lp(n,ge):n.remove()}function Fx(n){lp(n,nt);const[e]=ln(n,null,null),t=e.reduce((o,l)=>Math.max(o,l.length),0),r=n.getChildren();for(let o=0;o<e.length;++o){const l=r[o];if(!l)continue;nt(l)||ee(254,l.constructor.name,l.getType());const a=e[o].reduce((c,u)=>u?1+c:c,0);if(a!==t)for(let c=a;c<t;++c){const u=Ht();u.append(H()),l.append(u)}}const i=n.getColWidths(),s=n.getColumnCount();if(i&&i.length!==s){let o;if(s<i.length)o=i.slice(0,s);else if(i.length>0){const l=i[i.length-1];o=[...i,...Array(s-i.length).fill(l)]}n.setColWidths(o)}}function Dx(n){if(n.detail<3||!jn(n.target))return!1;const e=gt(n.target);if(e===null)return!1;const t=le(e,r=>A(r)&&!r.isInline());return t===null?!1:!!ge(t.getParent())&&(t.select(0),!0)}function Lx(){const n=O();if(!N(n))return!1;const e=oc(n.anchor.getNode());if(e===null)return!1;const t=fe();if(!t.is(e.getParent())||t.getChildrenSize()!==1)return!1;const[r]=ln(e,null,null);if(r.length===0||r[0].length===0)return!1;const i=r[0][0];if(!i||!i.cell)return!1;const s=r[r.length-1],o=s[s.length-1];if(!o||!o.cell)return!1;const l=kx(e,i.cell,o.cell);return Fe(l),!0}function vf(n,e){n.hasNodes([yr])||ee(255);const{hasNestedTables:t=bp(!1)}=e??{};return pt(n.registerCommand(Ts,r=>(function({rows:i,columns:s,includeHeaders:o},l){const a=O()||bn();if(!a||!N(a)||!l&&oc(a.anchor.getNode()))return!1;const c=yx(Number(i),Number(s),o);Ab(c);const u=c.getFirstDescendant();return D(u)&&u.select(),!0})(r,t.peek()),B),n.registerCommand(Nc,(r,i)=>{if(n!==i)return!1;if((function(l){const{nodes:a,selection:c}=l,u=c.getStartEndPoints(),d=Mr(c),f=N(c),h=f&&le(c.anchor.getNode(),j=>ge(j))!==null&&le(c.focus.getNode(),j=>ge(j))!==null||d;if(a.length!==1||!Jt(a[0])||!h||u===null)return!1;const[g,p]=u,[m,b,_]=_t(g),y=le(p.getNode(),j=>ge(j));if(!(ge(m)&&ge(y)&&nt(b)&&Jt(_)))return!1;const S=a[0],[C,x,v]=Sn(_,m,y),[k]=ln(S,null,null),E=C.length,M=E>0?C[0].length:0;let T=x.startRow,I=x.startColumn,K=k.length,$=K>0?k[0].length:0;if(d){const j=Dp(C,x,v),pe=j.maxRow-j.minRow+1,oe=j.maxColumn-j.minColumn+1;T=j.minRow,I=j.minColumn,K=Math.min(K,pe),$=Math.min($,oe)}let R=!1;const W=Math.min(E,T+K)-1,Z=Math.min(M,I+$)-1,Y=new Set;for(let j=T;j<=W;j++)for(let pe=I;pe<=Z;pe++){const oe=C[j][pe];Y.has(oe.cell.getKey())||oe.cell.__rowSpan===1&&oe.cell.__colSpan===1||(vx(oe.cell),Y.add(oe.cell.getKey()),R=!0)}let[se]=ln(_.getWritable(),null,null);const Ke=K-E+T;for(let j=0;j<Ke;j++)ic(se[E-1][0].cell);const qe=$-M+I;for(let j=0;j<qe;j++)sc(se[0][M-1].cell,!0,!1);[se]=ln(_.getWritable(),null,null);for(let j=T;j<T+K;j++)for(let pe=I;pe<I+$;pe++){const oe=j-T,Ze=pe-I,Se=k[oe][Ze];if(Se.startRow!==oe||Se.startColumn!==Ze)continue;const We=Se.cell;if(We.__rowSpan!==1||We.__colSpan!==1){const Ce=[],wn=Math.min(j+We.__rowSpan,T+K)-1,Ti=Math.min(pe+We.__colSpan,I+$)-1;for(let Zt=j;Zt<=wn;Zt++)for(let Ni=pe;Ni<=Ti;Ni++){const Vl=se[Zt][Ni];Ce.push(Vl.cell)}Cx(Ce),R=!0}const{cell:Xe}=se[j][pe],bt=Xe.getChildren();We.getChildren().forEach(Ce=>{D(Ce)&&H().append(Ce),Xe.append(Ce)}),bt.forEach(Ce=>Ce.remove())}if(d&&R){const[j]=ln(_.getWritable(),null,null);j[x.startRow][x.startColumn].cell.selectEnd()}return!0})(r))return!0;const{selection:s,nodes:o}=r;return t.peek()||n!==i||!N(s)?!1:oc(s.anchor.getNode())!==null&&o.some(Jt)},B),n.registerCommand(Xr,Lx,G),n.registerCommand(br,Dx,B),n.registerNodeTransform(yr,Fx),n.registerNodeTransform(Si,Ix),n.registerNodeTransform(Or,$x))}const Rx=new Set(["http:","https:","mailto:","sms:","tel:"]);class $r extends xe{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new $r(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 this.updateLinkDOM(null,t,e),me(t,e.theme.link),t}updateLinkDOM(e,t,r){if(ru(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Px,priority:1})}}static importJSON(e){return rr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Tf(e);try{const t=new URL(Tf(e));if(!Rx.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=rr(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(!N(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 Px(n){let e=null;if(ru(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=rr(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function rr(n="",e){return Le(new $r(n,e))}function vn(n){return n instanceof $r}let bu=class Pp extends $r{__isUnlinked;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 Pp(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){return Ef().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(A(r)){const i=Ef(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}};function Ef(n="",e){return Le(new bu(n,e))}function Ri(n){return n instanceof bu}const lc=z("TOGGLE_LINK_COMMAND");function kf(n,e){if(n.type==="element"){const t=n.getNode();return A(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const l of i)o.append("v",l);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Bx(n,e={}){let t;if(n&&typeof n=="object"){const{url:u,...d}=n;t=u,e={...d,...e}}else t=n;const{target:r,title:i}=e,s=e.rel===void 0?"noreferrer":e.rel,o=O();if(o===null||!N(o)&&!je(o))return;if(je(o)){const u=o.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){const f=le(d,h=>!Ri(h)&&vn(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{const f=le(d,h=>!Ri(h)&&vn(h));if(f)f.setURL(t),r!==void 0&&f.setTarget(r),s!==void 0&&f.setRel(s);else{const h=rr(t,{rel:s,target:r});d.insertBefore(h),h.append(d)}}})}const l=o.extract();if(t===null){const u=new Set;return void l.forEach(d=>{const f=le(d,h=>!Ri(h)&&vn(h));if(f!==null){const h=f.getKey();if(u.has(h))return;(function(g,p){const m=new Set(p.filter(k=>g.isParentOf(k)).map(k=>k.getKey())),b=g.getChildren(),_=k=>m.has(k.getKey())||A(k)&&p.some(E=>g.isParentOf(E)&&k.isParentOf(E)),y=b.filter(_);if(y.length===b.length)return b.forEach(k=>g.insertBefore(k)),void g.remove();const S=b.findIndex(_),C=b.findLastIndex(_),x=S===0,v=C===b.length-1;if(x)y.forEach(k=>g.insertBefore(k));else if(v)for(let k=y.length-1;k>=0;k--)g.insertAfter(y[k]);else{for(let E=y.length-1;E>=0;E--)g.insertAfter(y[E]);const k=b.slice(C+1);if(k.length>0){const E=rr(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});y[y.length-1].insertAfter(E),k.forEach(M=>E.append(M))}}})(f,l),u.add(h)}})}const a=new Set,c=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(t),r!==void 0&&u.setTarget(r),s!==void 0&&u.setRel(s),i!==void 0&&u.setTitle(i))};if(l.length===1){const u=l[0],d=le(u,vn);if(d!==null)return c(d)}(function(u){const d=O();if(!N(d))return u();const f=In(d),h=f.isBackward(),g=kf(f.anchor,h?-1:0),p=kf(f.focus,h?0:-1);if(u(),g||p){const m=O();if(N(m)){const b=m.clone();if(g){const _=g.getParent();_&&b.anchor.set(_.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(p){const _=p.getParent();_&&b.focus.set(_.getKey(),p.getIndexWithinParent()+(h?0:1),"element")}Fe(In(b))}}})(()=>{let u=null;for(const d of l){if(!d.isAttached())continue;const f=le(d,vn);if(f){c(f);continue}if(A(d)){if(!d.isInline())continue;if(vn(d)){if(!(Ri(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(const g of d.getChildren())d.insertBefore(g);d.remove();continue}}const h=d.getPreviousSibling();vn(h)&&h.is(u)?h.append(d):(u=rr(t,{rel:s,target:r,title:i}),d.insertAfter(u),u.append(d))}})}const zx=/^\+?[0-9\s()-]{5,}$/;function Tf(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:zx.test(n)?`tel:${n}`:`https://${n}`}const ha=Bx;var ga={exports:{}},Nf;function Ux(){return Nf||(Nf=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},l={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function _(y){return y instanceof a?new a(y.type,_(y.content),y.alias):Array.isArray(y)?y.map(_):y.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){return _.__id||Object.defineProperty(_,"__id",{value:++s}),_.__id},clone:function _(y,S){S=S||{};var C,x;switch(l.util.type(y)){case"Object":if(x=l.util.objId(y),S[x])return S[x];C={},S[x]=C;for(var v in y)y.hasOwnProperty(v)&&(C[v]=_(y[v],S));return C;case"Array":return x=l.util.objId(y),S[x]?S[x]:(C=[],S[x]=C,y.forEach(function(k,E){C[E]=_(k,S)}),C);default:return y}},getLanguage:function(_){for(;_;){var y=i.exec(_.className);if(y)return y[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,y){_.className=_.className.replace(RegExp(i,"gi"),""),_.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(C){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(_){var y=document.getElementsByTagName("script");for(var S in y)if(y[S].src==_)return y[S]}return null}},isActive:function(_,y,S){for(var C="no-"+y;_;){var x=_.classList;if(x.contains(y))return!0;if(x.contains(C))return!1;_=_.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(_,y){var S=l.util.clone(l.languages[_]);for(var C in y)S[C]=y[C];return S},insertBefore:function(_,y,S,C){C=C||l.languages;var x=C[_],v={};for(var k in x)if(x.hasOwnProperty(k)){if(k==y)for(var E in S)S.hasOwnProperty(E)&&(v[E]=S[E]);S.hasOwnProperty(k)||(v[k]=x[k])}var M=C[_];return C[_]=v,l.languages.DFS(l.languages,function(T,I){I===M&&T!=_&&(this[T]=v)}),v},DFS:function _(y,S,C,x){x=x||{};var v=l.util.objId;for(var k in y)if(y.hasOwnProperty(k)){S.call(y,k,y[k],C||k);var E=y[k],M=l.util.type(E);M==="Object"&&!x[v(E)]?(x[v(E)]=!0,_(E,S,null,x)):M==="Array"&&!x[v(E)]&&(x[v(E)]=!0,_(E,S,k,x))}}},plugins:{},highlightAll:function(_,y){l.highlightAllUnder(document,_,y)},highlightAllUnder:function(_,y,S){var C={callback:S,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),l.hooks.run("before-all-elements-highlight",C);for(var x=0,v;v=C.elements[x++];)l.highlightElement(v,y===!0,C.callback)},highlightElement:function(_,y,S){var C=l.util.getLanguage(_),x=l.languages[C];l.util.setLanguage(_,C);var v=_.parentElement;v&&v.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(v,C);var k=_.textContent,E={element:_,language:C,grammar:x,code:k};function M(I){E.highlightedCode=I,l.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,l.hooks.run("after-highlight",E),l.hooks.run("complete",E),S&&S.call(E.element)}if(l.hooks.run("before-sanity-check",E),v=E.element.parentElement,v&&v.nodeName.toLowerCase()==="pre"&&!v.hasAttribute("tabindex")&&v.setAttribute("tabindex","0"),!E.code){l.hooks.run("complete",E),S&&S.call(E.element);return}if(l.hooks.run("before-highlight",E),!E.grammar){M(l.util.encode(E.code));return}if(y&&r.Worker){var T=new Worker(l.filename);T.onmessage=function(I){M(I.data)},T.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else M(l.highlight(E.code,E.grammar,E.language))},highlight:function(_,y,S){var C={code:_,grammar:y,language:S};if(l.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=l.tokenize(C.code,C.grammar),l.hooks.run("after-tokenize",C),a.stringify(l.util.encode(C.tokens),C.language)},tokenize:function(_,y){var S=y.rest;if(S){for(var C in S)y[C]=S[C];delete y.rest}var x=new d;return f(x,x.head,_),u(_,x,y,x.head,0),g(x)},hooks:{all:{},add:function(_,y){var S=l.hooks.all;S[_]=S[_]||[],S[_].push(y)},run:function(_,y){var S=l.hooks.all[_];if(!(!S||!S.length))for(var C=0,x;x=S[C++];)x(y)}},Token:a};r.Prism=l;function a(_,y,S,C){this.type=_,this.content=y,this.alias=S,this.length=(C||"").length|0}a.stringify=function _(y,S){if(typeof y=="string")return y;if(Array.isArray(y)){var C="";return y.forEach(function(M){C+=_(M,S)}),C}var x={type:y.type,content:_(y.content,S),tag:"span",classes:["token",y.type],attributes:{},language:S},v=y.alias;v&&(Array.isArray(v)?Array.prototype.push.apply(x.classes,v):x.classes.push(v)),l.hooks.run("wrap",x);var k="";for(var E in x.attributes)k+=" "+E+'="'+(x.attributes[E]||"").replace(/"/g,""")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+k+">"+x.content+"</"+x.tag+">"};function c(_,y,S,C){_.lastIndex=y;var x=_.exec(S);if(x&&C&&x[1]){var v=x[1].length;x.index+=v,x[0]=x[0].slice(v)}return x}function u(_,y,S,C,x,v){for(var k in S)if(!(!S.hasOwnProperty(k)||!S[k])){var E=S[k];E=Array.isArray(E)?E:[E];for(var M=0;M<E.length;++M){if(v&&v.cause==k+","+M)return;var T=E[M],I=T.inside,K=!!T.lookbehind,$=!!T.greedy,R=T.alias;if($&&!T.pattern.global){var W=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,W+"g")}for(var Z=T.pattern||T,Y=C.next,se=x;Y!==y.tail&&!(v&&se>=v.reach);se+=Y.value.length,Y=Y.next){var Ke=Y.value;if(y.length>_.length)return;if(!(Ke instanceof a)){var qe=1,j;if($){if(j=c(Z,se,_,K),!j||j.index>=_.length)break;var Se=j.index,pe=j.index+j[0].length,oe=se;for(oe+=Y.value.length;Se>=oe;)Y=Y.next,oe+=Y.value.length;if(oe-=Y.value.length,se=oe,Y.value instanceof a)continue;for(var Ze=Y;Ze!==y.tail&&(oe<pe||typeof Ze.value=="string");Ze=Ze.next)qe++,oe+=Ze.value.length;qe--,Ke=_.slice(se,oe),j.index-=se}else if(j=c(Z,0,Ke,K),!j)continue;var Se=j.index,We=j[0],Xe=Ke.slice(0,Se),bt=Ke.slice(Se+We.length),Ce=se+Ke.length;v&&Ce>v.reach&&(v.reach=Ce);var wn=Y.prev;Xe&&(wn=f(y,wn,Xe),se+=Xe.length),h(y,wn,qe);var Ti=new a(k,I?l.tokenize(We,I):We,R,We);if(Y=f(y,wn,Ti),bt&&f(y,Y,bt),qe>1){var Zt={cause:k+","+M,reach:Ce};u(_,y,S,Y.prev,se,Zt),v&&Zt.reach>v.reach&&(v.reach=Zt.reach)}}}}}}function d(){var _={value:null,prev:null,next:null},y={value:null,prev:_,next:null};_.next=y,this.head=_,this.tail=y,this.length=0}function f(_,y,S){var C=y.next,x={value:S,prev:y,next:C};return y.next=x,C.prev=x,_.length++,x}function h(_,y,S){for(var C=y.next,x=0;x<S&&C!==_.tail;x++)C=C.next;y.next=C,C.prev=y,_.length-=x}function g(_){for(var y=[],S=_.head.next;S!==_.tail;)y.push(S.value),S=S.next;return y}if(!r.document)return r.addEventListener&&(l.disableWorkerMessageHandler||r.addEventListener("message",function(_){var y=JSON.parse(_.data),S=y.language,C=y.code,x=y.immediateClose;r.postMessage(l.highlight(C,l.languages[S],S)),x&&r.close()},!1)),l;var p=l.util.currentScript();p&&(l.filename=p.src,p.hasAttribute("data-manual")&&(l.manual=!0));function m(){l.manual||l.highlightAll()}if(!l.manual){var b=document.readyState;b==="loading"||b==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return l})(e);n.exports&&(n.exports=t),typeof Yu.commonjsGlobal<"u"&&(Yu.commonjsGlobal.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 l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};l["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:l},t.languages.insertBefore("markup","cdata",a)}}),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(p,m){return"✖ Error "+p+" while fetching file: "+m},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"},l="data-src-status",a="loading",c="loaded",u="failed",d="pre[data-src]:not(["+l+'="'+c+'"]):not(['+l+'="'+a+'"])';function f(p,m,b){var _=new XMLHttpRequest;_.open("GET",p,!0),_.onreadystatechange=function(){_.readyState==4&&(_.status<400&&_.responseText?m(_.responseText):_.status>=400?b(i(_.status,_.statusText)):b(s))},_.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var b=Number(m[1]),_=m[2],y=m[3];return _?y?[b,Number(y)]:[b,void 0]:[b,b]}}t.hooks.add("before-highlightall",function(p){p.selector+=", "+d}),t.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(d)){p.code="",m.setAttribute(l,a);var b=m.appendChild(document.createElement("CODE"));b.textContent=r;var _=m.getAttribute("data-src"),y=p.language;if(y==="none"){var S=(/\.(\w+)$/.exec(_)||[,"none"])[1];y=o[S]||S}t.util.setLanguage(b,y),t.util.setLanguage(m,y);var C=t.plugins.autoloader;C&&C.loadLanguages(y),f(_,function(x){m.setAttribute(l,c);var v=h(m.getAttribute("data-range"));if(v){var k=x.split(/\r\n?|\n/g),E=v[0],M=v[1]==null?k.length:v[1];E<0&&(E+=k.length),E=Math.max(0,Math.min(E-1,k.length)),M<0&&(M+=k.length),M=Math.max(0,Math.min(M,k.length)),x=k.slice(E,M).join(`
|
|
15
|
-
`),m.hasAttribute("data-start")||m.setAttribute("data-start",String(E+1))}b.textContent=x,t.highlightElement(b)},function(x){m.setAttribute(l,u),b.textContent=x})}}),t.plugins.fileHighlight={highlight:function(m){for(var b=(m||document).querySelectorAll(d),_=0,y;y=b[_++];)t.highlightElement(y)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(ga)),ga.exports}Ux();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(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}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(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){u!==d&&(n.languages.markdown[u].inside.content.inside[d]=n.languages.markdown[d])})}),n.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function d(f){if(!(!f||typeof f=="string"))for(var h=0,g=f.length;h<g;h++){var p=f[h];if(p.type!=="code"){d(p.content);continue}var m=p.content[1],b=p.content[3];if(m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"){var _=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");_=(/[a-z][\w-]*/i.exec(_)||[""])[0].toLowerCase();var y="language-"+_;b.alias?typeof b.alias=="string"?b.alias=[b.alias,y]:b.alias.push(y):b.alias=[y]}}}d(u.tokens)}),n.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var d="",f=0,h=u.classes.length;f<h;f++){var g=u.classes[f],p=/language-(.+)/.exec(g);if(p){d=p[1];break}}var m=n.languages[d];if(m)u.content=n.highlight(c(u.content),m,d);else if(d&&d!=="none"&&n.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=b,n.plugins.autoloader.loadLanguages(d,function(){var _=document.getElementById(b);_&&(_.innerHTML=n.highlight(_.textContent,n.languages[d],d))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},a=String.fromCodePoint||String.fromCharCode;function c(u){var d=u.replace(o,"");return d=d.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(f,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),a(g)}else{var p=l[h];return p||f}}),d}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);var Af={},Of;function Kx(){return Of||(Of=1,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),Af}Kx();var Mf={},$f;function Wx(){return $f||($f=1,(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)),Mf}Wx();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});var If={},Ff;function jx(){return Ff||(Ff=1,(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)),If}jx();var Df={},Lf;function Hx(){return Lf||(Lf=1,(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)),Df}Hx();var Rf={},Pf;function Jx(){return Pf||(Pf=1,(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)),Rf}Jx();function Sl(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Gx="javascript";function Bp(n,e){for(const t of n.childNodes){if(re(t)&&t.tagName===e)return!0;Bp(t,e)}return!1}const Pi="data-language",$i="data-highlight-language",js="data-theme";let ir=class zp extends xe{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new zp(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");me(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Pi,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute($i,r));const i=this.getTheme();i&&t.setAttribute(js,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute(Pi,i):s&&t.removeAttribute(Pi);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute($i,i):t.removeAttribute($i):o&&i&&t.setAttribute($i,i);const l=this.__theme,a=e.__theme;l?l!==a&&t.setAttribute(js,l):a&&t.removeAttribute(js);const c=this.__style,u=e.__style;return c?c!==u&&t.setAttribute("style",c):u&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");me(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Pi,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute($i,r));const i=this.getTheme();i&&t.setAttribute(js,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Bp(e,"BR"))?{conversion:Bf,priority:1}:null,div:()=>({conversion:Vx,priority:1}),pre:()=>({conversion:Bf,priority:0}),table:e=>pa(e)?{conversion:Yx,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&pa(r)?{conversion:zf,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pa(t)?{conversion:zf,priority:3}:null}}}static importJSON(e){return St().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
13
|
+
`?c.insertParagraph():u===" "?c.insertNodes([yt()]):c.insertText(u)}}}else e.insertRawText(o)}function Pd(n,e,t){n.dispatchCommand(wc,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(N(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=It(i,"previous");if(o)if(At(o))s=o.origin;else{const l=Vt(o,lt(de(),"next").getFlipped());for(const a of l){if(D(a.origin)){s=a.origin;break}if(A(a.origin)&&!a.origin.isInline())break}}if(s&&D(s)){const l=s.getFormat(),a=s.getStyle();r.format===l&&r.style===a||(r.format=l,r.style=a,r.dirty=!0)}}})(t))}function fp(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=A(t)&&t.excludeFromCopy("html");let o=t;e!==null&&D(o)&&(o=Zg(e,o,"clone"));const l=A(o)?o.getChildren():[],a=(function(c){const u=c.exportJSON(),d=c.constructor;if(u.type!==d.getType()&&To(58,d.name),A(c)){const f=u.children;Array.isArray(f)||To(59,d.name)}return u})(o);D(o)&&o.getTextContentSize()===0&&(i=!1);for(let c=0;c<l.length;c++){const u=l[c],d=fp(n,e,u,a.children);!i&&A(t)&&d&&t.extractWithChild(u,e,"clone")&&(i=!0)}if(i&&!s)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 bb(n,e){const t=[],r=de().getChildren();for(let i=0;i<r.length;i++)fp(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function xb(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=hg(r);D(i)&&eb(i),e.push(i)}return e}let Mr=null;async function zd(n,e,t){if(Mr!==null)return!1;if(e!==null)return new Promise((c,u)=>{n.update(()=>{c(Bd(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=Ct(i);if(r===null||o===null)return!1;const l=s.createElement("span");l.style.cssText="position: fixed; top: -1000px;",l.append(s.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),o.removeAllRanges(),o.addRange(a),new Promise((c,u)=>{const d=n.registerCommand(_r,f=>(rn(f,ClipboardEvent)&&(d(),Mr!==null&&(i.clearTimeout(Mr),Mr=null),c(Bd(n,f,t))),!0),Pc);Mr=i.setTimeout(()=>{d(),Mr=null,c(!1)},50),s.execCommand("copy"),l.remove()})}function Bd(n,e,t){if(t===void 0){const i=Ct(n._window),s=M();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,l=i.focusNode;if(o!==null&&l!==null&&!di(n,o,l))return!1;t=Sb(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Cb(r,t),!0)}const hp=[["text/html",dp],["application/x-lexical-editor",yb]];function Sb(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=fi();for(const[r,i]of hp){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Cb(n,e){for(const[t]of hp)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}const wb=Symbol.for("preact-signals");function fl(){if(An>1)return void An--;let n,e=!1;for(;Ui!==void 0;){let t=Ui;for(Ui=void 0,Ja++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&pp(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(Ja=0,An--,e)throw n}function vb(n){if(An>0)return n();An++;try{return n()}finally{fl()}}let re,Ui;function Ud(n){const e=re;re=void 0;try{return n()}finally{re=e}}let An=0,Ja=0,Gs=0;function Kd(n){if(re===void 0)return;let e=n.n;return e===void 0||e.t!==re?(e={i:0,S:n,p:re.s,n:void 0,t:re,e:void 0,x:void 0,r:e},re.s!==void 0&&(re.s.n=e),re.s=e,n.n=e,32&re.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=re.s,e.n=void 0,re.s.n=e,re.s=e),e):void 0}function Xe(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function gp(n,e){return new Xe(n,e)}function pp(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Wd(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function mp(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function $r(n,e){Xe.call(this,void 0),this.x=n,this.s=void 0,this.g=Gs-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function _p(n){const e=n.u;if(n.u=void 0,typeof e=="function"){An++;const t=re;re=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,ou(n),r}finally{re=t,fl()}}}function ou(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,_p(n)}function kb(n){if(re!==this)throw new Error("Out-of-order effect");mp(this),re=n,this.f&=-2,8&this.f&&ou(this),fl()}function zr(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function lu(n,e){const t=new zr(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Eb(n,e={}){const t={};for(const r in n){const i=e[r],s=gp(i===void 0?n[r]:i);t[r]=s}return t}Xe.prototype.brand=wb,Xe.prototype.h=function(){return!0},Xe.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:Ud(()=>{var t;(t=this.W)==null||t.call(this)}))},Xe.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&Ud(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Xe.prototype.subscribe=function(n){return lu(()=>{const e=this.value,t=re;re=void 0;try{n(e)}finally{re=t}},{name:"sub"})},Xe.prototype.valueOf=function(){return this.value},Xe.prototype.toString=function(){return this.value+""},Xe.prototype.toJSON=function(){return this.value},Xe.prototype.peek=function(){const n=re;re=void 0;try{return this.value}finally{re=n}},Object.defineProperty(Xe.prototype,"value",{get(){const n=Kd(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Ja>100)throw new Error("Cycle detected");this.v=n,this.i++,Gs++,An++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{fl()}}}}),$r.prototype=new Xe,$r.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Gs))return!0;if(this.g=Gs,this.f|=1,this.i>0&&!pp(this))return this.f&=-2,!0;const n=re;try{Wd(this),re=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return re=n,mp(this),this.f&=-2,!0},$r.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Xe.prototype.S.call(this,n)},$r.prototype.U=function(n){if(this.t!==void 0&&(Xe.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},$r.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty($r.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=Kd(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),zr.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},zr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,_p(this),Wd(this),An++;const n=re;return re=this,kb.bind(this,n)},zr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ui,Ui=this)},zr.prototype.d=function(){this.f|=8,1&this.f||ou(this)},zr.prototype.dispose=function(){this.d()};function Tb(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function ae(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function yp(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=yp(t[i],r[i]);return n}return e}const au=0,Va=1,bp=2,ea=3,Ls=4,Ir=5,ta=6,vi=7;function na(n){return n.id===au}function xp(n){return n.id===bp}function Nb(n){return(function(e){return e.id===Va})(n)||ae(305,String(n.id),String(Va)),Object.assign(n,{id:bp})}const Ab=new Set;let Ob=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:au}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Vg;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;xp(t)||ae(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(l,a,c){return Object.assign(l,{config:a,id:ea,registerState:c})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(l,a,c){return Object.assign(l,{id:Ls,initResult:a,registerState:c})})(s,o,i)}build(e){const t=this.state;let r;t.id!==Ls&&ae(307,String(t.id),String(Ir)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,l){return Object.assign(s,{id:Ir,output:o,registerState:l})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==Ir&&ae(308,String(r.id),String(Ir));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:ta})})(r),()=>{const s=this.state;s.id!==vi&&ae(309,String(r.id),String(vi)),this.state=(function(o){return Object.assign(o,{id:Ir})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==ta&&ae(310,String(t.id),String(ta)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:vi})})(t),r}getSignal(){return this._signal===void 0&&ae(311),this._signal}getInitResult(){this.extension.init===void 0&&ae(312,this.extension.name);const e=this.state;return(function(t){return t.id>=Ls})(e)||ae(313,String(e.id),String(Ls)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=ea})(e)||ae(314,String(e.id),String(ea)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&ae(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=vi})(e)||ae(316,String(e.id),String(vi)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Ab}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Ir})(e)||ae(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const jd={tag:Wr};function Mb(){const n=de();n.isEmpty()&&n.append(J())}const $b={config:{setOptions:jd,updateOptions:jd},init:({$initialEditorState:n=Mb})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(mg(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Cr,qe,yr,br,Kn]},Hd=Symbol.for("@lexical/extension/LexicalBuilder");function Jd(){}function Ib(n){throw n}function Rs(n){return Array.isArray(n)?n:[n]}const ra="0.40.0+prod.esm";let Fb=class Ys{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ra,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Rs($b)];for(const r of e)t.push(Rs(r));return new Ys(t)}static maybeFromEditor(e){const t=e[Hd];return t&&(t.PACKAGE_VERSION!==ra&&ae(292,t.PACKAGE_VERSION,ra),t instanceof Ys||ae(293)),t}static fromEditor(e){const t=Ys.maybeFromEditor(e);return t===void 0&&ae(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(ui({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[Hd]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Jd;function t(){try{e()}finally{e=Jd}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=ft(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ae(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ae(296);const t=Rs(e),[r]=t;typeof r.name!="string"&&ae(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&ae(298,r.name),!i){i=new Ob(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&ae(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&ae(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const l=Rs(o);this.addEdge(r.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[o,l]of r.peerDependencies||[])this.addEdge(r.name,o,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(xp(s))return;const o=r.extension.name;var l;na(s)||ae(300,o,i||"[unknown]"),na(l=s)||ae(304,String(l.id),String(au)),s=Object.assign(l,{id:Va}),r.state=s;const a=this.outgoingConfigEdges.get(o);if(a)for(const c of a.keys()){const u=this.extensionNameMap.get(c);u&&t(u,o)}s=Nb(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())na(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const l of s)o.configs.add(l)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&ae(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const l=o.register(e,s);l&&i.push(l)}for(const o of t){const l=o.afterRegistration(e);l&&i.push(l)}return ft(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},l=this.sortedExtensionReps();for(const u of l){const{extension:d}=u;if(d.onError!==void 0&&(e.onError=d.onError),d.disableEvents!==void 0&&(e.disableEvents=d.disableEvents),d.parentEditor!==void 0&&(e.parentEditor=d.parentEditor),d.editable!==void 0&&(e.editable=d.editable),d.namespace!==void 0&&(e.namespace=d.namespace),d.$initialEditorState!==void 0&&(e.$initialEditorState=d.$initialEditorState),d.nodes)for(const f of Tb(d)){if(typeof f!="function"){const h=r.get(f.replace);h&&ae(302,d.name,f.replace.name,h.extension.name),r.set(f.replace,u)}t.add(f)}if(d.html){if(d.html.export)for(const[f,h]of d.html.export.entries())i.set(f,h);d.html.import&&Object.assign(s,d.html.import)}d.theme&&yp(o,d.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const a=Object.keys(s).length>0,c=i.size>0;(a||c)&&(e.html={},a&&(e.html.import=s),c&&(e.html.export=i));for(const u of l)u.init(e);return e.onError||(e.onError=Ib),e}};function Db(n,e){const t=Fb.fromEditor(n).extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}function Vd(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 l=o.payload;if(l&&l.functionId==="makeChanges"){const a=l.args;if(a){const[c,u,d,f,h]=a;n.update(()=>{const g=M();if(N(g)){const p=g.anchor;let m=p.getNode(),b=0,_=0;if(D(m)&&c>=0&&u>=0&&(b=c,_=c+u,g.setTextNodeRange(m,b,m,_)),b===_&&d===""||(g.insertRawText(d),m=p.getNode()),D(m)){b=f,_=f+h;const y=m.getTextContentSize();b=b>y?y:b,_=_>y?y:_,g.setTextNodeRange(m,b,m,_)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function Gd(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 vr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Lb=vr&&"documentMode"in document?document.documentMode:null,Rb=vr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Pb=!(!vr||!("InputEvent"in window)||Lb)&&"getTargetRanges"in new window.InputEvent("input"),zb=vr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Yd=vr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Bb=vr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ub=vr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Rb&&!Bb,qd=K("DRAG_DROP_PASTE_FILE");let xs=class Sp extends Se{static getType(){return"quote"}static clone(e){return new Sp(e.__key)}createDOM(e){const t=document.createElement("blockquote");return _e(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Kb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(te(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return gi().updateFromJSON(e)}insertNewAfter(e,t){const r=J(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=J();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function gi(){return Re(new xs)}function Ga(n){return n instanceof xs}let Ss=class Cp extends Se{__tag;static getType(){return"heading"}static clone(e){return new Cp(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),i=e.theme.heading;if(i!==void 0){const s=i[t];_e(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:Fr,priority:0}),h2:e=>({conversion:Fr,priority:0}),h3:e=>({conversion:Fr,priority:0}),h4:e=>({conversion:Fr,priority:0}),h5:e=>({conversion:Fr,priority:0}),h6:e=>({conversion:Fr,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Zd(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Zd(e)?{conversion:t=>({node:Te("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(te(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Te(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?J():Te(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const l=J();l.select(),this.replace(l,!0)}return s}collapseAtStart(){const e=this.isEmpty()?J():Te(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Zd(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function Fr(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Te(e),n.style!==null&&(sl(n,t),t.setFormat(n.style.textAlign))),{node:t}}function Kb(n){const e=gi();return n.style!==null&&(e.setFormat(n.style.textAlign),sl(n,e)),{node:e}}function Te(n="h1"){return Re(new Ss(n))}function Wb(n){return n instanceof Ss}function Ps(n){let e=null;if(rn(n,DragEvent)?e=n.dataTransfer:rn(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 Xd(n){const e=M();if(!N(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 l=le(s,c=>A(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 Qd(n){const e=dt(n);return Y(e)}function ia(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function jb(n){return ft(n.registerCommand(mr,e=>{const t=M();return!!je(t)&&(t.clear(),!0)},U),n.registerCommand(Nt,e=>{const t=M();return N(t)?(t.deleteCharacter(e),!0):!!je(t)&&(t.deleteNodes(),!0)},U),n.registerCommand(or,e=>{const t=M();return!!N(t)&&(t.deleteWord(e),!0)},U),n.registerCommand(lr,e=>{const t=M();return!!N(t)&&(t.deleteLine(e),!0)},U),n.registerCommand(Tn,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)Rd(r,t,n);else if(N(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},U),n.registerCommand(Vi,()=>{const e=M();return!!N(e)&&(e.removeText(),!0)},U),n.registerCommand(ve,e=>{const t=M();return!!N(t)&&(t.formatText(e),!0)},U),n.registerCommand(Ac,e=>{const t=M();if(!N(t)&&!je(t))return!1;const r=t.getNodes();for(const i of r){const s=le(i,o=>A(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},U),n.registerCommand(ln,e=>{const t=M();return!!N(t)&&(t.insertLineBreak(e),!0)},U),n.registerCommand($n,()=>{const e=M();return!!N(e)&&(e.insertParagraph(),!0)},U),n.registerCommand(lo,()=>(Zo([yt()]),!0),U),n.registerCommand(Bt,()=>Xd(e=>{const t=e.getIndent();e.setIndent(t+1)}),U),n.registerCommand(nn,()=>Xd(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),U),n.registerCommand(cn,e=>{const t=M();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(N(t)){const r=bo(t.focus,!0);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},U),n.registerCommand(ar,e=>{const t=M();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(N(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===de().getChildrenSize()})(t))return e.preventDefault(),!0;const r=bo(t.focus,!1);if(!e.shiftKey&&Y(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},U),n.registerCommand(hs,e=>{const t=M();if(je(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),Dd(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!N(t))return!1;if(ko(t,!0)){const r=e.shiftKey;return e.preventDefault(),Eo(t,r,!0),!0}return!1},U),n.registerCommand(Wo,e=>{const t=M();if(je(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),Dd(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!N(t))return!1;const r=e.shiftKey;return!!ko(t,!1)&&(e.preventDefault(),Eo(t,r,!1),!0)},U),n.registerCommand(Ho,e=>{if(Qd(e.target))return!1;const t=M();if(N(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(ye(s))return!1;const o=fb(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(nn,void 0);if(Yd&&navigator.language==="ko-KR")return!1}else if(!je(t))return!1;return e.preventDefault(),n.dispatchCommand(Nt,!0)},U),n.registerCommand(Jo,e=>{if(Qd(e.target))return!1;const t=M();return!(!N(t)&&!je(t))&&(e.preventDefault(),n.dispatchCommand(Nt,!1))},U),n.registerCommand(In,e=>{const t=M();if(!N(t))return!1;if(ia(t),e!==null){if((Yd||zb||Ub)&&Pb)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(ln,!1)}return n.dispatchCommand($n,void 0)},U),n.registerCommand(oi,()=>{const e=M();return!!N(e)&&(n.blur(),!0)},U),n.registerCommand(Vo,e=>{const[,t]=Ps(e);if(t.length>0){const i=Gd(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,l=dt(o);if(l!==null){const a=ci();if(D(l))a.anchor.set(l.getKey(),s,"text"),a.focus.set(l.getKey(),s,"text");else{const u=l.getParentOrThrow().getKey(),d=l.getIndexWithinParent()+1;a.anchor.set(u,d,"element"),a.focus.set(u,d,"element")}const c=Mn(a);De(c)}n.dispatchCommand(qd,t)}return e.preventDefault(),!0}const r=M();return!!N(r)},U),n.registerCommand(Go,e=>{const[t]=Ps(e),r=M();return!(t&&!N(r))},U),n.registerCommand(Oc,e=>{const[t]=Ps(e),r=M();if(t&&!N(r))return!1;const i=Gd(e.clientX,e.clientY);if(i!==null){const s=dt(i.node);Y(s)&&e.preventDefault()}return!0},U),n.registerCommand(Gr,()=>(Vc(),!0),U),n.registerCommand(_r,e=>(zd(n,rn(e,ClipboardEvent)?e:null),!0),U),n.registerCommand(li,e=>((async function(t,r){await zd(r,rn(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();N(i)?i.removeText():je(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),U),n.registerCommand(ri,e=>{const[,t,r]=Ps(e);return t.length>0&&!r?(n.dispatchCommand(qd,t),!0):Wn(e.target)&&tl(e.target)?!1:M()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=M(),l=rn(i,InputEvent)||rn(i,KeyboardEvent)?null:i.clipboardData;l!=null&&o!==null&&Rd(l,o,s)},{tag:Ic})})(e,n),!0)},U),n.registerCommand(jo,e=>{const t=M();return N(t)&&ia(t),!1},U),n.registerCommand(gs,e=>{const t=M();return N(t)&&ia(t),!1},U))}function kn(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Hb(n){let e=1,t=n.getParent();for(;t!=null;){if(Q(t)){const r=t.getParent();if(V(r)){e++,t=r.getParent();continue}kn(40)}return e}return e}function Ya(n){let e=n.getParent();V(e)||kn(40);let t=e;for(;t!==null;)t=t.getParent(),V(t)&&(e=t);return e}function wp(n){let e=[];const t=n.getChildren().filter(Q);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();V(s)?e=e.concat(wp(s)):e.push(i)}return e}function zt(n){return Q(n)&&V(n.getFirstChild())}function ef(n){return ht().append(n)}function vp(n,e){return Q(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function No(n){const e=M();if(e!==null){let t=e.getNodes();if(N(e)){const i=e.getStartEndPoints();i===null&&kn(143);const[s]=i,o=s.getNode(),l=o.getParent();if(Ue(o)){const a=o.getFirstChild();if(a)t=a.selectStart().getNodes();else{const c=J();o.append(c),t=c.select().getNodes()}}else if(vp(o,t)){const a=st(n);if(Ue(l)){o.replace(a);const c=ht();A(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(Q(o)){const c=o.getParentOrThrow();gr(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(A(s)&&s.isEmpty()&&!Q(s)&&!r.has(s.getKey())){tf(s,n);continue}let o=Kc(s)?s.getParent():Q(s)&&s.isEmpty()?s:null;for(;o!=null;){const l=o.getKey();if(V(o)){if(!r.has(l)){const a=st(n);gr(a,o.getChildren()),o.replace(a),r.add(l)}break}{const a=o.getParent();if(Ue(a)&&!r.has(l)){r.add(l),tf(o,n);break}o=a}}}}}function gr(n,e){n.splice(n.getChildrenSize(),0,e)}function tf(n,e){if(V(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=ht();let s;if(gr(i,n.getChildren()),V(t)&&e===t.getListType())t.append(i),V(r)&&e===r.getListType()&&(gr(t,r.getChildren()),r.remove()),s=t;else if(V(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const l=st(e);l.append(i),n.replace(l),s=l}i.setFormat(n.getFormatType()),i.setIndent(n.getIndent());const o=M();return N(o)&&(s.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,"element"),s.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,"element")),n.remove(),s}function cu(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&zt(t)&&zt(r)&&(cu(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function kp(){const n=M();if(N(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(vp(r,t))e.add(Ya(r));else for(let i=0;i<t.length;i++){const s=t[i];if(Kc(s)){const o=db(s,kr);o!=null&&e.add(Ya(o))}}for(const i of e){let s=i;const o=wp(i);for(const l of o){const a=J().setTextStyle(n.style).setTextFormat(n.format);gr(a,l.getChildren()),s.insertAfter(a),s=a,l.__key===n.anchor.key&&Dn(n.anchor,et(lt(a,"next"))),l.__key===n.focus.key&&Dn(n.focus,et(lt(a,"next"))),l.remove()}i.remove()}}}function Ep(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())Q(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),V(r.getFirstChild())||t++)}function Jb(n){const e=new Set;if(zt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(zt(r)&&zt(i)){const s=i.getFirstChild();if(V(s)){s.append(n);const o=r.getFirstChild();V(o)&&(gr(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(zt(r)){const s=r.getFirstChild();if(V(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(zt(i)){const s=i.getFirstChild();V(s)&&s.append(n)}else if(V(t)){const s=ht().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=st(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function Vb(n){if(zt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(V(t?t.getParent():void 0)&&Q(t)&&V(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=ht(),l=st(s);o.append(l),n.getPreviousSiblings().forEach(u=>l.append(u));const a=ht(),c=st(s);a.append(c),gr(c,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(a),t.replace(n)}}}function Gb(){const n=M();if(!N(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();let t=null;if(Q(e)&&e.getChildrenSize()===0)t=e;else if(D(e)){const a=e.getParent();Q(a)&&a.getChildren().every(c=>D(c)&&c.getTextContent().trim()==="")&&(t=a)}if(t===null)return!1;const r=Ya(t),i=t.getParent();V(i)||kn(40);const s=i.getParent();let o;if(Ue(s))o=J(),r.insertAfter(o);else{if(!Q(s))return!1;o=ht(),s.insertAfter(o)}o.setTextStyle(n.style).setTextFormat(n.format).select();const l=t.getNextSiblings();if(l.length>0){const a=st(i.getListType());if(Q(o)){const c=ht();c.append(a),o.insertAfter(c)}else o.insertAfter(a);a.append(...l)}return(function(a){let c=a;for(;c.getNextSibling()==null&&c.getPreviousSibling()==null;){const u=c.getParent();if(u==null||!Q(u)&&!V(u))break;c=u}c.remove()})(t),!0}let kr=class extends Se{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();V(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:Se,importDOM:{li:()=>({conversion:Yb,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(o,l,a){const c=l.getParent();!V(c)||c.getListType()!=="check"||V(l.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),a&&l.__checked===a.__checked||o.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,l,a){const c=[],u=[],d=l.list,f=d?d.listitem:void 0;let h;if(d&&d.nested&&(h=d.nested.listitem),f!==void 0&&c.push(...dn(f)),d){const g=a.getParent(),p=V(g)&&g.getListType()==="check",m=a.getChecked();p&&!m||u.push(d.listitemUnchecked),p&&m||u.push(d.listitemChecked),p&&c.push(m?d.listitemChecked:d.listitemUnchecked)}if(h!==void 0){const g=dn(h);a.getChildren().some(p=>V(p))?c.push(...g):u.push(...g)}u.length>0&&an(o,...u),c.length>0&&_e(o,...c)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,l,a){const c=Xi(l.__textStyle);for(const u in c)o.style.setProperty(`--listitem-marker-${u}`,c[u]);if(a)for(const u in Xi(a.__textStyle))u in c||o.style.removeProperty(`--listitem-marker-${u}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(A(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(Q(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!V(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=st(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&&(A(e)||kn(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(V(r)||kn(39),Q(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=st(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&&zt(t)&&zt(r)&&(cu(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=ht().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=J();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=Q(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,l=e.focus,a=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(a,o.offset,"element"),l.type==="element"&&l.getNode().is(this)&&l.set(a,l.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return V(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;Q(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&kn(117),(e=Math.floor(e))>=0||kn(199);let t=this.getIndent();for(;t!==e;)t<e?(Jb(this),t++):(Vb(this),t--);return this}canInsertAfter(e){return Q(e)}canReplaceWith(e){return Q(e)}canMergeWith(e){return Q(e)||wr(e)}extractWithChild(e,t){if(!N(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 st("bullet")}canMergeWhenEmpty(){return!0}};function Yb(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return nf(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return nf(t.children[0])}const e=n.getAttribute("aria-checked");return{node:ht(e==="true"||e!=="false"&&void 0)}}function nf(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:ht(n.hasAttribute("checked"))}}function ht(n){return Re(new kr(void 0,n))}function Q(n){return n instanceof kr}let Cs=class extends Se{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();V(r)&&t.getListType()===r.getListType()&&cu(t,r)})(e),Ep(e)},extends:Se,importDOM:{ol:()=>({conversion:sf,priority:0}),ul:()=>({conversion:sf,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=Zb[e]||e;this.__listType=i,this.__tag=i==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,rf(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(rf(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return te(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()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let s=0;s<r.length;s++){const o=r[s];Q(o)||(i===r&&(i=[...r]),i[s]=ht().append(!A(o)||V(o)||o.isInline()?o:he(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return Q(e)}};function rf(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],l=Hb(t)-1,a=l%o.length,c=o[a],u=s[t.__tag];let d;const f=s.nested,h=s.checklist;if(f!==void 0&&f.list&&(d=f.list),u!==void 0&&r.push(u),h!==void 0&&t.__listType==="check"&&r.push(h),c!==void 0){r.push(...dn(c));for(let g=0;g<o.length;g++)g!==a&&i.push(t.__tag+g)}if(d!==void 0){const g=dn(d);l>1?r.push(...g):i.push(...g)}}i.length>0&&an(n,...i),r.length>0&&_e(n,...r)}function qb(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(Q(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{V(s)&&e.push(ef(s))})}else e.push(ef(r))}return e}function sf(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=st("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const i of r.childNodes)if(te(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?st("check"):st("bullet")),{after:qb,node:t}}const Zb={ol:"number",ul:"bullet"};function st(n="number",e=1){return Re(new Cs(n,e))}function V(n){return n instanceof Cs}const hl=K("INSERT_CHECK_LIST_COMMAND");function of(n){return ft(n.registerCommand(hl,()=>(No("check"),!0),G),n.registerCommand(ar,e=>cf(e,n,!1),G),n.registerCommand(cn,e=>cf(e,n,!0),G),n.registerCommand(oi,()=>{if(qa()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},G),n.registerCommand(jo,e=>{const t=qa();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=dt(t);Q(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},G),n.registerCommand(hs,e=>n.getEditorState().read(()=>{const t=M();if(N(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=le(s,l=>A(l)&&!l.isInline());if(Q(o)){const l=o.getParent();if(V(l)&&l.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const a=n.getElementByKey(o.__key);if(a!=null&&document.activeElement!==a)return a.focus(),e.preventDefault(),!0}}}}return!1}),G),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",lf),e.addEventListener("pointerdown",af)),t!==null&&(t.removeEventListener("click",lf),t.removeEventListener("pointerdown",af))}))}function Tp(n,e){const t=n.target;if(!te(t))return;const r=t.firstChild;if(te(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=pb(t),l=n.clientX/o,a=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},c=parseFloat(a.width),u=n.pointerType==="touch"?32:0;(t.dir==="rtl"?l<s.right+u&&l>s.right-c-u:l>s.left-u&&l<s.left+c+u)&&e()}function lf(n){Tp(n,()=>{if(te(n.target)){const e=n.target,t=rl(e);t!=null&&t.isEditable()&&t.update(()=>{const r=dt(e);Q(r)&&(e.focus(),r.toggleChecked())})}})}function af(n){Tp(n,()=>{n.preventDefault()})}function qa(){const n=document.activeElement;return te(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function cf(n,e,t){const r=qa();return r!=null&&e.update(()=>{const i=dt(r);if(!Q(i))return;const s=(function(o,l){let a=l?o.getPreviousSibling():o.getNextSibling(),c=o;for(;a==null&&Q(c);)c=c.getParentOrThrow().getParent(),c!=null&&(a=l?c.getPreviousSibling():c.getNextSibling());for(;Q(a);){const u=l?a.getLastChild():a.getFirstChild();if(!V(u))return a;a=l?u.getLastChild():u.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const Xb=K("UPDATE_LIST_START_COMMAND"),pi=K("INSERT_UNORDERED_LIST_COMMAND"),mi=K("INSERT_ORDERED_LIST_COMMAND"),uu=K("REMOVE_LIST_COMMAND");function sa(n){return ft(n.registerCommand(mi,()=>(No("number"),!0),G),n.registerCommand(Xb,e=>{const{listNodeKey:t,newStart:r}=e,i=Z(t);return!!V(i)&&(i.getListType()==="number"&&(i.setStart(r),Ep(i)),!0)},G),n.registerCommand(pi,()=>(No("bullet"),!0),G),n.registerCommand(uu,()=>(kp(),!0),G),n.registerCommand($n,()=>Gb(),G),n.registerNodeTransform(kr,e=>{const t=e.getFirstChild();if(t){if(D(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=M();N(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(qe,e=>{const t=e.getParent();if(Q(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function oa(n,e){n.update(()=>No(e))}function Qb(n){n.update(()=>kp())}const du=/^(\d+(?:\.\d+)?)px$/,Ne={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Er extends Se{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(e){return new Er(e.__headerState,e.__colSpan,e.__width,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign}static importDOM(){return{td:e=>({conversion:uf,priority:0}),th:e=>({conversion:uf,priority:0})}}static importJSON(e){return jt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=Ne.NO_STATUS,t=1,r,i){super(i),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}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),Za(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),_e(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const t=super.exportDOM(e);if(te(t.element)){const r=t.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),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=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...Za(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){const t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){const t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=Ne.BOTH){const r=this.getWritable();return r.__headerState=e&t|r.__headerState&~t,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){const t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){const t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){const t=this.getWritable();return t.__verticalAlign=e||void 0,t}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!==Ne.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||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Za(n){return n==="middle"||n==="bottom"}function uf(n){const e=n,t=n.nodeName.toLowerCase();let r;du.test(e.style.width)&&(r=parseFloat(e.style.width));const i=jt(t==="th"?Ne.ROW:Ne.NO_STATUS,e.colSpan,r);i.__rowSpan=e.rowSpan;const s=e.style.backgroundColor;s!==""&&(i.__backgroundColor=s);const o=e.style.verticalAlign;Za(o)&&(i.__verticalAlign=o);const l=e.style,a=(l&&l.textDecoration||"").split(" "),c=l.fontWeight==="700"||l.fontWeight==="bold",u=a.includes("line-through"),d=l.fontStyle==="italic",f=a.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const b=p.getFirstChild();ue(b)&&p.getChildrenSize()===1&&b.remove()}};for(const b of h)Fg(b)||D(b)||ue(b)?(D(b)&&(c&&b.toggleFormat("bold"),u&&b.toggleFormat("strikethrough"),d&&b.toggleFormat("italic"),f&&b.toggleFormat("underline")),p?p.append(b):(p=J().append(b),g.push(p))):(g.push(b),m(),p=null);return m(),g.length===0&&g.push(J()),g},node:i}}function jt(n=Ne.NO_STATUS,e=1,t){return Re(new Er(n,e,t))}function me(n){return n instanceof Er}const ws=K("INSERT_TABLE_COMMAND");function ee(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class _i extends Se{__height;static getType(){return"tablerow"}static clone(e){return new _i(e.__height,e.__key)}static importDOM(){return{tr:e=>({conversion:ex,priority:0})}}static importJSON(e){return Qi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){const e=this.getHeight();return{...super.exportJSON(),...e===void 0?void 0:{height:e}}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),_e(t,e.theme.tableRow),t}extractWithChild(e,t,r){return r==="html"}isShadowRoot(){return!0}setHeight(e){const t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function ex(n){const e=n;let t;return du.test(e.style.height)&&(t=parseFloat(e.style.height)),{after:r=>ip(r,me),node:Qi(t)}}function Qi(n){return Re(new _i(n))}function tt(n){return n instanceof _i}const Np=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,tx=Np&&"documentMode"in document?document.documentMode:null;function nx(n,e,t=!0){const r=hu();for(let i=0;i<n;i++){const s=Qi();for(let o=0;o<e;o++){let l=Ne.NO_STATUS;typeof t=="object"?(i===0&&t.rows&&(l|=Ne.ROW),o===0&&t.columns&&(l|=Ne.COLUMN)):t&&(i===0&&(l|=Ne.ROW),o===0&&(l|=Ne.COLUMN));const a=jt(l),c=J();c.append(he()),a.append(c),s.append(a)}r.append(s)}return r}function rx(n){const e=le(n,t=>me(t));return me(e)?e:null}function Ap(n){const e=le(n,t=>Ht(t));if(Ht(e))return e;throw new Error("Expected table cell to be inside of table.")}Np&&"InputEvent"in window&&!tx&&new window.InputEvent("input");const Xa=(n,e)=>n===Ne.BOTH||n===e?e:Ne.NO_STATUS;function df(n=!0){const e=M();N(e)||Tr(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=gt(t),[s,,o]=gt(r),[,l,a]=bn(o,s,i),{startRow:c}=a,{startRow:u}=l;return n?Qa(c+i.__rowSpan>u+s.__rowSpan?i:s,!0):Qa(u<c?s:i,!1)}function Qa(n,e=!0){const[,,t]=gt(n),[r,i]=bn(t,n,n),s=r[0].length,{startRow:o}=i;let l=null;if(e){const a=o+n.__rowSpan-1,c=r[a],u=Qi();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g+h.__rowSpan-1<=a){const p=c[f].cell.__headerState,m=Xa(p,Ne.COLUMN);u.append(jt(m).append(J()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);tt(d)||ee(256),d.insertAfter(u),l=u}else{const a=o,c=r[a],u=Qi();for(let f=0;f<s;f++){const{cell:h,startRow:g}=c[f];if(g===a){const p=c[f].cell.__headerState,m=Xa(p,Ne.COLUMN);u.append(jt(m).append(J()))}else h.setRowSpan(h.__rowSpan+1)}const d=t.getChildAtIndex(a);tt(d)||ee(257),d.insertBefore(u),l=u}return l}function ff(n=!0){const e=M();N(e)||Tr(e)||ee(188);const t=e.anchor.getNode(),r=e.focus.getNode(),[i]=gt(t),[s,,o]=gt(r),[,l,a]=bn(o,s,i),{startColumn:c}=a,{startColumn:u}=l;return n?ec(c+i.__colSpan>u+s.__colSpan?i:s,!0):ec(u<c?s:i,!1)}function ec(n,e=!0,t=!0){const[,,r]=gt(n),[i,s]=bn(r,n,n),o=i.length,{startColumn:l}=s,a=e?l+n.__colSpan-1:l-1,c=r.getFirstChild();tt(c)||ee(120);let u=null;function d(g=Ne.NO_STATUS){const p=jt(g).append(J());return u===null&&(u=p),p}let f=c;e:for(let g=0;g<o;g++){if(g!==0){const S=f.getNextSibling();tt(S)||ee(121),f=S}const p=i[g],m=p[a<0?0:a].cell.__headerState,b=Xa(m,Ne.ROW);if(a<0){fu(f,d(b));continue}const{cell:_,startColumn:y,startRow:C}=p[a];if(y+_.__colSpan-1<=a){let S=_,x=C,w=a;for(;x!==g&&S.__rowSpan>1;){if(w-=_.__colSpan,!(w>=0)){f.append(d(b));continue e}{const{cell:k,startRow:v}=p[w];S=k,x=v}}S.insertAfter(d(b))}else _.setColSpan(_.__colSpan+1)}u!==null&&t&&es(u);const h=r.getColWidths();if(h){const g=[...h],p=a<0?0:a,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function ix(){const n=M();N(n)||Tr(n)||ee(188);const[e,t]=n.isBackward()?[n.focus.getNode(),n.anchor.getNode()]:[n.anchor.getNode(),n.focus.getNode()],[r,,i]=gt(e),[s]=gt(t),[o,l,a]=bn(i,r,s),{startRow:c}=l,{startRow:u}=a,d=u+s.__rowSpan-1;if(o.length===d-c+1)return void i.remove();const f=o[0].length,h=o[d+1],g=i.getChildAtIndex(d+1);for(let p=d;p>=c;p--){for(let b=f-1;b>=0;b--){const{cell:_,startRow:y,startColumn:C}=o[p][b];if(C===b){if(y<c||y+_.__rowSpan-1>d){const S=Math.max(y,c),x=Math.min(_.__rowSpan+y-1,d),w=S<=x?x-S+1:0;_.setRowSpan(_.__rowSpan-w)}if(y>=c&&y+_.__rowSpan-1>d&&p===d){g===null&&ee(122);let S=null;for(let x=0;x<b;x++){const w=h[x],k=w.cell;w.startRow===p+1&&(S=k),k.__colSpan>1&&(x+=k.__colSpan-1)}S===null?fu(g,_):S.insertAfter(_)}}}const m=i.getChildAtIndex(p);tt(m)||ee(206,String(p)),m.remove()}if(h!==void 0){const{cell:p}=h[0];es(p)}else{const p=o[c-1],{cell:m}=p[0];es(m)}}function sx(){const n=M();N(n)||Tr(n)||ee(188);const e=n.anchor.getNode(),t=n.focus.getNode(),[r,,i]=gt(e),[s]=gt(t),[o,l,a]=bn(i,r,s),{startColumn:c}=l,{startRow:u,startColumn:d}=a,f=Math.min(c,d),h=Math.max(c+r.__colSpan-1,d+s.__colSpan-1),g=h-f+1;if(o[0].length===h-f+1)return i.selectPrevious(),void i.remove();const p=o.length;for(let y=0;y<p;y++)for(let C=f;C<=h;C++){const{cell:S,startColumn:x}=o[y][C];if(x<f){if(C===f){const w=f-x;S.setColSpan(S.__colSpan-Math.min(g,S.__colSpan-w))}}else if(x+S.__colSpan-1>h){if(C===h){const w=h-x+1;S.setColSpan(S.__colSpan-w)}}else S.remove()}const m=o[u],b=c>d?m[c+r.__colSpan]:m[d+s.__colSpan];if(b!==void 0){const{cell:y}=b;es(y)}else{const y=d<c?m[d-1]:m[c-1],{cell:C}=y;es(C)}const _=i.getColWidths();if(_){const y=[..._];y.splice(f,g),i.setColWidths(y)}}function es(n){const e=n.getFirstDescendant();e==null?n.selectStart():e.getParentOrThrow().selectStart()}function fu(n,e){const t=n.getFirstChild();t!==null?t.insertBefore(e):n.append(e)}function ox(n){if(n.length===0)return null;const e=Ap(n[0]),[t]=sn(e,null,null);let r=1/0,i=-1/0,s=1/0,o=-1/0;const l=new Set;for(const h of t)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!l.has(p)&&n.some(m=>m.is(g.cell))){l.add(p);const m=g.startRow,b=g.startColumn,_=g.cell.__rowSpan||1,y=g.cell.__colSpan||1;r=Math.min(r,m),i=Math.max(i,m+_-1),s=Math.min(s,b),o=Math.max(o,b+y-1)}}if(r===1/0||s===1/0)return null;const a=i-r+1,c=o-s+1,u=t[r][s];if(!u.cell)return null;const d=u.cell;d.setColSpan(c),d.setRowSpan(a);const f=new Set([d.getKey()]);for(let h=r;h<=i;h++)for(let g=s;g<=o;g++){const p=t[h][g];if(!p.cell)continue;const m=p.cell,b=m.getKey();f.has(b)||(f.add(b),lx(m)||d.append(...m.getChildren()),m.remove())}return d.getChildrenSize()===0&&d.append(J()),d}function lx(n){if(n.getChildrenSize()!==1)return!1;const e=n.getFirstChildOrThrow();return!(!wr(e)||!e.isEmpty())}function ax(n){const[e,t,r]=gt(n),i=e.__colSpan,s=e.__rowSpan;if(i===1&&s===1)return;const[o,l]=bn(r,e,e),{startColumn:a,startRow:c}=l,u=e.__headerState&Ne.COLUMN,d=Array.from({length:i},(g,p)=>{let m=u;for(let b=0;m!==0&&b<o.length;b++)m&=o[b][p+a].cell.__headerState;return m}),f=e.__headerState&Ne.ROW,h=Array.from({length:s},(g,p)=>{let m=f;for(let b=0;m!==0&&b<o[0].length;b++)m&=o[p+c][b].cell.__headerState;return m});if(i>1){for(let g=1;g<i;g++)e.insertAfter(jt(d[g]|h[0]).append(J()));e.setColSpan(1)}if(s>1){let g;for(let p=1;p<s;p++){const m=c+p,b=o[m];g=(g||t).getNextSibling(),tt(g)||ee(125);let _=null;for(let y=0;y<a;y++){const C=b[y],S=C.cell;C.startRow===m&&(_=S),S.__colSpan>1&&(y+=S.__colSpan-1)}if(_===null)for(let y=i-1;y>=0;y--)fu(g,jt(d[y]|h[p]).append(J()));else for(let y=i-1;y>=0;y--)_.insertAfter(jt(d[y]|h[p]).append(J()))}e.setRowSpan(1)}}function bn(n,e,t){const[r,i,s]=sn(n,e,t);return i===null&&ee(207),s===null&&ee(208),[r,i,s]}function sn(n,e,t){const r=[];let i=null,s=null;function o(a){let c=r[a];return c===void 0&&(r[a]=c=[]),c}const l=n.getChildren();for(let a=0;a<l.length;a++){const c=l[a];tt(c)||ee(209);const u=o(a);for(let d=c.getFirstChild(),f=0;d!=null;d=d.getNextSibling()){for(me(d)||ee(147);u[f]!==void 0;)f++;const h={cell:d,startColumn:f,startRow:a},{__rowSpan:g,__colSpan:p}=d;for(let m=0;m<g&&!(a+m>=l.length);m++){const b=o(a+m);for(let _=0;_<p;_++)b[f+_]=h}e!==null&&i===null&&e.is(d)&&(i=h),t!==null&&s===null&&t.is(d)&&(s=h)}}return[r,i,s]}function gt(n){let e;if(n instanceof Er)e=n;else if("__type"in n){const i=le(n,me);me(i)||ee(148),e=i}else{const i=le(n.getNode(),me);me(i)||ee(148),e=i}const t=e.getParent();tt(t)||ee(149);const r=t.getParent();return Ht(r)||ee(210),[e,t,r]}function Op(n,e,t){let r,i=Math.min(e.startColumn,t.startColumn),s=Math.min(e.startRow,t.startRow),o=Math.max(e.startColumn+e.cell.__colSpan-1,t.startColumn+t.cell.__colSpan-1),l=Math.max(e.startRow+e.cell.__rowSpan-1,t.startRow+t.cell.__rowSpan-1);do{r=!1;for(let a=0;a<n.length;a++)for(let c=0;c<n[0].length;c++){const u=n[a][c];if(!u)continue;const d=u.startColumn+u.cell.__colSpan-1,f=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=o&&d>=i,g=u.startRow<=l&&f>=s;if(h&&g){const p=Math.min(i,u.startColumn),m=Math.max(o,d),b=Math.min(s,u.startRow),_=Math.max(l,f);p===i&&m===o&&b===s&&_===l||(i=p,o=m,s=b,l=_,r=!0)}}}while(r);return{maxColumn:o,maxRow:l,minColumn:i,minRow:s}}function hf(n){const[e,,t]=gt(n),r=t.getChildren(),i=r.length,s=r[0].getChildren().length,o=new Array(i);for(let l=0;l<i;l++)o[l]=new Array(s);for(let l=0;l<i;l++){const a=r[l].getChildren();let c=0;for(let u=0;u<a.length;u++){for(;o[l][c];)c++;const d=a[u],f=d.__rowSpan||1,h=d.__colSpan||1;for(let g=0;g<f;g++)for(let p=0;p<h;p++)o[l+g][c+p]=d;if(e===d)return{colSpan:h,columnIndex:c,rowIndex:l,rowSpan:f};c+=h}}return null}function gf(n){const[[e,t,r,i],[s,o,l,a]]=["anchor","focus"].map(c=>{const u=n[c].getNode(),d=le(u,me);me(d)||ee(238,c,u.getKey(),u.getType());const f=d.getParent();tt(f)||ee(239,c);const h=f.getParent();return Ht(h)||ee(240,c),[u,d,f,h]});return i.is(a)||ee(241),{anchorCell:t,anchorNode:e,anchorRow:r,anchorTable:i,focusCell:o,focusNode:s,focusRow:l,focusTable:a}}let Mp=class $p{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,r){this.anchor=t,this.focus=r,t._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const e=Z(this.tableKey),t=Z(this.anchor.key),r=Z(this.focus.key);return e!==null&&t!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Tr(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,r){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||r!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=r,this._cachedNodes=null}clone(){return new $p(this.tableKey,Ae(this.anchor.key,this.anchor.offset,this.anchor.type),Ae(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(me).forEach(i=>{const s=i.getFirstChild();wr(s)&&(t|=s.getTextFormat())});const r=ze[e];return(t&r)!==0}insertNodes(e){const t=this.focus.getNode();A(t)||ee(151),Mn(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const{anchorCell:e,focusCell:t}=gf(this),r=hf(e);r===null&&ee(153);const i=hf(t);i===null&&ee(155);const s=Math.min(r.columnIndex,i.columnIndex),o=Math.max(r.columnIndex+r.colSpan-1,i.columnIndex+i.colSpan-1),l=Math.min(r.rowIndex,i.rowIndex),a=Math.max(r.rowIndex+r.rowSpan-1,i.rowIndex+i.rowSpan-1);return{fromX:Math.min(s,o),fromY:Math.min(l,a),toX:Math.max(s,o),toY:Math.max(l,a)}}getNodes(){if(!this.isValid())return[];const e=this._cachedNodes;if(e!==null)return e;const{anchorTable:t,anchorCell:r,focusCell:i}=gf(this),s=i.getParents()[1];if(s!==t){if(t.isParentOf(i)){const m=s.getParent();m==null&&ee(159),this.set(this.tableKey,i.getKey(),m.getKey())}else{const m=t.getParent();m==null&&ee(158),this.set(this.tableKey,m.getKey(),i.getKey())}return this.getNodes()}const[o,l,a]=bn(t,r,i),{minColumn:c,maxColumn:u,minRow:d,maxRow:f}=Op(o,l,a),h=new Map([[t.getKey(),t]]);let g=null;for(let m=d;m<=f;m++)for(let b=c;b<=u;b++){const{cell:_}=o[m][b],y=_.getParent();tt(y)||ee(160),y!==g&&(h.set(y.getKey(),y),g=y),h.has(_.getKey())||dx(_,C=>{h.set(C.getKey(),C)})}const p=Array.from(h.values());return Sr()||(this._cachedNodes=p),p}getTextContent(){const e=this.getNodes().filter(r=>me(r));let t="";for(let r=0;r<e.length;r++){const i=e[r],s=i.__parent,o=(e[r+1]||{}).__parent;t+=i.getTextContent()+(o!==s?`
|
|
14
|
+
`:" ")}return t}};function Tr(n){return n instanceof Mp}function cx(){const n=Ae("root",0,"element"),e=Ae("root",0,"element");return new Mp("root",n,e)}function ux(n,e,t){n.getKey(),e.getKey(),t.getKey();const r=M(),i=Tr(r)?r.clone():cx();return i.set(n.getKey(),e.getKey(),t.getKey()),i}function dx(n,e){const t=[[n]];for(let r=t.at(-1);r!==void 0&&t.length>0;r=t.at(-1)){const i=r.pop();i===void 0?t.pop():e(i)!==!1&&A(i)&&t.push(i.getChildren())}}function ki(n){return te(n)&&n.nodeName==="TABLE"}function fx(n,e){for(let t=e,r=null;t!==null;t=t.getParent()){if(n.is(t))return r;me(t)&&(r=t)}return null}function tc(n){const e=le(n,Ht);return Ht(e)?e:null}function hx(n,e,t){return fx(n,dt(e,t))}function pf(n,e,t){if(!e.theme.tableAlignment)return;const r=[],i=[];for(const s of["center","right"]){const o=e.theme.tableAlignment[s];o&&(s===t?i:r).push(o)}an(n,...r),_e(n,...i)}const gx=new WeakSet;function mf(n=fi()){return gx.has(n)}class pr extends Se{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){const t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new pr(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:e=>({conversion:px,priority:1})}}static importJSON(e){return hu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,r){return r==="html"}getDOMSlot(e){const t=ki(e)?e:e.querySelector("table");return ki(t)||ee(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const i=document.createElement("colgroup");if(r.appendChild(i),Pg(i),_e(r,e.theme.table),this.updateTableElement(null,r,e),mf(t)){const s=document.createElement("div"),o=e.theme.tableScrollableWrapper;return o?_e(s,o):s.style.cssText="overflow-x: auto;",s.appendChild(r),this.updateTableWrapper(null,s,r,e),s}return r}updateTableWrapper(e,t,r,i){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&(function(s,o,l,a){a>0?(_e(s,l.theme.tableFrozenColumn),o.setAttribute("data-lexical-frozen-column","true")):(an(s,l.theme.tableFrozenColumn),o.removeAttribute("data-lexical-frozen-column"))})(t,r,i,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&(function(s,o,l,a){a>0?(_e(s,l.theme.tableFrozenRow),o.setAttribute("data-lexical-frozen-row","true")):(an(s,l.theme.tableFrozenRow),o.removeAttribute("data-lexical-frozen-row"))})(t,r,i,this.__frozenRowCount)}updateTableElement(e,t,r){this.__style!==(e?e.__style:"")&&(t.style.cssText=this.__style),this.__rowStriping!==(!!e&&e.__rowStriping)&&(function(i,s,o){o?(_e(i,s.theme.tableRowStriping),i.setAttribute("data-lexical-row-striping","true")):(an(i,s.theme.tableRowStriping),i.removeAttribute("data-lexical-row-striping"))})(t,r,this.__rowStriping),(function(i,s,o,l){const a=i.querySelector("colgroup");if(!a)return;const c=[];for(let u=0;u<o;u++){const d=document.createElement("col"),f=l&&l[u];f&&(d.style.width=`${f}px`),c.push(d)}a.replaceChildren(...c)})(t,0,this.getColumnCount(),this.getColWidths()),pf(t,r,this.getFormatType())}updateDOM(e,t,r){const i=this.getDOMSlot(t).element;return t===i===mf()||(te(s=t)&&s.nodeName==="DIV"&&this.updateTableWrapper(e,t,i,r),this.updateTableElement(e,i,r),!1);var s}exportDOM(e){const t=super.exportDOM(e),{element:r}=t;return{after:i=>{if(t.after&&(i=t.after(i)),!ki(i)&&te(i)&&(i=i.querySelector("table")),!ki(i))return null;pf(i,e._config,this.getFormatType());const[s]=sn(this,null,null),o=new Map;for(const u of s)for(const d of u){const f=d.cell.getKey();o.has(f)||o.set(f,{colSpan:d.cell.getColSpan(),startColumn:d.startColumn})}const l=new Set;for(const u of i.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const d=u.getAttribute("data-temporary-table-cell-lexical-key");if(d){const f=o.get(d);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),f){o.delete(d);for(let h=0;h<f.colSpan;h++)l.add(h+f.startColumn)}}}const a=i.querySelector(":scope > colgroup");if(a){const u=Array.from(i.querySelectorAll(":scope > colgroup > col")).filter((d,f)=>l.has(f));a.replaceChildren(...u)}const c=i.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const d of c)u.appendChild(d);i.append(u)}return i},element:!ki(r)&&te(r)?r.querySelector("table"):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)for(let l=0;l<o.length;l++){const a=o[l];if(a==null)continue;const{elem:c}=a,u=hx(this,c);if(u!==null&&e.is(u))return{x:l,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=dt(i.elem);return me(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}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){const t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){const t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){const t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const e=this.getFirstChild();if(!e)return 0;let t=0;return e.getChildren().forEach(r=>{me(r)&&(t+=r.getColSpan())}),t}}function px(n){const e=hu();n.hasAttribute("data-lexical-row-striping")&&e.setRowStriping(!0),n.hasAttribute("data-lexical-frozen-column")&&e.setFrozenColumns(1),n.hasAttribute("data-lexical-frozen-row")&&e.setFrozenRows(1);const t=n.querySelector(":scope > colgroup");if(t){let r=[];for(const i of t.querySelectorAll(":scope > col")){let s=i.style.width||"";if(!du.test(s)&&(s=i.getAttribute("width")||"",!/^\d+$/.test(s))){r=void 0;break}r.push(parseFloat(s))}r&&e.setColWidths(r)}return{after:r=>ip(r,tt),node:e}}function hu(){return Re(new pr)}function Ht(n){return n instanceof pr}function mx(n){tt(n.getParent())?n.isEmpty()&&n.append(J()):n.remove()}function _x(n){Ht(n.getParent())?np(n,me):n.remove()}function yx(n){np(n,tt);const[e]=sn(n,null,null),t=e.reduce((o,l)=>Math.max(o,l.length),0),r=n.getChildren();for(let o=0;o<e.length;++o){const l=r[o];if(!l)continue;tt(l)||ee(254,l.constructor.name,l.getType());const a=e[o].reduce((c,u)=>u?1+c:c,0);if(a!==t)for(let c=a;c<t;++c){const u=jt();u.append(J()),l.append(u)}}const i=n.getColWidths(),s=n.getColumnCount();if(i&&i.length!==s){let o;if(s<i.length)o=i.slice(0,s);else if(i.length>0){const l=i[i.length-1];o=[...i,...Array(s-i.length).fill(l)]}n.setColWidths(o)}}function bx(n){if(n.detail<3||!Wn(n.target))return!1;const e=dt(n.target);if(e===null)return!1;const t=le(e,r=>A(r)&&!r.isInline());return t===null?!1:!!me(t.getParent())&&(t.select(0),!0)}function xx(){const n=M();if(!N(n))return!1;const e=tc(n.anchor.getNode());if(e===null)return!1;const t=de();if(!t.is(e.getParent())||t.getChildrenSize()!==1)return!1;const[r]=sn(e,null,null);if(r.length===0||r[0].length===0)return!1;const i=r[0][0];if(!i||!i.cell)return!1;const s=r[r.length-1],o=s[s.length-1];if(!o||!o.cell)return!1;const l=ux(e,i.cell,o.cell);return De(l),!0}function _f(n,e){n.hasNodes([pr])||ee(255);const{hasNestedTables:t=gp(!1)}=e??{};return ft(n.registerCommand(ws,r=>(function({rows:i,columns:s,includeHeaders:o},l){const a=M()||_n();if(!a||!N(a)||!l&&tc(a.anchor.getNode()))return!1;const c=nx(Number(i),Number(s),o);hb(c);const u=c.getFirstDescendant();return D(u)&&u.select(),!0})(r,t.peek()),U),n.registerCommand(wc,(r,i)=>{if(n!==i)return!1;if((function(l){const{nodes:a,selection:c}=l,u=c.getStartEndPoints(),d=Tr(c),f=N(c),h=f&&le(c.anchor.getNode(),j=>me(j))!==null&&le(c.focus.getNode(),j=>me(j))!==null||d;if(a.length!==1||!Ht(a[0])||!h||u===null)return!1;const[g,p]=u,[m,b,_]=gt(g),y=le(p.getNode(),j=>me(j));if(!(me(m)&&me(y)&&tt(b)&&Ht(_)))return!1;const C=a[0],[S,x,w]=bn(_,m,y),[k]=sn(C,null,null),v=S.length,I=v>0?S[0].length:0;let T=x.startRow,O=x.startColumn,z=k.length,F=z>0?k[0].length:0;if(d){const j=Op(S,x,w),Ce=j.maxRow-j.minRow+1,fe=j.maxColumn-j.minColumn+1;T=j.minRow,O=j.minColumn,z=Math.min(z,Ce),F=Math.min(F,fe)}let B=!1;const W=Math.min(v,T+z)-1,X=Math.min(I,O+F)-1,se=new Set;for(let j=T;j<=W;j++)for(let Ce=O;Ce<=X;Ce++){const fe=S[j][Ce];se.has(fe.cell.getKey())||fe.cell.__rowSpan===1&&fe.cell.__colSpan===1||(ax(fe.cell),se.add(fe.cell.getKey()),B=!0)}let[oe]=sn(_.getWritable(),null,null);const We=z-v+T;for(let j=0;j<We;j++)Qa(oe[v-1][0].cell);const wt=F-I+O;for(let j=0;j<wt;j++)ec(oe[0][I-1].cell,!0,!1);[oe]=sn(_.getWritable(),null,null);for(let j=T;j<T+z;j++)for(let Ce=O;Ce<O+F;Ce++){const fe=j-T,Ze=Ce-O,H=k[fe][Ze];if(H.startRow!==fe||H.startColumn!==Ze)continue;const $=H.cell;if($.__rowSpan!==1||$.__colSpan!==1){const pe=[],Dt=Math.min(j+$.__rowSpan,T+z)-1,Jn=Math.min(Ce+$.__colSpan,O+F)-1;for(let Sn=j;Sn<=Dt;Sn++)for(let Kl=Ce;Kl<=Jn;Kl++){const w_=oe[Sn][Kl];pe.push(w_.cell)}ox(pe),B=!0}const{cell:R}=oe[j][Ce],q=R.getChildren();$.getChildren().forEach(pe=>{D(pe)&&J().append(pe),R.append(pe)}),q.forEach(pe=>pe.remove())}if(d&&B){const[j]=sn(_.getWritable(),null,null);j[x.startRow][x.startColumn].cell.selectEnd()}return!0})(r))return!0;const{selection:s,nodes:o}=r;return t.peek()||n!==i||!N(s)?!1:tc(s.anchor.getNode())!==null&&o.some(Ht)},U),n.registerCommand(Gr,xx,G),n.registerCommand(mr,bx,U),n.registerNodeTransform(pr,yx),n.registerNodeTransform(_i,_x),n.registerNodeTransform(Er,mx))}const Sx=new Set(["http:","https:","mailto:","sms:","tel:"]);class Nr extends Se{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Nr(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 this.updateLinkDOM(null,t,e),_e(t,e.theme.link),t}updateLinkDOM(e,t,r){if(Xc(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Cx,priority:1})}}static importJSON(e){return er().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=xf(e);try{const t=new URL(xf(e));if(!Sx.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=er(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(!N(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 Cx(n){let e=null;if(Xc(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=er(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function er(n="",e){return Re(new Nr(n,e))}function Cn(n){return n instanceof Nr}let gu=class Ip extends Nr{__isUnlinked;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 Ip(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){return yf().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(A(r)){const i=yf(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}};function yf(n="",e){return Re(new gu(n,e))}function Mi(n){return n instanceof gu}const nc=K("TOGGLE_LINK_COMMAND");function bf(n,e){if(n.type==="element"){const t=n.getNode();return A(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const l of i)o.append("v",l);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function wx(n,e={}){let t;if(n&&typeof n=="object"){const{url:u,...d}=n;t=u,e={...d,...e}}else t=n;const{target:r,title:i}=e,s=e.rel===void 0?"noreferrer":e.rel,o=M();if(o===null||!N(o)&&!je(o))return;if(je(o)){const u=o.getNodes();return u.length===0?void 0:void u.forEach(d=>{if(t===null){const f=le(d,h=>!Mi(h)&&Cn(h));f&&(f.insertBefore(d),f.getChildren().length===0&&f.remove())}else{const f=le(d,h=>!Mi(h)&&Cn(h));if(f)f.setURL(t),r!==void 0&&f.setTarget(r),s!==void 0&&f.setRel(s);else{const h=er(t,{rel:s,target:r});d.insertBefore(h),h.append(d)}}})}const l=o.extract();if(t===null){const u=new Set;return void l.forEach(d=>{const f=le(d,h=>!Mi(h)&&Cn(h));if(f!==null){const h=f.getKey();if(u.has(h))return;(function(g,p){const m=new Set(p.filter(k=>g.isParentOf(k)).map(k=>k.getKey())),b=g.getChildren(),_=k=>m.has(k.getKey())||A(k)&&p.some(v=>g.isParentOf(v)&&k.isParentOf(v)),y=b.filter(_);if(y.length===b.length)return b.forEach(k=>g.insertBefore(k)),void g.remove();const C=b.findIndex(_),S=b.findLastIndex(_),x=C===0,w=S===b.length-1;if(x)y.forEach(k=>g.insertBefore(k));else if(w)for(let k=y.length-1;k>=0;k--)g.insertAfter(y[k]);else{for(let v=y.length-1;v>=0;v--)g.insertAfter(y[v]);const k=b.slice(S+1);if(k.length>0){const v=er(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});y[y.length-1].insertAfter(v),k.forEach(I=>v.append(I))}}})(f,l),u.add(h)}})}const a=new Set,c=u=>{a.has(u.getKey())||(a.add(u.getKey()),u.setURL(t),r!==void 0&&u.setTarget(r),s!==void 0&&u.setRel(s),i!==void 0&&u.setTitle(i))};if(l.length===1){const u=l[0],d=le(u,Cn);if(d!==null)return c(d)}(function(u){const d=M();if(!N(d))return u();const f=Mn(d),h=f.isBackward(),g=bf(f.anchor,h?-1:0),p=bf(f.focus,h?0:-1);if(u(),g||p){const m=M();if(N(m)){const b=m.clone();if(g){const _=g.getParent();_&&b.anchor.set(_.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(p){const _=p.getParent();_&&b.focus.set(_.getKey(),p.getIndexWithinParent()+(h?0:1),"element")}De(Mn(b))}}})(()=>{let u=null;for(const d of l){if(!d.isAttached())continue;const f=le(d,Cn);if(f){c(f);continue}if(A(d)){if(!d.isInline())continue;if(Cn(d)){if(!(Mi(d)||u!==null&&u.getParentOrThrow().isParentOf(d))){c(d),u=d;continue}for(const g of d.getChildren())d.insertBefore(g);d.remove();continue}}const h=d.getPreviousSibling();Cn(h)&&h.is(u)?h.append(d):(u=er(t,{rel:s,target:r,title:i}),d.insertAfter(u),u.append(d))}})}const vx=/^\+?[0-9\s()-]{5,}$/;function xf(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:vx.test(n)?`tel:${n}`:`https://${n}`}const la=wx;var aa={exports:{}},Sf;function kx(){return Sf||(Sf=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},l={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function _(y){return y instanceof a?new a(y.type,_(y.content),y.alias):Array.isArray(y)?y.map(_):y.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(_){return Object.prototype.toString.call(_).slice(8,-1)},objId:function(_){return _.__id||Object.defineProperty(_,"__id",{value:++s}),_.__id},clone:function _(y,C){C=C||{};var S,x;switch(l.util.type(y)){case"Object":if(x=l.util.objId(y),C[x])return C[x];S={},C[x]=S;for(var w in y)y.hasOwnProperty(w)&&(S[w]=_(y[w],C));return S;case"Array":return x=l.util.objId(y),C[x]?C[x]:(S=[],C[x]=S,y.forEach(function(k,v){S[v]=_(k,C)}),S);default:return y}},getLanguage:function(_){for(;_;){var y=i.exec(_.className);if(y)return y[1].toLowerCase();_=_.parentElement}return"none"},setLanguage:function(_,y){_.className=_.className.replace(RegExp(i,"gi"),""),_.classList.add("language-"+y)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(S){var _=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(S.stack)||[])[1];if(_){var y=document.getElementsByTagName("script");for(var C in y)if(y[C].src==_)return y[C]}return null}},isActive:function(_,y,C){for(var S="no-"+y;_;){var x=_.classList;if(x.contains(y))return!0;if(x.contains(S))return!1;_=_.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(_,y){var C=l.util.clone(l.languages[_]);for(var S in y)C[S]=y[S];return C},insertBefore:function(_,y,C,S){S=S||l.languages;var x=S[_],w={};for(var k in x)if(x.hasOwnProperty(k)){if(k==y)for(var v in C)C.hasOwnProperty(v)&&(w[v]=C[v]);C.hasOwnProperty(k)||(w[k]=x[k])}var I=S[_];return S[_]=w,l.languages.DFS(l.languages,function(T,O){O===I&&T!=_&&(this[T]=w)}),w},DFS:function _(y,C,S,x){x=x||{};var w=l.util.objId;for(var k in y)if(y.hasOwnProperty(k)){C.call(y,k,y[k],S||k);var v=y[k],I=l.util.type(v);I==="Object"&&!x[w(v)]?(x[w(v)]=!0,_(v,C,null,x)):I==="Array"&&!x[w(v)]&&(x[w(v)]=!0,_(v,C,k,x))}}},plugins:{},highlightAll:function(_,y){l.highlightAllUnder(document,_,y)},highlightAllUnder:function(_,y,C){var S={callback:C,container:_,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};l.hooks.run("before-highlightall",S),S.elements=Array.prototype.slice.apply(S.container.querySelectorAll(S.selector)),l.hooks.run("before-all-elements-highlight",S);for(var x=0,w;w=S.elements[x++];)l.highlightElement(w,y===!0,S.callback)},highlightElement:function(_,y,C){var S=l.util.getLanguage(_),x=l.languages[S];l.util.setLanguage(_,S);var w=_.parentElement;w&&w.nodeName.toLowerCase()==="pre"&&l.util.setLanguage(w,S);var k=_.textContent,v={element:_,language:S,grammar:x,code:k};function I(O){v.highlightedCode=O,l.hooks.run("before-insert",v),v.element.innerHTML=v.highlightedCode,l.hooks.run("after-highlight",v),l.hooks.run("complete",v),C&&C.call(v.element)}if(l.hooks.run("before-sanity-check",v),w=v.element.parentElement,w&&w.nodeName.toLowerCase()==="pre"&&!w.hasAttribute("tabindex")&&w.setAttribute("tabindex","0"),!v.code){l.hooks.run("complete",v),C&&C.call(v.element);return}if(l.hooks.run("before-highlight",v),!v.grammar){I(l.util.encode(v.code));return}if(y&&r.Worker){var T=new Worker(l.filename);T.onmessage=function(O){I(O.data)},T.postMessage(JSON.stringify({language:v.language,code:v.code,immediateClose:!0}))}else I(l.highlight(v.code,v.grammar,v.language))},highlight:function(_,y,C){var S={code:_,grammar:y,language:C};if(l.hooks.run("before-tokenize",S),!S.grammar)throw new Error('The language "'+S.language+'" has no grammar.');return S.tokens=l.tokenize(S.code,S.grammar),l.hooks.run("after-tokenize",S),a.stringify(l.util.encode(S.tokens),S.language)},tokenize:function(_,y){var C=y.rest;if(C){for(var S in C)y[S]=C[S];delete y.rest}var x=new d;return f(x,x.head,_),u(_,x,y,x.head,0),g(x)},hooks:{all:{},add:function(_,y){var C=l.hooks.all;C[_]=C[_]||[],C[_].push(y)},run:function(_,y){var C=l.hooks.all[_];if(!(!C||!C.length))for(var S=0,x;x=C[S++];)x(y)}},Token:a};r.Prism=l;function a(_,y,C,S){this.type=_,this.content=y,this.alias=C,this.length=(S||"").length|0}a.stringify=function _(y,C){if(typeof y=="string")return y;if(Array.isArray(y)){var S="";return y.forEach(function(I){S+=_(I,C)}),S}var x={type:y.type,content:_(y.content,C),tag:"span",classes:["token",y.type],attributes:{},language:C},w=y.alias;w&&(Array.isArray(w)?Array.prototype.push.apply(x.classes,w):x.classes.push(w)),l.hooks.run("wrap",x);var k="";for(var v in x.attributes)k+=" "+v+'="'+(x.attributes[v]||"").replace(/"/g,""")+'"';return"<"+x.tag+' class="'+x.classes.join(" ")+'"'+k+">"+x.content+"</"+x.tag+">"};function c(_,y,C,S){_.lastIndex=y;var x=_.exec(C);if(x&&S&&x[1]){var w=x[1].length;x.index+=w,x[0]=x[0].slice(w)}return x}function u(_,y,C,S,x,w){for(var k in C)if(!(!C.hasOwnProperty(k)||!C[k])){var v=C[k];v=Array.isArray(v)?v:[v];for(var I=0;I<v.length;++I){if(w&&w.cause==k+","+I)return;var T=v[I],O=T.inside,z=!!T.lookbehind,F=!!T.greedy,B=T.alias;if(F&&!T.pattern.global){var W=T.pattern.toString().match(/[imsuy]*$/)[0];T.pattern=RegExp(T.pattern.source,W+"g")}for(var X=T.pattern||T,se=S.next,oe=x;se!==y.tail&&!(w&&oe>=w.reach);oe+=se.value.length,se=se.next){var We=se.value;if(y.length>_.length)return;if(!(We instanceof a)){var wt=1,j;if(F){if(j=c(X,oe,_,z),!j||j.index>=_.length)break;var H=j.index,Ce=j.index+j[0].length,fe=oe;for(fe+=se.value.length;H>=fe;)se=se.next,fe+=se.value.length;if(fe-=se.value.length,oe=fe,se.value instanceof a)continue;for(var Ze=se;Ze!==y.tail&&(fe<Ce||typeof Ze.value=="string");Ze=Ze.next)wt++,fe+=Ze.value.length;wt--,We=_.slice(oe,fe),j.index-=oe}else if(j=c(X,0,We,z),!j)continue;var H=j.index,$=j[0],R=We.slice(0,H),q=We.slice(H+$.length),pe=oe+We.length;w&&pe>w.reach&&(w.reach=pe);var Dt=se.prev;R&&(Dt=f(y,Dt,R),oe+=R.length),h(y,Dt,wt);var Jn=new a(k,O?l.tokenize($,O):$,B,$);if(se=f(y,Dt,Jn),q&&f(y,se,q),wt>1){var Sn={cause:k+","+I,reach:pe};u(_,y,C,se.prev,oe,Sn),w&&Sn.reach>w.reach&&(w.reach=Sn.reach)}}}}}}function d(){var _={value:null,prev:null,next:null},y={value:null,prev:_,next:null};_.next=y,this.head=_,this.tail=y,this.length=0}function f(_,y,C){var S=y.next,x={value:C,prev:y,next:S};return y.next=x,S.prev=x,_.length++,x}function h(_,y,C){for(var S=y.next,x=0;x<C&&S!==_.tail;x++)S=S.next;y.next=S,S.prev=y,_.length-=x}function g(_){for(var y=[],C=_.head.next;C!==_.tail;)y.push(C.value),C=C.next;return y}if(!r.document)return r.addEventListener&&(l.disableWorkerMessageHandler||r.addEventListener("message",function(_){var y=JSON.parse(_.data),C=y.language,S=y.code,x=y.immediateClose;r.postMessage(l.highlight(S,l.languages[C],C)),x&&r.close()},!1)),l;var p=l.util.currentScript();p&&(l.filename=p.src,p.hasAttribute("data-manual")&&(l.manual=!0));function m(){l.manual||l.highlightAll()}if(!l.manual){var b=document.readyState;b==="loading"||b==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return l})(e);n.exports&&(n.exports=t),typeof Wu.commonjsGlobal<"u"&&(Wu.commonjsGlobal.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 l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};l["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:l},t.languages.insertBefore("markup","cdata",a)}}),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(p,m){return"✖ Error "+p+" while fetching file: "+m},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"},l="data-src-status",a="loading",c="loaded",u="failed",d="pre[data-src]:not(["+l+'="'+c+'"]):not(['+l+'="'+a+'"])';function f(p,m,b){var _=new XMLHttpRequest;_.open("GET",p,!0),_.onreadystatechange=function(){_.readyState==4&&(_.status<400&&_.responseText?m(_.responseText):_.status>=400?b(i(_.status,_.statusText)):b(s))},_.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var b=Number(m[1]),_=m[2],y=m[3];return _?y?[b,Number(y)]:[b,void 0]:[b,b]}}t.hooks.add("before-highlightall",function(p){p.selector+=", "+d}),t.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(d)){p.code="",m.setAttribute(l,a);var b=m.appendChild(document.createElement("CODE"));b.textContent=r;var _=m.getAttribute("data-src"),y=p.language;if(y==="none"){var C=(/\.(\w+)$/.exec(_)||[,"none"])[1];y=o[C]||C}t.util.setLanguage(b,y),t.util.setLanguage(m,y);var S=t.plugins.autoloader;S&&S.loadLanguages(y),f(_,function(x){m.setAttribute(l,c);var w=h(m.getAttribute("data-range"));if(w){var k=x.split(/\r\n?|\n/g),v=w[0],I=w[1]==null?k.length:w[1];v<0&&(v+=k.length),v=Math.max(0,Math.min(v-1,k.length)),I<0&&(I+=k.length),I=Math.max(0,Math.min(I,k.length)),x=k.slice(v,I).join(`
|
|
15
|
+
`),m.hasAttribute("data-start")||m.setAttribute("data-start",String(v+1))}b.textContent=x,t.highlightElement(b)},function(x){m.setAttribute(l,u),b.textContent=x})}}),t.plugins.fileHighlight={highlight:function(m){for(var b=(m||document).querySelectorAll(d),_=0,y;y=b[_++];)t.highlightElement(y)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(aa)),aa.exports}kx();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(u){return u=u.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}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(u){["url","bold","italic","strike","code-snippet"].forEach(function(d){u!==d&&(n.languages.markdown[u].inside.content.inside[d]=n.languages.markdown[d])})}),n.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function d(f){if(!(!f||typeof f=="string"))for(var h=0,g=f.length;h<g;h++){var p=f[h];if(p.type!=="code"){d(p.content);continue}var m=p.content[1],b=p.content[3];if(m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"){var _=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");_=(/[a-z][\w-]*/i.exec(_)||[""])[0].toLowerCase();var y="language-"+_;b.alias?typeof b.alias=="string"?b.alias=[b.alias,y]:b.alias.push(y):b.alias=[y]}}}d(u.tokens)}),n.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var d="",f=0,h=u.classes.length;f<h;f++){var g=u.classes[f],p=/language-(.+)/.exec(g);if(p){d=p[1];break}}var m=n.languages[d];if(m)u.content=n.highlight(c(u.content),m,d);else if(d&&d!=="none"&&n.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=b,n.plugins.autoloader.loadLanguages(d,function(){var _=document.getElementById(b);_&&(_.innerHTML=n.highlight(_.textContent,n.languages[d],d))})}}});var o=RegExp(n.languages.markup.tag.pattern.source,"gi"),l={amp:"&",lt:"<",gt:">",quot:'"'},a=String.fromCodePoint||String.fromCharCode;function c(u){var d=u.replace(o,"");return d=d.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(f,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),a(g)}else{var p=l[h];return p||f}}),d}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);var Cf={},wf;function Ex(){return wf||(wf=1,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),Cf}Ex();var vf={},kf;function Tx(){return kf||(kf=1,(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)),vf}Tx();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});var Ef={},Tf;function Nx(){return Tf||(Tf=1,(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)),Ef}Nx();var Nf={},Af;function Ax(){return Af||(Af=1,(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)),Nf}Ax();var Of={},Mf;function Ox(){return Mf||(Mf=1,(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)),Of}Ox();function gl(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Mx="javascript";function Fp(n,e){for(const t of n.childNodes){if(te(t)&&t.tagName===e)return!0;Fp(t,e)}return!1}const $i="data-language",Ei="data-highlight-language",zs="data-theme";let tr=class Dp extends Se{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Dp(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");_e(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute($i,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Ei,r));const i=this.getTheme();i&&t.setAttribute(zs,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute($i,i):s&&t.removeAttribute($i);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute(Ei,i):t.removeAttribute(Ei):o&&i&&t.setAttribute(Ei,i);const l=this.__theme,a=e.__theme;l?l!==a&&t.setAttribute(zs,l):a&&t.removeAttribute(zs);const c=this.__style,u=e.__style;return c?c!==u&&t.setAttribute("style",c):u&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");_e(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute($i,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(Ei,r));const i=this.getTheme();i&&t.setAttribute(zs,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||Fp(e,"BR"))?{conversion:$f,priority:1}:null,div:()=>({conversion:$x,priority:1}),pre:()=>({conversion:$f,priority:0}),table:e=>ca(e)?{conversion:Ix,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&ca(r)?{conversion:If,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&ca(t)?{conversion:If,priority:3}:null}}}static importJSON(e){return _t().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
16
16
|
`&&r[i-2].getTextContent()===`
|
|
17
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const a=
|
|
17
|
+
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const a=J();return this.insertAfter(a,t),a}const{anchor:s,focus:o}=e,l=(s.isBefore(o)?s:o).getNode();if(D(l)){let a=nr(l);const c=[];for(;;)if(Je(a))c.push(yt()),a=a.getNextSibling();else{if(!we(a))break;{let m=0;const b=a.getTextContent(),_=a.getTextContentSize();for(;m<_&&b[m]===" ";)m++;if(m!==0&&c.push(pu(" ".repeat(m))),m!==_)break;a=a.getNextSibling()}}const u=l.splitText(s.offset)[0],d=s.offset===0?0:1,f=u.getIndexWithinParent()+d,h=l.getParentOrThrow(),g=[ot(),...c];h.splice(f,0,g);const p=c[c.length-1];p?p.select():s.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Mt(l)){const{offset:a}=e.anchor;l.splice(a,0,[ot()]),l.select(a+1,a+1)}return null}canIndent(){return!1}collapseAtStart(){const e=J();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function _t(n,e){return Bg(tr).setLanguage(n).setTheme(e)}function Mt(n){return n instanceof tr}function $f(n){return{node:_t(n.getAttribute($i))}}function $x(n){const e=n,t=Ff(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(Ff(i))return!0;i=i.parentElement}return!1})(e)?{node:t?_t():null}:{node:null}}function Ix(){return{node:_t()}}function If(){return{node:null}}function Ff(n){return n.style.fontFamily.match("monospace")!==null}function ca(n){return n.classList.contains("js-file-line-container")}let ts=class Lp extends qe{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new Lp(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=ua(e.theme,this.__highlightType);return _e(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=ua(r.theme,e.__highlightType),o=ua(r.theme,this.__highlightType);return s!==o&&(s&&an(t,s),o&&_e(t,o)),i}static importJSON(e){return pu().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return _t()}};function ua(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function pu(n="",e){return Re(new ts(n,e))}function we(n){return n instanceof ts}function Rp(n,e){let t=n;for(let r=xe(n,e);r&&(we(r.origin)||Je(r.origin));r=ub(r))t=r.origin;return t}function nr(n){return Rp(n,"previous")}function Hr(n){return Rp(n,"next")}function Fx(n){const e=nr(n),t=Hr(n);let r=e;for(;r!==null;){if(we(r)){const s=wg(r.getTextContent());if(s!==null)return s}if(r===t)break;r=r.getNextSibling()}const i=e.getParent();if(A(i)){const s=i.getDirection();if(s==="ltr"||s==="rtl")return s}return null}function Dx(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(we(i)||Je(i)||ue(i)||gl(167),ue(i)){t={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const a=o[s];we(i)&&a!==" "&&(r={node:i,offset:s})}if(r!==null)return r;let l=null;if(e<n.getTextContentSize())we(n)&&(l=n.getTextContent()[e]);else{const a=n.getNextSibling();we(a)&&(l=a.getTextContent()[0])}if(l!==null&&l!==" ")return t;{const a=(function(c,u){let d=c,f=u,h=c.getTextContent(),g=c.getTextContentSize();for(;;){if(!we(d)||f===g){if(d=d.getNextSibling(),d===null||ue(d))return null;we(d)&&(f=0,h=d.getTextContent(),g=d.getTextContentSize())}if(we(d)){if(h[f]!==" ")return{node:d,offset:f};f++}}})(n,e);return a!==null?a:t}}function Lx(n){const e=Hr(n);return ue(e)&&gl(168),e}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
18
18
|
?|
|
|
19
|
-
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const
|
|
19
|
+
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const Pt=globalThis.Prism||window.Prism;function rc(n){return typeof n=="string"?n:Array.isArray(n)?n.map(rc).join(""):rc(n.content)}function Rx(n,e){const t=/^diff-([\w-]+)/i.exec(e),r=n.getTextContent();let i=Pt.tokenize(r,Pt.languages[t?"diff":e]);return t&&(i=(function(s,o){const l=o,a=Pt.languages[l],c={tokens:s},u=Pt.languages.diff.PREFIXES;for(const d of c.tokens){if(typeof d=="string"||!(d.type in u)||!Array.isArray(d.content))continue;const f=d.type;let h=0;const g=()=>(h++,new Pt.Token("prefix",u[f],f.replace(/^(\w+).*/,"$1"))),p=d.content.filter(S=>typeof S=="string"||S.type!=="prefix"),m=d.content.length-p.length,b=Pt.tokenize(rc(p),a);b.unshift(g());const _=/\r\n|\n/g,y=S=>{const x=[];_.lastIndex=0;let w,k=0;for(;h<m&&(w=_.exec(S));){const v=w.index+w[0].length;x.push(S.slice(k,v)),k=v,x.push(g())}if(x.length!==0)return k<S.length&&x.push(S.slice(k)),x},C=S=>{for(let x=0;x<S.length&&h<m;x++){const w=S[x];if(typeof w=="string"){const k=y(w);k&&(S.splice(x,1,...k),x+=k.length-1)}else if(typeof w.content=="string"){const k=y(w.content);k&&(w.content=k)}else Array.isArray(w.content)?C(w.content):C([w.content])}};C(b),h<m&&b.push(g()),d.content=b}return c.tokens})(i,t[1])),ic(i)}function ic(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 l=i[o];l===`
|
|
20
20
|
`||l===`\r
|
|
21
|
-
`?t.push(
|
|
22
|
-
`+ ++o);t.setAttribute("data-gutter",s)}const
|
|
23
|
-
`){const i=
|
|
24
|
-
`}isInline(){return!1}decorate(){return null}}function
|
|
25
|
-
`):D(l)?s.push(
|
|
26
|
-
`),l=o.length,a=s||
|
|
27
|
-
`)},
|
|
21
|
+
`?t.push(ot()):l===" "?t.push(yt()):l.length>0&&t.push(pu(l,e))}}else{const{content:i,alias:s}=r;typeof i=="string"?t.push(...ic([i],r.type==="prefix"&&typeof s=="string"?s:r.type)):Array.isArray(i)&&t.push(...ic(i,r.type==="unchanged"?void 0:r.type))}return t}const Px={$tokenize(n,e){return Rx(n,e||this.defaultLanguage)},defaultLanguage:Mx,tokenize(n,e){return Pt.tokenize(n,Pt.languages[e||""]||Pt.languages[this.defaultLanguage])}};function Df(n,e,t){const r=n.getParent();Mt(r)?Pp(r,e,t):we(n)&&n.replace(he(n.__text))}function zx(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 l=0;l<i;l++)ue(r[l])&&(s+=`
|
|
22
|
+
`+ ++o);t.setAttribute("data-gutter",s)}const da=new Set;function Pp(n,e,t){const r=n.getKey(),i=e.getKey()+"/"+r;n.getLanguage()===void 0&&n.setLanguage(t.defaultLanguage);const s=n.getLanguage()||t.defaultLanguage;if(!(function(o){const l=(function(c){const u=/^diff-([\w-]+)/i.exec(c);return u?u[1]:null})(o),a=l||o;try{return!!a&&Pt.languages.hasOwnProperty(a)}catch{return!1}})(s))return n.getIsSyntaxHighlightSupported()&&n.setIsSyntaxHighlightSupported(!1),void(async function(){})();n.getIsSyntaxHighlightSupported()||n.setIsSyntaxHighlightSupported(!0),da.has(i)||(da.add(i),e.update(()=>{(function(o,l){const a=Z(o);if(!Mt(a)||!a.isAttached())return;const c=M();if(!N(c))return void l();const u=c.anchor,d=u.offset,f=u.type==="element"&&ue(a.getChildAtIndex(u.offset-1));let h=0;if(!f){const g=u.getNode();h=d+g.getPreviousSiblings().reduce((p,m)=>p+m.getTextContentSize(),0)}if(l()){if(f)return void u.getNode().select(d,d);a.getChildren().some(g=>{const p=D(g);if(p||ue(g)){const m=g.getTextContentSize();if(p&&m>=h)return g.select(h,h),!0;h-=m}return!1})}})(r,()=>{const o=Z(r);if(!Mt(o)||!o.isAttached())return!1;const l=o.getLanguage()||t.defaultLanguage,a=t.$tokenize(o,l),c=(function(h,g){let p=0;for(;p<h.length&&Lf(h[p],g[p]);)p++;const m=h.length,b=g.length,_=Math.min(m,b)-p;let y=0;for(;y<_;)if(y++,!Lf(h[m-y],g[b-y])){y--;break}const C=p,S=m-y,x=g.slice(p,b-y);return{from:C,nodesForReplacement:x,to:S}})(o.getChildren(),a),{from:u,to:d,nodesForReplacement:f}=c;return!(u===d&&!f.length)&&(n.splice(u,d-u,f),!0)})},{onUpdate:()=>{da.delete(i)},skipTransforms:!0}))}function Lf(n,e){return we(n)&&we(e)&&n.__text===e.__text&&n.__highlightType===e.__highlightType||Je(n)&&Je(e)||ue(n)&&ue(e)}function Qn(n){if(!N(n))return!1;const e=n.anchor.getNode(),t=Mt(e)?e:e.getParent(),r=n.focus.getNode(),i=Mt(r)?r:r.getParent();return Mt(t)&&t.is(i)}function zp(n){const e=n.getNodes(),t=[];if(e.length===1&&Mt(e[0]))return t;let r=[];for(let i=0;i<e.length;i++){const s=e[i];we(s)||Je(s)||ue(s)||gl(169),ue(s)?r.length>0&&(t.push(r),r=[]):r.push(s)}if(r.length>0){const i=n.isBackward()?n.anchor:n.focus,s=Ae(r[0].getKey(),0,"text");i.is(s)||t.push(r)}return t}function Rf(n){const e=M();if(!N(e)||!Qn(e))return!1;const t=zp(e),r=t.length;if(r===0&&e.isCollapsed())return n===Bt&&e.insertNodes([yt()]),!0;if(r===0&&n===Bt&&e.getTextContent()===`
|
|
23
|
+
`){const i=yt(),s=ot(),o=e.isBackward()?"previous":"next";return e.insertNodes([i,s]),cl(ul(Vt(un(i,"next",0),et(xe(s,"next"))),o)),!0}for(let i=0;i<r;i++){const s=t[i];if(s.length>0){let o=s[0];if(i===0&&(o=nr(o)),n===Bt){const l=yt();if(o.insertBefore(l),i===0){const a=e.isBackward()?"focus":"anchor",c=Ae(o.getKey(),0,"text");e[a].is(c)&&e[a].set(l.getKey(),0,"text")}}else Je(o)&&o.remove()}}return!0}function Pf(n,e){const t=M();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.offset,o=i.offset,l=r.getNode(),a=i.getNode(),c=n===cn;if(!Qn(t)||!we(l)&&!Je(l)||!we(a)&&!Je(a))return!1;if(!e.altKey){if(t.isCollapsed()){const b=l.getParentOrThrow();if(c&&s===0&&l.getPreviousSibling()===null){if(b.getPreviousSibling()===null)return b.selectPrevious(),e.preventDefault(),!0}else if(!c&&s===l.getTextContentSize()&&l.getNextSibling()===null&&b.getNextSibling()===null)return b.selectNext(),e.preventDefault(),!0}return!1}let u,d;if(l.isBefore(a)?(u=nr(l),d=Hr(a)):(u=nr(a),d=Hr(l)),u==null||d==null)return!1;const f=u.getNodesBetween(d);for(let b=0;b<f.length;b++){const _=f[b];if(!we(_)&&!Je(_)&&!ue(_))return!1}e.preventDefault(),e.stopPropagation();const h=c?u.getPreviousSibling():d.getNextSibling();if(!ue(h))return!0;const g=c?h.getPreviousSibling():h.getNextSibling();if(g==null)return!0;const p=we(g)||Je(g)||ue(g)?c?nr(g):Hr(g):null;let m=p??g;return h.remove(),f.forEach(b=>b.remove()),n===cn?(f.forEach(b=>m.insertBefore(b)),m.insertBefore(h)):(m.insertAfter(h),m=h,f.forEach(b=>{m.insertAfter(b),m=b})),t.setTextNodeRange(l,s,a,o),!0}function zf(n,e){const t=M();if(!N(t))return!1;const{anchor:r,focus:i}=t,s=r.getNode(),o=i.getNode(),l=n===Gi;if(!Qn(t)||!we(s)&&!Je(s)||!we(o)&&!Je(o))return!1;const a=o;if(Fx(a)==="rtl"?!l:l){const c=Dx(a,i.offset);if(c!==null){const{node:u,offset:d}=c;ue(u)?u.selectNext(0,0):t.setTextNodeRange(u,d,u,d)}else a.getParentOrThrow().selectStart()}else Lx(a).select();return e.preventDefault(),e.stopPropagation(),!0}function Ao(n,e){if(!n.hasNodes([tr,ts]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");e==null&&(e=Px);const t=[];return n._headless!==!0&&t.push(n.registerMutationListener(tr,r=>{n.getEditorState().read(()=>{for(const[i,s]of r)if(s!=="destroyed"){const o=Z(i);o!==null&&zx(o,n)}})},{skipInitialization:!1})),t.push(n.registerNodeTransform(tr,r=>Pp(r,n,e)),n.registerNodeTransform(qe,r=>Df(r,n,e)),n.registerNodeTransform(ts,r=>Df(r,n,e)),n.registerCommand(gs,r=>{const i=(function(s){const o=M();if(!N(o)||!Qn(o))return null;const l=s?nn:Bt,a=s?nn:lo,c=o.anchor,u=o.focus;if(c.is(u))return a;const d=zp(o);if(d.length!==1)return l;const f=d[0];let h,g;f.length===0&&gl(285),o.isBackward()?(h=u,g=c):(h=c,g=u);const p=nr(f[0]),m=Hr(f[0]),b=Ae(p.getKey(),0,"text"),_=Ae(m.getKey(),m.getTextContentSize(),"text");return h.isBefore(b)||_.isBefore(g)?l:b.isBefore(h)||g.isBefore(_)?a:l})(r.shiftKey);return i!==null&&(r.preventDefault(),n.dispatchCommand(i,void 0),!0)},G),n.registerCommand(lo,()=>!!Qn(M())&&(Zo([yt()]),!0),G),n.registerCommand(Bt,r=>Rf(Bt),G),n.registerCommand(nn,r=>Rf(nn),G),n.registerCommand(cn,r=>{const i=M();if(!N(i))return!1;const{anchor:s}=i,o=s.getNode();return!!Qn(i)&&(i.isCollapsed()&&s.offset===0&&o.getPreviousSibling()===null&&Mt(o.getParentOrThrow())?(r.preventDefault(),!0):Pf(cn,r))},G),n.registerCommand(ar,r=>{const i=M();if(!N(i))return!1;const{anchor:s}=i,o=s.getNode();return!!Qn(i)&&(i.isCollapsed()&&s.offset===o.getTextContentSize()&&o.getNextSibling()===null&&Mt(o.getParentOrThrow())?(r.preventDefault(),!0):Pf(ar,r))},G),n.registerCommand(Gi,r=>zf(Gi,r),G),n.registerCommand(oo,r=>zf(oo,r),G)),ft(...t)}function Bx(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ux(n,e,t,r){const i=o=>o instanceof t,s=o=>{const l=he(o.getTextContent());l.setFormat(o.getFormat()),o.replace(l)};return[n.registerNodeTransform(qe,o=>{if(!o.isSimpleText())return;let l,a=o.getPreviousSibling(),c=o.getTextContent(),u=o;if(D(a)){const f=a.getTextContent(),h=e(f+c);if(i(a)){if(h===null||(g=>g.getLatest().__mode)(a)!==0)return void s(a);{const g=h.end-f.length;if(g>0){const p=f+c.slice(0,g);if(a.select(),a.setTextContent(p),g===c.length)o.remove();else{const m=c.slice(g);o.setTextContent(m)}return}}}else if(h===null||h.start<f.length)return}let d=0;for(;;){l=e(c);let f,h=l===null?"":c.slice(l.end);if(c=h,h===""){const p=u.getNextSibling();if(D(p)){h=u.getTextContent()+p.getTextContent();const m=e(h);if(m===null)return void(i(p)?s(p):p.markDirty());if(m.start!==0)return}}if(l===null)return;if(l.start===0&&D(a)&&a.isTextEntity()){d+=l.end;continue}l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start+d,l.end+d),f===void 0&&Bx(165,"nodeToReplace");const g=r(f);if(g.setFormat(f.getFormat()),f.replace(g),u==null)return;d=0,a=g}}),n.registerNodeTransform(t,o=>{const l=o.getTextContent(),a=e(l);if(a===null||a.start!==0)return void s(o);if(l.length>a.end)return void o.splitText(a.end);const c=o.getPreviousSibling();D(c)&&c.isTextEntity()&&(s(c),s(o));const u=o.getNextSibling();D(u)&&u.isTextEntity()&&(s(u),i(o)&&s(o))})]}let pl=class Bp extends qe{static getType(){return"hashtag"}static clone(e){return new Bp(e.__text,e.__key)}createDOM(e){const t=super.createDOM(e);return _e(t,e.theme.hashtag),t}static importJSON(e){return Kx().updateFromJSON(e)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Kx(n=""){return Re(new pl(n))}const Up=[];let mu=class Kp extends Se{__ids;static getType(){return"mark"}static clone(e){return new Kp(e.__ids,e.__key)}static importDOM(){return null}static importJSON(e){return sc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIDs(e.ids)}exportJSON(){return{...super.exportJSON(),ids:this.getIDs()}}constructor(e=Up,t){super(t),this.__ids=e}createDOM(e){const t=document.createElement("mark");return _e(t,e.theme.mark),this.__ids.length>1&&_e(t,e.theme.markOverlap),t}updateDOM(e,t,r){const i=e.__ids,s=this.__ids,o=i.length,l=s.length,a=r.theme.markOverlap;return o!==l&&(o===1?l===2&&_e(t,a):l===1&&an(t,a)),!1}hasID(e){return this.getIDs().includes(e)}getIDs(){return Array.from(this.getLatest().__ids)}setIDs(e){const t=this.getWritable();return t.__ids=e,t}addID(e){const t=this.getWritable();return t.__ids.includes(e)?t:t.setIDs([...t.__ids,e])}deleteID(e){const t=this.getWritable(),r=t.__ids.indexOf(e);if(r===-1)return t;const i=Array.from(t.__ids);return i.splice(r,1),t.setIDs(i)}insertNewAfter(e,t=!0){const r=sc(this.__ids);return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!N(t)||r==="html")return!1;const i=t.anchor,s=t.focus,o=i.getNode(),l=s.getNode(),a=t.isBackward()?i.offset-s.offset:s.offset-i.offset;return this.isParentOf(o)&&this.isParentOf(l)&&this.getTextContent().length===a}excludeFromCopy(e){return e!=="clone"}};function sc(n=Up){return Re(new mu(n))}function ns(n){return n instanceof mu}function Wx(n){const e=n.getChildren();let t=null;for(let r=0;r<e.length;r++){const i=e[r];t===null?n.insertBefore(i):t.insertAfter(i),t=i}n.remove()}function jx(n,e,t,r){const i=ci(),[s,o]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];let l,a;i.anchor.set(s.key,s.offset,s.type),i.focus.set(o.key,o.offset,o.type);const c=i.extract();for(const u of c){if(A(a)&&a.isParentOf(u))continue;let d=null;if(D(u))d=u;else{if(ns(u))continue;(A(u)||Y(u))&&u.isInline()&&(d=u)}if(d!==null){if(d&&d.is(l))continue;const f=d.getParent();f!=null&&f.is(l)||(a=void 0),l=f,a===void 0&&(a=sc([t]),d.insertBefore(a)),a.append(d)}else l=void 0,a=void 0}A(a)&&(e?a.selectStart():a.selectEnd())}function Hx(n,e){let t=n;for(;t!==null;){if(ns(t))return t.getIDs();if(D(t)&&e===t.getTextContentSize()){const r=t.getNextSibling();if(ns(r))return r.getIDs()}t=t.getParent()}return null}class Jx extends Se{$config(){return this.config("overflow",{$transform(e){e.isEmpty()&&e.remove()},extends:Se})}createDOM(e){const t=document.createElement("span"),r=e.theme.characterLimit;return typeof r=="string"&&(t.className=r),t}updateDOM(e,t){return!1}insertNewAfter(e,t=!0){return this.getParentOrThrow().insertNewAfter(e,t)}excludeFromCopy(){return!0}}class Ar extends ps{static getType(){return"horizontal-rule"}static clone(e){return new Ar(e.__key)}static importJSON(e){return vs()}static importDOM(){return{hr:()=>({conversion:Vx,priority:0})}}exportJSON(){return{...super.exportJSON(),type:"horizontal-rule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}updateDOM(){return!1}getTextContent(){return`
|
|
24
|
+
`}isInline(){return!1}decorate(){return null}}function Vx(){return{node:vs()}}function vs(){return Re(new Ar)}function Wp(n){return n instanceof Ar}function ml(n){const e=[Ss,xs,Cs,kr,Nr,tr,ts,Ar];return n.table&&e.push(pr,Er,_i),n.autoLink&&e.push(gu),n.hashtag&&e.push(pl),n.mark&&e.push(mu),n.overflow&&e.push(Jx),[...new Set(e)]}function _l(n){switch(n){case"bare":return{richText:!0,history:!0,clipboard:!0};case"docked":return{richText:!0,history:!0,clipboard:!0,list:!0,link:!0,autoLink:!0,code:!0,table:!0};case"contextual":return{richText:!0,history:!0,clipboard:!0,list:!0,link:!0,autoLink:!0,code:!0,table:!0}}}const Or=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Gx=Or&&"documentMode"in document?document.documentMode:null,Yx=Or&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),qx=!(!Or||!("InputEvent"in window)||Gx)&&"getTargetRanges"in new window.InputEvent("input"),Zx=Or&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Bf=Or&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xx=Or&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qx=Or&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Yx&&!Xx;function Uf(n,e){e.update(()=>{if(n!==null){const t=rn(n,KeyboardEvent)?null:n.clipboardData,r=M();if(r!==null&&!r.isCollapsed()&&t!=null){n.preventDefault();const i=dp(e);i!==null&&t.setData("text/html",i),t.setData("text/plain",r.getTextContent())}}})}function eS(n){return ft(n.registerCommand(Nt,e=>{const t=M();return!!N(t)&&(t.deleteCharacter(e),!0)},U),n.registerCommand(or,e=>{const t=M();return!!N(t)&&(t.deleteWord(e),!0)},U),n.registerCommand(lr,e=>{const t=M();return!!N(t)&&(t.deleteLine(e),!0)},U),n.registerCommand(Tn,e=>{const t=M();if(!N(t))return!1;if(typeof e=="string")t.insertText(e);else{const r=e.dataTransfer;if(r!=null)Ld(r,t);else{const i=e.data;i&&t.insertText(i)}}return!0},U),n.registerCommand(Vi,()=>{const e=M();return!!N(e)&&(e.removeText(),!0)},U),n.registerCommand(ln,e=>{const t=M();return!!N(t)&&(t.insertLineBreak(e),!0)},U),n.registerCommand($n,()=>{const e=M();return!!N(e)&&(e.insertLineBreak(),!0)},U),n.registerCommand(hs,e=>{const t=M();if(!N(t))return!1;const r=e,i=r.shiftKey;return!!ko(t,!0)&&(r.preventDefault(),Eo(t,i,!0),!0)},U),n.registerCommand(Wo,e=>{const t=M();if(!N(t))return!1;const r=e,i=r.shiftKey;return!!ko(t,!1)&&(r.preventDefault(),Eo(t,i,!1),!0)},U),n.registerCommand(Ho,e=>{const t=M();return!!N(t)&&(!Bf||navigator.language!=="ko-KR")&&(e.preventDefault(),n.dispatchCommand(Nt,!0))},U),n.registerCommand(Jo,e=>{const t=M();return!!N(t)&&(e.preventDefault(),n.dispatchCommand(Nt,!1))},U),n.registerCommand(In,e=>{const t=M();if(!N(t))return!1;if(e!==null){if((Bf||Zx||Qx)&&qx)return!1;e.preventDefault()}return n.dispatchCommand(ln,!1)},U),n.registerCommand(Gr,()=>(Vc(),!0),U),n.registerCommand(_r,e=>{const t=M();return!!N(t)&&(Uf(e,n),!0)},U),n.registerCommand(li,e=>{const t=M();return!!N(t)&&((function(r,i){Uf(r,i),i.update(()=>{const s=M();N(s)&&s.removeText()})})(e,n),!0)},U),n.registerCommand(ri,e=>{const t=M();return!!N(t)&&((function(r,i){r.preventDefault(),i.update(()=>{const s=M(),o=rn(r,ClipboardEvent)?r.clipboardData:null;o!=null&&N(s)&&Ld(o,s)},{tag:Ic})})(e,n),!0)},U),n.registerCommand(Vo,e=>{const t=M();return!!N(t)&&(e.preventDefault(),!0)},U),n.registerCommand(Go,e=>{const t=M();return!!N(t)&&(e.preventDefault(),!0)},U))}function tS(n,e,t,r,i){if(n===null||t.size===0&&r.size===0&&!i)return 0;const s=e._selection,o=n._selection;if(i)return 1;if(!(N(s)&&N(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const l=(function(b,_,y){const C=b._nodeMap,S=[];for(const x of _){const w=C.get(x);w!==void 0&&S.push(w)}for(const[x,w]of y){if(!w)continue;const k=C.get(x);k===void 0||ye(k)||S.push(k)}return S})(e,t,r);if(l.length===0)return 0;if(l.length>1){const b=e._nodeMap,_=b.get(s.anchor.key),y=b.get(o.anchor.key);return _&&y&&!n._nodeMap.has(_.__key)&&D(_)&&_.__text.length===1&&s.anchor.offset===1?2:0}const a=l[0],c=n._nodeMap.get(a.__key);if(!D(c)||!D(a)||c.__mode!==a.__mode)return 0;const u=c.__text,d=a.__text;if(u===d)return 0;const f=s.anchor,h=o.anchor;if(f.key!==h.key||f.type!=="text")return 0;const g=f.offset,p=h.offset,m=d.length-u.length;return m===1&&p===g-1?2:m===-1&&p===g+1?3:m===-1&&p===g?4:0}function nS(n,e){let t=Date.now(),r=0;return(i,s,o,l,a,c)=>{const u=Date.now();if(c.has(fo))return r=0,t=u,2;const d=tS(i,s,l,a,n.isComposing()),f=(()=>{const h=o===null||o.editor===n,g=c.has(eg);if(!g&&h&&c.has(Wr))return 0;if(i===null)return 1;const p=s._selection;if(!(l.size>0||a.size>0))return p!==null?0:2;const m=typeof e=="number"?e:e.peek();return g===!1&&d!==0&&d===r&&u<t+m&&h||l.size===1&&(function(b,_,y){const C=_._nodeMap.get(b),S=y._nodeMap.get(b),x=_._selection,w=y._selection;return!(N(x)&&N(w)&&x.anchor.type==="element"&&x.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"||!D(C)||!D(S)||C.__parent!==S.__parent)&&JSON.stringify(_.read(()=>C.exportJSON()))===JSON.stringify(y.read(()=>S.exportJSON()))})(Array.from(l)[0],i,s)?0:1})();return t=u,r=d,f}}function Kf(n){n.undoStack=[],n.redoStack=[],n.current=null}function jp(n,e,t){const r=nS(n,t);return ft(n.registerCommand(ii,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(a.length!==0){const c=o.current,u=a.pop();c!==null&&(l.push(c),s.dispatchCommand(Ni,!0)),a.length===0&&s.dispatchCommand(Ai,!1),o.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:fo})}})(n,e),!0),U),n.registerCommand(si,()=>((function(s,o){const l=o.redoStack,a=o.undoStack;if(l.length!==0){const c=o.current;c!==null&&(a.push(c),s.dispatchCommand(Ai,!0));const u=l.pop();l.length===0&&s.dispatchCommand(Ni,!1),o.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:fo})}})(n,e),!0),U),n.registerCommand(Mc,()=>(Kf(e),!1),U),n.registerCommand(Wh,()=>(Kf(e),n.dispatchCommand(Ni,!1),n.dispatchCommand(Ai,!1),!0),U),n.registerUpdateListener(({editorState:s,prevEditorState:o,dirtyLeaves:l,dirtyElements:a,tags:c})=>{const u=e.current,d=e.redoStack,f=e.undoStack,h=u===null?null:u.editorState;if(u!==null&&s===h)return;const g=r(o,s,u,l,a,c);if(g===1)d.length!==0&&(e.redoStack=[],n.dispatchCommand(Ni,!1)),u!==null&&(f.push({...u}),n.dispatchCommand(Ai,!0));else if(g===2)return;e.current={editor:n,editorState:s}}))}function Hp(){return{current:null,redoStack:[],undoStack:[]}}const fa={build:(n,{delay:e,createInitialHistoryState:t,disabled:r})=>Eb({delay:e,disabled:r,historyState:t(n)}),config:{createInitialHistoryState:Hp,delay:300,disabled:typeof window>"u"},name:"@lexical/history/History",register:(n,e,t)=>{const r=t.getOutput();return lu(()=>r.disabled.value?void 0:jp(n,r.historyState.value,r.delay))}};Jg(fa,{createInitialHistoryState:()=>{throw new Error("SharedHistory did not inherit parent history")},disabled:!0});function rS(n,e){const t={};for(const r of n){const i=e(r);i&&(t[i]?t[i].push(r):t[i]=[r])}return t}function Jp(n){const e=rS(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Wf=/[ \t\n\r\f]/,oc=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,iS=/^\s{0,3}$/;function lc(n){if(!wr(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&D(e)&&iS.test(e.getTextContent())}function sS(n,e,t,r){for(const i of e){if(!i.export)continue;const s=i.export(n,o=>Oo(o,t,r));if(s!=null)return s}return A(n)?Oo(n,t,r):Y(n)?n.getTextContent():null}function Oo(n,e,t,r,i){const s=[],o=n.getChildren();r||(r=[]),i||(i=[]);e:for(const l of o){for(const a of t){if(!a.export)continue;const c=a.export(l,u=>Oo(u,e,t,r,[...i,...r]),(u,d)=>jf(u,d,e,r,i));if(c!=null){s.push(c);continue e}}ue(l)?s.push(`
|
|
25
|
+
`):D(l)?s.push(jf(l,l.getTextContent(),e,r,i)):A(l)?s.push(Oo(l,e,t,r,i)):Y(l)&&s.push(l.getTextContent())}return s.join("")}function jf(n,e,t,r,i){let s=n.getFormat()===0?e:(function(f){return f.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let o="",l="",a="";const c=Hf(n,!0),u=Hf(n,!1),d=new Set;for(const f of t){const h=f.format[0],g=f.tag;Bs(n,h)&&!d.has(h)&&(d.add(h),Bs(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let f=0;f<r.length;f++){const h=Bs(n,r[f].format),g=Bs(u,r[f].format);if(h&&g)continue;const p=[...r];for(;p.length>f;){const m=p.pop();i&&m&&i.find(b=>b.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(a+=m.tag):l+=m.tag),r.pop())}break}return s=o+s+a,l+s}function Hf(n,e){const t=e?n.getPreviousSibling():n.getNextSibling();return D(t)?t:null}function Bs(n,e){return D(n)&&n.hasFormat(e)}function oS(n,e){const t=n.getTextContent(),r=e.fullMatchRegExpByTag["`"],i=e.transformersByTag["`"],s=[];let o=null;if(r&&i){const f=new RegExp(r.source,"g"),h=Array.from(t.matchAll(f));for(const g of h){const p=g.index,m=p+g[0].length;o||(o={content:g[2],endIndex:m,startIndex:p,tag:"`"}),s.push({end:m,start:p})}}const l=(function(f,h,g=[]){const p=[],m=new Set(Object.keys(h.transformersByTag).filter(C=>C[0]!=="`").map(C=>C[0])),b=C=>{let S=0;for(let x=C-1;x>=0&&f[x]==="\\";x--)S++;return S%2==1},_=C=>g.some(S=>C>=S.start&&C<S.end);let y=0;for(;y<f.length;){const C=f[y];if(!m.has(C)||b(y)||_(y)){y++;continue}let S=1;for(;y+S<f.length&&f[y+S]===C;)S++;const x=Jf(C,f,y,S,!0),w=Jf(C,f,y,S,!1);(x||w)&&p.push({active:!0,canClose:w,canOpen:x,char:C,index:y,length:S,originalLength:S}),y+=S}return p})(t,e,s),a=l.length>0?(function(f,h,g){const p={};let m=0,b=null;for(;m<h.length;){const _=h[m];if(!_.active||!_.canClose||_.length===0){m++;continue}const y=`${_.char}${_.canOpen}`,C=p[y]??-1;let S=!1;for(let x=m-1;x>C;x--){const w=h[x];if(!w.active||!w.canOpen||w.length===0||w.char!==_.char||(w.canClose||_.canOpen)&&(w.originalLength+_.originalLength)%3==0&&w.originalLength%3!=0&&_.originalLength%3!=0)continue;const k=Math.min(w.length,_.length),v=Object.keys(g.transformersByTag).filter(O=>O[0]===w.char&&O.length<=k).sort((O,z)=>z.length-O.length)[0];if(!v)continue;S=!0;const I=v.length,T={content:f.slice(w.index+w.length,_.index),endIndex:_.index+I,startIndex:w.index+(w.length-I),tag:v};(!b||T.startIndex<b.startIndex||T.startIndex===b.startIndex&&T.endIndex>b.endIndex)&&(b=T);for(let O=x+1;O<m;O++)h[O].active=!1;w.length-=I,_.length-=I,w.active=w.length>0,_.length>0?_.index+=I:(_.active=!1,m++);break}S||(p[y]=m-1,_.canOpen||(_.active=!1),m++)}return b})(t,l,e):null;let c=null,u=null;if(o&&a?a.startIndex<=o.startIndex&&a.endIndex>=o.endIndex?(c=a,u=e.transformersByTag[a.tag]):(c=o,u=i):o?(c=o,u=i):a&&(c=a,u=e.transformersByTag[a.tag]),!c||!u)return null;const d=[t.slice(c.startIndex,c.endIndex),c.tag,c.content];return d.index=c.startIndex,d.input=t,{endIndex:c.endIndex,match:d,startIndex:c.startIndex,transformer:u}}function Jf(n,e,t,r,i){if(!Vf(e,t,r,i))return!1;if(n==="*")return!0;if(n==="_"){if(!Vf(e,t,r,!i))return!0;const s=i?e[t-1]:e[t+r];return s!==void 0&&oc.test(s)}return!0}function Vf(n,e,t,r){const i=n[e-1],s=n[e+t],[o,l]=r?[s,i]:[i,s];return o!==void 0&&!Wf.test(o)&&(!oc.test(o)||l===void 0||Wf.test(l)||oc.test(l))}function Dr(n){return D(n)&&!n.hasFormat("code")}function Yn(n,e,t){let r=oS(n,e),i=(function(o,l){const a=o;let c,u,d,f;for(const h of l){if(!h.replace||!h.importRegExp)continue;const g=a.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(a,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,d=h,f=g)}return c===void 0||u===void 0||d===void 0||f===void 0?null:{endIndex:u,match:f,startIndex:c,transformer:d}})(n,t);if(r&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const o=(function(l,a,c,u,d){const f=l.getTextContent();let h,g,p;if(d[0]===f?h=l:a===0?[h,g]=l.splitText(c):[p,h,g]=l.splitText(a,c),h.setTextContent(d[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);Dr(o.nodeAfter)&&Yn(o.nodeAfter,e,t),Dr(o.nodeBefore)&&Yn(o.nodeBefore,e,t),Dr(o.transformedNode)&&Yn(o.transformedNode,e,t)}else if(i){const o=(function(l,a,c,u,d){let f,h,g;return a===0?[f,h]=l.splitText(c):[g,f,h]=l.splitText(a,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(f,d)||void 0}:null})(n,i.startIndex,i.endIndex,i.transformer,i.match);if(!o)return;Dr(o.nodeAfter)&&Yn(o.nodeAfter,e,t),Dr(o.nodeBefore)&&Yn(o.nodeBefore,e,t),Dr(o.transformedNode)&&Yn(o.transformedNode,e,t)}const s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,l)=>String.fromCodePoint(l));n.setTextContent(s)}function lS(n,e=!1){const t=Jp(n),r=(function(i){const s={},o={},l=[],a="(?<![\\\\])";for(const c of i){const{tag:u}=c;s[u]=c;const d=u.replace(/(\*|\^|\+)/g,"\\$1");l.push(d),u.length===1?o[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${d}])(${d})((\\\\${d})?.*?[^${d}\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?![\\\\${d}])`):o[u]=new RegExp(`(?<!\\\\)(${d})((\\\\${d})?.*?[^\\s](\\\\${d})?)((?<!\\\\)|(?<=\\\\\\\\))(${d})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${a}(${l.join("|")})`,"g"),transformersByTag:s}})(t.textFormat);return(i,s)=>{const o=i.split(`
|
|
26
|
+
`),l=o.length,a=s||de();a.clear();for(let u=0;u<l;u++){const d=o[u],[f,h]=aS(o,u,t.multilineElement,a);f?u=h:cS(d,a,t.element,r,t.textMatch,e)}const c=a.getChildren();for(const u of c)!e&&lc(u)&&a.getChildrenSize()>1&&u.remove();M()!==null&&a.selectStart()}}function aS(n,e,t,r){for(const i of t){const{handleImportAfterStartMatch:s,regExpEnd:o,regExpStart:l,replace:a}=i,c=n[e].match(l);if(!c)continue;if(s){const g=s({lines:n,rootNode:r,startLineIndex:e,startMatch:c,transformer:i});if(g===null)continue;if(g)return g}const u=typeof o=="object"&&"regExp"in o?o.regExp:o,d=o&&typeof o=="object"&&"optional"in o?o.optional:!o;let f=e;const h=n.length;for(;f<h;){const g=u?n[f].match(u):null;if(!g&&(!d||d&&f<h-1)){f++;continue}if(g&&e===f&&g.index===c.index){f++;continue}const p=[];if(g&&e===f)p.push(n[e].slice(c[0].length,-g[0].length));else for(let m=e;m<=f;m++)if(m===e){const b=n[m].slice(c[0].length);p.push(b)}else if(m===f&&g){const b=n[m].slice(0,-g[0].length);p.push(b)}else p.push(n[m]);if(a(r,null,c,g,p,!0)!==!1)return[!0,f];break}}return[!1,e]}function cS(n,e,t,r,i,s){const o=he(n),l=J();l.append(o),e.append(l);for(const{regExp:a,replace:c}of t){const u=n.match(a);if(u&&(o.setTextContent(n.slice(u[0].length)),c(l,[o],u,!0)!==!1))break}if(Yn(o,r,i),l.isAttached()&&n.length>0){const a=l.getPreviousSibling();if(!s&&(wr(a)||Ga(a)||V(a))){let c=a;if(V(a)){const u=a.getLastDescendant();c=u==null?null:le(u,Q)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[ot(),...l.getChildren()]),l.remove())}}}const Vp=/^(\s*)(\d{1,})\.\s/,Gp=/^(\s*)[-*+]\s/,uS=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,ac=/^(#{1,6})\s/,Yp=/^>\s/,qp=/^[ \t]*```([\w-]+)?/,cc=/[ \t]*```$/,dS=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,fS=/^(?:\|)(.+)(?:\|)\s?$/,hS=/^(\| ?:?-*:? ?)+\|\s?$/,Gf=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Yf=/^<\/[a-z_][\w-]*\s*>/i,qf=n=>new RegExp(`(?:${n.source})$`,n.flags),Ii=Cc("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),Zp=n=>(e,t,r,i)=>{const s=n(r);s.append(...t),e.replace(s),i||s.select(0,0)},Xp=n=>(e,t,r,i)=>{const s=e.getPreviousSibling(),o=e.getNextSibling(),l=ht(n==="check"?r[3]==="x":void 0),a=r[0].trim()[0],c=n!=="bullet"&&n!=="check"||a!==Ii.parse(a)?void 0:a;if(V(o)&&o.getListType()===n){c&&js(o,Ii,c);const d=o.getFirstChild();d!==null?d.insertBefore(l):o.append(l),e.remove()}else if(V(s)&&s.getListType()===n)c&&js(s,Ii,c),s.append(l),e.remove();else{const d=st(n,n==="number"?Number(r[2]):void 0);c&&js(d,Ii,c),d.append(l),e.replace(d)}l.append(...t),i||l.select(0,0);const u=(function(d){const f=d.match(/\t/g),h=d.match(/ /g);let g=0;return f&&(g+=f.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&l.setIndent(u)},_u=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(Q(o)){if(o.getChildrenSize()===1){const d=o.getFirstChild();if(V(d)){r.push(_u(d,e,t+1));continue}}const l=" ".repeat(4*t),a=n.getListType(),c=ji(n,Ii),u=a==="number"?`${n.getStart()+s}. `:a==="check"?`${c} [${o.getChecked()?"x":" "}] `:c+" ";r.push(l+u+e(o)),s++}return r.join(`
|
|
27
|
+
`)},gS={dependencies:[Ss],export:(n,e)=>{if(!Wb(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:ac,replace:Zp(n=>{const e="h"+n[1].length;return Te(e)}),type:"element"},pS={dependencies:[xs],export:(n,e)=>{if(!Ga(n))return null;const t=e(n).split(`
|
|
28
28
|
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
29
|
-
`)},regExp:
|
|
30
|
-
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:
|
|
31
|
-
`)}const a=
|
|
32
|
-
`);let c=!1;const u=[];for(let d=0;d<a.length;d++){const f=a[d].trimEnd(),h=u[u.length-1];
|
|
33
|
-
`)})(n,i);return
|
|
29
|
+
`)},regExp:Yp,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(Ga(s))return s.splice(s.getChildrenSize(),0,[ot(),...e]),void n.remove()}const i=gi();i.append(...e),n.replace(i),r||i.select(0,0)},type:"element"},mS={dependencies:[tr],export:n=>{if(!Mt(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
30
|
+
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:cc},regExpStart:qp,replace:(n,e,t,r,i,s)=>{let o,l;if(!e&&i){if(i.length===1)r?(o=_t(),l=t[1]+i[0]):(o=_t(t[1]),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=_t(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();l=i.join(`
|
|
31
|
+
`)}const a=he(l);o.append(a),n.append(o)}else e&&Zp(a=>_t(a?a[1]:void 0))(n,e,t,s)},type:"multiline-element"},_S={dependencies:[Cs,kr],export:(n,e)=>V(n)?_u(n,e,0):null,regExp:Gp,replace:Xp("bullet"),type:"element"},yS={dependencies:[Cs,kr],export:(n,e)=>V(n)?_u(n,e,0):null,regExp:Vp,replace:Xp("number"),type:"element"},bS={format:["code"],tag:"`",type:"text-format"},xS={format:["highlight"],tag:"==",type:"text-format"},SS={format:["bold","italic"],tag:"***",type:"text-format"},CS={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},wS={format:["bold"],tag:"**",type:"text-format"},vS={format:["bold"],intraword:!1,tag:"__",type:"text-format"},kS={format:["strikethrough"],tag:"~~",type:"text-format"},ES={format:["italic"],tag:"*",type:"text-format"},TS={format:["italic"],intraword:!1,tag:"_",type:"text-format"},NS={dependencies:[Nr],export:(n,e,t)=>{if(!Cn(n)||Mi(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=er(r,{title:i}),o=t.split("[").length-1,l=t.split("]").length-1;let a=t,c="";if(o<l)return;if(o>l){const d=t.split("[");c="["+d[0],a=d.slice(1).join("[")}const u=he(a);return u.setFormat(n.getFormat()),s.append(u),n.replace(s),c&&s.insertBefore(he(c)),u},trigger:")",type:"text-match"},AS=[gS,pS,_S,yS],OS=[mS],MS=[bS,SS,CS,wS,vS,xS,ES,TS,kS],$S=[NS],yu=[...AS,...OS,...MS,...$S];function IS(n,e=yu,t,r=!1,i=!1){const s=r?n:(function(o,l=!1){const a=o.split(`
|
|
32
|
+
`);let c=!1;const u=[];for(let d=0;d<a.length;d++){const f=a[d].trimEnd(),h=u[u.length-1];dS.test(f)?u.push(f):qp.test(f)||cc.test(f)?(c=!c,u.push(f)):c||f===""||h===""||!h||ac.test(h)||ac.test(f)||Yp.test(f)||Vp.test(f)||Gp.test(f)||uS.test(f)||fS.test(f)||hS.test(f)||!l||Gf.test(f)||Yf.test(f)||qf(Yf).test(h)||qf(Gf).test(h)||cc.test(h)?u.push(f):u[u.length-1]=h+" "+f.trimStart()}return u.join(`
|
|
33
|
+
`)})(n,i);return lS(e,r)(s,t)}function FS(n=yu,e,t=!1){return(function(i,s=!1){const o=Jp(i),l=[...o.multilineElement,...o.element],a=!s,c=o.textFormat.filter(u=>u.format.length===1).sort((u,d)=>Number(u.format.includes("code"))-Number(d.format.includes("code")));return u=>{const d=[],f=(u||de()).getChildren();for(let h=0;h<f.length;h++){const g=f[h],p=sS(g,l,c,o.textMatch);p!=null&&d.push(a&&h>0&&!lc(g)&&!lc(f[h-1])?`
|
|
34
34
|
`.concat(p):p)}return d.join(`
|
|
35
|
-
`)}})(n,t)(e)}function im(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class sm{_offsetMap;_firstNode;_blockOffsetSize;constructor(e,t,r=1){this._offsetMap=e,this._firstNode=t,this._blockOffsetSize=r}createSelectionFromOffsets(e,t,r){const i=this._firstNode;if(i===null)return null;let s=e,o=t,l=zi(i,s,this._blockOffsetSize),a=zi(i,o,this._blockOffsetSize);if(r!==void 0&&(s=ih(s,l,r,this,this._blockOffsetSize),l=zi(i,s,this._blockOffsetSize),o=ih(o,a,r,this,this._blockOffsetSize),a=zi(i,o,this._blockOffsetSize)),l===null||a===null)return null;let c=l.key,u=a.key;const d=q(c),f=q(u);if(d===null||f===null)return null;let h=0,g=0,p="element",m="element";if(l.type==="text"){h=s-l.start,p="text";const _=d.getNextSibling();s!==o&&h===d.getTextContentSize()&&D(_)&&(h=0,c=_.__key)}else l.type==="inline"&&(c=d.getParentOrThrow().getKey(),h=o>l.start?l.end:l.start);a.type==="text"?(g=o-a.start,m="text"):a.type==="inline"&&(u=f.getParentOrThrow().getKey(),g=o>a.start?a.end:a.start);const b=hi();return b===null?null:(b.anchor.set(c,h,p),b.focus.set(u,g,m),b)}getOffsetsFromSelection(e){const t=e.anchor,r=e.focus,i=this._offsetMap,s=t.offset,o=r.offset;let l=-1,a=-1;if(t.type==="text"){const c=i.get(t.key);c!==void 0&&(l=c.start+s)}else{const c=t.getNode().getDescendantByIndex(s);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(l=c.getIndexWithinParent()!==s?u.end:u.start)}}if(r.type==="text"){const c=i.get(r.key);c!==void 0&&(a=c.start+r.offset)}else{const c=r.getNode().getDescendantByIndex(o);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(a=c.getIndexWithinParent()!==o?u.end:u.start)}}return[l,a]}}function ih(n,e,t,r,i){const s=t._offsetMap,o=r._offsetMap,l=new Set;let a=n,c=e;for(;c!==null;){const d=c.key,f=s.get(d),h=c.end-c.start;if(l.add(d),f===void 0)a+=h;else{const m=f.end-f.start;m!==h&&(a+=h-m)}const g=c.prev;if(g!==null){c=g;continue}let p=c.parent;for(;p!==null;){let m=p.prev;if(m!==null){const b=m.key,_=s.get(b),y=m.end-m.start;if(l.add(b),_===void 0)a+=y;else{const S=_.end-_.start;S!==y&&(a+=y-S)}m=m.prev}p=p.parent}break}const u=t._firstNode;if(u!==null){c=zi(u,n,i);let d=!1;for(;c!==null;){if(!l.has(c.key)){d=!0;break}c=c.parent}if(!d)for(;c!==null;){const f=c.key;if(!l.has(f)){const h=o.get(f),g=c.end-c.start;if(h===void 0)a-=g;else{const p=h.end-h.start;g!==p&&(a+=p-g)}}c=c.prev}}return a}function zi(n,e,t){let r=n;for(;r!==null;){if(e<r.end+(r.type!=="element"||t===0?1:0)){const s=r.child;if(s!==null){r=s;continue}return r}const i=r.next;if(i===null)break;r=i}return null}function sh(n,e,t,r,i,s){return{child:n,end:r,key:i,next:null,parent:s,prev:null,start:t,type:e}}function ZS(n,e,t,r,i,s){const o=r.get(e);o===void 0&&im(3);const l=n.offset;if(A(o)){const d=or(o,r),f=d.length===0,h=f?null:om(n,d,null,r,i,s);n.prevIsBlock&&!f||(n.prevIsBlock=!0,n.offset+=s);const g=sh(h,"element",l,l,e,t);h!==null&&(h.parent=g);const p=n.offset;return g.end=p,i.set(e,g),g}n.prevIsBlock=!1;const a=D(o),c=a?o.__text.length:1,u=sh(null,a?"text":"inline",l,n.offset+=c,e,t);return i.set(e,u),u}function om(n,e,t,r,i,s){let o=null,l=null;const a=e.length;for(let c=0;c<a;c++){const u=ZS(n,e[c],t,r,i,s);l===null?o=u:(u.prev=l,l.next=u),l=u}return o}function or(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e===null?q(r):e.get(r);i==null&&im(174),t.push(r),r=i.__next}return t}const XS=or;function QS(n,e=1,t){const r=(t||n._pendingEditorState||n._editorState)._nodeMap,i=r.get("root"),s=new Map,o=om({offset:0,prevIsBlock:!1},or(i,r),null,r,s,e);return new sm(s,o,e)}const eC=Object.freeze(Object.defineProperty({__proto__:null,$createChildrenArray:or,$createOffsetView:QS,OffsetView:sm,createChildrenArray:XS},Symbol.toStringTag,{value:"Module"})),Gt=()=>new Map,pc=n=>{const e=Gt();return n.forEach((t,r)=>{e.set(r,t)}),e},Ci=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},tC=(n,e)=>{const t=[];for(const[r,i]of n)t.push(e(i,r));return t},nC=(n,e)=>{for(const[t,r]of n)if(e(r,t))return!0;return!1},ei=()=>new Set,ba=n=>n[n.length-1],ti=Array.from,vu=(n,e)=>{for(let t=0;t<n.length;t++)if(!e(n[t],t,n))return!1;return!0},lm=(n,e)=>{for(let t=0;t<n.length;t++)if(e(n[t],t,n))return!0;return!1},rC=(n,e)=>{const t=new Array(n);for(let r=0;r<n;r++)t[r]=e(r,t);return t},El=Array.isArray;class iC{constructor(){this._observers=Gt()}on(e,t){return Ci(this._observers,e,ei).add(t),t}once(e,t){const r=(...i)=>{this.off(e,r),t(...i)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return ti((this._observers.get(e)||Gt()).values()).forEach(r=>r(...t))}destroy(){this._observers=Gt()}}const gn=Math.floor,to=Math.abs,am=(n,e)=>n<e?n:e,wi=(n,e)=>n>e?n:e,sC=n=>n!==0?n<0:1/n<0,oh=1,lh=2,xa=4,Sa=8,oC=32,cm=64,Lo=128,lC=31,ah=63,Vi=127,aC=2147483647,ch=Number.MAX_SAFE_INTEGER,uh=Number.MIN_SAFE_INTEGER,cC=Number.isInteger||(n=>typeof n=="number"&&isFinite(n)&&gn(n)===n),uC=String.fromCharCode,dC=n=>n.toLowerCase(),fC=/^\s*/g,hC=n=>n.replace(fC,""),gC=/([A-Z])/g,dh=(n,e)=>hC(n.replace(gC,t=>`${e}${dC(t)}`)),pC=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.codePointAt(i);return r},cs=typeof TextEncoder<"u"?new TextEncoder:null,mC=n=>cs.encode(n),_C=cs?mC:pC;let Ca=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ca&&Ca.decode(new Uint8Array).length===1&&(Ca=null);const yC=(n,e)=>rC(e,()=>n).join("");class As{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Eu=()=>new As,bC=n=>{let e=n.cpos;for(let t=0;t<n.bufs.length;t++)e+=n.bufs[t].length;return e},an=n=>{const e=new Uint8Array(bC(n));let t=0;for(let r=0;r<n.bufs.length;r++){const i=n.bufs[r];e.set(i,t),t+=i.length}return e.set(new Uint8Array(n.cbuf.buffer,0,n.cpos),t),e},xC=(n,e)=>{const t=n.cbuf.length;t-n.cpos<e&&(n.bufs.push(new Uint8Array(n.cbuf.buffer,0,n.cpos)),n.cbuf=new Uint8Array(wi(t,e)*2),n.cpos=0)},Ae=(n,e)=>{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},mc=Ae,ce=(n,e)=>{for(;e>Vi;)Ae(n,Lo|Vi&e),e=gn(e/128);Ae(n,Vi&e)},ku=(n,e)=>{const t=sC(e);for(t&&(e=-e),Ae(n,(e>ah?Lo:0)|(t?cm:0)|ah&e),e=gn(e/64);e>0;)Ae(n,(e>Vi?Lo:0)|Vi&e),e=gn(e/128)},_c=new Uint8Array(3e4),SC=_c.length/3,CC=(n,e)=>{if(e.length<SC){const t=cs.encodeInto(e,_c).written||0;ce(n,t);for(let r=0;r<t;r++)Ae(n,_c[r])}else ut(n,_C(e))},wC=(n,e)=>{const t=unescape(encodeURIComponent(e)),r=t.length;ce(n,r);for(let i=0;i<r;i++)Ae(n,t.codePointAt(i))},qr=cs&&cs.encodeInto?CC:wC,Tu=(n,e)=>{const t=n.cbuf.length,r=n.cpos,i=am(t-r,e.length),s=e.length-i;n.cbuf.set(e.subarray(0,i),r),n.cpos+=i,s>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(wi(t*2,s)),n.cbuf.set(e.subarray(i)),n.cpos=s)},ut=(n,e)=>{ce(n,e.byteLength),Tu(n,e)},Nu=(n,e)=>{xC(n,e);const t=new DataView(n.cbuf.buffer,n.cpos,e);return n.cpos+=e,t},vC=(n,e)=>Nu(n,4).setFloat32(0,e,!1),EC=(n,e)=>Nu(n,8).setFloat64(0,e,!1),kC=(n,e)=>Nu(n,8).setBigInt64(0,e,!1),fh=new DataView(new ArrayBuffer(4)),TC=n=>(fh.setFloat32(0,n),fh.getFloat32(0)===n),us=(n,e)=>{switch(typeof e){case"string":Ae(n,119),qr(n,e);break;case"number":cC(e)&&to(e)<=aC?(Ae(n,125),ku(n,e)):TC(e)?(Ae(n,124),vC(n,e)):(Ae(n,123),EC(n,e));break;case"bigint":Ae(n,122),kC(n,e);break;case"object":if(e===null)Ae(n,126);else if(El(e)){Ae(n,117),ce(n,e.length);for(let t=0;t<e.length;t++)us(n,e[t])}else if(e instanceof Uint8Array)Ae(n,116),ut(n,e);else{Ae(n,118);const t=Object.keys(e);ce(n,t.length);for(let r=0;r<t.length;r++){const i=t[r];qr(n,i),us(n,e[i])}}break;case"boolean":Ae(n,e?120:121);break;default:Ae(n,127)}};class hh extends As{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ce(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const gh=n=>{n.count>0&&(ku(n.encoder,n.count===1?n.s:-n.s),n.count>1&&ce(n.encoder,n.count-2))};class no{constructor(){this.encoder=new As,this.s=0,this.count=0}write(e){this.s===e?this.count++:(gh(this),this.count=1,this.s=e)}toUint8Array(){return gh(this),an(this.encoder)}}const ph=n=>{if(n.count>0){const e=n.diff*2+(n.count===1?0:1);ku(n.encoder,e),n.count>1&&ce(n.encoder,n.count-2)}};class wa{constructor(){this.encoder=new As,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(ph(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return ph(this),an(this.encoder)}}class NC{constructor(){this.sarr=[],this.s="",this.lensE=new no}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new As;return this.sarr.push(this.s),this.s="",qr(e,this.sarr.join("")),Tu(e,this.lensE.toUint8Array()),an(e)}}const Pn=n=>new Error(n),Ft=()=>{throw Pn("Method unimplemented")},pn=()=>{throw Pn("Unexpected case")},AC=crypto.getRandomValues.bind(crypto),um=()=>AC(new Uint32Array(1))[0],OC="10000000-1000-4000-8000"+-1e11,MC=()=>OC.replace(/[018]/g,n=>(n^um()&15>>n/4).toString(16)),mh=n=>new Promise(n);Promise.all.bind(Promise);const _h=n=>n===void 0?null:n;class $C{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let dm=new $C,IC=!0;try{typeof localStorage<"u"&&localStorage&&(dm=localStorage,IC=!1)}catch{}const FC=dm,ds=Symbol("Equality"),fm=(n,e)=>n===e||!!n?.[ds]?.(e)||!1,DC=n=>typeof n=="object",LC=Object.assign,RC=Object.keys,PC=(n,e)=>{for(const t in n)e(n[t],t)},Ro=n=>RC(n).length,BC=n=>{for(const e in n)return!1;return!0},Os=(n,e)=>{for(const t in n)if(!e(n[t],t))return!1;return!0},Au=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),zC=(n,e)=>n===e||Ro(n)===Ro(e)&&Os(n,(t,r)=>(t!==void 0||Au(e,r))&&fm(e[r],t)),UC=Object.freeze,hm=n=>{for(const e in n){const t=n[e];(typeof t=="object"||typeof t=="function")&&hm(n[e])}return UC(n)},Ou=(n,e,t=0)=>{try{for(;t<n.length;t++)n[t](...e)}finally{t<n.length&&Ou(n,e,t+1)}},ro=(n,e)=>{if(n===e)return!0;if(n==null||e==null||n.constructor!==e.constructor&&(n.constructor||Object)!==(e.constructor||Object))return!1;if(n[ds]!=null)return n[ds](e);switch(n.constructor){case ArrayBuffer:n=new Uint8Array(n),e=new Uint8Array(e);case Uint8Array:{if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;break}case Set:{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;break}case Map:{if(n.size!==e.size)return!1;for(const t of n.keys())if(!e.has(t)||!ro(n.get(t),e.get(t)))return!1;break}case void 0:case Object:if(Ro(n)!==Ro(e))return!1;for(const t in n)if(!Au(n,t)||!ro(n[t],e[t]))return!1;break;case Array:if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!ro(n[t],e[t]))return!1;break;default:return!1}return!0},KC=(n,e)=>e.includes(n),fs=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Rt;const WC=()=>{if(Rt===void 0)if(fs){Rt=Gt();const n=process.argv;let e=null;for(let t=0;t<n.length;t++){const r=n[t];r[0]==="-"?(e!==null&&Rt.set(e,""),e=r):e!==null&&(Rt.set(e,r),e=null)}e!==null&&Rt.set(e,"")}else typeof location=="object"?(Rt=Gt(),(location.search||"?").slice(1).split("&").forEach(n=>{if(n.length!==0){const[e,t]=n.split("=");Rt.set(`--${dh(e,"-")}`,t),Rt.set(`-${dh(e,"-")}`,t)}})):Rt=Gt();return Rt},yc=n=>WC().has(n),Po=n=>_h(fs?process.env[n.toUpperCase().replaceAll("-","_")]:FC.getItem(n)),gm=n=>yc("--"+n)||Po(n)!==null,jC=gm("production"),HC=fs&&KC(process.env.FORCE_COLOR,["true","1","2"]),JC=HC||!yc("--no-colors")&&!gm("no-color")&&(!fs||process.stdout.isTTY)&&(!fs||yc("--color")||Po("COLORTERM")!==null||(Po("TERM")||"").includes("color"));class GC{constructor(e,t){this.left=e,this.right=t}}const en=(n,e)=>new GC(n,e),yh=n=>n.next()>=.5,va=(n,e,t)=>gn(n.next()*(t+1-e)+e),pm=(n,e,t)=>gn(n.next()*(t+1-e)+e),Mu=(n,e,t)=>pm(n,e,t),VC=n=>uC(Mu(n,97,122)),YC=(n,e=0,t=20)=>{const r=Mu(n,e,t);let i="";for(let s=0;s<r;s++)i+=VC(n);return i},Ea=(n,e)=>e[Mu(n,0,e.length-1)],qC=Symbol("0schema");class ZC{constructor(){this._rerrs=[]}extend(e,t,r,i=null){this._rerrs.push({path:e,expected:t,has:r,message:i})}toString(){const e=[];for(let t=this._rerrs.length-1;t>0;t--){const r=this._rerrs[t];e.push(yC(" ",(this._rerrs.length-t)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
|
|
36
|
-
`)}}const
|
|
37
|
-
${t.toString()}`)};class Sw{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:hs(e),h:t}),this}else(e){return this.if(zo,e)}done(){return(e,t)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,t)}throw Pn("Unhandled pattern")}}}const Cw=n=>new Sw(n),Om=Cw(zo).if(Tm,(n,e)=>va(e,uh,ch)).if(Nm,(n,e)=>YC(e)).if(yw,(n,e)=>yh(e)).if(_w,(n,e)=>BigInt(va(e,uh,ch))).if(Bo,(n,e)=>zr(e,Ea(e,n.shape))).if(iw,(n,e)=>{const t={};for(const r in n.shape){let i=n.shape[r];if(tw.check(i)){if(yh(e))continue;i=i.shape}t[r]=Om(i,e)}return t}).if(aw,(n,e)=>{const t=[],r=pm(e,0,42);for(let i=0;i<r;i++)t.push(zr(e,n.shape));return t}).if(mm,(n,e)=>Ea(e,n.shape)).if(bw,(n,e)=>null).if(hw,(n,e)=>{const t=zr(e,n.res);return()=>t}).if(mw,(n,e)=>zr(e,Ea(e,[Zr,ni,Ol,Am,Du,Al,wm(Zr),xm(vi("a","b","c"),Zr)]))).if(ow,(n,e)=>{const t={},r=va(e,0,3);for(let i=0;i<r;i++){const s=zr(e,n.shape.keys),o=zr(e,n.shape.values);t[s]=o}return t}).done(),zr=(n,e)=>Om(hs(e),n),Ml=typeof document<"u"?document:{};Re(n=>n.nodeType===Tw);typeof DOMParser<"u"&&new DOMParser;Re(n=>n.nodeType===vw);Re(n=>n.nodeType===Ew);const ww=n=>tC(n,(e,t)=>`${t}:${e};`).join(""),vw=Ml.ELEMENT_NODE,Ew=Ml.TEXT_NODE,kw=Ml.DOCUMENT_NODE,Tw=Ml.DOCUMENT_FRAGMENT_NODE;Re(n=>n.nodeType===kw);const Cn=Symbol,Mm=Cn(),$m=Cn(),Nw=Cn(),Aw=Cn(),Ow=Cn(),Im=Cn(),Mw=Cn(),Lu=Cn(),$w=Cn(),Iw=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[];let r=0;for(;r<n.length;r++){const i=n[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&t.push(e.join(""));r<n.length;r++){const i=n[r];i instanceof Symbol||t.push(i)}return t},Fw={[Mm]:en("font-weight","bold"),[$m]:en("font-weight","normal"),[Nw]:en("color","blue"),[Ow]:en("color","green"),[Aw]:en("color","grey"),[Im]:en("color","red"),[Mw]:en("color","purple"),[Lu]:en("color","orange"),[$w]:en("color","black")},Dw=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[],r=Gt();let i=[],s=0;for(;s<n.length;s++){const o=n[s],l=Fw[o];if(l!==void 0)r.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const a=ww(r);s>0||a.length>0?(e.push("%c"+o),t.push(a)):e.push(o)}else break}}for(s>0&&(i=t,i.unshift(e.join("")));s<n.length;s++){const o=n[s];o instanceof Symbol||i.push(o)}return i},Fm=JC?Dw:Iw,Lw=(...n)=>{console.log(...Fm(n)),Dm.forEach(e=>e.print(n))},Rw=(...n)=>{console.warn(...Fm(n)),n.unshift(Lu),Dm.forEach(e=>e.print(n))},Dm=ei(),Lm=n=>({[Symbol.iterator](){return this},next:n}),Pw=(n,e)=>Lm(()=>{let t;do t=n.next();while(!t.done&&!e(t.value));return t}),ka=(n,e)=>Lm(()=>{const{done:t,value:r}=n.next();return{done:t,value:t?void 0:e(r)}});class Bw{constructor(e,t){this.clock=e,this.len=t}}class zw{constructor(){this.clients=new Map}}const Rm=(n,e,t)=>e.clients.forEach((r,i)=>{const s=n.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],l=o.id.clock+o.length;for(let a=0,c=r[a];a<r.length&&c.clock<l;c=r[++a])jm(n,s,c.clock,c.len,t)}}),Uw=(n,e)=>{let t=0,r=n.length-1;for(;t<=r;){const i=gn((t+r)/2),s=n[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;t=i+1}else r=i-1}return null},Pm=(n,e)=>{const t=n.clients.get(e.client);return t!==void 0&&Uw(t,e.clock)!==null},Bm=n=>{n.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let t,r;for(t=1,r=1;t<e.length;t++){const i=e[r-1],s=e[t];i.clock+i.len>=s.clock?i.len=wi(i.len,s.clock+s.len-i.clock):(r<t&&(e[r]=s),r++)}e.length=r})},zm=(n,e,t,r)=>{Ci(n.clients,e,()=>[]).push(new Bw(t,r))},Kw=(n,e)=>{ce(n.restEncoder,e.clients.size),ti(e.clients.entries()).sort((t,r)=>r[0]-t[0]).forEach(([t,r])=>{n.resetDsCurVal(),ce(n.restEncoder,t);const i=r.length;ce(n.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];n.writeDsClock(o.clock),n.writeDsLen(o.len)}})},Um=um;class Bn extends iC{constructor({guid:e=MC(),collectionid:t=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=Um(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new Xw,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=mh(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>mh(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&he(e.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ti(this.subdocs).map(e=>e.guid))}transact(e,t=null){return he(this,e,t)}get(e,t=Ue){const r=Ci(this.share,e,()=>{const s=new t;return s._integrate(this,null),s}),i=r.constructor;if(t!==Ue&&i!==t)if(i===Ue){const s=new t;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Yi)}getText(e=""){return this.get(e,ms)}getMap(e=""){return this.get(e,yt)}getXmlElement(e=""){return this.get(e,_n)}getXmlFragment(e=""){return this.get(e,ri)}toJSON(){const e={};return this.share.forEach((t,r)=>{e[r]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,ti(this.subdocs).forEach(t=>t.destroy());const e=this._item;if(e!==null){this._item=null;const t=e.content;t.doc=new Bn({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,he(e.parent.doc,r=>{const i=t.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ww{constructor(){this.restEncoder=Eu()}toUint8Array(){return an(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ce(this.restEncoder,e)}writeDsLen(e){ce(this.restEncoder,e)}}class jw extends Ww{writeLeftID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeRightID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeClient(e){ce(this.restEncoder,e)}writeInfo(e){mc(this.restEncoder,e)}writeString(e){qr(this.restEncoder,e)}writeParentInfo(e){ce(this.restEncoder,e?1:0)}writeTypeRef(e){ce(this.restEncoder,e)}writeLen(e){ce(this.restEncoder,e)}writeAny(e){us(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){qr(this.restEncoder,JSON.stringify(e))}writeKey(e){qr(this.restEncoder,e)}}class Hw{constructor(){this.restEncoder=Eu(),this.dsCurrVal=0}toUint8Array(){return an(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,ce(this.restEncoder,t)}writeDsLen(e){e===0&&pn(),ce(this.restEncoder,e-1),this.dsCurrVal+=e}}class Jw extends Hw{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new wa,this.clientEncoder=new no,this.leftClockEncoder=new wa,this.rightClockEncoder=new wa,this.infoEncoder=new hh(mc),this.stringEncoder=new NC,this.parentInfoEncoder=new hh(mc),this.typeRefEncoder=new no,this.lenEncoder=new no}toUint8Array(){const e=Eu();return ce(e,0),ut(e,this.keyClockEncoder.toUint8Array()),ut(e,this.clientEncoder.toUint8Array()),ut(e,this.leftClockEncoder.toUint8Array()),ut(e,this.rightClockEncoder.toUint8Array()),ut(e,an(this.infoEncoder)),ut(e,this.stringEncoder.toUint8Array()),ut(e,an(this.parentInfoEncoder)),ut(e,this.typeRefEncoder.toUint8Array()),ut(e,this.lenEncoder.toUint8Array()),Tu(e,an(this.restEncoder)),an(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){us(this.restEncoder,e)}writeBuf(e){ut(this.restEncoder,e)}writeJSON(e){us(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Gw=(n,e,t,r)=>{r=wi(r,e[0].id.clock);const i=mn(e,r);ce(n.restEncoder,e.length-i),n.writeClient(t),ce(n.restEncoder,r);const s=e[i];s.write(n,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(n,0)},Vw=(n,e,t)=>{const r=new Map;t.forEach((i,s)=>{it(e,s)>i&&r.set(s,i)}),Ru(e).forEach((i,s)=>{t.has(s)||r.set(s,0)}),ce(n.restEncoder,r.size),ti(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{Gw(n,e.clients.get(i),i,s)})},Yw=(n,e)=>Vw(n,e.doc.store,e.beforeState);class qw{constructor(){this.l=[]}}const xh=()=>new qw,Sh=(n,e)=>n.l.push(e),Ch=(n,e)=>{const t=n.l,r=t.length;n.l=t.filter(i=>e!==i),r===n.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Km=(n,e,t)=>Ou(n.l,[e,t]);class io{constructor(e,t){this.client=e,this.clock=t}}const Js=(n,e)=>n===e||n!==null&&e!==null&&n.client===e.client&&n.clock===e.clock,_e=(n,e)=>new io(n,e),Zw=n=>{for(const[e,t]of n.doc.share.entries())if(t===n)return e;throw pn()},jr=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&(e.sv.get(n.id.client)||0)>n.id.clock&&!Pm(e.ds,n.id),xc=(n,e)=>{const t=Ci(n.meta,xc,ei),r=n.doc.store;t.has(e)||(e.sv.forEach((i,s)=>{i<it(r,s)&&zn(n,_e(s,i))}),Rm(n,e.ds,i=>{}),t.add(e))};class Xw{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Ru=n=>{const e=new Map;return n.clients.forEach((t,r)=>{const i=t[t.length-1];e.set(r,i.id.clock+i.length)}),e},it=(n,e)=>{const t=n.clients.get(e);if(t===void 0)return 0;const r=t[t.length-1];return r.id.clock+r.length},Wm=(n,e)=>{let t=n.clients.get(e.id.client);if(t===void 0)t=[],n.clients.set(e.id.client,t);else{const r=t[t.length-1];if(r.id.clock+r.length!==e.id.clock)throw pn()}t.push(e)},mn=(n,e)=>{let t=0,r=n.length-1,i=n[r],s=i.id.clock;if(s===e)return r;let o=gn(e/(s+i.length-1)*r);for(;t<=r;){if(i=n[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;t=o+1}else r=o-1;o=gn((t+r)/2)}throw pn()},Qw=(n,e)=>{const t=n.clients.get(e.client);return t[mn(t,e.clock)]},Ta=Qw,Sc=(n,e,t)=>{const r=mn(e,t),i=e[r];return i.id.clock<t&&i instanceof Je?(e.splice(r+1,0,a_(n,i,t-i.id.clock)),r+1):r},zn=(n,e)=>{const t=n.doc.store.clients.get(e.client);return t[Sc(n,t,e.clock)]},wh=(n,e,t)=>{const r=e.clients.get(t.client),i=mn(r,t.clock),s=r[i];return t.clock!==s.id.clock+s.length-1&&s.constructor!==En&&r.splice(i+1,0,a_(n,s,t.clock-s.id.clock+1)),s},ev=(n,e,t)=>{const r=n.clients.get(e.id.client);r[mn(r,e.id.clock)]=t},jm=(n,e,t,r,i)=>{if(r===0)return;const s=t+r;let o=Sc(n,e,t),l;do l=e[o++],s<l.id.clock+l.length&&Sc(n,e,s),i(l);while(o<e.length&&e[o].id.clock<s)};class tv{constructor(e,t,r){this.doc=e,this.deleteSet=new zw,this.beforeState=Ru(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const vh=(n,e)=>e.deleteSet.clients.size===0&&!nC(e.afterState,(t,r)=>e.beforeState.get(r)!==t)?!1:(Bm(e.deleteSet),Yw(n,e),Kw(n,e.deleteSet),!0),Eh=(n,e,t)=>{const r=e._item;(r===null||r.id.clock<(n.beforeState.get(r.id.client)||0)&&!r.deleted)&&Ci(n.changed,e,ei).add(t)},so=(n,e)=>{let t=n[e],r=n[e-1],i=e;for(;i>0;t=r,r=n[--i-1]){if(r.deleted===t.deleted&&r.constructor===t.constructor&&r.mergeWith(t)){t instanceof Je&&t.parentSub!==null&&t.parent._map.get(t.parentSub)===t&&t.parent._map.set(t.parentSub,r);continue}break}const s=e-i;return s&&n.splice(e+1-s,s),s},nv=(n,e,t)=>{for(const[r,i]of n.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const l=i[o],a=l.clock+l.len;for(let c=mn(s,l.clock),u=s[c];c<s.length&&u.id.clock<a;u=s[++c]){const d=s[c];if(l.clock+l.len<=d.id.clock)break;d instanceof Je&&d.deleted&&!d.keep&&t(d)&&d.gc(e,!1)}}}},rv=(n,e)=>{n.clients.forEach((t,r)=>{const i=e.clients.get(r);for(let s=t.length-1;s>=0;s--){const o=t[s],l=am(i.length-1,1+mn(i,o.clock+o.len-1));for(let a=l,c=i[a];a>0&&c.id.clock>=o.clock;c=i[a])a-=1+so(i,a)}})},Hm=(n,e)=>{if(e<n.length){const t=n[e],r=t.doc,i=r.store,s=t.deleteSet,o=t._mergeStructs;try{Bm(s),t.afterState=Ru(t.doc.store),r.emit("beforeObserverCalls",[t,r]);const l=[];t.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(t,a)})),l.push(()=>{t.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),l.push(()=>{Km(c._dEH,a,t)}))}),l.push(()=>r.emit("afterTransaction",[t,r])),l.push(()=>{t._needFormattingCleanup&&pv(t)})}),Ou(l,[])}finally{r.gc&&nv(s,i,r.gcFilter),rv(s,i),t.afterState.forEach((u,d)=>{const f=t.beforeState.get(d)||0;if(f!==u){const h=i.clients.get(d),g=wi(mn(h,f),1);for(let p=h.length-1;p>=g;)p-=1+so(h,p)}});for(let u=o.length-1;u>=0;u--){const{client:d,clock:f}=o[u].id,h=i.clients.get(d),g=mn(h,f);g+1<h.length&&so(h,g+1)>1||g>0&&so(h,g)}if(!t.local&&t.afterState.get(r.clientID)!==t.beforeState.get(r.clientID)&&(Lw(Lu,Mm,"[yjs] ",$m,Im,"Changed the client-id because another client seems to be using it."),r.clientID=Um()),r.emit("afterTransactionCleanup",[t,r]),r._observers.has("update")){const u=new jw;vh(u,t)&&r.emit("update",[u.toUint8Array(),t.origin,r,t])}if(r._observers.has("updateV2")){const u=new Jw;vh(u,t)&&r.emit("updateV2",[u.toUint8Array(),t.origin,r,t])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=t;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,t]),c.forEach(u=>u.destroy())),n.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,n])):Hm(n,e+1)}}},he=(n,e,t=null,r=!0)=>{const i=n._transactionCleanups;let s=!1,o=null;n._transaction===null&&(s=!0,n._transaction=new tv(n,t,r),i.push(n._transaction),i.length===1&&n.emit("beforeAllTransactions",[n]),n.emit("beforeTransaction",[n._transaction,n]));try{o=e(n._transaction)}finally{if(s){const l=n._transaction===i[0];n._transaction=null,l&&Hm(i,0)}}return o},kh="You must not compute changes after the event-handler fired.";class $l{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=iv(this.currentTarget,this.target))}deletes(e){return Pm(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Pn(kh);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(i=>{if(i!==null){const s=t._map.get(i);let o,l;if(this.adds(s)){let a=s.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(s))if(a!==null&&this.deletes(a))o="delete",l=ba(a.content.getContent());else return;else a!==null&&this.deletes(a)?(o="update",l=ba(a.content.getContent())):(o="add",l=void 0)}else if(this.deletes(s))o="delete",l=ba(s.content.getContent());else return;e.set(i,{action:o,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Pn(kh);const t=this.target,r=ei(),i=ei(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(t).has(null)){let l=null;const a=()=>{l&&s.push(l)};for(let c=t._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,i.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const iv=(n,e)=>{const t=[];for(;e._item!==null&&e!==n;){if(e._item.parentSub!==null)t.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;t.unshift(r)}e=e._item.parent}return t},Ve=()=>{Rw("Invalid access: Add Yjs type to a document before reading data.")},Jm=80;let Pu=0;class sv{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Pu++}}const ov=n=>{n.timestamp=Pu++},Gm=(n,e,t)=>{n.p.marker=!1,n.p=e,e.marker=!0,n.index=t,n.timestamp=Pu++},lv=(n,e,t)=>{if(n.length>=Jm){const r=n.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return Gm(r,e,t),r}else{const r=new sv(e,t);return n.push(r),r}},Il=(n,e)=>{if(n._start===null||e===0||n._searchMarker===null)return null;const t=n._searchMarker.length===0?null:n._searchMarker.reduce((s,o)=>to(e-s.index)<to(e-o.index)?s:o);let r=n._start,i=0;for(t!==null&&(r=t.p,i=t.index,ov(t));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return t!==null&&to(t.index-i)<r.parent.length/Jm?(Gm(t,r,i),t):lv(n._searchMarker,r,i)},gs=(n,e,t)=>{for(let r=n.length-1;r>=0;r--){const i=n[r];if(t>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){n.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||t>0&&e===i.index)&&(i.index=wi(e,i.index+t))}},Fl=(n,e,t)=>{const r=n,i=e.changedParentTypes;for(;Ci(i,n,()=>[]).push(t),n._item!==null;)n=n._item.parent;Km(r._eH,t,e)};class Ue{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=xh(),this._dEH=xh(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Ft()}clone(){throw Ft()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Sh(this._eH,e)}observeDeep(e){Sh(this._dEH,e)}unobserve(e){Ch(this._eH,e)}unobserveDeep(e){Ch(this._dEH,e)}toJSON(){}}const Vm=(n,e,t)=>{n.doc??Ve(),e<0&&(e=n._length+e),t<0&&(t=n._length+t);let r=t-e;const i=[];let s=n._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let l=e;l<o.length&&r>0;l++)i.push(o[l]),r--;e=0}}s=s.right}return i},Ym=n=>{n.doc??Ve();const e=[];let t=n._start;for(;t!==null;){if(t.countable&&!t.deleted){const r=t.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}t=t.right}return e},ps=(n,e)=>{let t=0,r=n._start;for(n.doc??Ve();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],t++,n)}r=r.right}},qm=(n,e)=>{const t=[];return ps(n,(r,i)=>{t.push(e(r,i,n))}),t},av=n=>{let e=n._start,t=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(t===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};t=e.content.getContent(),r=0,e=e.right}const i=t[r++];return t.length<=r&&(t=null),{done:!1,value:i}}}},Zm=(n,e)=>{n.doc??Ve();const t=Il(n,e);let r=n._start;for(t!==null&&(r=t.p,e-=t.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Uo=(n,e,t,r)=>{let i=t;const s=n.doc,o=s.clientID,l=s.store,a=t===null?e._start:t.right;let c=[];const u=()=>{c.length>0&&(i=new Je(_e(o,it(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new ii(c)),i.integrate(n,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:i=new Je(_e(o,it(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Dl(new Uint8Array(d))),i.integrate(n,0);break;case Bn:i=new Je(_e(o,it(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Ll(d)),i.integrate(n,0);break;default:if(d instanceof Ue)i=new Je(_e(o,it(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Jn(d)),i.integrate(n,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},Xm=()=>Pn("Length exceeded!"),Qm=(n,e,t,r)=>{if(t>e._length)throw Xm();if(t===0)return e._searchMarker&&gs(e._searchMarker,t,r.length),Uo(n,e,null,r);const i=t,s=Il(e,t);let o=e._start;for(s!==null&&(o=s.p,t-=s.index,t===0&&(o=o.prev,t+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(t<=o.length){t<o.length&&zn(n,_e(o.id.client,o.id.clock+t));break}t-=o.length}return e._searchMarker&&gs(e._searchMarker,i,r.length),Uo(n,e,o,r)},cv=(n,e,t)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Uo(n,e,i,t)},e_=(n,e,t,r)=>{if(r===0)return;const i=t,s=r,o=Il(e,t);let l=e._start;for(o!==null&&(l=o.p,t-=o.index);l!==null&&t>0;l=l.right)!l.deleted&&l.countable&&(t<l.length&&zn(n,_e(l.id.client,l.id.clock+t)),t-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&zn(n,_e(l.id.client,l.id.clock+r)),l.delete(n),r-=l.length),l=l.right;if(r>0)throw Xm();e._searchMarker&&gs(e._searchMarker,i,-s+r)},Ko=(n,e,t)=>{const r=e._map.get(t);r!==void 0&&r.delete(n)},Bu=(n,e,t,r)=>{const i=e._map.get(t)||null,s=n.doc,o=s.clientID;let l;if(r==null)l=new ii([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new ii([r]);break;case Uint8Array:l=new Dl(r);break;case Bn:l=new Ll(r);break;default:if(r instanceof Ue)l=new Jn(r);else throw new Error("Unexpected content type")}new Je(_e(o,it(s.store,o)),i,i&&i.lastId,null,null,e,t,l).integrate(n,0)},zu=(n,e)=>{n.doc??Ve();const t=n._map.get(e);return t!==void 0&&!t.deleted?t.content.getContent()[t.length-1]:void 0},t_=n=>{const e={};return n.doc??Ve(),n._map.forEach((t,r)=>{t.deleted||(e[r]=t.content.getContent()[t.length-1])}),e},n_=(n,e)=>{n.doc??Ve();const t=n._map.get(e);return t!==void 0&&!t.deleted},uv=(n,e)=>{const t={};return n._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&jr(s,e)&&(t[i]=s.content.getContent()[s.length-1])}),t},Gs=n=>(n.doc??Ve(),Pw(n._map.entries(),e=>!e[1].deleted));class dv extends $l{}class Yi extends Ue{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Yi;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Yi}clone(){const e=new Yi;return e.insert(0,this.toArray().map(t=>t instanceof Ue?t.clone():t)),e}get length(){return this.doc??Ve(),this._length}_callObserver(e,t){super._callObserver(e,t),Fl(this,e,new dv(this,e))}insert(e,t){this.doc!==null?he(this.doc,r=>{Qm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){this.doc!==null?he(this.doc,t=>{cv(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc!==null?he(this.doc,r=>{e_(r,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return Zm(this,e)}toArray(){return Ym(this)}slice(e=0,t=this.length){return Vm(this,e,t)}toJSON(){return this.map(e=>e instanceof Ue?e.toJSON():e)}map(e){return qm(this,e)}forEach(e){ps(this,e)}[Symbol.iterator](){return av(this)}_write(e){e.writeTypeRef(Sv)}}class fv extends $l{constructor(e,t,r){super(e,t),this.keysChanged=r}}class yt extends Ue{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new yt}clone(){const e=new yt;return this.forEach((t,r)=>{e.set(r,t instanceof Ue?t.clone():t)}),e}_callObserver(e,t){Fl(this,e,new fv(this,e,t))}toJSON(){this.doc??Ve();const e={};return this._map.forEach((t,r)=>{if(!t.deleted){const i=t.content.getContent()[t.length-1];e[r]=i instanceof Ue?i.toJSON():i}}),e}get size(){return[...Gs(this)].length}keys(){return ka(Gs(this),e=>e[0])}values(){return ka(Gs(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return ka(Gs(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Ve(),this._map.forEach((t,r)=>{t.deleted||e(t.content.getContent()[t.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?he(this.doc,t=>{Ko(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return zu(this,e)}has(e){return n_(this,e)}clear(){this.doc!==null?he(this.doc,e=>{this.forEach(function(t,r,i){Ko(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(Cv)}}const Nn=(n,e)=>n===e||typeof n=="object"&&typeof e=="object"&&n&&e&&zC(n,e);class Cc{constructor(e,t,r,i){this.left=e,this.right=t,this.index=r,this.currentAttributes=i}forward(){this.right===null&&pn(),this.right.content.constructor===De?this.right.deleted||Ei(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const Th=(n,e,t)=>{for(;e.right!==null&&t>0;)e.right.content.constructor===De?e.right.deleted||Ei(e.currentAttributes,e.right.content):e.right.deleted||(t<e.right.length&&zn(n,_e(e.right.id.client,e.right.id.clock+t)),e.index+=e.right.length,t-=e.right.length),e.left=e.right,e.right=e.right.right;return e},Vs=(n,e,t,r)=>{const i=new Map,s=r?Il(e,t):null;if(s){const o=new Cc(s.p.left,s.p,s.index,i);return Th(n,o,t-s.index)}else{const o=new Cc(null,e._start,0,i);return Th(n,o,t)}},r_=(n,e,t,r)=>{for(;t.right!==null&&(t.right.deleted===!0||t.right.content.constructor===De&&Nn(r.get(t.right.content.key),t.right.content.value));)t.right.deleted||r.delete(t.right.content.key),t.forward();const i=n.doc,s=i.clientID;r.forEach((o,l)=>{const a=t.left,c=t.right,u=new Je(_e(s,it(i.store,s)),a,a&&a.lastId,c,c&&c.id,e,null,new De(l,o));u.integrate(n,0),t.right=u,t.forward()})},Ei=(n,e)=>{const{key:t,value:r}=e;r===null?n.delete(t):n.set(t,r)},i_=(n,e)=>{for(;n.right!==null;){if(!(n.right.deleted||n.right.content.constructor===De&&Nn(e[n.right.content.key]??null,n.right.content.value)))break;n.forward()}},s_=(n,e,t,r)=>{const i=n.doc,s=i.clientID,o=new Map;for(const l in r){const a=r[l],c=t.currentAttributes.get(l)??null;if(!Nn(c,a)){o.set(l,c);const{left:u,right:d}=t;t.right=new Je(_e(s,it(i.store,s)),u,u&&u.lastId,d,d&&d.id,e,null,new De(l,a)),t.right.integrate(n,0),t.forward()}}return o},Na=(n,e,t,r,i)=>{t.currentAttributes.forEach((f,h)=>{i[h]===void 0&&(i[h]=null)});const s=n.doc,o=s.clientID;i_(t,i);const l=s_(n,e,t,i),a=r.constructor===String?new yn(r):r instanceof Ue?new Jn(r):new ki(r);let{left:c,right:u,index:d}=t;e._searchMarker&&gs(e._searchMarker,t.index,a.getLength()),u=new Je(_e(o,it(s.store,o)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(n,0),t.right=u,t.index=d,t.forward(),r_(n,e,t,l)},Nh=(n,e,t,r,i)=>{const s=n.doc,o=s.clientID;i_(t,i);const l=s_(n,e,t,i);e:for(;t.right!==null&&(r>0||l.size>0&&(t.right.deleted||t.right.content.constructor===De));){if(!t.right.deleted)switch(t.right.content.constructor){case De:{const{key:a,value:c}=t.right.content,u=i[a];if(u!==void 0){if(Nn(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}t.right.delete(n)}else t.currentAttributes.set(a,c);break}default:r<t.right.length&&zn(n,_e(t.right.id.client,t.right.id.clock+r)),r-=t.right.length;break}t.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
|
|
38
|
-
`;t.right=new
|
|
39
|
-
`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Na(r,this,i,l,o.attributes||{})}else o.retain!==void 0?Nh(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&Ah(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,r){this.doc??Ve();const i=[],s=new Map,o=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;s.forEach((g,p)=>{f=!0,d[p]=g});const h={insert:l};f&&(h.attributes=d),i.push(h),l=""}}const u=()=>{for(;a!==null;){if(jr(a,e)||t!==void 0&&jr(a,t))switch(a.content.constructor){case yn:{const d=s.get("ychange");e!==void 0&&!jr(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),s.set("ychange",r?r("removed",a.id):{type:"removed"})):t!==void 0&&!jr(a,t)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),s.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),s.delete("ychange")),l+=a.content.str;break}case Jn:case ki:{c();const d={insert:a.content.getContent()[0]};if(s.size>0){const f={};d.attributes=f,s.forEach((h,g)=>{f[g]=h})}i.push(d);break}case De:jr(a,e)&&(c(),Ei(s,a.content));break}a=a.right}c()};return e||t?he(o,d=>{e&&xc(d,e),t&&xc(d,t),u()},"cleanup"):u(),i}insert(e,t,r){if(t.length<=0)return;const i=this.doc;i!==null?he(i,s=>{const o=Vs(s,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),Na(s,this,o,t,r)}):this._pending.push(()=>this.insert(e,t,r))}insertEmbed(e,t,r){const i=this.doc;i!==null?he(i,s=>{const o=Vs(s,this,e,!r);Na(s,this,o,t,r||{})}):this._pending.push(()=>this.insertEmbed(e,t,r||{}))}delete(e,t){if(t===0)return;const r=this.doc;r!==null?he(r,i=>{Ah(i,Vs(i,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,r){if(t===0)return;const i=this.doc;i!==null?he(i,s=>{const o=Vs(s,this,e,!1);o.right!==null&&Nh(s,this,o,t,r)}):this._pending.push(()=>this.format(e,t,r))}removeAttribute(e){this.doc!==null?he(this.doc,t=>{Ko(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return zu(this,e)}getAttributes(){return t_(this)}_write(e){e.writeTypeRef(wv)}}class Aa{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Ve()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===_n||t.constructor===ri)&&t._start!==null)e=t._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class ri extends Ue{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ri}clone(){const e=new ri;return e.insert(0,this.toArray().map(t=>t instanceof Ue?t.clone():t)),e}get length(){return this.doc??Ve(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Aa(this,e)}querySelector(e){e=e.toUpperCase();const r=new Aa(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),ti(new Aa(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Fl(this,e,new _v(this,t,e))}toString(){return qm(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),ps(this,s=>{i.insertBefore(s.toDOM(e,t,r),null)}),i}insert(e,t){this.doc!==null?he(this.doc,r=>{Qm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)he(this.doc,r=>{const i=e&&e instanceof Ue?e._item:e;Uo(r,this,i,t)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Pn("Reference item not found");r.splice(i,0,...t)}}delete(e,t=1){this.doc!==null?he(this.doc,r=>{e_(r,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Ym(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Zm(this,e)}slice(e=0,t=this.length){return Vm(this,e,t)}forEach(e){ps(this,e)}_write(e){e.writeTypeRef(Ev)}}class _n extends ri{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new _n(this.nodeName)}clone(){const e=new _n(this.nodeName),t=this.getAttributes();return PC(t,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Ue?r.clone():r)),e}toString(){const e=this.getAttributes(),t=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const a=r[l];t.push(a+'="'+e[a]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=t.length>0?" "+t.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?he(this.doc,t=>{Ko(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?he(this.doc,r=>{Bu(r,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return zu(this,e)}hasAttribute(e){return n_(this,e)}getAttributes(e){return e?uv(this,e):t_(this)}toDOM(e=document,t={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const l=s[o];typeof l=="string"&&i.setAttribute(o,l)}return ps(this,o=>{i.appendChild(o.toDOM(e,t,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(vv),e.writeKey(this.nodeName)}}class _v extends $l{constructor(e,t,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class Un extends ms{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Un}clone(){const e=new Un;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const t=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,l)=>o.key<l.key?-1:1),t.push({nodeName:i,attrs:s})}t.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<t.length;i++){const s=t[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const l=s.attrs[o];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=t.length-1;i>=0;i--)r+=`</${t[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(kv)}}class l_{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Ft()}mergeWith(e){return!1}write(e,t,r){throw Ft()}integrate(e,t){throw Ft()}}const yv=0;class En extends l_{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Wm(e.doc.store,this)}write(e,t){e.writeInfo(yv),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Dl{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Dl(this.content)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class Wo{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Wo(this.len)}splice(e){const t=new Wo(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){zm(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const bv=(n,e)=>new Bn({guid:n,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Ll{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ll(bv(this.doc.guid,this.opts))}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class ki{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ki(this.embed)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class De{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new De(this.key,this.value)}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){const r=t.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const xv=Po("node_env")==="development";class ii{constructor(e){this.arr=e,xv&&hm(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ii(this.arr)}splice(e){const t=new ii(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const r=this.arr.length;e.writeLen(r-t);for(let i=t;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}class yn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new yn(this.str)}splice(e){const t=new yn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}}const Sv=0,Cv=1,wv=2,vv=3,Ev=4,kv=6;class Jn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Jn(this.type._copy())}splice(e){throw Ft()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const a_=(n,e,t)=>{const{client:r,clock:i}=e.id,s=new Je(_e(r,i+t),e,_e(r,i+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=_e(e.redone.client,e.redone.clock+t)),e.right=s,s.right!==null&&(s.right.left=s),n._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=t,s};class Je extends l_{constructor(e,t,r,i,s,o,l,a){super(e,a.getLength()),this.origin=r,this.left=t,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?lh:0}set marker(e){(this.info&Sa)>0!==e&&(this.info^=Sa)}get marker(){return(this.info&Sa)>0}get keep(){return(this.info&oh)>0}set keep(e){this.keep!==e&&(this.info^=oh)}get countable(){return(this.info&lh)>0}get deleted(){return(this.info&xa)>0}set deleted(e){this.deleted!==e&&(this.info^=xa)}markDeleted(){this.info|=xa}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=it(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=it(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===io&&this.id.client!==this.parent.client&&this.parent.clock>=it(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=wh(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=zn(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===En||this.right&&this.right.constructor===En)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Je?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Je&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===io){const r=Ta(t,this.parent);r.constructor===En?this.parent=null:this.parent=r.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=wh(e,e.doc.store,_e(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),Js(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Js(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Ta(e.doc.store,i.origin)))s.has(Ta(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Wm(e.doc.store,this),this.content.integrate(e,this),Eh(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new En(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:_e(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Js(e.origin,this.lastId)&&this.right===e&&Js(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),zm(e.deleteSet,this.id.client,this.id.clock,this.length),Eh(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw pn();this.content.gc(e),t?ev(e,this,new En(this.id,this.length)):this.content=new Wo(this.length)}write(e,t){const r=t>0?_e(this.id.client,this.id.clock+t-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&lC|(r===null?0:Lo)|(i===null?0:cm)|(s===null?0:oC);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=Zw(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===io?(e.writeParentInfo(!1),e.writeLeftID(l)):pn();s!==null&&e.writeString(s)}this.content.write(e,t)}}const c_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},u_="__ $YJS$ __";c_[u_]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");c_[u_]=!0;function Be(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Tv(n,e,t){const r=n.length,i=e.length;let s=0,o=0;for(;s<r&&s<i&&n[s]===e[s]&&s<t;)s++;for(;o+s<r&&o+s<i&&n[r-o-1]===e[i-o-1];)o++;for(;o+s<r&&o+s<i&&n[s]===e[s];)s++;return{index:s,insert:e.slice(s,i-o),remove:r-s-o}}class er{_xmlElem;_key;_parent;_type;constructor(e,t,r){this._key="",this._xmlElem=e,this._parent=t,this._type=r}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return V(t)?t:null}getNode(){const e=q(this._key);return V(e)?e:null}getSharedType(){return this._xmlElem}getType(){return this._type}getKey(){return this._key}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}syncPropertiesFromLexical(e,t,r){const i=this.getPrevNode(r);Wu(e,this._xmlElem,i,t)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Be(83),Ku(e,this._xmlElem,r,t)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function d_(n,e,t){const r=new er(n,e,t);return n._collabNode=r,r}class Ui{_map;_key;_parent;_type;constructor(e,t){this._key="",this._map=e,this._parent=t,this._type="linebreak"}getNode(){const e=q(this._key);return ue(e)?e:null}getKey(){return this._key}getSharedType(){return this._map}getType(){return this._type}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function f_(n,e){const t=new Ui(n,e);return n._collabNode=t,t}class xt{_map;_key;_parent;_text;_type;_normalized;constructor(e,t,r,i){this._key="",this._map=e,this._parent=r,this._text=t,this._type=i,this._normalized=!1}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return D(t)?t:null}getNode(){const e=q(this._key);return D(e)?e:null}getSharedType(){return this._map}getType(){return this._type}getKey(){return this._key}getSize(){return this._text.length+(this._normalized?0:1)}getOffset(){return this._parent.getChildOffset(this)}spliceText(e,t,r){const i=this._parent._xmlText,s=this.getOffset()+1+e;t!==0&&i.delete(s,t),r!==""&&i.insert(s,r)}syncPropertiesAndTextFromLexical(e,t,r){const i=this.getPrevNode(r),s=t.__text;if(Wu(e,this._map,i,t),i!==null){const o=i.__text;o!==s&&((function(l,a,c,u){const d=O();let f=u.length;if(N(d)&&d.isCollapsed()){const g=d.anchor;g.key===a&&(f=g.offset)}const h=Tv(c,u,f);l.spliceText(h.index,h.remove,h.insert)})(this,t.__key,o,s),this._text=s)}}syncPropertiesAndTextFromYjs(e,t){const r=this.getNode();r===null&&Be(84),Ku(e,this._map,r,t);const i=this._text;r.__text!==i&&r.setTextContent(i)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function h_(n,e,t,r){const i=new xt(n,e,t,r);return n._collabNode=i,i}class rn{_key;_children;_xmlText;_type;_parent;constructor(e,t,r){this._key="",this._children=[],this._xmlText=e,this._type=r,this._parent=t}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return A(t)?t:null}getNode(){const e=q(this._key);return A(e)?e:null}getSharedType(){return this._xmlText}getType(){return this._type}getKey(){return this._key}isEmpty(){return this._children.length===0}getSize(){return 1}getOffset(){const e=this._parent;return e===null&&Be(90),e.getChildOffset(this)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Be(91),Ku(e,this._xmlText,r,t)}applyChildrenYjsDelta(e,t){const r=this._children;let i=0,s=null;for(let o=0;o<t.length;o++){const l=t[o],a=l.insert,c=l.delete;if(l.retain!=null)i+=l.retain;else if(typeof c=="number"){let u=c;for(;u>0;){const{node:d,nodeIndex:f,offset:h,length:g}=Oa(this,i,!1);if(d instanceof rn||d instanceof Ui||d instanceof er)r.splice(f,1),u-=1;else{if(!(d instanceof xt))break;{const p=Math.min(u,g),m=f!==0?r[f-1]:null,b=d.getSize();if(h===0&&g===b){r.splice(f,1);const _=Ii(d._text,h,p-1,"");_.length>0&&(m instanceof xt?m._text+=_:this._xmlText.delete(h,_.length))}else d._text=Ii(d._text,h,p,"");u-=p}}}}else{if(a==null)throw new Error("Unexpected delta format");if(typeof a=="string"){const{node:u,offset:d}=Oa(this,i,!0);u instanceof xt?u._text=Ii(u._text,d,0,a):this._xmlText.delete(d,a.length),i+=a.length}else{const u=a,{node:d,nodeIndex:f,length:h}=Oa(this,i,!1),g=p_(e,u,this);if(d instanceof xt&&h>0&&h<d._text.length){const p=d._text,m=p.length-h;d._text=Ii(p,m,h,""),r.splice(f+1,0,g),s=Ii(p,0,m,"")}else r.splice(f,0,g);s!==null&&g instanceof xt&&(g._text=s+g._text,s=null),i+=1}}}}syncChildrenFromYjs(e){const t=this.getNode();t===null&&Be(92);const r=t.__key,i=or(t,null),s=i.length,o=this._children,l=o.length,a=e.collabNodeMap,c=new Set;let u,d,f=0,h=null;l!==s&&(d=t.getWritable());for(let g=0;g<l;g++){const p=i[f],m=o[g],b=m.getNode(),_=m._key;if(b!==null&&p===_){const y=D(b);if(c.add(p),y)if(m._key=p,m instanceof rn){const S=m._xmlText;m.syncPropertiesFromYjs(e,null),m.applyChildrenYjsDelta(e,S.toDelta()),m.syncChildrenFromYjs(e)}else m instanceof xt?m.syncPropertiesAndTextFromYjs(e,null):m instanceof er?m.syncPropertiesFromYjs(e,null):m instanceof Ui||Be(93);h=b,f++}else{if(u===void 0){u=new Set;for(let C=0;C<l;C++){const x=o[C]._key;x!==""&&u.add(x)}}if(b!==null&&p!==void 0&&!u.has(p)){const C=Qn(p);jt(C),g--,f++;continue}d=t.getWritable();const y=Rv(e,m,r),S=y.__key;if(a.set(S,m),h===null){const C=d.getFirstChild();if(d.__first=S,C!==null){const x=C.getWritable();x.__prev=S,y.__next=x.__key}}else{const C=h.getWritable(),x=h.getNextSibling();if(C.__next=S,y.__prev=h.__key,x!==null){const v=x.getWritable();v.__prev=S,y.__next=v.__key}}g===l-1&&(d.__last=S),d.__size++,h=y}}for(let g=0;g<s;g++){const p=i[g];if(!c.has(p)){const m=Qn(p),b=e.collabNodeMap.get(p);b!==void 0&&b.destroy(e),jt(m)}}}syncPropertiesFromLexical(e,t,r){Wu(e,this._xmlText,this.getPrevNode(r),t)}_syncChildFromLexical(e,t,r,i,s,o){const l=this._children[t],a=Qn(r);l instanceof rn&&A(a)?(l.syncPropertiesFromLexical(e,a,i),l.syncChildrenFromLexical(e,a,i,s,o)):l instanceof xt&&D(a)?l.syncPropertiesAndTextFromLexical(e,a,i):l instanceof er&&V(a)&&l.syncPropertiesFromLexical(e,a,i)}syncChildrenFromLexical(e,t,r,i,s){const o=this.getPrevNode(r),l=o===null?[]:or(o,r),a=or(t,null),c=l.length-1,u=a.length-1,d=e.collabNodeMap;let f,h,g=0,p=0;for(;g<=c&&p<=u;){const _=l[g],y=a[p];if(_===y)this._syncChildFromLexical(e,p,y,r,i,s),g++,p++;else{f===void 0&&(f=new Set(l)),h===void 0&&(h=new Set(a));const S=h.has(_),C=f.has(y);if(S){const x=Oh(e,Qn(y),this);d.set(y,x),C?(this.splice(e,p,1,x),g++,p++):(this.splice(e,p,0,x),p++)}else this.splice(e,p,1),g++}}const m=g>c,b=p>u;if(m&&!b)for(;p<=u;++p){const _=a[p],y=Oh(e,Qn(_),this);this.append(y),d.set(_,y)}else if(b&&!m)for(let _=this._children.length-1;_>=p;_--)this.splice(e,_,1)}append(e){const t=this._xmlText,r=this._children,i=r[r.length-1],s=i!==void 0?i.getOffset()+i.getSize():0;if(e instanceof rn)t.insertEmbed(s,e._xmlText);else if(e instanceof xt){const o=e._map;o.parent===null&&t.insertEmbed(s,o),t.insert(s+1,e._text)}else e instanceof Ui?t.insertEmbed(s,e._map):e instanceof er&&t.insertEmbed(s,e._xmlElem);this._children.push(e)}splice(e,t,r,i){const s=this._children,o=s[t];if(o===void 0)return i===void 0&&Be(94),void this.append(i);const l=o.getOffset();l===-1&&Be(95);const a=this._xmlText;if(r!==0&&a.delete(l,o.getSize()),i instanceof rn)a.insertEmbed(l,i._xmlText);else if(i instanceof xt){const c=i._map;c.parent===null&&a.insertEmbed(l,c),a.insert(l+1,i._text)}else i instanceof Ui?a.insertEmbed(l,i._map):i instanceof er&&a.insertEmbed(l,i._xmlElem);if(r!==0){const c=s.slice(t,t+r);for(let u=0;u<c.length;u++)c[u].destroy(e)}i!==void 0?s.splice(t,r,i):s.splice(t,r)}getChildOffset(e){let t=0;const r=this._children;for(let i=0;i<r.length;i++){const s=r[i];if(s===e)return t;t+=s.getSize()}return-1}destroy(e){const t=e.collabNodeMap,r=this._children;for(let i=0;i<r.length;i++)r[i].destroy(e);t.get(this._key)===this&&t.delete(this._key)}}function Uu(n,e,t){const r=new rn(n,e,t);return n._collabNode=r,r}function Nv(n,e,t,r,i){t==null&&Be(81);const s={clientID:t.clientID,cursors:new Map,cursorsContainer:null,doc:t,docMap:r,editor:n,excludedProperties:i||new Map,id:e,nodeProperties:new Map};return(function(o){const{editor:l,nodeProperties:a}=o;l.update(()=>{l._nodes.forEach(c=>{const u=new c.klass,d={};for(const[f,h]of Object.entries(u))g_(f,u,o)||(d[f]=h);a.set(u.__type,Object.freeze(d))})})})(s),s}function Av(n,e,t,r,i,s){r==null&&Be(81);const o=Uu(r.get("root",Un),null,"root");return o._key="root",{...Nv(n,t,r,i,s),collabNodeMap:new Map,root:o}}function Ov(n){return Object.hasOwn(n,"collabNodeMap")}const Mv=new Set(["__key","__parent","__next","__prev","__state"]),$v=new Set(["__first","__last","__size"]),Iv=new Set(["__cachedText"]),Fv=new Set(["__text"]);function g_(n,e,t){if(Mv.has(n)||typeof e[n]=="function")return!0;if(D(e)){if(Fv.has(n))return!0}else if(A(e)&&($v.has(n)||be(e)&&Iv.has(n)))return!0;const r=e.constructor,i=t.excludedProperties.get(r);return i!=null&&i.has(n)}function Dv(n,e){const t=n.__type,{nodeProperties:r}=e,i=r.get(t);return i===void 0&&Be(330,t),i}function Oh(n,e,t){const r=e.__type;let i;if(A(e))i=Uu(new Un,t,r),i.syncPropertiesFromLexical(n,e,null),i.syncChildrenFromLexical(n,e,null,null,null);else if(D(e))i=h_(new yt,e.__text,t,r),i.syncPropertiesAndTextFromLexical(n,e,null);else if(ue(e)){const s=new yt;s.set("__type","linebreak"),i=f_(s,t)}else V(e)?(i=d_(new _n,t,r),i.syncPropertiesFromLexical(n,e,null)):Be(86);return i._key=e.__key,i}function Lv(n){const e=Rl(n,"__type");return typeof e!="string"&&e!==void 0&&Be(87),e}function p_(n,e,t){const r=e._collabNode;if(r===void 0){const i=n.editor._nodes,s=Lv(e);typeof s!="string"&&Be(87),i.get(s)===void 0&&Be(88,s);const o=e.parent,l=t===void 0&&o!==null?p_(n,o):t||null;if(l instanceof rn||Be(89),e instanceof Un)return Uu(e,l,s);if(e instanceof yt)return s==="linebreak"?f_(e,l):h_(e,"",l,s);if(e instanceof _n)return d_(e,l,s)}return r}function Rv(n,e,t){const r=e.getType(),i=n.editor._nodes.get(r);i===void 0&&Be(88,r);const s=new i.klass;if(s.__parent=t,e._key=s.__key,e instanceof rn){const o=e._xmlText;e.syncPropertiesFromYjs(n,null),e.applyChildrenYjsDelta(n,o.toDelta()),e.syncChildrenFromYjs(n)}else e instanceof xt?e.syncPropertiesAndTextFromYjs(n,null):e instanceof er&&e.syncPropertiesFromYjs(n,null);return n.collabNodeMap.set(s.__key,e),s}function Ku(n,e,t,r){const i=r===null?e instanceof yt?Array.from(e.keys()):e instanceof Un||e instanceof _n?Object.keys(e.getAttributes()):Object.keys(e):Array.from(r);let s;for(let o=0;o<i.length;o++){const l=i[o];if(g_(l,t,n)){l==="__state"&&Ov(n)&&(s||(s=t.getWritable()),Pv(e,s));continue}const a=t[l];let c=Rl(e,l);if(a!==c){if(c instanceof Bn){const u=n.docMap;a instanceof Bn&&u.delete(a.guid);const d=gi(),f=c.guid;d._key=f,u.set(f,c),c=d}s===void 0&&(s=t.getWritable()),s[l]=c}}}function Rl(n,e){return n instanceof yt?n.get(e):n instanceof Un||n instanceof _n?n.getAttribute(e):n[e]}function Mh(n,e,t){n instanceof yt?n.set(e,t):n.setAttribute(e,t)}function Pv(n,e){const t=Rl(n,"__state");t instanceof yt&&Jo(e).updateFromJSON(t.toJSON())}function Wu(n,e,t,r){const i=Object.keys(Dv(r,n)),s=n.editor.constructor;(function(o,l,a,c){const u=c.__state,d=Rl(l,"__state");if(!u)return;const[f,h]=u.getInternalState(),g=a&&a.__state,p=d instanceof yt?d:new yt;if(g===u)return;const[m,b]=g&&p.doc?g.getInternalState():[void 0,new Map];if(f)for(const[_,y]of Object.entries(f))m&&y!==m[_]&&p.set(_,y);for(const[_,y]of h)b.get(_)!==y&&p.set(_.key,_.unparse(y));d||Mh(l,"__state",p)})(0,e,t,r);for(let o=0;o<i.length;o++){const l=i[o],a=t===null?void 0:t[l];let c=r[l];if(a!==c){if(c instanceof s){const u=n.docMap;let d;if(a instanceof s){const g=a._key;d=u.get(g),u.delete(g)}const f=d||new Bn,h=f.guid;c._key=h,u.set(h,f),c=f,n.editor.update(()=>{r.markDirty()})}Mh(e,l,c)}}}function Ii(n,e,t,r){return n.slice(0,e)+r+n.slice(e+t)}function Oa(n,e,t){let r=0,i=0;const s=n._children,o=s.length;for(;i<o;i++){const l=s[i],a=r;if(r+=l.getSize(),(t?r>=e:r>e)&&l instanceof xt){let c=e-a-1;return c<0&&(c=0),{length:r-e,node:l,nodeIndex:i,offset:c}}if(r>e)return{length:0,node:l,nodeIndex:i,offset:a};if(i===o-1)return{length:0,node:null,nodeIndex:i+1,offset:a+1}}return{length:0,node:null,nodeIndex:0,offset:0}}Tc("ychange",{isEqual:(n,e)=>n===e,parse:n=>n??null});async function m_(){return hb}async function Pl(n){return ox(n)}async function Bl(n){return mS(n)}async function zl(n,e){const t=qp(),r=e?.delay??300;return Yp(n,t,r)}async function Ul(n){return()=>{}}async function Kl(n){return typeof da=="function"?typeof hf=="function"?pt(da(n),hf(n)):da(n):pt(n.registerCommand(xi,()=>(fa(n,"number"),!0),G),n.registerCommand(bi,()=>(fa(n,"bullet"),!0),G),n.registerCommand(xl,()=>(fa(n,"check"),!0),G),n.registerCommand(pu,()=>(px(n),!0),G))}async function Wl(n){return n.registerCommand(lc,e=>(e===null||typeof e=="string"?ha(e):ha(e.url,e),!0),G)}async function Bv(n,e,t){const r=e?.trigger||"/";let i=!1,s=null,o=0;const l=()=>n.getEditorState().read(()=>{const p=O();if(!N(p)||!p.isCollapsed())return!1;const m=p.anchor,b=m.getNode();if(!D(b))return!1;const _=b.getTextContent(),y=m.offset;if(y===0||_[y-1]!==r)return!1;if(y===1)return!0;const C=_[y-2];return!!/\s/.test(C)}),a=()=>s?n.getEditorState().read(()=>{if(!s)return"";const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return"";const b=O();if(!N(b))return"";const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return"";const S=_.offset;return S<=m?"":p.slice(m+1,S)}):"",c=()=>{n.getEditorState().read(()=>{const p=O();if(N(p)){const m=p.anchor,b=m.getNode();if(D(b)){s=b,o=m.offset-1,i=!0;const _={isActive:!0,filterText:"",anchorNode:s,anchorOffset:o};t?.onTrigger?.(_,d),t?.onUpdate?.(_,d)}}})},u=()=>{i&&(i=!1,s=null,o=0,t?.onDismiss?.())},d=()=>{s&&n.update(()=>{if(!s)return;const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return;const b=O();if(!N(b))return;const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return;const S=_.offset,C=p.slice(0,m),x=p.slice(S);s.setTextContent(C+x);const v=O();N(v)&&(v.anchor.set(s.getKey(),m,"text"),v.focus.set(s.getKey(),m,"text"))})},f=()=>{if(!i)return;const m={isActive:!0,filterText:a(),anchorNode:s,anchorOffset:o};t?.onUpdate?.(m,d)},h=n.registerMutationListener(Ye,p=>{if(!i&&l()){c();return}i&&(s&&!p.has(s.getKey())?f():u())}),g=pt(n.registerUpdateListener(({editorState:p})=>{p.read(()=>{if(!i)return;const m=O();if(!N(m)){u();return}const b=m.anchor,_=b.getNode();if(!s||_.getKey()!==s.getKey()){u();return}const S=s.getTextContent().indexOf(r,o);if(S===-1||b.offset<=S){u();return}})}),n.registerCommand(dr,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(dn,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(Dn,p=>i?(p?.preventDefault(),!0):!1,G),n.registerCommand(ui,p=>i?(p?.preventDefault(),u(),!0):!1,G));return()=>{u(),h(),g()}}function zv(n,e,t){t(),e.handler(n),n.focus()}const Uv=z("TOGGLE_SLASH_COMMAND_PALETTE"),Ms=z("INSERT_HORIZONTAL_RULE_COMMAND"),Kv=z("INSERT_IMAGE_COMMAND");function jl(n){return n.registerCommand(Ms,()=>{const e=O();if(!N(e))return!1;if(e.focus.getNode()!==null){const r=Ns();e.insertNodes([r]);const i=H();r.insertAfter(i),i.selectStart()}return!0},G)}const __={dependencies:[Ir],export:n=>Vp(n)?"---":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Ns();if(r)n.replace(i);else{n.replace(i);const s=H();i.insertAfter(s),s.selectStart()}},type:"element"},ju=[...wu,__];async function wt(n){let e="";return n.getEditorState().read(()=>{e=qS(ju)}),e}async function Kn(n,e){n.update(()=>{YS(e,ju)})}async function y_(){return ju}const Hu=Object.freeze(Object.defineProperty({__proto__:null,exportToMarkdown:wt,getMarkdownTransformers:y_,importFromMarkdown:Kn},Symbol.toStringTag,{value:"Module"}));async function vt(n){let e="";return n.getEditorState().read(()=>{e=fp(n)}),e}async function Wn(n,e){n.update(()=>{const r=new DOMParser().parseFromString(e,"text/html"),i=dp(n,r);fe().clear(),nl(i)})}const Ju=Object.freeze(Object.defineProperty({__proto__:null,exportToHtml:vt,importFromHtml:Wn},Symbol.toStringTag,{value:"Module"}));async function Wv(n,e,t){let r,i,s;switch(e){case"markdown":r=await wt(n),i="text/markdown",s="md";break;case"html":r=await vt(n),i="text/html",s="html";break;case"json":r=JSON.stringify(n.getEditorState().toJSON(),null,2),i="application/json",s="json";break}const o=new Blob([r],{type:i}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=t??`document.${s}`,a.click(),URL.revokeObjectURL(l)}async function jv(n,e,t){const r=await new Promise((s,o)=>{const l=new FileReader;l.onload=()=>s(l.result),l.onerror=()=>o(l.error),l.readAsText(e)});switch(t??Hv(e.name)){case"markdown":{const{importFromMarkdown:s}=await Promise.resolve().then(()=>Hu);await s(n,r);break}case"html":{const{importFromHtml:s}=await Promise.resolve().then(()=>Ju);await s(n,r);break}case"json":{const s=n.parseEditorState(r);n.setEditorState(s);break}}}function Hv(n){return n.endsWith(".md")||n.endsWith(".markdown")?"markdown":n.endsWith(".html")||n.endsWith(".htm")?"html":"json"}async function Hl(n,e){return typeof vf=="function"?vf(n):()=>{}}async function Jv(n,e=3,t=3){n.dispatchCommand(Ts,{rows:String(e),columns:String(t),includeHeaders:!0})}async function Gv(n,e){return typeof Fo=="function"?Fo(n):()=>{}}async function Vv(n,e){return typeof Fo=="function"?Fo(n):()=>{}}const Yv=/#[\w\u0590-\u05ff]+/;function qv(n){return new Cl(n)}async function Zv(n,e){const t=[],r=rS(n,i=>{const s=Yv.exec(i);return s?{start:s.index,end:s.index+s[0].length}:null},Cl,qv);if(Array.isArray(r)?t.push(...r):typeof r=="function"&&t.push(r),e?.onHashtagClick){const i=n.registerCommand(br,s=>{const o=s.target;if(o.classList.contains("bc-lexical-hashtag")){const l=o.textContent;if(l)return e.onHashtagClick(l.replace("#","")),!0}return!1},G);t.push(i)}return()=>{t.forEach(i=>i())}}const Xv=/((https?:\/\/(www\.)?|www\.)[^\s<>]+)/g,Qv=/([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/g,e0=[{pattern:Xv,urlTransformer:n=>n.startsWith("http")?n:`https://${n}`},{pattern:Qv,urlTransformer:n=>`mailto:${n}`}];async function t0(n,e){const t=e?.matchers??e0;return n.registerMutationListener(Ye,r=>{n.update(()=>{for(const[i,s]of r){if(s!=="created"&&s!=="updated")continue;const o=q(i);if(!o||!D(o))continue;const l=o.getTextContent();for(const a of t){const c=new RegExp(a.pattern.source,a.pattern.flags);let u;for(;(u=c.exec(l))!==null;)a.urlTransformer(u[0])}}})})}async function n0(n,e){const t=[];return e?.onMarkClick&&t.push(n.registerCommand(br,r=>{const i=r.target;if(i.classList.contains("bc-lexical-mark")){const s=i.dataset.markId;if(s)return e.onMarkClick(s,{id:s,type:i.dataset.markType||"annotation",data:{}}),!0}return!1},G)),()=>t.forEach(r=>r())}async function r0(n,e,t){n.update(()=>{const r=O();N(r)&&oS(r,r.isBackward(),e)})}async function i0(n,e){n.update(()=>{const r=fe().getAllTextNodes().filter(i=>{const s=i.getParent();return as(s)?lS(i,0)?.includes(e)??!1:!1});for(const i of r){const s=i.getParent();as(s)&&sS(s)}})}async function s0(n,e){const{maxLength:t,onOverflow:r}=e;return n.registerUpdateListener(({editorState:i})=>{i.read(()=>{const l=fe().getTextContent().length,a=l>t;r&&r(a,l)})})}async function Jl(n){return typeof ef=="function"?ef(n):()=>{}}async function Gl(n,e){const t=e.docMap??new Map,r=e.id??"lexical",i=e.doc.getText(r),s=Av(n,e.provider,i,e.doc,t),o=n.registerUpdateListener(()=>{});return()=>{o(),s&&typeof s.destroy=="function"&&s.destroy()}}function o0(n){let e={hasSelection:!1,selectedText:"",anchorOffset:0,focusOffset:0};return n.getEditorState().read(()=>{const t=O();N(t)&&(e={hasSelection:!t.isCollapsed(),selectedText:t.getTextContent(),anchorOffset:t.anchor.offset,focusOffset:t.focus.offset})}),e}function Gu(n){let e="";return n.getEditorState().read(()=>{e=fe().getTextContent()}),e}function l0(n){return Gu(n).length}function a0(n){const e=Gu(n).trim();return e?e.split(/\s+/).length:0}async function c0(){return eC}async function $s(n={}){const{nodes:e=[],plugins:t=[],onError:r}=n,s=(await m_()).createEditor({namespace:"BeatUIHeadless",nodes:e,onError:o=>{r?r(o,s):console.error("[BeatUI Headless]",o)},editable:!1});if(t.length>0)for(const o of t)o.register(s);return s}async function u0(n){const e=await $s(),{importFromMarkdown:t}=await Promise.resolve().then(()=>Hu);return await t(e,n),e.getEditorState().toJSON()}async function d0(n){const e=await $s(),{exportToMarkdown:t}=await Promise.resolve().then(()=>Hu),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}async function f0(n){const e=await $s(),{importFromHtml:t}=await Promise.resolve().then(()=>Ju);return await t(e,n),e.getEditorState().toJSON()}async function h0(n){const e=await $s(),{exportToHtml:t}=await Promise.resolve().then(()=>Ju),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}const b_=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",onError:c,onInput:u,onChange:d,onBlur:f,onReady:h}=n;return w.Use(vc.Theme,({appearance:g})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:p})=>wc.LinkPortal({id:"beatui-lexical-css",href:p})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,p=>!p):!0),i!=null?w.attr.class(w.Value.map(i,p=>p?"bc-lexical-editor--readonly":"")):null,w.WithElement(p=>{let m=null;const b=[];return(async()=>{try{const y=r??vl("bare"),S=wl(y),C=w.Value.get(t??"markdown"),x=gi({namespace:l,nodes:S,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:E=>{c?c(E,x):console.error("[BeatUI Lexical]",E)},editable:i?!w.Value.get(i):!0});m=x,x.setRootElement(p);const v=[];if(y.richText?v.push(Pl(x)):y.plainText&&v.push(Bl(x)),y.history){const E=typeof y.history=="object"?y.history:void 0;v.push(zl(x,E))}if(y.clipboard&&v.push(Ul(x)),y.list&&v.push(Kl(x)),y.link&&v.push(Wl(x)),y.yjs&&v.push(Gl(x,y.yjs)),y.dragon&&v.push(Jl(x)),y.table&&v.push(Hl(x)),(await Promise.all(v)).forEach(E=>{E&&b.push(E)}),b.push(jl(x)),e!=null){const E=w.Value.get(e);if(E!=null&&(E!==""||C==="json"&&typeof E=="object")){if(C==="markdown"&&typeof E=="string")await Kn(x,E);else if(C==="html"&&typeof E=="string")await Wn(x,E);else if(C==="json"&&typeof E=="object")try{const T=JSON.stringify(E),I=x.parseEditorState(T);x.setEditorState(I)}catch(T){console.error("[BeatUI] Failed to parse JSON editor state:",T),c&&c(T instanceof Error?T:new Error(String(T)),x)}}}b.push(x.registerUpdateListener(({editorState:E,dirtyElements:M,dirtyLeaves:T})=>{M.size===0&&T.size===0||u&&E.read(async()=>{if(C==="markdown"){const I=await wt(x);u(I,x)}else if(C==="html"){const I=await vt(x);u(I,x)}else C==="json"&&u(E.toJSON(),x)})})),e!=null&&b.push(w.Value.on(e,async E=>{if(E!=null){if(C==="markdown"&&typeof E=="string"){const M=await wt(x);E!==M&&await Kn(x,E)}else if(C==="html"&&typeof E=="string"){const M=await vt(x);E!==M&&await Wn(x,E)}else if(C==="json"&&typeof E=="object"){const M=JSON.stringify(x.getEditorState().toJSON()),T=JSON.stringify(E);if(M!==T){const I=x.parseEditorState(T);x.setEditorState(I)}}}})),i!=null&&b.push(w.Value.on(i,E=>{x.setEditable(!E)})),b.push(x.registerCommand(fi,()=>(f&&f(x),d&&x.getEditorState().read(async()=>{if(C==="markdown"){const E=await wt(x);d(E,x)}else if(C==="html"){const E=await vt(x);d(E,x)}else C==="json"&&d(x.getEditorState().toJSON(),x)}),!1),G)),b.push(g.on(E=>{const M=x.getRootElement();M&&(M.dataset.theme=E)})),h&&h(x)}catch(y){console.error("[BeatUI] Failed to initialize Lexical editor:",y);const S=p;S.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{b.forEach(y=>y())}catch{}try{m?.setRootElement(null)}catch{}})}))))};function x_(n,e,t){const r=(h,g)=>e.map(()=>{const p=n.value;return p?p.getEditorState().read(()=>{const m=O();return N(m)?h(m):g}):g}),i=h=>{const g=h.anchor.getNode();return g.getKey()==="root"?g:g.getTopLevelElementOrThrow()};return{withSelection:r,getAnchorElement:i,textFormatActive:h=>r(g=>g.hasFormat(h),!1),blockTypeActive:h=>r(g=>i(g).getType()===h,!1),listTypeActive:h=>r(g=>{const p=i(g).getParent();return J(p)&&p.getListType()===h},!1),headingActive:h=>e.map(()=>{const g=n.value;return g?g.getEditorState().read(()=>{const p=O();if(N(p)){const m=i(p);if(m.getType()==="heading")return g.getElementByKey(m.getKey())?.tagName===`H${h}`}return!1}):!1}),linkActive:()=>r(h=>{const g=h.anchor.getNode();return g.getParent()?.getType()==="link"||g.getType()==="link"},!1),dispatch:(h,g)=>()=>{const p=n.value;p&&(p.dispatchCommand(h,g),p.focus())},toggleBlock:(h,g)=>()=>{const p=n.value;p&&(p.update(()=>{const m=O();if(N(m)){const b=i(m);et(m,()=>b.getType()===h?H():g())}}),p.focus())},toggleLink:()=>{const h=n.value;h&&(h.getEditorState().read(()=>{const g=O();if(N(g)){const p=g.anchor.getNode();if(p.getParent()?.getType()==="link"||p.getType()==="link")h.dispatchCommand(lc,null);else{const _=prompt(t?.enterUrlMessage?.()??"Enter URL:");_&&h.dispatchCommand(lc,_)}}}),h.focus())}}}function S_(n,e){return t=>r=>ct.EditorToolbarButton({...r,display:t,disabled:n,size:e})}const g0=[{value:"Arial",label:"Arial"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Times New Roman",label:"Times New Roman"},{value:"Trebuchet MS",label:"Trebuchet MS"},{value:"Verdana",label:"Verdana"}],p0=[{value:"10px",label:"10"},{value:"12px",label:"12"},{value:"14px",label:"14"},{value:"16px",label:"16"},{value:"18px",label:"18"},{value:"20px",label:"20"},{value:"24px",label:"24"},{value:"30px",label:"30"},{value:"36px",label:"36"}];function C_({editor:n,stateUpdate:e,toolbar:t={},readOnly:r=w.signal(!1),size:i="sm"}){const{visibleGroups:s,hiddenGroups:o,maxHeadingLevel:l=3}=t,a=c=>!(o?.includes(c)||s&&!s.includes(c));return w.Use(nr.BeatUII18n,c=>w.Ensure(n,u=>{const d=u,f=c.$.lexical,h=w.signal(a("text-formatting")),g=w.signal(a("headings")),p=w.signal(a("lists")),m=w.signal(a("blocks")),b=w.signal(a("links")),_=w.signal(a("indent")),y=w.signal(a("tables")),S=w.signal(a("history")),C=w.signal(a("clipboard")),x=w.signal(a("font")),v=w.signal(a("color")),k=w.signal(a("clear-formatting")),{getAnchorElement:E,textFormatActive:M,blockTypeActive:T,listTypeActive:I,headingActive:K,linkActive:$,dispatch:R,toggleBlock:W,toggleLink:Z}=x_(d,e,{enterUrlMessage:()=>c.value.lexical.enterUrl}),Y=S_(r,i),se=()=>{const F=d.value;F&&(F.update(()=>{const U=O();N(U)&&et(U,()=>H())}),F.focus())},Ke=F=>{const U=d.value;U&&(U.update(()=>{const X=O();if(N(X)){const Gn=E(X),Is=`h${F}`,B_=U.getElementByKey(Gn.getKey());Gn.getType()==="heading"&&B_?.tagName===`H${F}`?et(X,()=>H()):et(X,()=>ft(Is))}}),U.focus())},qe=Y(h),j=Y(g),pe=Y(p),oe=Y(m),Ze=Y(b),Se=Y(_),We=Y(y),Xe=Y(k),bt=Y(S),Ce=Y(C),wn=()=>{const F=d.value;if(!F)return;const U=F.getRootElement();U&&(U.focus(),document.execCommand("copy"))},Ti=()=>{const F=d.value;if(!F)return;const U=F.getRootElement();U&&(U.focus(),document.execCommand("cut"))},Zt=()=>{const F=d.value;F&&navigator.clipboard.readText().then(U=>{F.update(()=>{const X=O();N(X)&&X.insertText(U)}),F.focus()}).catch(()=>{})},Ni=()=>{const F=d.value;F&&(F.update(()=>{const U=O();if(N(U))for(const X of U.getNodes())D(X)&&(X.setFormat(0),X.setStyle(""))}),F.focus())},Vl=()=>{const F=d.value;F&&(F.dispatchCommand(Ts,{rows:"3",columns:"3",includeHeaders:!0}),F.focus())},Vu={value:"",label:c.value.lexical.defaultOption},T_=[Vu,...t.fontFamilies??g0],N_=[Vu,...t.fontSizes??p0],A_=e.map(()=>{const F=d.value;return F?F.getEditorState().read(()=>{const U=O();return N(U)?zs(U,"font-family",""):""}):""}),O_=e.map(()=>{const F=d.value;return F?F.getEditorState().read(()=>{const U=O();return N(U)?zs(U,"font-size",""):""}):""}),M_=F=>{const U=d.value;U&&(U.update(()=>{const X=O();N(X)&&Bs(X,{"font-family":F||null})}),U.focus())},$_=F=>{const U=d.value;U&&(U.update(()=>{const X=O();N(X)&&Bs(X,{"font-size":F||null})}),U.focus())},I_=e.map(()=>{const F=d.value;return F?F.getEditorState().read(()=>{const U=O();return N(U)&&zs(U,"color","")||"#000000"}):"#000000"}),F_=e.map(()=>{const F=d.value;return F?F.getEditorState().read(()=>{const U=O();return N(U)&&zs(U,"background-color","")||"#ffffff"}):"#ffffff"}),D_=e.map(()=>{const F=d.value;return F?F.getEditorState().read(()=>{const U=O();if(N(U)){const X=E(U);return F.getElementByKey(X.getKey())?.style.backgroundColor||"#ffffff"}return"#ffffff"}):"#ffffff"}),L_=F=>{const U=d.value;U&&(U.update(()=>{const X=O();N(X)&&Bs(X,{color:F})}),U.focus())},R_=F=>{const U=d.value;U&&(U.update(()=>{const X=O();N(X)&&Bs(X,{"background-color":F})}),U.focus())},P_=F=>{const U=d.value;U&&(U.update(()=>{const X=O();if(N(X)){const Gn=E(X),Is=U.getElementByKey(Gn.getKey());Is&&(Is.style.backgroundColor=F)}}),U.focus())};return z_.Toolbar(w.attr.class("bc-lexical-toolbar"),w.When(x,()=>ct.EditorToolbarGroup({display:[x]},w.html.select(w.attr.class("bc-lexical-toolbar-select"),w.attr.title(f.map(F=>F.fontFamily)),w.attr.disabled(r),w.on.change(F=>M_(F.target.value)),...T_.map(F=>w.html.option(w.attr.value(F.value),w.attr.selected(A_.map(U=>U===F.value)),F.label))),w.html.select(w.attr.class("bc-lexical-toolbar-select"),w.attr.title(f.map(F=>F.fontSize)),w.attr.disabled(r),w.on.change(F=>$_(F.target.value)),...N_.map(F=>w.html.option(w.attr.value(F.value),w.attr.selected(O_.map(U=>U===F.value)),F.label))))),w.When(v,()=>ct.EditorToolbarGroup({display:[v]},w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title(f.map(F=>F.fontColor)),w.html.input(w.attr.type("color"),w.attr.value(I_),w.attr.disabled(r),w.on.input(F=>L_(F.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon"),"A")),w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title(f.map(F=>F.highlightColor)),w.html.input(w.attr.type("color"),w.attr.value(F_),w.attr.disabled(r),w.on.input(F=>R_(F.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--highlight"),"A")),w.html.label(w.attr.class("bc-lexical-toolbar-color"),w.attr.title(f.map(F=>F.backgroundColor)),w.html.input(w.attr.type("color"),w.attr.value(D_),w.attr.disabled(r),w.on.input(F=>P_(F.target.value))),w.html.span(w.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--bg"),"■")))),ct.EditorToolbarGroup({display:Array(5).fill(h)},qe({active:M("bold"),onClick:R(ve,"bold"),label:f.map(F=>F.bold),icon:"mdi:format-bold"}),qe({active:M("italic"),onClick:R(ve,"italic"),label:f.map(F=>F.italic),icon:"mdi:format-italic"}),qe({active:M("underline"),onClick:R(ve,"underline"),label:f.map(F=>F.underline),icon:"mdi:format-underline"}),qe({active:M("strikethrough"),onClick:R(ve,"strikethrough"),label:f.map(F=>F.strikethrough),icon:"mdi:format-strikethrough"}),qe({active:M("code"),onClick:R(ve,"code"),label:f.map(F=>F.code),icon:"mdi:code-tags"})),ct.EditorToolbarGroup({display:[k]},Xe({active:w.signal(!1),onClick:Ni,label:f.map(F=>F.clearFormatting),icon:"mdi:format-clear"})),ct.EditorToolbarGroup({display:[g,...Array(l).fill(g)]},j({active:T("paragraph"),onClick:se,label:f.map(F=>F.normal),icon:"mdi:format-paragraph"}),...Array.from({length:l},(F,U)=>{const X=U+1;return j({active:K(X),onClick:()=>Ke(X),label:f.map(Gn=>Gn.heading(X)),icon:`mdi:format-header-${X}`})})),ct.EditorToolbarGroup({display:Array(3).fill(p)},pe({active:I("bullet"),onClick:R(bi,void 0),label:f.map(F=>F.bulletList),icon:"mdi:format-list-bulleted"}),pe({active:I("number"),onClick:R(xi,void 0),label:f.map(F=>F.orderedList),icon:"mdi:format-list-numbered"}),pe({active:I("check"),onClick:R(xl,void 0),label:f.map(F=>F.checkList),icon:"mdi:format-list-checks"})),ct.EditorToolbarGroup({display:Array(2).fill(_)},Se({active:w.signal(!1),onClick:R(Ut,void 0),label:f.map(F=>F.indent),icon:"mdi:format-indent-increase"}),Se({active:w.signal(!1),onClick:R(sn,void 0),label:f.map(F=>F.outdent),icon:"mdi:format-indent-decrease"})),ct.EditorToolbarGroup({display:Array(3).fill(m)},oe({active:T("quote"),onClick:W("quote",yi),label:f.map(F=>F.blockquote),icon:"mdi:format-quote-close"}),oe({active:T("code"),onClick:W("code",St),label:f.map(F=>F.codeBlock),icon:"mdi:code-braces"}),oe({active:w.signal(!1),onClick:R(Ms,void 0),label:f.map(F=>F.horizontalRule),icon:"mdi:minus"})),ct.EditorToolbarGroup({display:[y]},We({active:w.signal(!1),onClick:Vl,label:f.map(F=>F.insertTable),icon:"mdi:table-plus"})),ct.EditorToolbarGroup({display:[b]},Ze({active:$(),onClick:Z,label:f.map(F=>F.link),icon:"mdi:link"})),ct.EditorToolbarGroup({display:Array(2).fill(S)},bt({active:w.signal(!1),onClick:R(ai,void 0),label:f.map(F=>F.undo),icon:"mdi:undo"}),bt({active:w.signal(!1),onClick:R(ci,void 0),label:f.map(F=>F.redo),icon:"mdi:redo"})),ct.EditorToolbarGroup({display:Array(3).fill(C)},Ce({active:w.signal(!1),onClick:Ti,label:f.map(F=>F.cut),icon:"mdi:content-cut"}),Ce({active:w.signal(!1),onClick:wn,label:f.map(F=>F.copy),icon:"mdi:content-copy"}),Ce({active:w.signal(!1),onClick:Zt,label:f.map(F=>F.paste),icon:"mdi:content-paste"})))}))}function w_({editor:n,stateUpdate:e,readOnly:t=w.signal(!1)}){const r=w.prop(!1),i=w.prop(0),s=w.prop(0),o=()=>{const p=n.value;if(!p){r.value=!1;return}p.getEditorState().read(()=>{const m=O();if(!N(m)){r.value=!1;return}let _=m.anchor.getNode(),y=null;for(;_;){if(ge(_)){y=_;break}if(_=_.getParent(),!_||_.getKey()==="root")break}if(!y){r.value=!1;return}const S=p.getElementByKey(y.getKey()),C=p.getRootElement();if(S&&C){const x=S.getBoundingClientRect(),v=C.closest(".bc-lexical-editor-container"),k=v?v.getBoundingClientRect():C.getBoundingClientRect();i.value=x.bottom-k.top+4,s.value=x.left-k.left}r.value=!0})};e.onChange(o);const l=()=>{const p=n.value;p&&(p.update(()=>{yf(!1)}),p.focus())},a=()=>{const p=n.value;p&&(p.update(()=>{yf(!0)}),p.focus())},c=()=>{const p=n.value;p&&(p.update(()=>{bf(!1)}),p.focus())},u=()=>{const p=n.value;p&&(p.update(()=>{bf(!0)}),p.focus())},d=()=>{const p=n.value;p&&(p.update(()=>{xx()}),p.focus())},f=()=>{const p=n.value;p&&(p.update(()=>{Sx()}),p.focus())},h=()=>{const p=n.value;p&&(p.update(()=>{const m=O();if(!N(m))return;const b=m.anchor.getNode(),_=bx(b);if(!_)return;Fp(_).remove()}),p.focus())},g=w.html.div(w.attr.class("bc-table-context-menu"),w.attr.role("menu"),w.style.position("absolute"),w.style.top(i.map(p=>`${p}px`)),w.style.left(s.map(p=>`${p}px`)),w.style.zIndex("1000"),w.style.backgroundColor("var(--color-surface)"),w.style.border("1px solid var(--color-border)"),w.style.borderRadius("var(--radius-md)"),w.style.boxShadow("0 2px 8px rgba(0, 0, 0, 0.15)"),w.style.padding("var(--spacing-xs)"),w.style.minWidth("180px"),w.WithElement(p=>{const m=_=>{if(_.key==="Escape"&&r.value){r.value=!1;const y=n.value;y&&y.focus()}},b=_=>{if(r.value&&!p.contains(_.target)){const y=n.value;if(y){const S=y.getRootElement();if(S&&S.contains(_.target))return}r.value=!1}};return document.addEventListener("keydown",m),document.addEventListener("mousedown",b),w.OnDispose(()=>{document.removeEventListener("keydown",m),document.removeEventListener("mousedown",b)})}),Yn("Insert row above",l,t),Yn("Insert row below",a,t),Yn("Insert column left",c,t),Yn("Insert column right",u,t),w.html.div(w.attr.class("bc-table-menu-separator"),w.style.height("1px"),w.style.backgroundColor("var(--color-border)"),w.style.margin("var(--spacing-xs) 0")),Yn("Delete row",d,t,"danger"),Yn("Delete column",f,t,"danger"),Yn("Delete table",h,t,"danger"));return w.When(r,()=>g)}function Yn(n,e,t,r="default"){return w.html.button(w.attr.class("bc-table-menu-button"),w.attr.type("button"),w.attr.role("menuitem"),w.attr.disabled(t),w.on.click(e),w.style.display("block"),w.style.width("100%"),w.style.padding("var(--spacing-xs) var(--spacing-sm)"),w.style.border("none"),w.style.backgroundColor("transparent"),w.style.color(r==="danger"?"var(--color-danger-600)":"var(--color-neutral-900)"),w.style.textAlign("left"),w.style.cursor("pointer"),w.style.borderRadius("var(--radius-sm)"),w.style.fontSize("0.875rem"),w.style.transition("background-color 0.15s"),w.html.span(n))}const m0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="fixed",toolbar:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=w.prop(null),m=w.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:w.prop(w.Value.get(i)):w.prop(!1);return w.Use(vc.Theme,({appearance:y})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:S})=>wc.LinkPortal({id:"beatui-lexical-css",href:S})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),w.When(_.map(S=>!S),()=>C_({editor:p,stateUpdate:m,toolbar:c,readOnly:_,size:"sm"})),w_({editor:p,stateUpdate:m,readOnly:_}),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,S=>!S):!0),i!=null?w.attr.class(w.Value.map(i,S=>S?"bc-lexical-editor--readonly":"")):null,w.WithElement(S=>{let C=null;const x=[];return(async()=>{try{const k=r??vl("docked"),E=wl(k),M=w.Value.get(t??"markdown"),T=gi({namespace:l,nodes:E,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:$=>{u?u($,T):console.error("[BeatUI Lexical]",$)},editable:i?!w.Value.get(i):!0});C=T,p.set(T),T.setRootElement(S);const I=[];if(k.richText?I.push(Pl(T)):k.plainText&&I.push(Bl(T)),k.history){const $=typeof k.history=="object"?k.history:void 0;I.push(zl(T,$))}if(k.clipboard&&I.push(Ul(T)),k.list&&I.push(Kl(T)),k.link&&I.push(Wl(T)),k.yjs&&I.push(Gl(T,k.yjs)),k.dragon&&I.push(Jl(T)),k.table&&I.push(Hl(T)),(await Promise.all(I)).forEach($=>{$&&x.push($)}),x.push(jl(T)),x.push(T.registerCommand(oi,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:$,dirtyElements:R,dirtyLeaves:W})=>{(R.size>0||W.size>0)&&m.set(m.value+1),d&&(R.size>0||W.size>0)&&$.read(async()=>{if(M==="markdown"){const Z=await wt(T);d(Z,T)}else if(M==="html"){const Z=await vt(T);d(Z,T)}else M==="json"&&d($.toJSON(),T)})})),e!=null){const $=w.Value.get(e);if($!=null&&($!==""||M==="json"&&typeof $=="object")){if(M==="markdown"&&typeof $=="string")await Kn(T,$);else if(M==="html"&&typeof $=="string")await Wn(T,$);else if(M==="json"&&typeof $=="object")try{const W=JSON.stringify($),Z=T.parseEditorState(W);T.setEditorState(Z)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(w.Value.on(e,async $=>{if($!=null){if(M==="markdown"&&typeof $=="string"){const R=await wt(T);$!==R&&await Kn(T,$)}else if(M==="html"&&typeof $=="string"){const R=await vt(T);$!==R&&await Wn(T,$)}else if(M==="json"&&typeof $=="object"){const R=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify($);if(R!==W){const Z=T.parseEditorState(W);T.setEditorState(Z)}}}})),i!=null&&x.push(w.Value.on(i,$=>{T.setEditable(!$)})),x.push(T.registerCommand(fi,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(M==="markdown"){const $=await wt(T);f($,T)}else if(M==="html"){const $=await vt(T);f($,T)}else M==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on($=>{const R=T.getRootElement();R&&(R.dataset.theme=$)})),g&&g(T)}catch(k){console.error("[BeatUI] Failed to initialize Lexical editor:",k);const E=S;E.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{x.forEach(k=>k())}catch{}try{C?.setRootElement(null)}catch{}p.set(null)})}))))};function v_({editor:n,stateUpdate:e,groups:t=["text-formatting"],readOnly:r=w.signal(!1),size:i="sm"}){const s=w.prop(!1),o=w.prop(0),l=w.prop(0);return w.Use(nr.BeatUII18n,a=>w.Ensure(n,c=>{const u=c,d=a.$.lexical,f=v=>t.includes(v),{textFormatActive:h,linkActive:g,dispatch:p,toggleLink:m}=x_(u,e,{enterUrlMessage:()=>a.value.lexical.enterUrl}),_=S_(r,i)(w.signal(!0)),y=()=>{const v=u.value;if(!v){s.value=!1;return}const k=v.getRootElement();if(!k){s.value=!1;return}const E=window.getSelection();if(!E||E.rangeCount===0||E.isCollapsed){s.value=!1;return}const M=E.anchorNode;if(M&&!k.contains(M)){s.value=!1;return}const I=E.getRangeAt(0).getBoundingClientRect();if(I.width===0&&I.height===0){s.value=!1;return}const K=40,$=8;let R=I.top-K-$;const W=I.left+I.width/2;R<0&&(R=I.bottom+$),o.value=R,l.value=W,s.value=!0},S=e.onChange(y),C=()=>{y()};document.addEventListener("selectionchange",C);const x=w.html.div(w.attr.class("bc-floating-toolbar"),w.style.position("fixed"),w.style.top(o.map(v=>`${v}px`)),w.style.left(l.map(v=>`${v}px`)),w.style.transform("translateX(-50%)"),w.WithElement(v=>{const k=M=>{if(M.key==="Escape"&&s.value){s.value=!1;const T=u.value;T&&T.focus()}},E=M=>{if(s.value&&!v.contains(M.target)){const T=u.value;if(T){const I=T.getRootElement();if(I&&I.contains(M.target))return}s.value=!1}};return document.addEventListener("keydown",k),document.addEventListener("mousedown",E),w.OnDispose(()=>{S(),document.removeEventListener("keydown",k),document.removeEventListener("mousedown",E),document.removeEventListener("selectionchange",C)})}),...f("text-formatting")?[_({active:h("bold"),onClick:p(ve,"bold"),label:d.map(v=>v.bold),icon:"mdi:format-bold"}),_({active:h("italic"),onClick:p(ve,"italic"),label:d.map(v=>v.italic),icon:"mdi:format-italic"}),_({active:h("underline"),onClick:p(ve,"underline"),label:d.map(v=>v.underline),icon:"mdi:format-underline"}),_({active:h("strikethrough"),onClick:p(ve,"strikethrough"),label:d.map(v=>v.strikethrough),icon:"mdi:format-strikethrough"}),_({active:h("code"),onClick:p(ve,"code"),label:d.map(v=>v.code),icon:"mdi:code-tags"})]:[],...f("links")?[_({active:g(),onClick:m,label:d.map(v=>v.link),icon:"mdi:link"})]:[],...f("clipboard")?[_({active:w.signal(!1),onClick:()=>{const v=u.value;if(!v)return;const k=v.getRootElement();k&&(k.focus(),document.execCommand("cut"))},label:d.map(v=>v.cut),icon:"mdi:content-cut"}),_({active:w.signal(!1),onClick:()=>{const v=u.value;if(!v)return;const k=v.getRootElement();k&&(k.focus(),document.execCommand("copy"))},label:d.map(v=>v.copy),icon:"mdi:content-copy"}),_({active:w.signal(!1),onClick:()=>{const v=u.value;v&&navigator.clipboard.readText().then(k=>{v.update(()=>{const E=O();N(E)&&E.insertText(k)}),v.focus()}).catch(()=>{})},label:d.map(v=>v.paste),icon:"mdi:content-paste"})]:[]);return w.When(s,()=>x)}))}const _0=[{id:"heading1",label:"Heading 1",description:"Large section heading",icon:"mdi:format-header-1",keywords:["h1","heading","title"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h1"))})}},{id:"heading2",label:"Heading 2",description:"Medium section heading",icon:"mdi:format-header-2",keywords:["h2","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h2"))})}},{id:"heading3",label:"Heading 3",description:"Small section heading",icon:"mdi:format-header-3",keywords:["h3","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h3"))})}},{id:"bullet-list",label:"Bullet List",description:"Create a bulleted list",icon:"mdi:format-list-bulleted",keywords:["ul","unordered","bullets"],category:"Lists",handler:n=>{n.dispatchCommand(bi,void 0)}},{id:"ordered-list",label:"Ordered List",description:"Create a numbered list",icon:"mdi:format-list-numbered",keywords:["ol","numbered","1","2","3"],category:"Lists",handler:n=>{n.dispatchCommand(xi,void 0)}},{id:"quote",label:"Quote",description:"Insert a blockquote",icon:"mdi:format-quote-close",keywords:["blockquote","citation"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>yi())})}},{id:"code-block",label:"Code Block",description:"Insert a code block",icon:"mdi:code-braces",keywords:["code","pre","programming"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>St())})}},{id:"divider",label:"Divider",description:"Insert a horizontal rule",icon:"mdi:minus",keywords:["hr","horizontal","line","separator"],category:"Basic blocks",handler:n=>{n.dispatchCommand(Ms,void 0)}},{id:"table",label:"Table",description:"Insert a table",icon:"mdi:table",keywords:["table","grid","cells","rows","columns"],category:"Advanced",handler:n=>{n.dispatchCommand(Ts,{rows:"3",columns:"3",includeHeaders:!0})}}];function y0({commands:n,isVisible:e,filterText:t,position:r,onSelect:i,onDismiss:s}){const o=w.prop(0),l=t.map(f=>{const h=f.toLowerCase().trim();return h?n.filter(g=>[g.label.toLowerCase(),g.description?.toLowerCase()||"",...g.keywords?.map(m=>m.toLowerCase())||[]].join(" ").includes(h)):n});l.onChange(()=>{o.value=0});const a=f=>{const h=l.value;if(f>=0&&f<h.length){const g=h[f];i(g)}},c=f=>{if(!e.value)return;const g=l.value.length-1;switch(f.key){case"ArrowDown":f.preventDefault(),o.value=Math.min(o.value+1,g);break;case"ArrowUp":f.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":f.preventDefault(),a(o.value);break;case"Escape":f.preventDefault(),s();break}},u=(f,h)=>{const g=o.map(m=>m===h),p=`slash-cmd-${f.id}`;return w.html.div(w.attr.class("bc-slash-command-palette__item"),w.attr.id(p),w.attr.role("option"),w.aria.selected(g),w.WithElement(m=>{const b=()=>{o.value=h},_=()=>{a(h)};return m.addEventListener("mouseenter",b),m.addEventListener("click",_),w.OnDispose(()=>{m.removeEventListener("mouseenter",b),m.removeEventListener("click",_)})}),typeof f.icon=="string"?w.html.div(w.attr.class("bc-slash-command-palette__icon"),nr.Icon({icon:f.icon,size:"sm"})):f.icon,w.html.div(w.attr.class("bc-slash-command-palette__content"),w.html.div(w.attr.class("bc-slash-command-palette__label"),f.label),f.description?w.html.div(w.attr.class("bc-slash-command-palette__description"),f.description):void 0),f.category?w.html.div(w.attr.class("bc-slash-command-palette__category"),f.category):void 0)},d=w.Use(nr.BeatUII18n,f=>w.html.div(w.attr.class("bc-slash-command-palette"),w.attr.role("listbox"),w.aria.label(f.$.lexical.map(h=>h.slashCommands)),w.style.position("absolute"),w.style.top(r.map(h=>`${h.top}px`)),w.style.left(r.map(h=>`${h.left}px`)),w.WithElement(()=>(document.addEventListener("keydown",c),w.OnDispose(()=>{document.removeEventListener("keydown",c)}))),w.When(l.map(h=>h.length===0),()=>w.html.div(w.attr.class("bc-slash-command-palette__empty"),f.$.lexical.map(h=>h.noCommandsFound))),w.ForEach(l,(h,g)=>{const p=h.value;return u(p,g.index)})));return w.When(e,()=>d)}const E_=[{id:"paragraph",label:"Paragraph",icon:"mdi:format-paragraph",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>H())})}},{id:"heading1",label:"Heading 1",icon:"mdi:format-header-1",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h1"))})}},{id:"heading2",label:"Heading 2",icon:"mdi:format-header-2",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h2"))})}},{id:"heading3",label:"Heading 3",icon:"mdi:format-header-3",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>ft("h3"))})}},{id:"bullet-list",label:"Bullet List",icon:"mdi:format-list-bulleted",handler:n=>{n.dispatchCommand(bi,void 0)}},{id:"ordered-list",label:"Ordered List",icon:"mdi:format-list-numbered",handler:n=>{n.dispatchCommand(xi,void 0)}},{id:"quote",label:"Quote",icon:"mdi:format-quote-close",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>yi())})}},{id:"code-block",label:"Code Block",icon:"mdi:code-braces",handler:n=>{n.update(()=>{const e=O();N(e)&&et(e,()=>St())})}},{id:"divider",label:"Divider",icon:"mdi:minus",handler:n=>{n.dispatchCommand(Ms,void 0)}},{id:"table",label:"Table",icon:"mdi:table",handler:n=>{n.dispatchCommand(Ts,{rows:"3",columns:"3",includeHeaders:!0})}}];function k_({editor:n,stateUpdate:e,readOnly:t=w.signal(!1),commands:r=E_}){const i=w.prop(!1),s=w.prop(!1),o=w.prop(0),l=w.prop(0);return w.Use(nr.BeatUII18n,a=>w.Ensure(n,c=>{const u=c;let d=null,f=!1,h=null,g=null;const p=24,m=4,b=200,_=T=>{if(T===d&&i.value)return;d=T;const I=T.getBoundingClientRect();o.value=I.top,l.value=I.left-p-m,i.value=!0},y=()=>{h!=null&&(clearTimeout(h),h=null)},S=()=>{s.value||(y(),h=setTimeout(()=>{h=null,s.value||(i.value=!1,d=null)},b))},C=()=>{const T=u.value;if(!T)return;const I=T.getRootElement();I&&(k(I),T.getEditorState().read(()=>{const K=O();if(N(K))try{const R=K.anchor.getNode().getTopLevelElementOrThrow(),W=T.getElementByKey(R.getKey());W&&_(W)}catch{}}))},x=T=>{if(s.value)return;const I=u.value;if(!I)return;const K=I.getRootElement();if(K)for(const $ of Array.from(K.children)){const R=$.getBoundingClientRect();if(T.clientY>=R.top&&T.clientY<=R.bottom){y(),_($);return}}},v=()=>{S()},k=T=>{f||(f=!0,T.addEventListener("mousemove",x),T.addEventListener("mouseleave",v))},E=e.onChange(C);return[w.OnDispose(()=>{E(),y();const T=u.value;if(T){const I=T.getRootElement();I&&f&&(I.removeEventListener("mousemove",x),I.removeEventListener("mouseleave",v))}}),w.When(i,()=>w.html.div(w.attr.class("bc-block-handle"),w.style.position("fixed"),w.style.top(o.map(T=>`${T}px`)),w.style.left(l.map(T=>`${T}px`)),w.on.mouseenter(y),w.on.mouseleave(()=>S()),w.WithElement(T=>{T.addEventListener("mousedown",I=>{I.preventDefault()})}),w.html.button(w.attr.class("bc-block-handle__button"),w.attr.type("button"),w.attr.title(a.$.lexical.map(T=>T.changeBlockType)),w.attr.disabled(t),nr.Icon({icon:"mdi:drag-horizontal-variant",size:"sm"}),w.WithElement(T=>{const I=new MutationObserver(()=>{const K=T.getAttribute("aria-expanded")==="true";s.value=K});return I.observe(T,{attributes:!0,attributeFilter:["aria-expanded"]}),w.OnDispose(()=>I.disconnect())}),qu.Menu({items:()=>r.map(T=>qu.MenuItem({key:T.id,content:T.label,startContent:nr.Icon({icon:T.icon,size:"sm"}),onClick:()=>{const I=u.value;I&&(T.handler(I),g?.(),I.focus())}})),placement:"bottom-start",showOn:(T,I)=>(g=I,w.on.click(()=>{s.value?I():(T(),s.value=!0)})),showDelay:0,hideDelay:0,mainAxisOffset:4,onClose:()=>{const T=u.value;T&&T.focus()},ariaLabel:a.value.lexical.blockTypes}))))]}))}const b0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",floatingToolbarGroups:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=w.prop(null),m=w.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:w.prop(w.Value.get(i)):w.prop(!1);return w.Use(vc.Theme,({appearance:y})=>w.html.div(w.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:S})=>wc.LinkPortal({id:"beatui-lexical-css",href:S})),w.attr.class("bc-lexical-editor-container"),a==="fixed"?w.attr.class("bc-lexical-editor-container--fixed"):null,w.attr.class(o),v_({editor:p,stateUpdate:m,groups:c??["text-formatting","links"],readOnly:_}),k_({editor:p,stateUpdate:m,readOnly:_}),w_({editor:p,stateUpdate:m,readOnly:_}),w.html.div(w.attr.class("bc-lexical-editor"),w.attr.class(`bc-lexical-editor--${a}`),w.attr.contenteditable(i!=null?w.Value.map(i,S=>!S):!0),i!=null?w.attr.class(w.Value.map(i,S=>S?"bc-lexical-editor--readonly":"")):null,w.WithElement(S=>{let C=null;const x=[];return(async()=>{try{const k=r??vl("contextual"),E=wl(k),M=w.Value.get(t??"markdown"),T=gi({namespace:l,nodes:E,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:$=>{u?u($,T):console.error("[BeatUI Lexical]",$)},editable:i?!w.Value.get(i):!0});C=T,p.set(T),T.setRootElement(S);const I=[];if(k.richText?I.push(Pl(T)):k.plainText&&I.push(Bl(T)),k.history){const $=typeof k.history=="object"?k.history:void 0;I.push(zl(T,$))}if(k.clipboard&&I.push(Ul(T)),k.list&&I.push(Kl(T)),k.link&&I.push(Wl(T)),k.yjs&&I.push(Gl(T,k.yjs)),k.dragon&&I.push(Jl(T)),k.table&&I.push(Hl(T)),(await Promise.all(I)).forEach($=>{$&&x.push($)}),x.push(jl(T)),x.push(T.registerCommand(oi,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:$,dirtyElements:R,dirtyLeaves:W})=>{(R.size>0||W.size>0)&&m.set(m.value+1),d&&(R.size>0||W.size>0)&&$.read(async()=>{if(M==="markdown"){const Z=await wt(T);d(Z,T)}else if(M==="html"){const Z=await vt(T);d(Z,T)}else M==="json"&&d($.toJSON(),T)})})),e!=null){const $=w.Value.get(e);if($!=null&&($!==""||M==="json"&&typeof $=="object")){if(M==="markdown"&&typeof $=="string")await Kn(T,$);else if(M==="html"&&typeof $=="string")await Wn(T,$);else if(M==="json"&&typeof $=="object")try{const W=JSON.stringify($),Z=T.parseEditorState(W);T.setEditorState(Z)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(w.Value.on(e,async $=>{if($!=null){if(M==="markdown"&&typeof $=="string"){const R=await wt(T);$!==R&&await Kn(T,$)}else if(M==="html"&&typeof $=="string"){const R=await vt(T);$!==R&&await Wn(T,$)}else if(M==="json"&&typeof $=="object"){const R=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify($);if(R!==W){const Z=T.parseEditorState(W);T.setEditorState(Z)}}}})),i!=null&&x.push(w.Value.on(i,$=>{T.setEditable(!$)})),x.push(T.registerCommand(fi,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(M==="markdown"){const $=await wt(T);f($,T)}else if(M==="html"){const $=await vt(T);f($,T)}else M==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on($=>{const R=T.getRootElement();R&&(R.dataset.theme=$)})),g&&g(T)}catch(k){console.error("[BeatUI] Failed to initialize Lexical editor:",k);const E=S;E.textContent="Failed to load Lexical editor."}})(),w.OnDispose(()=>{try{x.forEach(k=>k())}catch{}try{C?.setRootElement(null)}catch{}p.set(null)})}))))},x0=n=>{const{value:e,before:t,after:r,onChange:i,onInput:s,onBlur:o,disabled:l,hasError:a,name:c,placeholder:u,id:d,required:f,tabIndex:h,size:g,class:p,namespace:m,format:b,plugins:_,readOnly:y,onError:S,onReady:C,marks:x}=n,v=l!=null&&y!=null?w.computedOf(l,y)((k,E)=>(k??!1)||(E??!1)):l??y;return U_.InputContainer({disabled:l,hasError:a,size:g,baseContainer:!0,growInput:!0,focusableSelector:"[contenteditable]",before:t,after:r,input:w.html.div(w.attr.class("bc-lexical-editor-input"),w.attr.name(c),w.attr.id(d),f!=null?w.aria.required(f):null,h!=null?w.attr.tabindex(h):null,a!=null?w.attr.class(w.Value.map(a,k=>k?"bc-lexical-editor-input--error":"")):null,b_({value:e,format:b??"markdown",plugins:_,readOnly:v,placeholder:u,namespace:m,class:p,onError:S,onReady:C,onInput:s?(k,E)=>{s(k)}:void 0,onChange:i?(k,E)=>{i(k)}:void 0,onBlur:o?k=>{o()}:void 0}))})};exports.$createHorizontalRuleNode=Ns;exports.$isHorizontalRuleNode=Vp;exports.BLUR_COMMAND=fi;exports.BareEditor=b_;exports.BlockHandle=k_;exports.CLEAR_EDITOR_COMMAND=Lc;exports.CLICK_COMMAND=br;exports.COMMAND_PRIORITY_CRITICAL=Wc;exports.COMMAND_PRIORITY_EDITOR=B;exports.COMMAND_PRIORITY_HIGH=wg;exports.COMMAND_PRIORITY_LOW=G;exports.COMMAND_PRIORITY_NORMAL=Cg;exports.COPY_COMMAND=xr;exports.CUT_COMMAND=di;exports.ContextualEditor=b0;exports.DEFAULT_BLOCK_COMMANDS=E_;exports.DEFAULT_SLASH_COMMANDS=_0;exports.DecoratorNode=Ss;exports.DockedEditor=m0;exports.ElementNode=xe;exports.FOCUS_COMMAND=Rc;exports.FORMAT_ELEMENT_COMMAND=Fc;exports.FORMAT_TEXT_COMMAND=ve;exports.FloatingToolbar=v_;exports.HR_TRANSFORMER=__;exports.HorizontalRuleNode=Ir;exports.INDENT_CONTENT_COMMAND=Ut;exports.INSERT_CHECK_LIST_COMMAND=xl;exports.INSERT_HORIZONTAL_RULE_COMMAND=Ms;exports.INSERT_IMAGE_COMMAND=Kv;exports.INSERT_ORDERED_LIST_COMMAND=xi;exports.INSERT_PARAGRAPH_COMMAND=Fn;exports.INSERT_UNORDERED_LIST_COMMAND=bi;exports.KEY_ENTER_COMMAND=Dn;exports.KEY_ESCAPE_COMMAND=ui;exports.KEY_TAB_COMMAND=xs;exports.LexicalEditorInput=x0;exports.LexicalToolbar=C_;exports.OUTDENT_CONTENT_COMMAND=sn;exports.PASTE_COMMAND=li;exports.REDO_COMMAND=ci;exports.REMOVE_LIST_COMMAND=pu;exports.SELECTION_CHANGE_COMMAND=oi;exports.SlashCommandPalette=y0;exports.TOGGLE_SLASH_COMMAND_PALETTE=Uv;exports.TextNode=Ye;exports.UNDO_COMMAND=ai;exports.applyMark=r0;exports.createCommand=z;exports.createDefaultPluginConfig=vl;exports.createHeadlessEditor=$s;exports.executeSlashCommand=zv;exports.exportEditorToFile=Wv;exports.exportToHtml=vt;exports.exportToMarkdown=wt;exports.getCharacterCount=l0;exports.getMarkdownTransformers=y_;exports.getNodesForPlugins=wl;exports.getSelectionInfo=o0;exports.getTextContent=Gu;exports.getWordCount=a0;exports.htmlToLexicalJson=f0;exports.importFileToEditor=jv;exports.importFromHtml=Wn;exports.importFromMarkdown=Kn;exports.insertTable=Jv;exports.lexicalJsonToHtml=h0;exports.lexicalJsonToMarkdown=d0;exports.loadLexicalCore=m_;exports.loadOffsetUtils=c0;exports.markdownToLexicalJson=u0;exports.registerAutoLinkPlugin=t0;exports.registerClipboardPlugin=Ul;exports.registerCodePlugin=Gv;exports.registerCodeShikiPlugin=Vv;exports.registerDragonPlugin=Jl;exports.registerHashtagPlugin=Zv;exports.registerHistoryPlugin=zl;exports.registerHorizontalRulePlugin=jl;exports.registerLinkPlugin=Wl;exports.registerListPlugin=Kl;exports.registerMarkPlugin=n0;exports.registerOverflowPlugin=s0;exports.registerPlainTextPlugin=Bl;exports.registerRichTextPlugin=Pl;exports.registerSlashCommandsPlugin=Bv;exports.registerTablePlugin=Hl;exports.registerYjsPlugin=Gl;exports.removeMark=i0;
|
|
35
|
+
`)}})(n,t)(e)}function Qp(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class em{_offsetMap;_firstNode;_blockOffsetSize;constructor(e,t,r=1){this._offsetMap=e,this._firstNode=t,this._blockOffsetSize=r}createSelectionFromOffsets(e,t,r){const i=this._firstNode;if(i===null)return null;let s=e,o=t,l=Fi(i,s,this._blockOffsetSize),a=Fi(i,o,this._blockOffsetSize);if(r!==void 0&&(s=Zf(s,l,r,this,this._blockOffsetSize),l=Fi(i,s,this._blockOffsetSize),o=Zf(o,a,r,this,this._blockOffsetSize),a=Fi(i,o,this._blockOffsetSize)),l===null||a===null)return null;let c=l.key,u=a.key;const d=Z(c),f=Z(u);if(d===null||f===null)return null;let h=0,g=0,p="element",m="element";if(l.type==="text"){h=s-l.start,p="text";const _=d.getNextSibling();s!==o&&h===d.getTextContentSize()&&D(_)&&(h=0,c=_.__key)}else l.type==="inline"&&(c=d.getParentOrThrow().getKey(),h=o>l.start?l.end:l.start);a.type==="text"?(g=o-a.start,m="text"):a.type==="inline"&&(u=f.getParentOrThrow().getKey(),g=o>a.start?a.end:a.start);const b=ci();return b===null?null:(b.anchor.set(c,h,p),b.focus.set(u,g,m),b)}getOffsetsFromSelection(e){const t=e.anchor,r=e.focus,i=this._offsetMap,s=t.offset,o=r.offset;let l=-1,a=-1;if(t.type==="text"){const c=i.get(t.key);c!==void 0&&(l=c.start+s)}else{const c=t.getNode().getDescendantByIndex(s);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(l=c.getIndexWithinParent()!==s?u.end:u.start)}}if(r.type==="text"){const c=i.get(r.key);c!==void 0&&(a=c.start+r.offset)}else{const c=r.getNode().getDescendantByIndex(o);if(c!==null){const u=i.get(c.getKey());u!==void 0&&(a=c.getIndexWithinParent()!==o?u.end:u.start)}}return[l,a]}}function Zf(n,e,t,r,i){const s=t._offsetMap,o=r._offsetMap,l=new Set;let a=n,c=e;for(;c!==null;){const d=c.key,f=s.get(d),h=c.end-c.start;if(l.add(d),f===void 0)a+=h;else{const m=f.end-f.start;m!==h&&(a+=h-m)}const g=c.prev;if(g!==null){c=g;continue}let p=c.parent;for(;p!==null;){let m=p.prev;if(m!==null){const b=m.key,_=s.get(b),y=m.end-m.start;if(l.add(b),_===void 0)a+=y;else{const C=_.end-_.start;C!==y&&(a+=y-C)}m=m.prev}p=p.parent}break}const u=t._firstNode;if(u!==null){c=Fi(u,n,i);let d=!1;for(;c!==null;){if(!l.has(c.key)){d=!0;break}c=c.parent}if(!d)for(;c!==null;){const f=c.key;if(!l.has(f)){const h=o.get(f),g=c.end-c.start;if(h===void 0)a-=g;else{const p=h.end-h.start;g!==p&&(a+=p-g)}}c=c.prev}}return a}function Fi(n,e,t){let r=n;for(;r!==null;){if(e<r.end+(r.type!=="element"||t===0?1:0)){const s=r.child;if(s!==null){r=s;continue}return r}const i=r.next;if(i===null)break;r=i}return null}function Xf(n,e,t,r,i,s){return{child:n,end:r,key:i,next:null,parent:s,prev:null,start:t,type:e}}function DS(n,e,t,r,i,s){const o=r.get(e);o===void 0&&Qp(3);const l=n.offset;if(A(o)){const d=rr(o,r),f=d.length===0,h=f?null:tm(n,d,null,r,i,s);n.prevIsBlock&&!f||(n.prevIsBlock=!0,n.offset+=s);const g=Xf(h,"element",l,l,e,t);h!==null&&(h.parent=g);const p=n.offset;return g.end=p,i.set(e,g),g}n.prevIsBlock=!1;const a=D(o),c=a?o.__text.length:1,u=Xf(null,a?"text":"inline",l,n.offset+=c,e,t);return i.set(e,u),u}function tm(n,e,t,r,i,s){let o=null,l=null;const a=e.length;for(let c=0;c<a;c++){const u=DS(n,e[c],t,r,i,s);l===null?o=u:(u.prev=l,l.next=u),l=u}return o}function rr(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e===null?Z(r):e.get(r);i==null&&Qp(174),t.push(r),r=i.__next}return t}const LS=rr;function RS(n,e=1,t){const r=(t||n._pendingEditorState||n._editorState)._nodeMap,i=r.get("root"),s=new Map,o=tm({offset:0,prevIsBlock:!1},rr(i,r),null,r,s,e);return new em(s,o,e)}const PS=Object.freeze(Object.defineProperty({__proto__:null,$createChildrenArray:rr,$createOffsetView:RS,OffsetView:em,createChildrenArray:LS},Symbol.toStringTag,{value:"Module"})),Jt=()=>new Map,uc=n=>{const e=Jt();return n.forEach((t,r)=>{e.set(r,t)}),e},yi=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},zS=(n,e)=>{const t=[];for(const[r,i]of n)t.push(e(i,r));return t},BS=(n,e)=>{for(const[t,r]of n)if(e(r,t))return!0;return!1},qr=()=>new Set,ha=n=>n[n.length-1],Zr=Array.from,bu=(n,e)=>{for(let t=0;t<n.length;t++)if(!e(n[t],t,n))return!1;return!0},nm=(n,e)=>{for(let t=0;t<n.length;t++)if(e(n[t],t,n))return!0;return!1},US=(n,e)=>{const t=new Array(n);for(let r=0;r<n;r++)t[r]=e(r,t);return t},yl=Array.isArray;class KS{constructor(){this._observers=Jt()}on(e,t){return yi(this._observers,e,qr).add(t),t}once(e,t){const r=(...i)=>{this.off(e,r),t(...i)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return Zr((this._observers.get(e)||Jt()).values()).forEach(r=>r(...t))}destroy(){this._observers=Jt()}}const fn=Math.floor,qs=Math.abs,rm=(n,e)=>n<e?n:e,bi=(n,e)=>n>e?n:e,WS=n=>n!==0?n<0:1/n<0,Qf=1,eh=2,ga=4,pa=8,jS=32,im=64,Mo=128,HS=31,th=63,Ki=127,JS=2147483647,nh=Number.MAX_SAFE_INTEGER,rh=Number.MIN_SAFE_INTEGER,VS=Number.isInteger||(n=>typeof n=="number"&&isFinite(n)&&fn(n)===n),GS=String.fromCharCode,YS=n=>n.toLowerCase(),qS=/^\s*/g,ZS=n=>n.replace(qS,""),XS=/([A-Z])/g,ih=(n,e)=>ZS(n.replace(XS,t=>`${e}${YS(t)}`)),QS=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let i=0;i<t;i++)r[i]=e.codePointAt(i);return r},rs=typeof TextEncoder<"u"?new TextEncoder:null,eC=n=>rs.encode(n),tC=rs?eC:QS;let ma=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});ma&&ma.decode(new Uint8Array).length===1&&(ma=null);const nC=(n,e)=>US(e,()=>n).join("");class ks{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const xu=()=>new ks,rC=n=>{let e=n.cpos;for(let t=0;t<n.bufs.length;t++)e+=n.bufs[t].length;return e},on=n=>{const e=new Uint8Array(rC(n));let t=0;for(let r=0;r<n.bufs.length;r++){const i=n.bufs[r];e.set(i,t),t+=i.length}return e.set(new Uint8Array(n.cbuf.buffer,0,n.cpos),t),e},iC=(n,e)=>{const t=n.cbuf.length;t-n.cpos<e&&(n.bufs.push(new Uint8Array(n.cbuf.buffer,0,n.cpos)),n.cbuf=new Uint8Array(bi(t,e)*2),n.cpos=0)},Oe=(n,e)=>{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},dc=Oe,ce=(n,e)=>{for(;e>Ki;)Oe(n,Mo|Ki&e),e=fn(e/128);Oe(n,Ki&e)},Su=(n,e)=>{const t=WS(e);for(t&&(e=-e),Oe(n,(e>th?Mo:0)|(t?im:0)|th&e),e=fn(e/64);e>0;)Oe(n,(e>Ki?Mo:0)|Ki&e),e=fn(e/128)},fc=new Uint8Array(3e4),sC=fc.length/3,oC=(n,e)=>{if(e.length<sC){const t=rs.encodeInto(e,fc).written||0;ce(n,t);for(let r=0;r<t;r++)Oe(n,fc[r])}else at(n,tC(e))},lC=(n,e)=>{const t=unescape(encodeURIComponent(e)),r=t.length;ce(n,r);for(let i=0;i<r;i++)Oe(n,t.codePointAt(i))},Jr=rs&&rs.encodeInto?oC:lC,Cu=(n,e)=>{const t=n.cbuf.length,r=n.cpos,i=rm(t-r,e.length),s=e.length-i;n.cbuf.set(e.subarray(0,i),r),n.cpos+=i,s>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(bi(t*2,s)),n.cbuf.set(e.subarray(i)),n.cpos=s)},at=(n,e)=>{ce(n,e.byteLength),Cu(n,e)},wu=(n,e)=>{iC(n,e);const t=new DataView(n.cbuf.buffer,n.cpos,e);return n.cpos+=e,t},aC=(n,e)=>wu(n,4).setFloat32(0,e,!1),cC=(n,e)=>wu(n,8).setFloat64(0,e,!1),uC=(n,e)=>wu(n,8).setBigInt64(0,e,!1),sh=new DataView(new ArrayBuffer(4)),dC=n=>(sh.setFloat32(0,n),sh.getFloat32(0)===n),is=(n,e)=>{switch(typeof e){case"string":Oe(n,119),Jr(n,e);break;case"number":VS(e)&&qs(e)<=JS?(Oe(n,125),Su(n,e)):dC(e)?(Oe(n,124),aC(n,e)):(Oe(n,123),cC(n,e));break;case"bigint":Oe(n,122),uC(n,e);break;case"object":if(e===null)Oe(n,126);else if(yl(e)){Oe(n,117),ce(n,e.length);for(let t=0;t<e.length;t++)is(n,e[t])}else if(e instanceof Uint8Array)Oe(n,116),at(n,e);else{Oe(n,118);const t=Object.keys(e);ce(n,t.length);for(let r=0;r<t.length;r++){const i=t[r];Jr(n,i),is(n,e[i])}}break;case"boolean":Oe(n,e?120:121);break;default:Oe(n,127)}};class oh extends ks{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&ce(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const lh=n=>{n.count>0&&(Su(n.encoder,n.count===1?n.s:-n.s),n.count>1&&ce(n.encoder,n.count-2))};class Zs{constructor(){this.encoder=new ks,this.s=0,this.count=0}write(e){this.s===e?this.count++:(lh(this),this.count=1,this.s=e)}toUint8Array(){return lh(this),on(this.encoder)}}const ah=n=>{if(n.count>0){const e=n.diff*2+(n.count===1?0:1);Su(n.encoder,e),n.count>1&&ce(n.encoder,n.count-2)}};class _a{constructor(){this.encoder=new ks,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(ah(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return ah(this),on(this.encoder)}}class fC{constructor(){this.sarr=[],this.s="",this.lensE=new Zs}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new ks;return this.sarr.push(this.s),this.s="",Jr(e,this.sarr.join("")),Cu(e,this.lensE.toUint8Array()),on(e)}}const Ln=n=>new Error(n),$t=()=>{throw Ln("Method unimplemented")},hn=()=>{throw Ln("Unexpected case")},hC=crypto.getRandomValues.bind(crypto),sm=()=>hC(new Uint32Array(1))[0],gC="10000000-1000-4000-8000"+-1e11,pC=()=>gC.replace(/[018]/g,n=>(n^sm()&15>>n/4).toString(16)),ch=n=>new Promise(n);Promise.all.bind(Promise);const uh=n=>n===void 0?null:n;class mC{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let om=new mC,_C=!0;try{typeof localStorage<"u"&&localStorage&&(om=localStorage,_C=!1)}catch{}const yC=om,ss=Symbol("Equality"),lm=(n,e)=>n===e||!!n?.[ss]?.(e)||!1,bC=n=>typeof n=="object",xC=Object.assign,SC=Object.keys,CC=(n,e)=>{for(const t in n)e(n[t],t)},$o=n=>SC(n).length,wC=n=>{for(const e in n)return!1;return!0},Es=(n,e)=>{for(const t in n)if(!e(n[t],t))return!1;return!0},vu=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),vC=(n,e)=>n===e||$o(n)===$o(e)&&Es(n,(t,r)=>(t!==void 0||vu(e,r))&&lm(e[r],t)),kC=Object.freeze,am=n=>{for(const e in n){const t=n[e];(typeof t=="object"||typeof t=="function")&&am(n[e])}return kC(n)},ku=(n,e,t=0)=>{try{for(;t<n.length;t++)n[t](...e)}finally{t<n.length&&ku(n,e,t+1)}},Xs=(n,e)=>{if(n===e)return!0;if(n==null||e==null||n.constructor!==e.constructor&&(n.constructor||Object)!==(e.constructor||Object))return!1;if(n[ss]!=null)return n[ss](e);switch(n.constructor){case ArrayBuffer:n=new Uint8Array(n),e=new Uint8Array(e);case Uint8Array:{if(n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;break}case Set:{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;break}case Map:{if(n.size!==e.size)return!1;for(const t of n.keys())if(!e.has(t)||!Xs(n.get(t),e.get(t)))return!1;break}case void 0:case Object:if($o(n)!==$o(e))return!1;for(const t in n)if(!vu(n,t)||!Xs(n[t],e[t]))return!1;break;case Array:if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!Xs(n[t],e[t]))return!1;break;default:return!1}return!0},EC=(n,e)=>e.includes(n),os=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]";let Lt;const TC=()=>{if(Lt===void 0)if(os){Lt=Jt();const n=process.argv;let e=null;for(let t=0;t<n.length;t++){const r=n[t];r[0]==="-"?(e!==null&&Lt.set(e,""),e=r):e!==null&&(Lt.set(e,r),e=null)}e!==null&&Lt.set(e,"")}else typeof location=="object"?(Lt=Jt(),(location.search||"?").slice(1).split("&").forEach(n=>{if(n.length!==0){const[e,t]=n.split("=");Lt.set(`--${ih(e,"-")}`,t),Lt.set(`-${ih(e,"-")}`,t)}})):Lt=Jt();return Lt},hc=n=>TC().has(n),Io=n=>uh(os?process.env[n.toUpperCase().replaceAll("-","_")]:yC.getItem(n)),cm=n=>hc("--"+n)||Io(n)!==null,NC=cm("production"),AC=os&&EC(process.env.FORCE_COLOR,["true","1","2"]),OC=AC||!hc("--no-colors")&&!cm("no-color")&&(!os||process.stdout.isTTY)&&(!os||hc("--color")||Io("COLORTERM")!==null||(Io("TERM")||"").includes("color"));class MC{constructor(e,t){this.left=e,this.right=t}}const Xt=(n,e)=>new MC(n,e),dh=n=>n.next()>=.5,ya=(n,e,t)=>fn(n.next()*(t+1-e)+e),um=(n,e,t)=>fn(n.next()*(t+1-e)+e),Eu=(n,e,t)=>um(n,e,t),$C=n=>GS(Eu(n,97,122)),IC=(n,e=0,t=20)=>{const r=Eu(n,e,t);let i="";for(let s=0;s<r;s++)i+=$C(n);return i},ba=(n,e)=>e[Eu(n,0,e.length-1)],FC=Symbol("0schema");class DC{constructor(){this._rerrs=[]}extend(e,t,r,i=null){this._rerrs.push({path:e,expected:t,has:r,message:i})}toString(){const e=[];for(let t=this._rerrs.length-1;t>0;t--){const r=this._rerrs[t];e.push(nC(" ",(this._rerrs.length-t)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
|
|
36
|
+
`)}}const gc=(n,e)=>n===e?!0:n==null||e==null||n.constructor!==e.constructor?!1:n[ss]?lm(n,e):yl(n)?bu(n,t=>nm(e,r=>gc(t,r))):bC(n)?Es(n,(t,r)=>gc(t,e[r])):!1;class nt{static _dilutes=!1;extends(e){let[t,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,t]=[t,r]),gc(t,r)}equals(e){return this.constructor===e.constructor&&Xs(this.shape,e.shape)}[FC](){return!0}[ss](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){$t()}get nullable(){return xi(this,wl)}get optional(){return new hm(this)}cast(e){return fh(e,this),e}expect(e){return fh(e,this),e}}class Tu extends nt{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){const r=e?.constructor===this.shape&&(this._c==null||this._c(e));return!r&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor!==this.shape?"Constructor match failed":"Check failed"),r}}const ke=(n,e=null)=>new Tu(n,e);ke(Tu);class Nu extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=this.shape(e);return!r&&t?.extend(null,"custom prop",e?.constructor.name,"failed to check custom prop"),r}}const Pe=n=>new Nu(n);ke(Nu);class bl extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=this.shape.some(i=>i===e);return!r&&t?.extend(null,this.shape.join(" | "),e.toString()),r}}const xl=(...n)=>new bl(n),dm=ke(bl),LC=RegExp.escape||(n=>n.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),fm=n=>{if(Xr.check(n))return[LC(n)];if(dm.check(n))return n.shape.map(e=>e+"");if(Cm.check(n))return["[+-]?\\d+.?\\d*"];if(wm.check(n))return[".*"];if(Fo.check(n))return n.shape.map(fm).flat(1);hn()};class RC extends nt{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(fm).map(t=>`(${t.join("|")})`).join("")+"$")}check(e,t){const r=this._r.exec(e)!=null;return!r&&t?.extend(null,this._r.toString(),e.toString(),"String doesn't match string template."),r}}ke(RC);const PC=Symbol("optional");class hm extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=e===void 0||this.shape.check(e);return!r&&t?.extend(null,"undefined (optional)","()"),r}get[PC](){return!0}}const zC=ke(hm);class BC extends nt{check(e,t){return t?.extend(null,"never",typeof e),!1}}ke(BC);class Sl extends nt{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new Sl(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,"object","null"),!1):Es(this.shape,(r,i)=>{const s=this._isPartial&&!vu(e,i)||r.check(e[i],t);return!s&&t?.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match"),s})}}const UC=n=>new Sl(n),KC=ke(Sl),WC=Pe(n=>n!=null&&(n.constructor===Object||n.constructor==null));class gm extends nt{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&Es(e,(r,i)=>{const s=this.shape.keys.check(i,t);return!s&&t?.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(r,t)})}}const pm=(n,e)=>new gm(n,e),jC=ke(gm);class mm extends nt{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&Es(this.shape,(r,i)=>{const s=r.check(e[i],t);return!s&&t?.extend(i.toString(),"Tuple",typeof r),s})}}const HC=(...n)=>new mm(n);ke(mm);class _m extends nt{constructor(e){super(),this.shape=e.length===1?e[0]:new Au(e)}check(e,t){const r=yl(e)&&bu(e,i=>this.shape.check(i));return!r&&t?.extend(null,"Array",""),r}}const ym=(...n)=>new _m(n),JC=ke(_m),VC=Pe(n=>yl(n));class bm extends nt{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&t?.extend(null,this.shape.name,e?.constructor.name),r}}const GC=(n,e=null)=>new bm(n,e);ke(bm);const YC=GC(nt);class qC extends nt{constructor(e){super(),this.len=e.length-1,this.args=HC(...e.slice(-1)),this.res=e[this.len]}check(e,t){const r=e.constructor===Function&&e.length<=this.len;return!r&&t?.extend(null,"function",typeof e),r}}const ZC=ke(qC),XC=Pe(n=>typeof n=="function");class QC extends nt{constructor(e){super(),this.shape=e}check(e,t){const r=bu(this.shape,i=>i.check(e,t));return!r&&t?.extend(null,"Intersectinon",typeof e),r}}ke(QC,n=>n.shape.length>0);class Au extends nt{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){const r=nm(this.shape,i=>i.check(e,t));return t?.extend(null,"Union",typeof e),r}}const xi=(...n)=>n.findIndex(e=>Fo.check(e))>=0?xi(...n.map(e=>ls(e)).map(e=>Fo.check(e)?e.shape:[e]).flat(1)):n.length===1?n[0]:new Au(n),Fo=ke(Au),xm=()=>!0,Do=Pe(xm),ew=ke(Nu,n=>n.shape===xm),Ou=Pe(n=>typeof n=="bigint"),tw=Pe(n=>n===Ou),Sm=Pe(n=>typeof n=="symbol");Pe(n=>n===Sm);const Vr=Pe(n=>typeof n=="number"),Cm=Pe(n=>n===Vr),Xr=Pe(n=>typeof n=="string"),wm=Pe(n=>n===Xr),Cl=Pe(n=>typeof n=="boolean"),nw=Pe(n=>n===Cl),vm=xl(void 0);ke(bl,n=>n.shape.length===1&&n.shape[0]===void 0);xl(void 0);const wl=xl(null),rw=ke(bl,n=>n.shape.length===1&&n.shape[0]===null);ke(Uint8Array);ke(Tu,n=>n.shape===Uint8Array);const iw=xi(Vr,Xr,wl,vm,Ou,Cl,Sm);(()=>{const n=ym(Do),e=pm(Xr,Do),t=xi(Vr,Xr,wl,Cl,n,e);return n.shape=t,e.shape.values=t,t})();const ls=n=>{if(YC.check(n))return n;if(WC.check(n)){const e={};for(const t in n)e[t]=ls(n[t]);return UC(e)}else{if(VC.check(n))return xi(...n.map(ls));if(iw.check(n))return xl(n);if(XC.check(n))return ke(n)}hn()},fh=NC?()=>{}:(n,e)=>{const t=new DC;if(!e.check(n,t))throw Ln(`Expected value to be of type ${e.constructor.name}.
|
|
37
|
+
${t.toString()}`)};class sw{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:ls(e),h:t}),this}else(e){return this.if(Do,e)}done(){return(e,t)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,t)}throw Ln("Unhandled pattern")}}}const ow=n=>new sw(n),km=ow(Do).if(Cm,(n,e)=>ya(e,rh,nh)).if(wm,(n,e)=>IC(e)).if(nw,(n,e)=>dh(e)).if(tw,(n,e)=>BigInt(ya(e,rh,nh))).if(Fo,(n,e)=>Lr(e,ba(e,n.shape))).if(KC,(n,e)=>{const t={};for(const r in n.shape){let i=n.shape[r];if(zC.check(i)){if(dh(e))continue;i=i.shape}t[r]=km(i,e)}return t}).if(JC,(n,e)=>{const t=[],r=um(e,0,42);for(let i=0;i<r;i++)t.push(Lr(e,n.shape));return t}).if(dm,(n,e)=>ba(e,n.shape)).if(rw,(n,e)=>null).if(ZC,(n,e)=>{const t=Lr(e,n.res);return()=>t}).if(ew,(n,e)=>Lr(e,ba(e,[Vr,Xr,wl,vm,Ou,Cl,ym(Vr),pm(xi("a","b","c"),Vr)]))).if(jC,(n,e)=>{const t={},r=ya(e,0,3);for(let i=0;i<r;i++){const s=Lr(e,n.shape.keys),o=Lr(e,n.shape.values);t[s]=o}return t}).done(),Lr=(n,e)=>km(ls(e),n),vl=typeof document<"u"?document:{};Pe(n=>n.nodeType===dw);typeof DOMParser<"u"&&new DOMParser;Pe(n=>n.nodeType===aw);Pe(n=>n.nodeType===cw);const lw=n=>zS(n,(e,t)=>`${t}:${e};`).join(""),aw=vl.ELEMENT_NODE,cw=vl.TEXT_NODE,uw=vl.DOCUMENT_NODE,dw=vl.DOCUMENT_FRAGMENT_NODE;Pe(n=>n.nodeType===uw);const xn=Symbol,Em=xn(),Tm=xn(),fw=xn(),hw=xn(),gw=xn(),Nm=xn(),pw=xn(),Mu=xn(),mw=xn(),_w=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[];let r=0;for(;r<n.length;r++){const i=n[r];if(i===void 0)break;if(i.constructor===String||i.constructor===Number)e.push(i);else if(i.constructor===Object)break}for(r>0&&t.push(e.join(""));r<n.length;r++){const i=n[r];i instanceof Symbol||t.push(i)}return t},yw={[Em]:Xt("font-weight","bold"),[Tm]:Xt("font-weight","normal"),[fw]:Xt("color","blue"),[gw]:Xt("color","green"),[hw]:Xt("color","grey"),[Nm]:Xt("color","red"),[pw]:Xt("color","purple"),[Mu]:Xt("color","orange"),[mw]:Xt("color","black")},bw=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const e=[],t=[],r=Jt();let i=[],s=0;for(;s<n.length;s++){const o=n[s],l=yw[o];if(l!==void 0)r.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const a=lw(r);s>0||a.length>0?(e.push("%c"+o),t.push(a)):e.push(o)}else break}}for(s>0&&(i=t,i.unshift(e.join("")));s<n.length;s++){const o=n[s];o instanceof Symbol||i.push(o)}return i},Am=OC?bw:_w,xw=(...n)=>{console.log(...Am(n)),Om.forEach(e=>e.print(n))},Sw=(...n)=>{console.warn(...Am(n)),n.unshift(Mu),Om.forEach(e=>e.print(n))},Om=qr(),Mm=n=>({[Symbol.iterator](){return this},next:n}),Cw=(n,e)=>Mm(()=>{let t;do t=n.next();while(!t.done&&!e(t.value));return t}),xa=(n,e)=>Mm(()=>{const{done:t,value:r}=n.next();return{done:t,value:t?void 0:e(r)}});class ww{constructor(e,t){this.clock=e,this.len=t}}class vw{constructor(){this.clients=new Map}}const $m=(n,e,t)=>e.clients.forEach((r,i)=>{const s=n.doc.store.clients.get(i);if(s!=null){const o=s[s.length-1],l=o.id.clock+o.length;for(let a=0,c=r[a];a<r.length&&c.clock<l;c=r[++a])zm(n,s,c.clock,c.len,t)}}),kw=(n,e)=>{let t=0,r=n.length-1;for(;t<=r;){const i=fn((t+r)/2),s=n[i],o=s.clock;if(o<=e){if(e<o+s.len)return i;t=i+1}else r=i-1}return null},Im=(n,e)=>{const t=n.clients.get(e.client);return t!==void 0&&kw(t,e.clock)!==null},Fm=n=>{n.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let t,r;for(t=1,r=1;t<e.length;t++){const i=e[r-1],s=e[t];i.clock+i.len>=s.clock?i.len=bi(i.len,s.clock+s.len-i.clock):(r<t&&(e[r]=s),r++)}e.length=r})},Dm=(n,e,t,r)=>{yi(n.clients,e,()=>[]).push(new ww(t,r))},Ew=(n,e)=>{ce(n.restEncoder,e.clients.size),Zr(e.clients.entries()).sort((t,r)=>r[0]-t[0]).forEach(([t,r])=>{n.resetDsCurVal(),ce(n.restEncoder,t);const i=r.length;ce(n.restEncoder,i);for(let s=0;s<i;s++){const o=r[s];n.writeDsClock(o.clock),n.writeDsLen(o.len)}})},Lm=sm;class Rn extends KS{constructor({guid:e=pC(),collectionid:t=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=Lm(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new Lw,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=ch(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>ch(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&ge(e.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Zr(this.subdocs).map(e=>e.guid))}transact(e,t=null){return ge(this,e,t)}get(e,t=Ke){const r=yi(this.share,e,()=>{const s=new t;return s._integrate(this,null),s}),i=r.constructor;if(t!==Ke&&i!==t)if(i===Ke){const s=new t;s._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=r._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=r._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Wi)}getText(e=""){return this.get(e,us)}getMap(e=""){return this.get(e,pt)}getXmlElement(e=""){return this.get(e,pn)}getXmlFragment(e=""){return this.get(e,Qr)}toJSON(){const e={};return this.share.forEach((t,r)=>{e[r]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,Zr(this.subdocs).forEach(t=>t.destroy());const e=this._item;if(e!==null){this._item=null;const t=e.content;t.doc=new Rn({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,ge(e.parent.doc,r=>{const i=t.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Tw{constructor(){this.restEncoder=xu()}toUint8Array(){return on(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){ce(this.restEncoder,e)}writeDsLen(e){ce(this.restEncoder,e)}}class Nw extends Tw{writeLeftID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeRightID(e){ce(this.restEncoder,e.client),ce(this.restEncoder,e.clock)}writeClient(e){ce(this.restEncoder,e)}writeInfo(e){dc(this.restEncoder,e)}writeString(e){Jr(this.restEncoder,e)}writeParentInfo(e){ce(this.restEncoder,e?1:0)}writeTypeRef(e){ce(this.restEncoder,e)}writeLen(e){ce(this.restEncoder,e)}writeAny(e){is(this.restEncoder,e)}writeBuf(e){at(this.restEncoder,e)}writeJSON(e){Jr(this.restEncoder,JSON.stringify(e))}writeKey(e){Jr(this.restEncoder,e)}}class Aw{constructor(){this.restEncoder=xu(),this.dsCurrVal=0}toUint8Array(){return on(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,ce(this.restEncoder,t)}writeDsLen(e){e===0&&hn(),ce(this.restEncoder,e-1),this.dsCurrVal+=e}}class Ow extends Aw{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new _a,this.clientEncoder=new Zs,this.leftClockEncoder=new _a,this.rightClockEncoder=new _a,this.infoEncoder=new oh(dc),this.stringEncoder=new fC,this.parentInfoEncoder=new oh(dc),this.typeRefEncoder=new Zs,this.lenEncoder=new Zs}toUint8Array(){const e=xu();return ce(e,0),at(e,this.keyClockEncoder.toUint8Array()),at(e,this.clientEncoder.toUint8Array()),at(e,this.leftClockEncoder.toUint8Array()),at(e,this.rightClockEncoder.toUint8Array()),at(e,on(this.infoEncoder)),at(e,this.stringEncoder.toUint8Array()),at(e,on(this.parentInfoEncoder)),at(e,this.typeRefEncoder.toUint8Array()),at(e,this.lenEncoder.toUint8Array()),Cu(e,on(this.restEncoder)),on(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){is(this.restEncoder,e)}writeBuf(e){at(this.restEncoder,e)}writeJSON(e){is(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Mw=(n,e,t,r)=>{r=bi(r,e[0].id.clock);const i=gn(e,r);ce(n.restEncoder,e.length-i),n.writeClient(t),ce(n.restEncoder,r);const s=e[i];s.write(n,r-s.id.clock);for(let o=i+1;o<e.length;o++)e[o].write(n,0)},$w=(n,e,t)=>{const r=new Map;t.forEach((i,s)=>{rt(e,s)>i&&r.set(s,i)}),$u(e).forEach((i,s)=>{t.has(s)||r.set(s,0)}),ce(n.restEncoder,r.size),Zr(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{Mw(n,e.clients.get(i),i,s)})},Iw=(n,e)=>$w(n,e.doc.store,e.beforeState);class Fw{constructor(){this.l=[]}}const hh=()=>new Fw,gh=(n,e)=>n.l.push(e),ph=(n,e)=>{const t=n.l,r=t.length;n.l=t.filter(i=>e!==i),r===n.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Rm=(n,e,t)=>ku(n.l,[e,t]);class Qs{constructor(e,t){this.client=e,this.clock=t}}const Us=(n,e)=>n===e||n!==null&&e!==null&&n.client===e.client&&n.clock===e.clock,be=(n,e)=>new Qs(n,e),Dw=n=>{for(const[e,t]of n.doc.share.entries())if(t===n)return e;throw hn()},Br=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&(e.sv.get(n.id.client)||0)>n.id.clock&&!Im(e.ds,n.id),pc=(n,e)=>{const t=yi(n.meta,pc,qr),r=n.doc.store;t.has(e)||(e.sv.forEach((i,s)=>{i<rt(r,s)&&Pn(n,be(s,i))}),$m(n,e.ds,i=>{}),t.add(e))};class Lw{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const $u=n=>{const e=new Map;return n.clients.forEach((t,r)=>{const i=t[t.length-1];e.set(r,i.id.clock+i.length)}),e},rt=(n,e)=>{const t=n.clients.get(e);if(t===void 0)return 0;const r=t[t.length-1];return r.id.clock+r.length},Pm=(n,e)=>{let t=n.clients.get(e.id.client);if(t===void 0)t=[],n.clients.set(e.id.client,t);else{const r=t[t.length-1];if(r.id.clock+r.length!==e.id.clock)throw hn()}t.push(e)},gn=(n,e)=>{let t=0,r=n.length-1,i=n[r],s=i.id.clock;if(s===e)return r;let o=fn(e/(s+i.length-1)*r);for(;t<=r;){if(i=n[o],s=i.id.clock,s<=e){if(e<s+i.length)return o;t=o+1}else r=o-1;o=fn((t+r)/2)}throw hn()},Rw=(n,e)=>{const t=n.clients.get(e.client);return t[gn(t,e.clock)]},Sa=Rw,mc=(n,e,t)=>{const r=gn(e,t),i=e[r];return i.id.clock<t&&i instanceof Ve?(e.splice(r+1,0,r_(n,i,t-i.id.clock)),r+1):r},Pn=(n,e)=>{const t=n.doc.store.clients.get(e.client);return t[mc(n,t,e.clock)]},mh=(n,e,t)=>{const r=e.clients.get(t.client),i=gn(r,t.clock),s=r[i];return t.clock!==s.id.clock+s.length-1&&s.constructor!==wn&&r.splice(i+1,0,r_(n,s,t.clock-s.id.clock+1)),s},Pw=(n,e,t)=>{const r=n.clients.get(e.id.client);r[gn(r,e.id.clock)]=t},zm=(n,e,t,r,i)=>{if(r===0)return;const s=t+r;let o=mc(n,e,t),l;do l=e[o++],s<l.id.clock+l.length&&mc(n,e,s),i(l);while(o<e.length&&e[o].id.clock<s)};class zw{constructor(e,t,r){this.doc=e,this.deleteSet=new vw,this.beforeState=$u(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const _h=(n,e)=>e.deleteSet.clients.size===0&&!BS(e.afterState,(t,r)=>e.beforeState.get(r)!==t)?!1:(Fm(e.deleteSet),Iw(n,e),Ew(n,e.deleteSet),!0),yh=(n,e,t)=>{const r=e._item;(r===null||r.id.clock<(n.beforeState.get(r.id.client)||0)&&!r.deleted)&&yi(n.changed,e,qr).add(t)},eo=(n,e)=>{let t=n[e],r=n[e-1],i=e;for(;i>0;t=r,r=n[--i-1]){if(r.deleted===t.deleted&&r.constructor===t.constructor&&r.mergeWith(t)){t instanceof Ve&&t.parentSub!==null&&t.parent._map.get(t.parentSub)===t&&t.parent._map.set(t.parentSub,r);continue}break}const s=e-i;return s&&n.splice(e+1-s,s),s},Bw=(n,e,t)=>{for(const[r,i]of n.clients.entries()){const s=e.clients.get(r);for(let o=i.length-1;o>=0;o--){const l=i[o],a=l.clock+l.len;for(let c=gn(s,l.clock),u=s[c];c<s.length&&u.id.clock<a;u=s[++c]){const d=s[c];if(l.clock+l.len<=d.id.clock)break;d instanceof Ve&&d.deleted&&!d.keep&&t(d)&&d.gc(e,!1)}}}},Uw=(n,e)=>{n.clients.forEach((t,r)=>{const i=e.clients.get(r);for(let s=t.length-1;s>=0;s--){const o=t[s],l=rm(i.length-1,1+gn(i,o.clock+o.len-1));for(let a=l,c=i[a];a>0&&c.id.clock>=o.clock;c=i[a])a-=1+eo(i,a)}})},Bm=(n,e)=>{if(e<n.length){const t=n[e],r=t.doc,i=r.store,s=t.deleteSet,o=t._mergeStructs;try{Fm(s),t.afterState=$u(t.doc.store),r.emit("beforeObserverCalls",[t,r]);const l=[];t.changed.forEach((a,c)=>l.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(t,a)})),l.push(()=>{t.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),l.push(()=>{Rm(c._dEH,a,t)}))}),l.push(()=>r.emit("afterTransaction",[t,r])),l.push(()=>{t._needFormattingCleanup&&Qw(t)})}),ku(l,[])}finally{r.gc&&Bw(s,i,r.gcFilter),Uw(s,i),t.afterState.forEach((u,d)=>{const f=t.beforeState.get(d)||0;if(f!==u){const h=i.clients.get(d),g=bi(gn(h,f),1);for(let p=h.length-1;p>=g;)p-=1+eo(h,p)}});for(let u=o.length-1;u>=0;u--){const{client:d,clock:f}=o[u].id,h=i.clients.get(d),g=gn(h,f);g+1<h.length&&eo(h,g+1)>1||g>0&&eo(h,g)}if(!t.local&&t.afterState.get(r.clientID)!==t.beforeState.get(r.clientID)&&(xw(Mu,Em,"[yjs] ",Tm,Nm,"Changed the client-id because another client seems to be using it."),r.clientID=Lm()),r.emit("afterTransactionCleanup",[t,r]),r._observers.has("update")){const u=new Nw;_h(u,t)&&r.emit("update",[u.toUint8Array(),t.origin,r,t])}if(r._observers.has("updateV2")){const u=new Ow;_h(u,t)&&r.emit("updateV2",[u.toUint8Array(),t.origin,r,t])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=t;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,t]),c.forEach(u=>u.destroy())),n.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,n])):Bm(n,e+1)}}},ge=(n,e,t=null,r=!0)=>{const i=n._transactionCleanups;let s=!1,o=null;n._transaction===null&&(s=!0,n._transaction=new zw(n,t,r),i.push(n._transaction),i.length===1&&n.emit("beforeAllTransactions",[n]),n.emit("beforeTransaction",[n._transaction,n]));try{o=e(n._transaction)}finally{if(s){const l=n._transaction===i[0];n._transaction=null,l&&Bm(i,0)}}return o},bh="You must not compute changes after the event-handler fired.";class kl{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Kw(this.currentTarget,this.target))}deletes(e){return Im(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ln(bh);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(i=>{if(i!==null){const s=t._map.get(i);let o,l;if(this.adds(s)){let a=s.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(s))if(a!==null&&this.deletes(a))o="delete",l=ha(a.content.getContent());else return;else a!==null&&this.deletes(a)?(o="update",l=ha(a.content.getContent())):(o="add",l=void 0)}else if(this.deletes(s))o="delete",l=ha(s.content.getContent());else return;e.set(i,{action:o,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ln(bh);const t=this.target,r=qr(),i=qr(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(t).has(null)){let l=null;const a=()=>{l&&s.push(l)};for(let c=t._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,i.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const Kw=(n,e)=>{const t=[];for(;e._item!==null&&e!==n;){if(e._item.parentSub!==null)t.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;t.unshift(r)}e=e._item.parent}return t},Ye=()=>{Sw("Invalid access: Add Yjs type to a document before reading data.")},Um=80;let Iu=0;class Ww{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Iu++}}const jw=n=>{n.timestamp=Iu++},Km=(n,e,t)=>{n.p.marker=!1,n.p=e,e.marker=!0,n.index=t,n.timestamp=Iu++},Hw=(n,e,t)=>{if(n.length>=Um){const r=n.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return Km(r,e,t),r}else{const r=new Ww(e,t);return n.push(r),r}},El=(n,e)=>{if(n._start===null||e===0||n._searchMarker===null)return null;const t=n._searchMarker.length===0?null:n._searchMarker.reduce((s,o)=>qs(e-s.index)<qs(e-o.index)?s:o);let r=n._start,i=0;for(t!==null&&(r=t.p,i=t.index,jw(t));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return t!==null&&qs(t.index-i)<r.parent.length/Um?(Km(t,r,i),t):Hw(n._searchMarker,r,i)},as=(n,e,t)=>{for(let r=n.length-1;r>=0;r--){const i=n[r];if(t>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){n.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||t>0&&e===i.index)&&(i.index=bi(e,i.index+t))}},Tl=(n,e,t)=>{const r=n,i=e.changedParentTypes;for(;yi(i,n,()=>[]).push(t),n._item!==null;)n=n._item.parent;Rm(r._eH,t,e)};class Ke{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=hh(),this._dEH=hh(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw $t()}clone(){throw $t()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){gh(this._eH,e)}observeDeep(e){gh(this._dEH,e)}unobserve(e){ph(this._eH,e)}unobserveDeep(e){ph(this._dEH,e)}toJSON(){}}const Wm=(n,e,t)=>{n.doc??Ye(),e<0&&(e=n._length+e),t<0&&(t=n._length+t);let r=t-e;const i=[];let s=n._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let l=e;l<o.length&&r>0;l++)i.push(o[l]),r--;e=0}}s=s.right}return i},jm=n=>{n.doc??Ye();const e=[];let t=n._start;for(;t!==null;){if(t.countable&&!t.deleted){const r=t.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}t=t.right}return e},cs=(n,e)=>{let t=0,r=n._start;for(n.doc??Ye();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],t++,n)}r=r.right}},Hm=(n,e)=>{const t=[];return cs(n,(r,i)=>{t.push(e(r,i,n))}),t},Jw=n=>{let e=n._start,t=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(t===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};t=e.content.getContent(),r=0,e=e.right}const i=t[r++];return t.length<=r&&(t=null),{done:!1,value:i}}}},Jm=(n,e)=>{n.doc??Ye();const t=El(n,e);let r=n._start;for(t!==null&&(r=t.p,e-=t.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Lo=(n,e,t,r)=>{let i=t;const s=n.doc,o=s.clientID,l=s.store,a=t===null?e._start:t.right;let c=[];const u=()=>{c.length>0&&(i=new Ve(be(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new ei(c)),i.integrate(n,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:i=new Ve(be(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Nl(new Uint8Array(d))),i.integrate(n,0);break;case Rn:i=new Ve(be(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Al(d)),i.integrate(n,0);break;default:if(d instanceof Ke)i=new Ve(be(o,rt(l,o)),i,i&&i.lastId,a,a&&a.id,e,null,new Hn(d)),i.integrate(n,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},Vm=()=>Ln("Length exceeded!"),Gm=(n,e,t,r)=>{if(t>e._length)throw Vm();if(t===0)return e._searchMarker&&as(e._searchMarker,t,r.length),Lo(n,e,null,r);const i=t,s=El(e,t);let o=e._start;for(s!==null&&(o=s.p,t-=s.index,t===0&&(o=o.prev,t+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(t<=o.length){t<o.length&&Pn(n,be(o.id.client,o.id.clock+t));break}t-=o.length}return e._searchMarker&&as(e._searchMarker,i,r.length),Lo(n,e,o,r)},Vw=(n,e,t)=>{let i=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return Lo(n,e,i,t)},Ym=(n,e,t,r)=>{if(r===0)return;const i=t,s=r,o=El(e,t);let l=e._start;for(o!==null&&(l=o.p,t-=o.index);l!==null&&t>0;l=l.right)!l.deleted&&l.countable&&(t<l.length&&Pn(n,be(l.id.client,l.id.clock+t)),t-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&Pn(n,be(l.id.client,l.id.clock+r)),l.delete(n),r-=l.length),l=l.right;if(r>0)throw Vm();e._searchMarker&&as(e._searchMarker,i,-s+r)},Ro=(n,e,t)=>{const r=e._map.get(t);r!==void 0&&r.delete(n)},Fu=(n,e,t,r)=>{const i=e._map.get(t)||null,s=n.doc,o=s.clientID;let l;if(r==null)l=new ei([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new ei([r]);break;case Uint8Array:l=new Nl(r);break;case Rn:l=new Al(r);break;default:if(r instanceof Ke)l=new Hn(r);else throw new Error("Unexpected content type")}new Ve(be(o,rt(s.store,o)),i,i&&i.lastId,null,null,e,t,l).integrate(n,0)},Du=(n,e)=>{n.doc??Ye();const t=n._map.get(e);return t!==void 0&&!t.deleted?t.content.getContent()[t.length-1]:void 0},qm=n=>{const e={};return n.doc??Ye(),n._map.forEach((t,r)=>{t.deleted||(e[r]=t.content.getContent()[t.length-1])}),e},Zm=(n,e)=>{n.doc??Ye();const t=n._map.get(e);return t!==void 0&&!t.deleted},Gw=(n,e)=>{const t={};return n._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Br(s,e)&&(t[i]=s.content.getContent()[s.length-1])}),t},Ks=n=>(n.doc??Ye(),Cw(n._map.entries(),e=>!e[1].deleted));class Yw extends kl{}class Wi extends Ke{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Wi;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Wi}clone(){const e=new Wi;return e.insert(0,this.toArray().map(t=>t instanceof Ke?t.clone():t)),e}get length(){return this.doc??Ye(),this._length}_callObserver(e,t){super._callObserver(e,t),Tl(this,e,new Yw(this,e))}insert(e,t){this.doc!==null?ge(this.doc,r=>{Gm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){this.doc!==null?ge(this.doc,t=>{Vw(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc!==null?ge(this.doc,r=>{Ym(r,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return Jm(this,e)}toArray(){return jm(this)}slice(e=0,t=this.length){return Wm(this,e,t)}toJSON(){return this.map(e=>e instanceof Ke?e.toJSON():e)}map(e){return Hm(this,e)}forEach(e){cs(this,e)}[Symbol.iterator](){return Jw(this)}_write(e){e.writeTypeRef(sv)}}class qw extends kl{constructor(e,t,r){super(e,t),this.keysChanged=r}}class pt extends Ke{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new pt}clone(){const e=new pt;return this.forEach((t,r)=>{e.set(r,t instanceof Ke?t.clone():t)}),e}_callObserver(e,t){Tl(this,e,new qw(this,e,t))}toJSON(){this.doc??Ye();const e={};return this._map.forEach((t,r)=>{if(!t.deleted){const i=t.content.getContent()[t.length-1];e[r]=i instanceof Ke?i.toJSON():i}}),e}get size(){return[...Ks(this)].length}keys(){return xa(Ks(this),e=>e[0])}values(){return xa(Ks(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return xa(Ks(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Ye(),this._map.forEach((t,r)=>{t.deleted||e(t.content.getContent()[t.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?ge(this.doc,t=>{Ro(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return this.doc!==null?ge(this.doc,r=>{Fu(r,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return Du(this,e)}has(e){return Zm(this,e)}clear(){this.doc!==null?ge(this.doc,e=>{this.forEach(function(t,r,i){Ro(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(ov)}}const En=(n,e)=>n===e||typeof n=="object"&&typeof e=="object"&&n&&e&&vC(n,e);class _c{constructor(e,t,r,i){this.left=e,this.right=t,this.index=r,this.currentAttributes=i}forward(){this.right===null&&hn(),this.right.content.constructor===Le?this.right.deleted||Si(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const xh=(n,e,t)=>{for(;e.right!==null&&t>0;)e.right.content.constructor===Le?e.right.deleted||Si(e.currentAttributes,e.right.content):e.right.deleted||(t<e.right.length&&Pn(n,be(e.right.id.client,e.right.id.clock+t)),e.index+=e.right.length,t-=e.right.length),e.left=e.right,e.right=e.right.right;return e},Ws=(n,e,t,r)=>{const i=new Map,s=r?El(e,t):null;if(s){const o=new _c(s.p.left,s.p,s.index,i);return xh(n,o,t-s.index)}else{const o=new _c(null,e._start,0,i);return xh(n,o,t)}},Xm=(n,e,t,r)=>{for(;t.right!==null&&(t.right.deleted===!0||t.right.content.constructor===Le&&En(r.get(t.right.content.key),t.right.content.value));)t.right.deleted||r.delete(t.right.content.key),t.forward();const i=n.doc,s=i.clientID;r.forEach((o,l)=>{const a=t.left,c=t.right,u=new Ve(be(s,rt(i.store,s)),a,a&&a.lastId,c,c&&c.id,e,null,new Le(l,o));u.integrate(n,0),t.right=u,t.forward()})},Si=(n,e)=>{const{key:t,value:r}=e;r===null?n.delete(t):n.set(t,r)},Qm=(n,e)=>{for(;n.right!==null;){if(!(n.right.deleted||n.right.content.constructor===Le&&En(e[n.right.content.key]??null,n.right.content.value)))break;n.forward()}},e_=(n,e,t,r)=>{const i=n.doc,s=i.clientID,o=new Map;for(const l in r){const a=r[l],c=t.currentAttributes.get(l)??null;if(!En(c,a)){o.set(l,c);const{left:u,right:d}=t;t.right=new Ve(be(s,rt(i.store,s)),u,u&&u.lastId,d,d&&d.id,e,null,new Le(l,a)),t.right.integrate(n,0),t.forward()}}return o},Ca=(n,e,t,r,i)=>{t.currentAttributes.forEach((f,h)=>{i[h]===void 0&&(i[h]=null)});const s=n.doc,o=s.clientID;Qm(t,i);const l=e_(n,e,t,i),a=r.constructor===String?new mn(r):r instanceof Ke?new Hn(r):new Ci(r);let{left:c,right:u,index:d}=t;e._searchMarker&&as(e._searchMarker,t.index,a.getLength()),u=new Ve(be(o,rt(s.store,o)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(n,0),t.right=u,t.index=d,t.forward(),Xm(n,e,t,l)},Sh=(n,e,t,r,i)=>{const s=n.doc,o=s.clientID;Qm(t,i);const l=e_(n,e,t,i);e:for(;t.right!==null&&(r>0||l.size>0&&(t.right.deleted||t.right.content.constructor===Le));){if(!t.right.deleted)switch(t.right.content.constructor){case Le:{const{key:a,value:c}=t.right.content,u=i[a];if(u!==void 0){if(En(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}t.right.delete(n)}else t.currentAttributes.set(a,c);break}default:r<t.right.length&&Pn(n,be(t.right.id.client,t.right.id.clock+r)),r-=t.right.length;break}t.forward()}if(r>0){let a="";for(;r>0;r--)a+=`
|
|
38
|
+
`;t.right=new Ve(be(o,rt(s.store,o)),t.left,t.left&&t.left.lastId,t.right,t.right&&t.right.id,e,null,new mn(a)),t.right.integrate(n,0),t.forward()}Xm(n,e,t,l)},t_=(n,e,t,r,i)=>{let s=e;const o=Jt();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Le){const c=s.content;o.set(c.key,c)}s=s.right}let l=0,a=!1;for(;e!==s;){if(t===e&&(a=!0),!e.deleted){const c=e.content;if(c.constructor===Le){const{key:u,value:d}=c,f=r.get(u)??null;(o.get(u)!==c||f===d)&&(e.delete(n),l++,!a&&(i.get(u)??null)===d&&f!==d&&(f===null?i.delete(u):i.set(u,f))),!a&&!e.deleted&&Si(i,c)}}e=e.right}return l},Zw=(n,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const t=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Le){const r=e.content.key;t.has(r)?e.delete(n):t.add(r)}e=e.left}},Xw=n=>{let e=0;return ge(n.doc,t=>{let r=n._start,i=n._start,s=Jt();const o=uc(s);for(;i;)i.deleted===!1&&(i.content.constructor===Le?Si(o,i.content):(e+=t_(t,r,i,s,o),s=uc(o),r=i)),i=i.right}),e},Qw=n=>{const e=new Set,t=n.doc;for(const[r,i]of n.afterState.entries()){const s=n.beforeState.get(r)||0;i!==s&&zm(n,t.store.clients.get(r),s,i,o=>{!o.deleted&&o.content.constructor===Le&&o.constructor!==wn&&e.add(o.parent)})}ge(t,r=>{$m(n,n.deleteSet,i=>{if(i instanceof wn||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===Le?e.add(s):Zw(r,i)});for(const i of e)Xw(i)})},Ch=(n,e,t)=>{const r=t,i=uc(e.currentAttributes),s=e.right;for(;t>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Hn:case Ci:case mn:t<e.right.length&&Pn(n,be(e.right.id.client,e.right.id.clock+t)),t-=e.right.length,e.right.delete(n);break}e.forward()}s&&t_(n,s,e.right,i,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&as(o._searchMarker,e.index,-r+t),e};class ev extends kl{constructor(e,t,r){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,t=[];ge(e,r=>{const i=new Map,s=new Map;let o=this.target._start,l=null;const a={};let c="",u=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},i.size>0&&(h.attributes={},i.forEach((g,p)=>{g!==null&&(h.attributes[p]=g)}))),c="";break;case"retain":u>0&&(h={retain:u},wC(a)||(h.attributes=xC({},a))),u=0;break}h&&t.push(h),l=null}};for(;o!==null;){switch(o.content.constructor){case Hn:case Ci:this.adds(o)?this.deletes(o)||(f(),l="insert",c=o.content.getContent()[0],f()):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=1):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=1);break;case mn:this.adds(o)?this.deletes(o)||(l!=="insert"&&(f(),l="insert"),c+=o.content.str):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=o.length):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=o.length);break;case Le:{const{key:h,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const p=i.get(h)??null;En(p,g)?g!==null&&o.delete(r):(l==="retain"&&f(),En(g,s.get(h)??null)?delete a[h]:a[h]=g)}}else if(this.deletes(o)){s.set(h,g);const p=i.get(h)??null;En(p,g)||(l==="retain"&&f(),a[h]=p)}else if(!o.deleted){s.set(h,g);const p=a[h];p!==void 0&&(En(p,g)?p!==null&&o.delete(r):(l==="retain"&&f(),g===null?delete a[h]:a[h]=g))}o.deleted||(l==="insert"&&f(),Si(i,o.content));break}}o=o.right}for(f();t.length>0;){const h=t[t.length-1];if(h.retain!==void 0&&h.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}}class us extends Ke{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Ye(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new us}clone(){const e=new us;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const r=new ev(this,e,t);Tl(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Ye();let e="",t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===mn&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc!==null?ge(this.doc,r=>{const i=new _c(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const l=!t&&typeof o.insert=="string"&&s===e.length-1&&i.right===null&&o.insert.slice(-1)===`
|
|
39
|
+
`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Ca(r,this,i,l,o.attributes||{})}else o.retain!==void 0?Sh(r,this,i,o.retain,o.attributes||{}):o.delete!==void 0&&Ch(r,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,r){this.doc??Ye();const i=[],s=new Map,o=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;s.forEach((g,p)=>{f=!0,d[p]=g});const h={insert:l};f&&(h.attributes=d),i.push(h),l=""}}const u=()=>{for(;a!==null;){if(Br(a,e)||t!==void 0&&Br(a,t))switch(a.content.constructor){case mn:{const d=s.get("ychange");e!==void 0&&!Br(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),s.set("ychange",r?r("removed",a.id):{type:"removed"})):t!==void 0&&!Br(a,t)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),s.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),s.delete("ychange")),l+=a.content.str;break}case Hn:case Ci:{c();const d={insert:a.content.getContent()[0]};if(s.size>0){const f={};d.attributes=f,s.forEach((h,g)=>{f[g]=h})}i.push(d);break}case Le:Br(a,e)&&(c(),Si(s,a.content));break}a=a.right}c()};return e||t?ge(o,d=>{e&&pc(d,e),t&&pc(d,t),u()},"cleanup"):u(),i}insert(e,t,r){if(t.length<=0)return;const i=this.doc;i!==null?ge(i,s=>{const o=Ws(s,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),Ca(s,this,o,t,r)}):this._pending.push(()=>this.insert(e,t,r))}insertEmbed(e,t,r){const i=this.doc;i!==null?ge(i,s=>{const o=Ws(s,this,e,!r);Ca(s,this,o,t,r||{})}):this._pending.push(()=>this.insertEmbed(e,t,r||{}))}delete(e,t){if(t===0)return;const r=this.doc;r!==null?ge(r,i=>{Ch(i,Ws(i,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,r){if(t===0)return;const i=this.doc;i!==null?ge(i,s=>{const o=Ws(s,this,e,!1);o.right!==null&&Sh(s,this,o,t,r)}):this._pending.push(()=>this.format(e,t,r))}removeAttribute(e){this.doc!==null?ge(this.doc,t=>{Ro(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?ge(this.doc,r=>{Fu(r,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return Du(this,e)}getAttributes(){return qm(this)}_write(e){e.writeTypeRef(lv)}}class wa{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Ye()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===pn||t.constructor===Qr)&&t._start!==null)e=t._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Qr extends Ke{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Qr}clone(){const e=new Qr;return e.insert(0,this.toArray().map(t=>t instanceof Ke?t.clone():t)),e}get length(){return this.doc??Ye(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new wa(this,e)}querySelector(e){e=e.toUpperCase();const r=new wa(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Zr(new wa(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Tl(this,e,new tv(this,t,e))}toString(){return Hm(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),cs(this,s=>{i.insertBefore(s.toDOM(e,t,r),null)}),i}insert(e,t){this.doc!==null?ge(this.doc,r=>{Gm(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)ge(this.doc,r=>{const i=e&&e instanceof Ke?e._item:e;Lo(r,this,i,t)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Ln("Reference item not found");r.splice(i,0,...t)}}delete(e,t=1){this.doc!==null?ge(this.doc,r=>{Ym(r,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return jm(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Jm(this,e)}slice(e=0,t=this.length){return Wm(this,e,t)}forEach(e){cs(this,e)}_write(e){e.writeTypeRef(cv)}}class pn extends Qr{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new pn(this.nodeName)}clone(){const e=new pn(this.nodeName),t=this.getAttributes();return CC(t,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Ke?r.clone():r)),e}toString(){const e=this.getAttributes(),t=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const a=r[l];t.push(a+'="'+e[a]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=t.length>0?" "+t.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?ge(this.doc,t=>{Ro(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?ge(this.doc,r=>{Fu(r,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return Du(this,e)}hasAttribute(e){return Zm(this,e)}getAttributes(e){return e?Gw(this,e):qm(this)}toDOM(e=document,t={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const l=s[o];typeof l=="string"&&i.setAttribute(o,l)}return cs(this,o=>{i.appendChild(o.toDOM(e,t,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(av),e.writeKey(this.nodeName)}}class tv extends kl{constructor(e,t,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class zn extends us{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new zn}clone(){const e=new zn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const t=[];for(const i in e.attributes){const s=[];for(const o in e.attributes[i])s.push({key:o,value:e.attributes[i][o]});s.sort((o,l)=>o.key<l.key?-1:1),t.push({nodeName:i,attrs:s})}t.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<t.length;i++){const s=t[i];r+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const l=s.attrs[o];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=t.length-1;i>=0;i--)r+=`</${t[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(uv)}}class n_{constructor(e,t){this.id=e,this.length=t}get deleted(){throw $t()}mergeWith(e){return!1}write(e,t,r){throw $t()}integrate(e,t){throw $t()}}const nv=0;class wn extends n_{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),Pm(e.doc.store,this)}write(e,t){e.writeInfo(nv),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Nl{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Nl(this.content)}splice(e){throw $t()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class Po{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Po(this.len)}splice(e){const t=new Po(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Dm(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const rv=(n,e)=>new Rn({guid:n,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Al{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Al(rv(this.doc.guid,this.opts))}splice(e){throw $t()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Ci{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Ci(this.embed)}splice(e){throw $t()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Le{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Le(this.key,this.value)}splice(e){throw $t()}mergeWith(e){return!1}integrate(e,t){const r=t.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const iv=Io("node_env")==="development";class ei{constructor(e){this.arr=e,iv&&am(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ei(this.arr)}splice(e){const t=new ei(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const r=this.arr.length;e.writeLen(r-t);for(let i=t;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}class mn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new mn(this.str)}splice(e){const t=new mn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}}const sv=0,ov=1,lv=2,av=3,cv=4,uv=6;class Hn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Hn(this.type._copy())}splice(e){throw $t()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const r_=(n,e,t)=>{const{client:r,clock:i}=e.id,s=new Ve(be(r,i+t),e,be(r,i+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=be(e.redone.client,e.redone.clock+t)),e.right=s,s.right!==null&&(s.right.left=s),n._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=t,s};class Ve extends n_{constructor(e,t,r,i,s,o,l,a){super(e,a.getLength()),this.origin=r,this.left=t,this.right=i,this.rightOrigin=s,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?eh:0}set marker(e){(this.info&pa)>0!==e&&(this.info^=pa)}get marker(){return(this.info&pa)>0}get keep(){return(this.info&Qf)>0}set keep(e){this.keep!==e&&(this.info^=Qf)}get countable(){return(this.info&eh)>0}get deleted(){return(this.info&ga)>0}set deleted(e){this.deleted!==e&&(this.info^=ga)}markDeleted(){this.info|=ga}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=rt(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=rt(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Qs&&this.id.client!==this.parent.client&&this.parent.clock>=rt(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=mh(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Pn(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===wn||this.right&&this.right.constructor===wn)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Ve?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Ve&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Qs){const r=Sa(t,this.parent);r.constructor===wn?this.parent=null:this.parent=r.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=mh(e,e.doc.store,be(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,i;if(r!==null)i=r.right;else if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start;const s=new Set,o=new Set;for(;i!==null&&i!==this.right;){if(o.add(i),s.add(i),Us(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Us(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&o.has(Sa(e.doc.store,i.origin)))s.has(Sa(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Pm(e.doc.store,this),this.content.integrate(e,this),yh(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new wn(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:be(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Us(e.origin,this.lastId)&&this.right===e&&Us(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Dm(e.deleteSet,this.id.client,this.id.clock,this.length),yh(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw hn();this.content.gc(e),t?Pw(e,this,new wn(this.id,this.length)):this.content=new Po(this.length)}write(e,t){const r=t>0?be(this.id.client,this.id.clock+t-1):this.origin,i=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&HS|(r===null?0:Mo)|(i===null?0:im)|(s===null?0:jS);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=Dw(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===Qs?(e.writeParentInfo(!1),e.writeLeftID(l)):hn();s!==null&&e.writeString(s)}this.content.write(e,t)}}const i_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},s_="__ $YJS$ __";i_[s_]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");i_[s_]=!0;function Be(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function dv(n,e,t){const r=n.length,i=e.length;let s=0,o=0;for(;s<r&&s<i&&n[s]===e[s]&&s<t;)s++;for(;o+s<r&&o+s<i&&n[r-o-1]===e[i-o-1];)o++;for(;o+s<r&&o+s<i&&n[s]===e[s];)s++;return{index:s,insert:e.slice(s,i-o),remove:r-s-o}}class Xn{_xmlElem;_key;_parent;_type;constructor(e,t,r){this._key="",this._xmlElem=e,this._parent=t,this._type=r}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return Y(t)?t:null}getNode(){const e=Z(this._key);return Y(e)?e:null}getSharedType(){return this._xmlElem}getType(){return this._type}getKey(){return this._key}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}syncPropertiesFromLexical(e,t,r){const i=this.getPrevNode(r);Pu(e,this._xmlElem,i,t)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Be(83),Ru(e,this._xmlElem,r,t)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function o_(n,e,t){const r=new Xn(n,e,t);return n._collabNode=r,r}class Di{_map;_key;_parent;_type;constructor(e,t){this._key="",this._map=e,this._parent=t,this._type="linebreak"}getNode(){const e=Z(this._key);return ue(e)?e:null}getKey(){return this._key}getSharedType(){return this._map}getType(){return this._type}getSize(){return 1}getOffset(){return this._parent.getChildOffset(this)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function l_(n,e){const t=new Di(n,e);return n._collabNode=t,t}class mt{_map;_key;_parent;_text;_type;_normalized;constructor(e,t,r,i){this._key="",this._map=e,this._parent=r,this._text=t,this._type=i,this._normalized=!1}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return D(t)?t:null}getNode(){const e=Z(this._key);return D(e)?e:null}getSharedType(){return this._map}getType(){return this._type}getKey(){return this._key}getSize(){return this._text.length+(this._normalized?0:1)}getOffset(){return this._parent.getChildOffset(this)}spliceText(e,t,r){const i=this._parent._xmlText,s=this.getOffset()+1+e;t!==0&&i.delete(s,t),r!==""&&i.insert(s,r)}syncPropertiesAndTextFromLexical(e,t,r){const i=this.getPrevNode(r),s=t.__text;if(Pu(e,this._map,i,t),i!==null){const o=i.__text;o!==s&&((function(l,a,c,u){const d=M();let f=u.length;if(N(d)&&d.isCollapsed()){const g=d.anchor;g.key===a&&(f=g.offset)}const h=dv(c,u,f);l.spliceText(h.index,h.remove,h.insert)})(this,t.__key,o,s),this._text=s)}}syncPropertiesAndTextFromYjs(e,t){const r=this.getNode();r===null&&Be(84),Ru(e,this._map,r,t);const i=this._text;r.__text!==i&&r.setTextContent(i)}destroy(e){const t=e.collabNodeMap;t.get(this._key)===this&&t.delete(this._key)}}function a_(n,e,t,r){const i=new mt(n,e,t,r);return n._collabNode=i,i}class tn{_key;_children;_xmlText;_type;_parent;constructor(e,t,r){this._key="",this._children=[],this._xmlText=e,this._type=r,this._parent=t}getPrevNode(e){if(e===null)return null;const t=e.get(this._key);return A(t)?t:null}getNode(){const e=Z(this._key);return A(e)?e:null}getSharedType(){return this._xmlText}getType(){return this._type}getKey(){return this._key}isEmpty(){return this._children.length===0}getSize(){return 1}getOffset(){const e=this._parent;return e===null&&Be(90),e.getChildOffset(this)}syncPropertiesFromYjs(e,t){const r=this.getNode();r===null&&Be(91),Ru(e,this._xmlText,r,t)}applyChildrenYjsDelta(e,t){const r=this._children;let i=0,s=null;for(let o=0;o<t.length;o++){const l=t[o],a=l.insert,c=l.delete;if(l.retain!=null)i+=l.retain;else if(typeof c=="number"){let u=c;for(;u>0;){const{node:d,nodeIndex:f,offset:h,length:g}=va(this,i,!1);if(d instanceof tn||d instanceof Di||d instanceof Xn)r.splice(f,1),u-=1;else{if(!(d instanceof mt))break;{const p=Math.min(u,g),m=f!==0?r[f-1]:null,b=d.getSize();if(h===0&&g===b){r.splice(f,1);const _=Ti(d._text,h,p-1,"");_.length>0&&(m instanceof mt?m._text+=_:this._xmlText.delete(h,_.length))}else d._text=Ti(d._text,h,p,"");u-=p}}}}else{if(a==null)throw new Error("Unexpected delta format");if(typeof a=="string"){const{node:u,offset:d}=va(this,i,!0);u instanceof mt?u._text=Ti(u._text,d,0,a):this._xmlText.delete(d,a.length),i+=a.length}else{const u=a,{node:d,nodeIndex:f,length:h}=va(this,i,!1),g=u_(e,u,this);if(d instanceof mt&&h>0&&h<d._text.length){const p=d._text,m=p.length-h;d._text=Ti(p,m,h,""),r.splice(f+1,0,g),s=Ti(p,0,m,"")}else r.splice(f,0,g);s!==null&&g instanceof mt&&(g._text=s+g._text,s=null),i+=1}}}}syncChildrenFromYjs(e){const t=this.getNode();t===null&&Be(92);const r=t.__key,i=rr(t,null),s=i.length,o=this._children,l=o.length,a=e.collabNodeMap,c=new Set;let u,d,f=0,h=null;l!==s&&(d=t.getWritable());for(let g=0;g<l;g++){const p=i[f],m=o[g],b=m.getNode(),_=m._key;if(b!==null&&p===_){const y=D(b);if(c.add(p),y)if(m._key=p,m instanceof tn){const C=m._xmlText;m.syncPropertiesFromYjs(e,null),m.applyChildrenYjsDelta(e,C.toDelta()),m.syncChildrenFromYjs(e)}else m instanceof mt?m.syncPropertiesAndTextFromYjs(e,null):m instanceof Xn?m.syncPropertiesFromYjs(e,null):m instanceof Di||Be(93);h=b,f++}else{if(u===void 0){u=new Set;for(let S=0;S<l;S++){const x=o[S]._key;x!==""&&u.add(x)}}if(b!==null&&p!==void 0&&!u.has(p)){const S=Zn(p);Wt(S),g--,f++;continue}d=t.getWritable();const y=Sv(e,m,r),C=y.__key;if(a.set(C,m),h===null){const S=d.getFirstChild();if(d.__first=C,S!==null){const x=S.getWritable();x.__prev=C,y.__next=x.__key}}else{const S=h.getWritable(),x=h.getNextSibling();if(S.__next=C,y.__prev=h.__key,x!==null){const w=x.getWritable();w.__prev=C,y.__next=w.__key}}g===l-1&&(d.__last=C),d.__size++,h=y}}for(let g=0;g<s;g++){const p=i[g];if(!c.has(p)){const m=Zn(p),b=e.collabNodeMap.get(p);b!==void 0&&b.destroy(e),Wt(m)}}}syncPropertiesFromLexical(e,t,r){Pu(e,this._xmlText,this.getPrevNode(r),t)}_syncChildFromLexical(e,t,r,i,s,o){const l=this._children[t],a=Zn(r);l instanceof tn&&A(a)?(l.syncPropertiesFromLexical(e,a,i),l.syncChildrenFromLexical(e,a,i,s,o)):l instanceof mt&&D(a)?l.syncPropertiesAndTextFromLexical(e,a,i):l instanceof Xn&&Y(a)&&l.syncPropertiesFromLexical(e,a,i)}syncChildrenFromLexical(e,t,r,i,s){const o=this.getPrevNode(r),l=o===null?[]:rr(o,r),a=rr(t,null),c=l.length-1,u=a.length-1,d=e.collabNodeMap;let f,h,g=0,p=0;for(;g<=c&&p<=u;){const _=l[g],y=a[p];if(_===y)this._syncChildFromLexical(e,p,y,r,i,s),g++,p++;else{f===void 0&&(f=new Set(l)),h===void 0&&(h=new Set(a));const C=h.has(_),S=f.has(y);if(C){const x=wh(e,Zn(y),this);d.set(y,x),S?(this.splice(e,p,1,x),g++,p++):(this.splice(e,p,0,x),p++)}else this.splice(e,p,1),g++}}const m=g>c,b=p>u;if(m&&!b)for(;p<=u;++p){const _=a[p],y=wh(e,Zn(_),this);this.append(y),d.set(_,y)}else if(b&&!m)for(let _=this._children.length-1;_>=p;_--)this.splice(e,_,1)}append(e){const t=this._xmlText,r=this._children,i=r[r.length-1],s=i!==void 0?i.getOffset()+i.getSize():0;if(e instanceof tn)t.insertEmbed(s,e._xmlText);else if(e instanceof mt){const o=e._map;o.parent===null&&t.insertEmbed(s,o),t.insert(s+1,e._text)}else e instanceof Di?t.insertEmbed(s,e._map):e instanceof Xn&&t.insertEmbed(s,e._xmlElem);this._children.push(e)}splice(e,t,r,i){const s=this._children,o=s[t];if(o===void 0)return i===void 0&&Be(94),void this.append(i);const l=o.getOffset();l===-1&&Be(95);const a=this._xmlText;if(r!==0&&a.delete(l,o.getSize()),i instanceof tn)a.insertEmbed(l,i._xmlText);else if(i instanceof mt){const c=i._map;c.parent===null&&a.insertEmbed(l,c),a.insert(l+1,i._text)}else i instanceof Di?a.insertEmbed(l,i._map):i instanceof Xn&&a.insertEmbed(l,i._xmlElem);if(r!==0){const c=s.slice(t,t+r);for(let u=0;u<c.length;u++)c[u].destroy(e)}i!==void 0?s.splice(t,r,i):s.splice(t,r)}getChildOffset(e){let t=0;const r=this._children;for(let i=0;i<r.length;i++){const s=r[i];if(s===e)return t;t+=s.getSize()}return-1}destroy(e){const t=e.collabNodeMap,r=this._children;for(let i=0;i<r.length;i++)r[i].destroy(e);t.get(this._key)===this&&t.delete(this._key)}}function Lu(n,e,t){const r=new tn(n,e,t);return n._collabNode=r,r}function fv(n,e,t,r,i){t==null&&Be(81);const s={clientID:t.clientID,cursors:new Map,cursorsContainer:null,doc:t,docMap:r,editor:n,excludedProperties:i||new Map,id:e,nodeProperties:new Map};return(function(o){const{editor:l,nodeProperties:a}=o;l.update(()=>{l._nodes.forEach(c=>{const u=new c.klass,d={};for(const[f,h]of Object.entries(u))c_(f,u,o)||(d[f]=h);a.set(u.__type,Object.freeze(d))})})})(s),s}function hv(n,e,t,r,i,s){r==null&&Be(81);const o=Lu(r.get("root",zn),null,"root");return o._key="root",{...fv(n,t,r,i,s),collabNodeMap:new Map,root:o}}function gv(n){return Object.hasOwn(n,"collabNodeMap")}const pv=new Set(["__key","__parent","__next","__prev","__state"]),mv=new Set(["__first","__last","__size"]),_v=new Set(["__cachedText"]),yv=new Set(["__text"]);function c_(n,e,t){if(pv.has(n)||typeof e[n]=="function")return!0;if(D(e)){if(yv.has(n))return!0}else if(A(e)&&(mv.has(n)||ye(e)&&_v.has(n)))return!0;const r=e.constructor,i=t.excludedProperties.get(r);return i!=null&&i.has(n)}function bv(n,e){const t=n.__type,{nodeProperties:r}=e,i=r.get(t);return i===void 0&&Be(330,t),i}function wh(n,e,t){const r=e.__type;let i;if(A(e))i=Lu(new zn,t,r),i.syncPropertiesFromLexical(n,e,null),i.syncChildrenFromLexical(n,e,null,null,null);else if(D(e))i=a_(new pt,e.__text,t,r),i.syncPropertiesAndTextFromLexical(n,e,null);else if(ue(e)){const s=new pt;s.set("__type","linebreak"),i=l_(s,t)}else Y(e)?(i=o_(new pn,t,r),i.syncPropertiesFromLexical(n,e,null)):Be(86);return i._key=e.__key,i}function xv(n){const e=Ol(n,"__type");return typeof e!="string"&&e!==void 0&&Be(87),e}function u_(n,e,t){const r=e._collabNode;if(r===void 0){const i=n.editor._nodes,s=xv(e);typeof s!="string"&&Be(87),i.get(s)===void 0&&Be(88,s);const o=e.parent,l=t===void 0&&o!==null?u_(n,o):t||null;if(l instanceof tn||Be(89),e instanceof zn)return Lu(e,l,s);if(e instanceof pt)return s==="linebreak"?l_(e,l):a_(e,"",l,s);if(e instanceof pn)return o_(e,l,s)}return r}function Sv(n,e,t){const r=e.getType(),i=n.editor._nodes.get(r);i===void 0&&Be(88,r);const s=new i.klass;if(s.__parent=t,e._key=s.__key,e instanceof tn){const o=e._xmlText;e.syncPropertiesFromYjs(n,null),e.applyChildrenYjsDelta(n,o.toDelta()),e.syncChildrenFromYjs(n)}else e instanceof mt?e.syncPropertiesAndTextFromYjs(n,null):e instanceof Xn&&e.syncPropertiesFromYjs(n,null);return n.collabNodeMap.set(s.__key,e),s}function Ru(n,e,t,r){const i=r===null?e instanceof pt?Array.from(e.keys()):e instanceof zn||e instanceof pn?Object.keys(e.getAttributes()):Object.keys(e):Array.from(r);let s;for(let o=0;o<i.length;o++){const l=i[o];if(c_(l,t,n)){l==="__state"&&gv(n)&&(s||(s=t.getWritable()),Cv(e,s));continue}const a=t[l];let c=Ol(e,l);if(a!==c){if(c instanceof Rn){const u=n.docMap;a instanceof Rn&&u.delete(a.guid);const d=ui(),f=c.guid;d._key=f,u.set(f,c),c=d}s===void 0&&(s=t.getWritable()),s[l]=c}}}function Ol(n,e){return n instanceof pt?n.get(e):n instanceof zn||n instanceof pn?n.getAttribute(e):n[e]}function vh(n,e,t){n instanceof pt?n.set(e,t):n.setAttribute(e,t)}function Cv(n,e){const t=Ol(n,"__state");t instanceof pt&&Uo(e).updateFromJSON(t.toJSON())}function Pu(n,e,t,r){const i=Object.keys(bv(r,n)),s=n.editor.constructor;(function(o,l,a,c){const u=c.__state,d=Ol(l,"__state");if(!u)return;const[f,h]=u.getInternalState(),g=a&&a.__state,p=d instanceof pt?d:new pt;if(g===u)return;const[m,b]=g&&p.doc?g.getInternalState():[void 0,new Map];if(f)for(const[_,y]of Object.entries(f))m&&y!==m[_]&&p.set(_,y);for(const[_,y]of h)b.get(_)!==y&&p.set(_.key,_.unparse(y));d||vh(l,"__state",p)})(0,e,t,r);for(let o=0;o<i.length;o++){const l=i[o],a=t===null?void 0:t[l];let c=r[l];if(a!==c){if(c instanceof s){const u=n.docMap;let d;if(a instanceof s){const g=a._key;d=u.get(g),u.delete(g)}const f=d||new Rn,h=f.guid;c._key=h,u.set(h,f),c=f,n.editor.update(()=>{r.markDirty()})}vh(e,l,c)}}}function Ti(n,e,t,r){return n.slice(0,e)+r+n.slice(e+t)}function va(n,e,t){let r=0,i=0;const s=n._children,o=s.length;for(;i<o;i++){const l=s[i],a=r;if(r+=l.getSize(),(t?r>=e:r>e)&&l instanceof mt){let c=e-a-1;return c<0&&(c=0),{length:r-e,node:l,nodeIndex:i,offset:c}}if(r>e)return{length:0,node:l,nodeIndex:i,offset:a};if(i===o-1)return{length:0,node:null,nodeIndex:i+1,offset:a+1}}return{length:0,node:null,nodeIndex:0,offset:0}}Cc("ychange",{isEqual:(n,e)=>n===e,parse:n=>n??null});async function d_(){return Zy}async function Ml(n){return jb(n)}async function $l(n){return eS(n)}async function Il(n,e){const t=Hp(),r=e?.delay??300;return jp(n,t,r)}async function Fl(n){return()=>{}}async function Dl(n){return typeof sa=="function"?typeof of=="function"?ft(sa(n),of(n)):sa(n):ft(n.registerCommand(mi,()=>(oa(n,"number"),!0),G),n.registerCommand(pi,()=>(oa(n,"bullet"),!0),G),n.registerCommand(hl,()=>(oa(n,"check"),!0),G),n.registerCommand(uu,()=>(Qb(n),!0),G))}async function Ll(n){return n.registerCommand(nc,e=>(e===null||typeof e=="string"?la(e):la(e.url,e),!0),G)}async function wv(n,e,t){const r=e?.trigger||"/";let i=!1,s=null,o=0;const l=()=>n.getEditorState().read(()=>{const p=M();if(!N(p)||!p.isCollapsed())return!1;const m=p.anchor,b=m.getNode();if(!D(b))return!1;const _=b.getTextContent(),y=m.offset;if(y===0||_[y-1]!==r)return!1;if(y===1)return!0;const S=_[y-2];return!!/\s/.test(S)}),a=()=>s?n.getEditorState().read(()=>{if(!s)return"";const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return"";const b=M();if(!N(b))return"";const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return"";const C=_.offset;return C<=m?"":p.slice(m+1,C)}):"",c=()=>{n.getEditorState().read(()=>{const p=M();if(N(p)){const m=p.anchor,b=m.getNode();if(D(b)){s=b,o=m.offset-1,i=!0;const _={isActive:!0,filterText:"",anchorNode:s,anchorOffset:o};t?.onTrigger?.(_,d),t?.onUpdate?.(_,d)}}})},u=()=>{i&&(i=!1,s=null,o=0,t?.onDismiss?.())},d=()=>{s&&n.update(()=>{if(!s)return;const p=s.getTextContent(),m=p.indexOf(r,o);if(m===-1)return;const b=M();if(!N(b))return;const _=b.anchor;if(_.getNode().getKey()!==s.getKey())return;const C=_.offset,S=p.slice(0,m),x=p.slice(C);s.setTextContent(S+x);const w=M();N(w)&&(w.anchor.set(s.getKey(),m,"text"),w.focus.set(s.getKey(),m,"text"))})},f=()=>{if(!i)return;const m={isActive:!0,filterText:a(),anchorNode:s,anchorOffset:o};t?.onUpdate?.(m,d)},h=n.registerMutationListener(qe,p=>{if(!i&&l()){c();return}i&&(s&&!p.has(s.getKey())?f():u())}),g=ft(n.registerUpdateListener(({editorState:p})=>{p.read(()=>{if(!i)return;const m=M();if(!N(m)){u();return}const b=m.anchor,_=b.getNode();if(!s||_.getKey()!==s.getKey()){u();return}const C=s.getTextContent().indexOf(r,o);if(C===-1||b.offset<=C){u();return}})}),n.registerCommand(ar,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(cn,p=>i?(p.preventDefault(),!0):!1,G),n.registerCommand(In,p=>i?(p?.preventDefault(),!0):!1,G),n.registerCommand(oi,p=>i?(p?.preventDefault(),u(),!0):!1,G));return()=>{u(),h(),g()}}function vv(n,e,t){t(),e.handler(n),n.focus()}const kv=K("TOGGLE_SLASH_COMMAND_PALETTE"),Ts=K("INSERT_HORIZONTAL_RULE_COMMAND"),Ev=K("INSERT_IMAGE_COMMAND");function Rl(n){return n.registerCommand(Ts,()=>{const e=M();if(!N(e))return!1;if(e.focus.getNode()!==null){const r=vs();e.insertNodes([r]);const i=J();r.insertAfter(i),i.selectStart()}return!0},G)}const f_={dependencies:[Ar],export:n=>Wp(n)?"---":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=vs();if(r)n.replace(i);else{n.replace(i);const s=J();i.insertAfter(s),s.selectStart()}},type:"element"},zu=[...yu,f_];async function bt(n){let e="";return n.getEditorState().read(()=>{e=FS(zu)}),e}async function Bn(n,e){n.update(()=>{IS(e,zu)})}async function h_(){return zu}const Bu=Object.freeze(Object.defineProperty({__proto__:null,exportToMarkdown:bt,getMarkdownTransformers:h_,importFromMarkdown:Bn},Symbol.toStringTag,{value:"Module"}));async function xt(n){let e="";return n.getEditorState().read(()=>{e=lp(n)}),e}async function Un(n,e){n.update(()=>{const r=new DOMParser().parseFromString(e,"text/html"),i=op(n,r);de().clear(),Zo(i)})}const Uu=Object.freeze(Object.defineProperty({__proto__:null,exportToHtml:xt,importFromHtml:Un},Symbol.toStringTag,{value:"Module"}));async function Tv(n,e,t){let r,i,s;switch(e){case"markdown":r=await bt(n),i="text/markdown",s="md";break;case"html":r=await xt(n),i="text/html",s="html";break;case"json":r=JSON.stringify(n.getEditorState().toJSON(),null,2),i="application/json",s="json";break}const o=new Blob([r],{type:i}),l=URL.createObjectURL(o),a=document.createElement("a");a.href=l,a.download=t??`document.${s}`,a.click(),URL.revokeObjectURL(l)}async function Nv(n,e,t){const r=await new Promise((s,o)=>{const l=new FileReader;l.onload=()=>s(l.result),l.onerror=()=>o(l.error),l.readAsText(e)});switch(t??Av(e.name)){case"markdown":{const{importFromMarkdown:s}=await Promise.resolve().then(()=>Bu);await s(n,r);break}case"html":{const{importFromHtml:s}=await Promise.resolve().then(()=>Uu);await s(n,r);break}case"json":{const s=n.parseEditorState(r);n.setEditorState(s);break}}}function Av(n){return n.endsWith(".md")||n.endsWith(".markdown")?"markdown":n.endsWith(".html")||n.endsWith(".htm")?"html":"json"}async function Pl(n,e){return typeof _f=="function"?_f(n):()=>{}}async function Ov(n,e=3,t=3){n.dispatchCommand(ws,{rows:String(e),columns:String(t),includeHeaders:!0})}async function Mv(n,e){return typeof Ao=="function"?Ao(n):()=>{}}async function $v(n,e){return typeof Ao=="function"?Ao(n):()=>{}}const Iv=/#[\w\u0590-\u05ff]+/;function Fv(n){return new pl(n)}async function Dv(n,e){const t=[],r=Ux(n,i=>{const s=Iv.exec(i);return s?{start:s.index,end:s.index+s[0].length}:null},pl,Fv);if(Array.isArray(r)?t.push(...r):typeof r=="function"&&t.push(r),e?.onHashtagClick){const i=n.registerCommand(mr,s=>{const o=s.target;if(o.classList.contains("bc-lexical-hashtag")){const l=o.textContent;if(l)return e.onHashtagClick(l.replace("#","")),!0}return!1},G);t.push(i)}return()=>{t.forEach(i=>i())}}const Lv=/((https?:\/\/(www\.)?|www\.)[^\s<>]+)/g,Rv=/([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/g,Pv=[{pattern:Lv,urlTransformer:n=>n.startsWith("http")?n:`https://${n}`},{pattern:Rv,urlTransformer:n=>`mailto:${n}`}];async function zv(n,e){const t=e?.matchers??Pv;return n.registerMutationListener(qe,r=>{n.update(()=>{for(const[i,s]of r){if(s!=="created"&&s!=="updated")continue;const o=Z(i);if(!o||!D(o))continue;const l=o.getTextContent();for(const a of t){const c=new RegExp(a.pattern.source,a.pattern.flags);let u;for(;(u=c.exec(l))!==null;)a.urlTransformer(u[0])}}})})}async function Bv(n,e){const t=[];return e?.onMarkClick&&t.push(n.registerCommand(mr,r=>{const i=r.target;if(i.classList.contains("bc-lexical-mark")){const s=i.dataset.markId;if(s)return e.onMarkClick(s,{id:s,type:i.dataset.markType||"annotation",data:{}}),!0}return!1},G)),()=>t.forEach(r=>r())}async function Uv(n,e,t){n.update(()=>{const r=M();N(r)&&jx(r,r.isBackward(),e)})}async function Kv(n,e){n.update(()=>{const r=de().getAllTextNodes().filter(i=>{const s=i.getParent();return ns(s)?Hx(i,0)?.includes(e)??!1:!1});for(const i of r){const s=i.getParent();ns(s)&&Wx(s)}})}async function Wv(n,e){const{maxLength:t,onOverflow:r}=e;return n.registerUpdateListener(({editorState:i})=>{i.read(()=>{const l=de().getTextContent().length,a=l>t;r&&r(a,l)})})}async function zl(n){return typeof Vd=="function"?Vd(n):()=>{}}async function Bl(n,e){const t=e.docMap??new Map,r=e.id??"lexical",i=e.doc.getText(r),s=hv(n,e.provider,i,e.doc,t),o=n.registerUpdateListener(()=>{});return()=>{o(),s&&typeof s.destroy=="function"&&s.destroy()}}function jv(n){let e={hasSelection:!1,selectedText:"",anchorOffset:0,focusOffset:0};return n.getEditorState().read(()=>{const t=M();N(t)&&(e={hasSelection:!t.isCollapsed(),selectedText:t.getTextContent(),anchorOffset:t.anchor.offset,focusOffset:t.focus.offset})}),e}function Ku(n){let e="";return n.getEditorState().read(()=>{e=de().getTextContent()}),e}function Hv(n){return Ku(n).length}function Jv(n){const e=Ku(n).trim();return e?e.split(/\s+/).length:0}async function Vv(){return PS}function g_(n,e,t){const r=new Map;if(n)for(const i of n.split(";")){const s=i.trim();if(!s)continue;const o=s.indexOf(":");if(o===-1)continue;const l=s.slice(0,o).trim(),a=s.slice(o+1).trim();r.set(l,a)}return t?r.set(e,t):r.delete(e),r.size===0?"":Array.from(r.entries()).map(([i,s])=>`${i}: ${s}`).join("; ")}function Ul(n,e){if(!n)return"";const t=new RegExp(`(?:^|;)\\s*${e.replace(/-/g,"\\-")}:\\s*([^;]+)`),r=n.match(t);return r?r[1].trim():""}function Gv(n,e){const t=n.getElementByKey(e);t&&n.getEditorState().read(()=>{const r=Z(e);if(!A(r)||ye(r))return;const i=r.getStyle(),s=Ul(i,"background-color");t.style.backgroundColor=s||""})}function Yv(n){const e=n.registerUpdateListener(({dirtyElements:t})=>{if(t.size!==0)for(const[r]of t)Gv(n,r)});return n.getEditorState().read(()=>{const t=de();for(const r of t.getChildren())if(A(r)){const i=r.getStyle();if(i){const s=n.getElementByKey(r.getKey());if(s){const o=Ul(i,"background-color");o&&(s.style.backgroundColor=o)}}}}),e}function ka(n,e){const t=e.exportDOM(n);if(t.element&&te(t.element)&&A(e)){const r=e.getStyle(),i=Ul(r,"background-color");i&&(t.element.style.backgroundColor=i)}return t}function qv(){const n=new Map;return n.set(Kn,ka),n.set(Ss,ka),n.set(xs,ka),n}function Zv(){const n=e=>()=>({conversion:t=>{const r=e(t);return r&&A(r)&&(t.style?.textAlign&&r.setFormat(t.style.textAlign),t.style?.backgroundColor&&r.setStyle(g_("","background-color",t.style.backgroundColor))),{node:r}},priority:1});return{p:n(()=>J()),h1:n(()=>Te("h1")),h2:n(()=>Te("h2")),h3:n(()=>Te("h3")),h4:n(()=>Te("h4")),h5:n(()=>Te("h5")),h6:n(()=>Te("h6"))}}async function Ns(n={}){const{nodes:e=[],plugins:t=[],onError:r}=n,s=(await d_()).createEditor({namespace:"BeatUIHeadless",nodes:e,onError:o=>{r?r(o,s):console.error("[BeatUI Headless]",o)},editable:!1});if(t.length>0)for(const o of t)o.register(s);return s}async function Xv(n){const e=await Ns(),{importFromMarkdown:t}=await Promise.resolve().then(()=>Bu);return await t(e,n),e.getEditorState().toJSON()}async function Qv(n){const e=await Ns(),{exportToMarkdown:t}=await Promise.resolve().then(()=>Bu),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}async function e0(n){const e=await Ns(),{importFromHtml:t}=await Promise.resolve().then(()=>Uu);return await t(e,n),e.getEditorState().toJSON()}async function t0(n){const e=await Ns(),{exportToHtml:t}=await Promise.resolve().then(()=>Uu),r=e.parseEditorState(JSON.stringify(n));return e.setEditorState(r),await t(e)}const p_=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",onError:c,onInput:u,onChange:d,onBlur:f,onReady:h}=n;return E.Use(bc.Theme,({appearance:g})=>E.html.div(E.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:p})=>yc.LinkPortal({id:"beatui-lexical-css",href:p})),E.attr.class("bc-lexical-editor-container"),a==="fixed"?E.attr.class("bc-lexical-editor-container--fixed"):null,E.attr.class(o),E.html.div(E.attr.class("bc-lexical-editor"),E.attr.class(`bc-lexical-editor--${a}`),E.attr.contenteditable(i!=null?E.Value.map(i,p=>!p):!0),i!=null?E.attr.class(E.Value.map(i,p=>p?"bc-lexical-editor--readonly":"")):null,E.WithElement(p=>{let m=null;const b=[];return(async()=>{try{const y=r??_l("bare"),C=ml(y),S=E.Value.get(t??"markdown"),x=ui({namespace:l,nodes:C,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:v=>{c?c(v,x):console.error("[BeatUI Lexical]",v)},editable:i?!E.Value.get(i):!0,html:{export:qv(),import:Zv()}});m=x,x.setRootElement(p);const w=[];if(y.richText?w.push(Ml(x)):y.plainText&&w.push($l(x)),y.history){const v=typeof y.history=="object"?y.history:void 0;w.push(Il(x,v))}if(y.clipboard&&w.push(Fl(x)),y.list&&w.push(Dl(x)),y.link&&w.push(Ll(x)),y.yjs&&w.push(Bl(x,y.yjs)),y.dragon&&w.push(zl(x)),y.table&&w.push(Pl(x)),(await Promise.all(w)).forEach(v=>{v&&b.push(v)}),b.push(Rl(x)),b.push(Yv(x)),e!=null){const v=E.Value.get(e);if(v!=null&&(v!==""||S==="json"&&typeof v=="object")){if(S==="markdown"&&typeof v=="string")await Bn(x,v);else if(S==="html"&&typeof v=="string")await Un(x,v);else if(S==="json"&&typeof v=="object")try{const T=JSON.stringify(v),O=x.parseEditorState(T);x.setEditorState(O)}catch(T){console.error("[BeatUI] Failed to parse JSON editor state:",T),c&&c(T instanceof Error?T:new Error(String(T)),x)}}}b.push(x.registerUpdateListener(({editorState:v,dirtyElements:I,dirtyLeaves:T})=>{I.size===0&&T.size===0||u&&v.read(async()=>{if(S==="markdown"){const O=await bt(x);u(O,x)}else if(S==="html"){const O=await xt(x);u(O,x)}else S==="json"&&u(v.toJSON(),x)})})),e!=null&&b.push(E.Value.on(e,async v=>{if(v!=null){if(S==="markdown"&&typeof v=="string"){const I=await bt(x);v!==I&&await Bn(x,v)}else if(S==="html"&&typeof v=="string"){const I=await xt(x);v!==I&&await Un(x,v)}else if(S==="json"&&typeof v=="object"){const I=JSON.stringify(x.getEditorState().toJSON()),T=JSON.stringify(v);if(I!==T){const O=x.parseEditorState(T);x.setEditorState(O)}}}})),i!=null&&b.push(E.Value.on(i,v=>{x.setEditable(!v)})),b.push(x.registerCommand(ai,()=>(f&&f(x),d&&x.getEditorState().read(async()=>{if(S==="markdown"){const v=await bt(x);d(v,x)}else if(S==="html"){const v=await xt(x);d(v,x)}else S==="json"&&d(x.getEditorState().toJSON(),x)}),!1),G)),b.push(g.on(v=>{const I=x.getRootElement();I&&(I.dataset.theme=v)})),h&&h(x)}catch(y){console.error("[BeatUI] Failed to initialize Lexical editor:",y);const C=p;C.textContent="Failed to load Lexical editor."}})(),E.OnDispose(()=>{try{b.forEach(y=>y())}catch{}try{m?.setRootElement(null)}catch{}})}))))};function m_(n,e,t){const r=(h,g)=>e.map(()=>{const p=n.value;return p?p.getEditorState().read(()=>{const m=M();return N(m)?h(m):g}):g}),i=h=>{const g=h.anchor.getNode();return g.getKey()==="root"?g:g.getTopLevelElementOrThrow()};return{withSelection:r,getAnchorElement:i,textFormatActive:h=>r(g=>g.hasFormat(h),!1),blockTypeActive:h=>r(g=>i(g).getType()===h,!1),listTypeActive:h=>r(g=>{const p=i(g).getParent();return V(p)&&p.getListType()===h},!1),headingActive:h=>e.map(()=>{const g=n.value;return g?g.getEditorState().read(()=>{const p=M();if(N(p)){const m=i(p);if(m.getType()==="heading")return g.getElementByKey(m.getKey())?.tagName===`H${h}`}return!1}):!1}),linkActive:()=>r(h=>{const g=h.anchor.getNode();return g.getParent()?.getType()==="link"||g.getType()==="link"},!1),dispatch:(h,g)=>()=>{const p=n.value;p&&(p.dispatchCommand(h,g),p.focus())},toggleBlock:(h,g)=>()=>{const p=n.value;p&&(p.update(()=>{const m=M();if(N(m)){const b=i(m);Qe(m,()=>b.getType()===h?J():g())}}),p.focus())},toggleLink:()=>{const h=n.value;h&&(h.getEditorState().read(()=>{const g=M();if(N(g)){const p=g.anchor.getNode();if(p.getParent()?.getType()==="link"||p.getType()==="link")h.dispatchCommand(nc,null);else{const _=prompt(t?.enterUrlMessage?.()??"Enter URL:");_&&h.dispatchCommand(nc,_)}}}),h.focus())}}}function __(n,e){return t=>r=>kh.EditorToolbarButton({...r,display:t,disabled:n,size:e})}const n0={font:["font-family","font-size"],color:["font-color","highlight-color","background-color"],"text-formatting":["bold","italic","underline","strikethrough","code"],"clear-formatting":["clear-formatting"],headings:["paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"],lists:["bullet-list","ordered-list","check-list"],indent:["indent","outdent"],blocks:["blockquote","code-block","horizontal-rule"],tables:["insert-table"],links:["link"],history:["undo","redo"],clipboard:["cut","copy","paste"]},r0=["font","color","text-formatting","clear-formatting","headings","lists","indent","blocks","tables","links","history","clipboard"];function i0(){return r0.map(n=>({group:n}))}function s0(n){if(n.layout)return n.layout;const{visibleGroups:e,hiddenGroups:t}=n,r=i0();return!e&&!t?r:r.filter(i=>{if("separator"in i)return!0;const s=i.group;return!(t?.includes(s)||e&&!e.includes(s))})}const o0=[{value:"Arial",label:"Arial"},{value:"Courier New",label:"Courier New"},{value:"Georgia",label:"Georgia"},{value:"Times New Roman",label:"Times New Roman"},{value:"Trebuchet MS",label:"Trebuchet MS"},{value:"Verdana",label:"Verdana"}],l0=[{value:"10px",label:"10"},{value:"12px",label:"12"},{value:"14px",label:"14"},{value:"16px",label:"16"},{value:"18px",label:"18"},{value:"20px",label:"20"},{value:"24px",label:"24"},{value:"30px",label:"30"},{value:"36px",label:"36"}];function y_({editor:n,stateUpdate:e,toolbar:t={},readOnly:r=E.signal(!1),size:i="sm"}){const{maxHeadingLevel:s=3}=t,o=s0(t);return E.Use(He.BeatUII18n,l=>E.Ensure(n,a=>{const c=a,u=l.$.lexical,{getAnchorElement:d,textFormatActive:f,blockTypeActive:h,listTypeActive:g,headingActive:p,linkActive:m,dispatch:b,toggleBlock:_,toggleLink:y}=m_(c,e,{enterUrlMessage:()=>l.value.lexical.enterUrl}),S=__(r,i)(E.signal(!0)),x=()=>{const $=c.value;$&&($.update(()=>{const R=M();N(R)&&Qe(R,()=>J())}),$.focus())},w=$=>{const R=c.value;R&&(R.update(()=>{const q=M();if(N(q)){const pe=d(q),Dt=`h${$}`,Jn=R.getElementByKey(pe.getKey());pe.getType()==="heading"&&Jn?.tagName===`H${$}`?Qe(q,()=>J()):Qe(q,()=>Te(Dt))}}),R.focus())},k=()=>{const $=c.value;if(!$)return;const R=$.getRootElement();R&&(R.focus(),document.execCommand("copy"))},v=()=>{const $=c.value;if(!$)return;const R=$.getRootElement();R&&(R.focus(),document.execCommand("cut"))},I=()=>{const $=c.value;$&&navigator.clipboard.readText().then(R=>{$.update(()=>{const q=M();N(q)&&q.insertText(R)}),$.focus()}).catch(()=>{})},T=()=>{const $=c.value;$&&($.update(()=>{const R=M();if(N(R))for(const q of R.getNodes())D(q)&&(q.setFormat(0),q.setStyle(""))}),$.focus())},O=()=>{const $=c.value;$&&($.dispatchCommand(ws,{rows:"3",columns:"3",includeHeaders:!0}),$.focus())},z={value:"",label:l.value.lexical.defaultOption},F=[z,...t.fontFamilies??o0],B=[z,...t.fontSizes??l0],W=e.map(()=>{const $=c.value;return $?$.getEditorState().read(()=>{const R=M();return N(R)?Ds(R,"font-family",""):""}):""}),X=e.map(()=>{const $=c.value;return $?$.getEditorState().read(()=>{const R=M();return N(R)?Ds(R,"font-size",""):""}):""}),se=$=>{const R=c.value;R&&(R.update(()=>{const q=M();N(q)&&Fs(q,{"font-family":$||null})}),R.focus())},oe=$=>{const R=c.value;R&&(R.update(()=>{const q=M();N(q)&&Fs(q,{"font-size":$||null})}),R.focus())},We=e.map(()=>{const $=c.value;return $?$.getEditorState().read(()=>{const R=M();return N(R)&&Ds(R,"color","")||"#000000"}):"#000000"}),wt=e.map(()=>{const $=c.value;return $?$.getEditorState().read(()=>{const R=M();return N(R)&&Ds(R,"background-color","")||"#ffffff"}):"#ffffff"}),j=e.map(()=>{const $=c.value;return $?$.getEditorState().read(()=>{const R=M();if(N(R)){const pe=d(R).getStyle();return Ul(pe,"background-color")||"#ffffff"}return"#ffffff"}):"#ffffff"}),Ce=$=>{const R=c.value;R&&(R.update(()=>{const q=M();N(q)&&Fs(q,{color:$})}),R.focus())},fe=$=>{const R=c.value;R&&(R.update(()=>{const q=M();N(q)&&Fs(q,{"background-color":$})}),R.focus())},Ze=$=>{const R=c.value;R&&(R.update(()=>{const q=M();if(N(q)){const pe=d(q),Dt=pe.getStyle(),Jn=g_(Dt,"background-color",$);pe.setStyle(Jn)}}),R.focus())},H=new Map;H.set("bold",()=>S({active:f("bold"),onClick:b(ve,"bold"),label:u.map($=>$.bold),icon:"mdi:format-bold"})),H.set("italic",()=>S({active:f("italic"),onClick:b(ve,"italic"),label:u.map($=>$.italic),icon:"mdi:format-italic"})),H.set("underline",()=>S({active:f("underline"),onClick:b(ve,"underline"),label:u.map($=>$.underline),icon:"mdi:format-underline"})),H.set("strikethrough",()=>S({active:f("strikethrough"),onClick:b(ve,"strikethrough"),label:u.map($=>$.strikethrough),icon:"mdi:format-strikethrough"})),H.set("code",()=>S({active:f("code"),onClick:b(ve,"code"),label:u.map($=>$.code),icon:"mdi:code-tags"})),H.set("clear-formatting",()=>S({active:E.signal(!1),onClick:T,label:u.map($=>$.clearFormatting),icon:"mdi:format-clear"})),H.set("paragraph",()=>S({active:h("paragraph"),onClick:x,label:u.map($=>$.normal),icon:"mdi:format-paragraph"}));for(let $=1;$<=s;$++)H.set(`heading-${$}`,()=>S({active:p($),onClick:()=>w($),label:u.map(R=>R.heading($)),icon:`mdi:format-header-${$}`}));return H.set("bullet-list",()=>S({active:g("bullet"),onClick:b(pi,void 0),label:u.map($=>$.bulletList),icon:"mdi:format-list-bulleted"})),H.set("ordered-list",()=>S({active:g("number"),onClick:b(mi,void 0),label:u.map($=>$.orderedList),icon:"mdi:format-list-numbered"})),H.set("check-list",()=>S({active:g("check"),onClick:b(hl,void 0),label:u.map($=>$.checkList),icon:"mdi:format-list-checks"})),H.set("indent",()=>S({active:E.signal(!1),onClick:b(Bt,void 0),label:u.map($=>$.indent),icon:"mdi:format-indent-increase"})),H.set("outdent",()=>S({active:E.signal(!1),onClick:b(nn,void 0),label:u.map($=>$.outdent),icon:"mdi:format-indent-decrease"})),H.set("blockquote",()=>S({active:h("quote"),onClick:_("quote",gi),label:u.map($=>$.blockquote),icon:"mdi:format-quote-close"})),H.set("code-block",()=>S({active:h("code"),onClick:_("code",_t),label:u.map($=>$.codeBlock),icon:"mdi:code-braces"})),H.set("horizontal-rule",()=>S({active:E.signal(!1),onClick:b(Ts,void 0),label:u.map($=>$.horizontalRule),icon:"mdi:minus"})),H.set("insert-table",()=>S({active:E.signal(!1),onClick:O,label:u.map($=>$.insertTable),icon:"mdi:table-plus"})),H.set("link",()=>S({active:m(),onClick:y,label:u.map($=>$.link),icon:"mdi:link"})),H.set("undo",()=>S({active:E.signal(!1),onClick:b(ii,void 0),label:u.map($=>$.undo),icon:"mdi:undo"})),H.set("redo",()=>S({active:E.signal(!1),onClick:b(si,void 0),label:u.map($=>$.redo),icon:"mdi:redo"})),H.set("cut",()=>S({active:E.signal(!1),onClick:v,label:u.map($=>$.cut),icon:"mdi:content-cut"})),H.set("copy",()=>S({active:E.signal(!1),onClick:k,label:u.map($=>$.copy),icon:"mdi:content-copy"})),H.set("paste",()=>S({active:E.signal(!1),onClick:I,label:u.map($=>$.paste),icon:"mdi:content-paste"})),H.set("font-family",()=>E.html.select(E.attr.class("bc-lexical-toolbar-select"),E.attr.title(u.map($=>$.fontFamily)),E.attr.disabled(r),E.on.change($=>se($.target.value)),...F.map($=>E.html.option(E.attr.value($.value),E.attr.selected(W.map(R=>R===$.value)),$.label)))),H.set("font-size",()=>E.html.select(E.attr.class("bc-lexical-toolbar-select"),E.attr.title(u.map($=>$.fontSize)),E.attr.disabled(r),E.on.change($=>oe($.target.value)),...B.map($=>E.html.option(E.attr.value($.value),E.attr.selected(X.map(R=>R===$.value)),$.label)))),H.set("font-color",()=>E.html.label(E.attr.class("bc-lexical-toolbar-color"),E.attr.title(u.map($=>$.fontColor)),E.html.input(E.attr.type("color"),E.attr.value(We),E.attr.disabled(r),E.on.input($=>Ce($.target.value))),E.html.span(E.attr.class("bc-lexical-toolbar-color-icon"),"A"))),H.set("highlight-color",()=>E.html.label(E.attr.class("bc-lexical-toolbar-color"),E.attr.title(u.map($=>$.highlightColor)),E.html.input(E.attr.type("color"),E.attr.value(wt),E.attr.disabled(r),E.on.input($=>fe($.target.value))),E.html.span(E.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--highlight"),"A"))),H.set("background-color",()=>E.html.label(E.attr.class("bc-lexical-toolbar-color"),E.attr.title(u.map($=>$.backgroundColor)),E.html.input(E.attr.type("color"),E.attr.value(j),E.attr.disabled(r),E.on.input($=>Ze($.target.value))),E.html.span(E.attr.class("bc-lexical-toolbar-color-icon bc-lexical-toolbar-color-icon--bg"),"■"))),Eh.Toolbar(E.attr.class("bc-lexical-toolbar"),...a0(o,H,s))}))}function a0(n,e,t){const r=[];for(const i of n){if("separator"in i){r.push(Eh.ToolbarDivider());continue}let s=i.items??n0[i.group]??[];i.group==="headings"&&!i.items&&(s=s.filter(a=>a.startsWith("heading-")?parseInt(a.split("-")[1],10)<=t:!0));const o=[];for(const a of s){const c=e.get(a);c&&o.push(c())}if(o.length===0)continue;const l=o.map(()=>E.signal(!0));r.push(kh.EditorToolbarGroup({display:l},...o))}return r}function b_({editor:n,stateUpdate:e,readOnly:t=E.signal(!1)}){const r=E.prop(!1),i=E.prop(0),s=E.prop(0);let o=null,l=null;const a=E.prop(!1),c=C=>{let S=null;return C.getEditorState().read(()=>{const x=M();if(!N(x))return;let w=x.anchor.getNode();for(;w;){if(me(w)){S=w;break}if(w=w.getParent(),!w||w.getKey()==="root")break}}),S},u=(C,S)=>{const x=C.getBoundingClientRect(),w=S.closest(".bc-lexical-editor-container"),k=w?w.getBoundingClientRect():S.getBoundingClientRect();return i.value=x.top-k.top+2,s.value=k.right-x.right+2,!0},d=()=>{const C=n.value;if(!C){r.value=!1;return}const S=c(C);if(!S){a.value||(r.value=!1);return}const x=C.getElementByKey(S.getKey()),w=C.getRootElement();x&&w?(u(x,w),r.value=!0):r.value=!1};e.onChange(d);const f=C=>()=>{const S=n.value;S&&(S.update(C),l?.(),S.focus())},h=f(()=>df(!1)),g=f(()=>df(!0)),p=f(()=>ff(!1)),m=f(()=>ff(!0)),b=f(()=>ix()),_=f(()=>sx()),y=f(()=>{const C=M();if(!N(C))return;const S=C.anchor.getNode(),x=rx(S);if(!x)return;Ap(x).remove()});return E.Use(He.BeatUII18n,C=>E.Ensure(n,S=>{const x=S,w=C.$.lexical,k=O=>{const z=x.value;if(!z||t.value)return;const F=z.getRootElement();if(!F)return;const W=O.target.closest("td, th");W&&F.contains(W)&&(O.preventDefault(),u(W,F)&&(r.value=!0),requestAnimationFrame(()=>{o?.()}))},v=x.value?.getRootElement(),T=v?.closest(".bc-lexical-editor-container")??v??document;return T.addEventListener("contextmenu",k),[E.OnDispose(()=>{T.removeEventListener("contextmenu",k)}),E.When(r,()=>E.html.div(E.attr.class("bc-table-cell-marker"),E.style.position("absolute"),E.style.top(i.map(O=>`${O}px`)),E.style.right(s.map(O=>`${O}px`)),E.style.zIndex("10"),E.WithElement(O=>{O.addEventListener("mousedown",z=>{z.preventDefault()})}),E.html.button(E.attr.class("bc-table-cell-marker__button"),E.attr.type("button"),E.attr.title(w.map(O=>O.tableActions)),E.attr.disabled(t),He.Icon({icon:"lucide:chevron-down",size:"xs"}),E.WithElement(O=>{const z=new MutationObserver(()=>{const F=O.getAttribute("aria-expanded")==="true";a.value=F});return z.observe(O,{attributes:!0,attributeFilter:["aria-expanded"]}),E.OnDispose(()=>z.disconnect())}),vt.Menu({items:()=>[vt.MenuItem({key:"insert-row-above",content:w.map(O=>O.insertRowAbove),startContent:He.Icon({icon:"lucide:arrow-up",size:"sm"}),onClick:h,disabled:t}),vt.MenuItem({key:"insert-row-below",content:w.map(O=>O.insertRowBelow),startContent:He.Icon({icon:"lucide:arrow-down",size:"sm"}),onClick:g,disabled:t}),vt.MenuItem({key:"insert-column-left",content:w.map(O=>O.insertColumnLeft),startContent:He.Icon({icon:"lucide:arrow-left",size:"sm"}),onClick:p,disabled:t}),vt.MenuItem({key:"insert-column-right",content:w.map(O=>O.insertColumnRight),startContent:He.Icon({icon:"lucide:arrow-right",size:"sm"}),onClick:m,disabled:t}),vt.MenuSeparator(),vt.MenuItem({key:"delete-row",content:w.map(O=>O.deleteRow),startContent:He.Icon({icon:"lucide:trash-2",size:"sm"}),onClick:b,disabled:t}),vt.MenuItem({key:"delete-column",content:w.map(O=>O.deleteColumn),startContent:He.Icon({icon:"lucide:trash-2",size:"sm"}),onClick:_,disabled:t}),vt.MenuItem({key:"delete-table",content:w.map(O=>O.deleteTable),startContent:He.Icon({icon:"lucide:trash-2",size:"sm"}),onClick:y,disabled:t})],placement:"bottom-end",showOn:(O,z)=>(o=O,l=z,E.on.click(()=>{a.value?z():(O(),a.value=!0)})),showDelay:0,hideDelay:0,mainAxisOffset:4,onClose:()=>{const O=x.value;O&&O.focus()},ariaLabel:w.map(O=>O.tableActions)}))))]}))}const c0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="fixed",toolbar:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=E.prop(null),m=E.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:E.prop(E.Value.get(i)):E.prop(!1);return E.Use(bc.Theme,({appearance:y})=>E.html.div(E.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:C})=>yc.LinkPortal({id:"beatui-lexical-css",href:C})),E.attr.class("bc-lexical-editor-container"),a==="fixed"?E.attr.class("bc-lexical-editor-container--fixed"):null,E.attr.class(o),E.When(_.map(C=>!C),()=>y_({editor:p,stateUpdate:m,toolbar:c,readOnly:_,size:"sm"})),b_({editor:p,stateUpdate:m,readOnly:_}),E.html.div(E.attr.class("bc-lexical-editor"),E.attr.class(`bc-lexical-editor--${a}`),E.attr.contenteditable(i!=null?E.Value.map(i,C=>!C):!0),i!=null?E.attr.class(E.Value.map(i,C=>C?"bc-lexical-editor--readonly":"")):null,E.WithElement(C=>{let S=null;const x=[];return(async()=>{try{const k=r??_l("docked"),v=ml(k),I=E.Value.get(t??"markdown"),T=ui({namespace:l,nodes:v,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:F=>{u?u(F,T):console.error("[BeatUI Lexical]",F)},editable:i?!E.Value.get(i):!0});S=T,p.set(T),T.setRootElement(C);const O=[];if(k.richText?O.push(Ml(T)):k.plainText&&O.push($l(T)),k.history){const F=typeof k.history=="object"?k.history:void 0;O.push(Il(T,F))}if(k.clipboard&&O.push(Fl(T)),k.list&&O.push(Dl(T)),k.link&&O.push(Ll(T)),k.yjs&&O.push(Bl(T,k.yjs)),k.dragon&&O.push(zl(T)),k.table&&O.push(Pl(T)),(await Promise.all(O)).forEach(F=>{F&&x.push(F)}),x.push(Rl(T)),x.push(T.registerCommand(ni,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:F,dirtyElements:B,dirtyLeaves:W})=>{(B.size>0||W.size>0)&&m.set(m.value+1),d&&(B.size>0||W.size>0)&&F.read(async()=>{if(I==="markdown"){const X=await bt(T);d(X,T)}else if(I==="html"){const X=await xt(T);d(X,T)}else I==="json"&&d(F.toJSON(),T)})})),e!=null){const F=E.Value.get(e);if(F!=null&&(F!==""||I==="json"&&typeof F=="object")){if(I==="markdown"&&typeof F=="string")await Bn(T,F);else if(I==="html"&&typeof F=="string")await Un(T,F);else if(I==="json"&&typeof F=="object")try{const W=JSON.stringify(F),X=T.parseEditorState(W);T.setEditorState(X)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(E.Value.on(e,async F=>{if(F!=null){if(I==="markdown"&&typeof F=="string"){const B=await bt(T);F!==B&&await Bn(T,F)}else if(I==="html"&&typeof F=="string"){const B=await xt(T);F!==B&&await Un(T,F)}else if(I==="json"&&typeof F=="object"){const B=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify(F);if(B!==W){const X=T.parseEditorState(W);T.setEditorState(X)}}}})),i!=null&&x.push(E.Value.on(i,F=>{T.setEditable(!F)})),x.push(T.registerCommand(ai,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(I==="markdown"){const F=await bt(T);f(F,T)}else if(I==="html"){const F=await xt(T);f(F,T)}else I==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on(F=>{const B=T.getRootElement();B&&(B.dataset.theme=F)})),g&&g(T)}catch(k){console.error("[BeatUI] Failed to initialize Lexical editor:",k);const v=C;v.textContent="Failed to load Lexical editor."}})(),E.OnDispose(()=>{try{x.forEach(k=>k())}catch{}try{S?.setRootElement(null)}catch{}p.set(null)})}))))};function x_({editor:n,stateUpdate:e,groups:t=["text-formatting"],readOnly:r=E.signal(!1),size:i="sm"}){const s=E.prop(!1),o=E.prop(0),l=E.prop(0);return E.Use(He.BeatUII18n,a=>E.Ensure(n,c=>{const u=c,d=a.$.lexical,f=w=>t.includes(w),{textFormatActive:h,linkActive:g,dispatch:p,toggleLink:m}=m_(u,e,{enterUrlMessage:()=>a.value.lexical.enterUrl}),_=__(r,i)(E.signal(!0)),y=()=>{const w=u.value;if(!w){s.value=!1;return}const k=w.getRootElement();if(!k){s.value=!1;return}const v=window.getSelection();if(!v||v.rangeCount===0||v.isCollapsed){s.value=!1;return}const I=v.anchorNode;if(I&&!k.contains(I)){s.value=!1;return}const O=v.getRangeAt(0).getBoundingClientRect();if(O.width===0&&O.height===0){s.value=!1;return}const z=40,F=8;let B=O.top-z-F;const W=O.left+O.width/2;B<0&&(B=O.bottom+F),o.value=B,l.value=W,s.value=!0},C=e.onChange(y),S=()=>{y()};document.addEventListener("selectionchange",S);const x=E.html.div(E.attr.class("bc-floating-toolbar"),E.style.position("fixed"),E.style.top(o.map(w=>`${w}px`)),E.style.left(l.map(w=>`${w}px`)),E.style.transform("translateX(-50%)"),E.WithElement(w=>{const k=I=>{if(I.key==="Escape"&&s.value){s.value=!1;const T=u.value;T&&T.focus()}},v=I=>{if(s.value&&!w.contains(I.target)){const T=u.value;if(T){const O=T.getRootElement();if(O&&O.contains(I.target))return}s.value=!1}};return document.addEventListener("keydown",k),document.addEventListener("mousedown",v),E.OnDispose(()=>{C(),document.removeEventListener("keydown",k),document.removeEventListener("mousedown",v),document.removeEventListener("selectionchange",S)})}),...f("text-formatting")?[_({active:h("bold"),onClick:p(ve,"bold"),label:d.map(w=>w.bold),icon:"mdi:format-bold"}),_({active:h("italic"),onClick:p(ve,"italic"),label:d.map(w=>w.italic),icon:"mdi:format-italic"}),_({active:h("underline"),onClick:p(ve,"underline"),label:d.map(w=>w.underline),icon:"mdi:format-underline"}),_({active:h("strikethrough"),onClick:p(ve,"strikethrough"),label:d.map(w=>w.strikethrough),icon:"mdi:format-strikethrough"}),_({active:h("code"),onClick:p(ve,"code"),label:d.map(w=>w.code),icon:"mdi:code-tags"})]:[],...f("links")?[_({active:g(),onClick:m,label:d.map(w=>w.link),icon:"mdi:link"})]:[],...f("clipboard")?[_({active:E.signal(!1),onClick:()=>{const w=u.value;if(!w)return;const k=w.getRootElement();k&&(k.focus(),document.execCommand("cut"))},label:d.map(w=>w.cut),icon:"mdi:content-cut"}),_({active:E.signal(!1),onClick:()=>{const w=u.value;if(!w)return;const k=w.getRootElement();k&&(k.focus(),document.execCommand("copy"))},label:d.map(w=>w.copy),icon:"mdi:content-copy"}),_({active:E.signal(!1),onClick:()=>{const w=u.value;w&&navigator.clipboard.readText().then(k=>{w.update(()=>{const v=M();N(v)&&v.insertText(k)}),w.focus()}).catch(()=>{})},label:d.map(w=>w.paste),icon:"mdi:content-paste"})]:[]);return E.When(s,()=>x)}))}const u0=[{id:"heading1",label:"Heading 1",description:"Large section heading",icon:"mdi:format-header-1",keywords:["h1","heading","title"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h1"))})}},{id:"heading2",label:"Heading 2",description:"Medium section heading",icon:"mdi:format-header-2",keywords:["h2","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h2"))})}},{id:"heading3",label:"Heading 3",description:"Small section heading",icon:"mdi:format-header-3",keywords:["h3","heading"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h3"))})}},{id:"bullet-list",label:"Bullet List",description:"Create a bulleted list",icon:"mdi:format-list-bulleted",keywords:["ul","unordered","bullets"],category:"Lists",handler:n=>{n.dispatchCommand(pi,void 0)}},{id:"ordered-list",label:"Ordered List",description:"Create a numbered list",icon:"mdi:format-list-numbered",keywords:["ol","numbered","1","2","3"],category:"Lists",handler:n=>{n.dispatchCommand(mi,void 0)}},{id:"quote",label:"Quote",description:"Insert a blockquote",icon:"mdi:format-quote-close",keywords:["blockquote","citation"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>gi())})}},{id:"code-block",label:"Code Block",description:"Insert a code block",icon:"mdi:code-braces",keywords:["code","pre","programming"],category:"Basic blocks",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>_t())})}},{id:"divider",label:"Divider",description:"Insert a horizontal rule",icon:"mdi:minus",keywords:["hr","horizontal","line","separator"],category:"Basic blocks",handler:n=>{n.dispatchCommand(Ts,void 0)}},{id:"table",label:"Table",description:"Insert a table",icon:"mdi:table",keywords:["table","grid","cells","rows","columns"],category:"Advanced",handler:n=>{n.dispatchCommand(ws,{rows:"3",columns:"3",includeHeaders:!0})}}];function d0({commands:n,isVisible:e,filterText:t,position:r,onSelect:i,onDismiss:s}){const o=E.prop(0),l=t.map(f=>{const h=f.toLowerCase().trim();return h?n.filter(g=>[g.label.toLowerCase(),g.description?.toLowerCase()||"",...g.keywords?.map(m=>m.toLowerCase())||[]].join(" ").includes(h)):n});l.onChange(()=>{o.value=0});const a=f=>{const h=l.value;if(f>=0&&f<h.length){const g=h[f];i(g)}},c=f=>{if(!e.value)return;const g=l.value.length-1;switch(f.key){case"ArrowDown":f.preventDefault(),o.value=Math.min(o.value+1,g);break;case"ArrowUp":f.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":f.preventDefault(),a(o.value);break;case"Escape":f.preventDefault(),s();break}},u=(f,h)=>{const g=o.map(m=>m===h),p=`slash-cmd-${f.id}`;return E.html.div(E.attr.class("bc-slash-command-palette__item"),E.attr.id(p),E.attr.role("option"),E.aria.selected(g),E.WithElement(m=>{const b=()=>{o.value=h},_=()=>{a(h)};return m.addEventListener("mouseenter",b),m.addEventListener("click",_),E.OnDispose(()=>{m.removeEventListener("mouseenter",b),m.removeEventListener("click",_)})}),typeof f.icon=="string"?E.html.div(E.attr.class("bc-slash-command-palette__icon"),He.Icon({icon:f.icon,size:"sm"})):f.icon,E.html.div(E.attr.class("bc-slash-command-palette__content"),E.html.div(E.attr.class("bc-slash-command-palette__label"),f.label),f.description?E.html.div(E.attr.class("bc-slash-command-palette__description"),f.description):void 0),f.category?E.html.div(E.attr.class("bc-slash-command-palette__category"),f.category):void 0)},d=E.Use(He.BeatUII18n,f=>E.html.div(E.attr.class("bc-slash-command-palette"),E.attr.role("listbox"),E.aria.label(f.$.lexical.map(h=>h.slashCommands)),E.style.position("absolute"),E.style.top(r.map(h=>`${h.top}px`)),E.style.left(r.map(h=>`${h.left}px`)),E.WithElement(()=>(document.addEventListener("keydown",c),E.OnDispose(()=>{document.removeEventListener("keydown",c)}))),E.When(l.map(h=>h.length===0),()=>E.html.div(E.attr.class("bc-slash-command-palette__empty"),f.$.lexical.map(h=>h.noCommandsFound))),E.ForEach(l,(h,g)=>{const p=h.value;return u(p,g.index)})));return E.When(e,()=>d)}const S_=[{id:"paragraph",label:"Paragraph",icon:"mdi:format-paragraph",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>J())})}},{id:"heading1",label:"Heading 1",icon:"mdi:format-header-1",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h1"))})}},{id:"heading2",label:"Heading 2",icon:"mdi:format-header-2",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h2"))})}},{id:"heading3",label:"Heading 3",icon:"mdi:format-header-3",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>Te("h3"))})}},{id:"bullet-list",label:"Bullet List",icon:"mdi:format-list-bulleted",handler:n=>{n.dispatchCommand(pi,void 0)}},{id:"ordered-list",label:"Ordered List",icon:"mdi:format-list-numbered",handler:n=>{n.dispatchCommand(mi,void 0)}},{id:"quote",label:"Quote",icon:"mdi:format-quote-close",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>gi())})}},{id:"code-block",label:"Code Block",icon:"mdi:code-braces",handler:n=>{n.update(()=>{const e=M();N(e)&&Qe(e,()=>_t())})}},{id:"divider",label:"Divider",icon:"mdi:minus",handler:n=>{n.dispatchCommand(Ts,void 0)}},{id:"table",label:"Table",icon:"mdi:table",handler:n=>{n.dispatchCommand(ws,{rows:"3",columns:"3",includeHeaders:!0})}}];function C_({editor:n,stateUpdate:e,readOnly:t=E.signal(!1),commands:r=S_}){const i=E.prop(!1),s=E.prop(!1),o=E.prop(0),l=E.prop(0);return E.Use(He.BeatUII18n,a=>E.Ensure(n,c=>{const u=c;let d=null,f=!1,h=null,g=null;const p=24,m=4,b=200,_=T=>{if(T===d&&i.value)return;d=T;const O=T.getBoundingClientRect();o.value=O.top,l.value=O.left-p-m,i.value=!0},y=()=>{h!=null&&(clearTimeout(h),h=null)},C=()=>{s.value||(y(),h=setTimeout(()=>{h=null,s.value||(i.value=!1,d=null)},b))},S=()=>{const T=u.value;if(!T)return;const O=T.getRootElement();O&&(k(O),T.getEditorState().read(()=>{const z=M();if(N(z))try{const B=z.anchor.getNode().getTopLevelElementOrThrow(),W=T.getElementByKey(B.getKey());W&&_(W)}catch{}}))},x=T=>{if(s.value)return;const O=u.value;if(!O)return;const z=O.getRootElement();if(z)for(const F of Array.from(z.children)){const B=F.getBoundingClientRect();if(T.clientY>=B.top&&T.clientY<=B.bottom){y(),_(F);return}}},w=()=>{C()},k=T=>{f||(f=!0,T.addEventListener("mousemove",x),T.addEventListener("mouseleave",w))},v=e.onChange(S);return[E.OnDispose(()=>{v(),y();const T=u.value;if(T){const O=T.getRootElement();O&&f&&(O.removeEventListener("mousemove",x),O.removeEventListener("mouseleave",w))}}),E.When(i,()=>E.html.div(E.attr.class("bc-block-handle"),E.style.position("fixed"),E.style.top(o.map(T=>`${T}px`)),E.style.left(l.map(T=>`${T}px`)),E.on.mouseenter(y),E.on.mouseleave(()=>C()),E.WithElement(T=>{T.addEventListener("mousedown",O=>{O.preventDefault()})}),E.html.button(E.attr.class("bc-block-handle__button"),E.attr.type("button"),E.attr.title(a.$.lexical.map(T=>T.changeBlockType)),E.attr.disabled(t),He.Icon({icon:"mdi:drag-horizontal-variant",size:"sm"}),E.WithElement(T=>{const O=new MutationObserver(()=>{const z=T.getAttribute("aria-expanded")==="true";s.value=z});return O.observe(T,{attributes:!0,attributeFilter:["aria-expanded"]}),E.OnDispose(()=>O.disconnect())}),vt.Menu({items:()=>r.map(T=>vt.MenuItem({key:T.id,content:T.label,startContent:He.Icon({icon:T.icon,size:"sm"}),onClick:()=>{const O=u.value;O&&(T.handler(O),g?.(),O.focus())}})),placement:"bottom-start",showOn:(T,O)=>(g=O,E.on.click(()=>{s.value?O():(T(),s.value=!0)})),showDelay:0,hideDelay:0,mainAxisOffset:4,onClose:()=>{const T=u.value;T&&T.focus()},ariaLabel:a.value.lexical.blockTypes}))))]}))}const f0=n=>{const{value:e,format:t,plugins:r,readOnly:i,placeholder:s,class:o,namespace:l="BeatUILexical",heightMode:a="auto",floatingToolbarGroups:c,onError:u,onInput:d,onChange:f,onBlur:h,onReady:g}=n,p=E.prop(null),m=E.prop(0),b=y=>typeof y=="object"&&y!==null&&"map"in y&&typeof y.map=="function",_=i!=null?b(i)?i:E.prop(E.Value.get(i)):E.prop(!1);return E.Use(bc.Theme,({appearance:y})=>E.html.div(E.Task(()=>Promise.resolve().then(()=>require("../styles-url-mlDYoWbF.cjs")),({default:C})=>yc.LinkPortal({id:"beatui-lexical-css",href:C})),E.attr.class("bc-lexical-editor-container"),a==="fixed"?E.attr.class("bc-lexical-editor-container--fixed"):null,E.attr.class(o),x_({editor:p,stateUpdate:m,groups:c??["text-formatting","links"],readOnly:_}),C_({editor:p,stateUpdate:m,readOnly:_}),b_({editor:p,stateUpdate:m,readOnly:_}),E.html.div(E.attr.class("bc-lexical-editor"),E.attr.class(`bc-lexical-editor--${a}`),E.attr.contenteditable(i!=null?E.Value.map(i,C=>!C):!0),i!=null?E.attr.class(E.Value.map(i,C=>C?"bc-lexical-editor--readonly":"")):null,E.WithElement(C=>{let S=null;const x=[];return(async()=>{try{const k=r??_l("contextual"),v=ml(k),I=E.Value.get(t??"markdown"),T=ui({namespace:l,nodes:v,theme:{heading:{h1:"bc-lexical-h1",h2:"bc-lexical-h2",h3:"bc-lexical-h3",h4:"bc-lexical-h4",h5:"bc-lexical-h5",h6:"bc-lexical-h6"},text:{bold:"bc-lexical-bold",italic:"bc-lexical-italic",underline:"bc-lexical-underline",strikethrough:"bc-lexical-strikethrough",code:"bc-lexical-code"},list:{ul:"bc-lexical-ul",ol:"bc-lexical-ol",listitem:"bc-lexical-li",listitemChecked:"bc-lexical-li-checked",listitemUnchecked:"bc-lexical-li-unchecked"},link:"bc-lexical-link",quote:"bc-lexical-blockquote",code:"bc-lexical-code-block",codeHighlight:{},hashtag:"bc-lexical-hashtag",table:"bc-lexical-table",tableCell:"bc-lexical-table-cell",tableCellHeader:"bc-lexical-table-cell-header",tableRow:"bc-lexical-table-row",mark:"bc-lexical-mark",paragraph:"bc-lexical-paragraph"},onError:F=>{u?u(F,T):console.error("[BeatUI Lexical]",F)},editable:i?!E.Value.get(i):!0});S=T,p.set(T),T.setRootElement(C);const O=[];if(k.richText?O.push(Ml(T)):k.plainText&&O.push($l(T)),k.history){const F=typeof k.history=="object"?k.history:void 0;O.push(Il(T,F))}if(k.clipboard&&O.push(Fl(T)),k.list&&O.push(Dl(T)),k.link&&O.push(Ll(T)),k.yjs&&O.push(Bl(T,k.yjs)),k.dragon&&O.push(zl(T)),k.table&&O.push(Pl(T)),(await Promise.all(O)).forEach(F=>{F&&x.push(F)}),x.push(Rl(T)),x.push(T.registerCommand(ni,()=>(m.set(m.value+1),!1),G)),x.push(T.registerUpdateListener(({editorState:F,dirtyElements:B,dirtyLeaves:W})=>{(B.size>0||W.size>0)&&m.set(m.value+1),d&&(B.size>0||W.size>0)&&F.read(async()=>{if(I==="markdown"){const X=await bt(T);d(X,T)}else if(I==="html"){const X=await xt(T);d(X,T)}else I==="json"&&d(F.toJSON(),T)})})),e!=null){const F=E.Value.get(e);if(F!=null&&(F!==""||I==="json"&&typeof F=="object")){if(I==="markdown"&&typeof F=="string")await Bn(T,F);else if(I==="html"&&typeof F=="string")await Un(T,F);else if(I==="json"&&typeof F=="object")try{const W=JSON.stringify(F),X=T.parseEditorState(W);T.setEditorState(X)}catch(W){console.error("[BeatUI] Failed to parse JSON editor state:",W),u&&u(W instanceof Error?W:new Error(String(W)),T)}}}e!=null&&x.push(E.Value.on(e,async F=>{if(F!=null){if(I==="markdown"&&typeof F=="string"){const B=await bt(T);F!==B&&await Bn(T,F)}else if(I==="html"&&typeof F=="string"){const B=await xt(T);F!==B&&await Un(T,F)}else if(I==="json"&&typeof F=="object"){const B=JSON.stringify(T.getEditorState().toJSON()),W=JSON.stringify(F);if(B!==W){const X=T.parseEditorState(W);T.setEditorState(X)}}}})),i!=null&&x.push(E.Value.on(i,F=>{T.setEditable(!F)})),x.push(T.registerCommand(ai,()=>(h&&h(T),f&&T.getEditorState().read(async()=>{if(I==="markdown"){const F=await bt(T);f(F,T)}else if(I==="html"){const F=await xt(T);f(F,T)}else I==="json"&&f(T.getEditorState().toJSON(),T)}),!1),G)),x.push(y.on(F=>{const B=T.getRootElement();B&&(B.dataset.theme=F)})),g&&g(T)}catch(k){console.error("[BeatUI] Failed to initialize Lexical editor:",k);const v=C;v.textContent="Failed to load Lexical editor."}})(),E.OnDispose(()=>{try{x.forEach(k=>k())}catch{}try{S?.setRootElement(null)}catch{}p.set(null)})}))))},h0=n=>{const{value:e,before:t,after:r,onChange:i,onInput:s,onBlur:o,disabled:l,hasError:a,name:c,placeholder:u,id:d,required:f,tabIndex:h,size:g,class:p,namespace:m,format:b,plugins:_,readOnly:y,onError:C,onReady:S,marks:x}=n,w=l!=null&&y!=null?E.computedOf(l,y)((k,v)=>(k??!1)||(v??!1)):l??y;return v_.InputContainer({disabled:l,hasError:a,size:g,baseContainer:!0,growInput:!0,focusableSelector:"[contenteditable]",before:t,after:r,input:E.html.div(E.attr.class("bc-lexical-editor-input"),E.attr.name(c),E.attr.id(d),f!=null?E.aria.required(f):null,h!=null?E.attr.tabindex(h):null,a!=null?E.attr.class(E.Value.map(a,k=>k?"bc-lexical-editor-input--error":"")):null,p_({value:e,format:b??"markdown",plugins:_,readOnly:w,placeholder:u,namespace:m,class:p,onError:C,onReady:S,onInput:s?(k,v)=>{s(k)}:void 0,onChange:i?(k,v)=>{i(k)}:void 0,onBlur:o?k=>{o()}:void 0}))})};exports.$createHorizontalRuleNode=vs;exports.$isHorizontalRuleNode=Wp;exports.BLUR_COMMAND=ai;exports.BareEditor=p_;exports.BlockHandle=C_;exports.CLEAR_EDITOR_COMMAND=Mc;exports.CLICK_COMMAND=mr;exports.COMMAND_PRIORITY_CRITICAL=Pc;exports.COMMAND_PRIORITY_EDITOR=U;exports.COMMAND_PRIORITY_HIGH=yg;exports.COMMAND_PRIORITY_LOW=G;exports.COMMAND_PRIORITY_NORMAL=_g;exports.COPY_COMMAND=_r;exports.CUT_COMMAND=li;exports.ContextualEditor=f0;exports.DEFAULT_BLOCK_COMMANDS=S_;exports.DEFAULT_SLASH_COMMANDS=u0;exports.DecoratorNode=ps;exports.DockedEditor=c0;exports.ElementNode=Se;exports.FOCUS_COMMAND=$c;exports.FORMAT_ELEMENT_COMMAND=Ac;exports.FORMAT_TEXT_COMMAND=ve;exports.FloatingToolbar=x_;exports.HR_TRANSFORMER=f_;exports.HorizontalRuleNode=Ar;exports.INDENT_CONTENT_COMMAND=Bt;exports.INSERT_CHECK_LIST_COMMAND=hl;exports.INSERT_HORIZONTAL_RULE_COMMAND=Ts;exports.INSERT_IMAGE_COMMAND=Ev;exports.INSERT_ORDERED_LIST_COMMAND=mi;exports.INSERT_PARAGRAPH_COMMAND=$n;exports.INSERT_UNORDERED_LIST_COMMAND=pi;exports.KEY_ENTER_COMMAND=In;exports.KEY_ESCAPE_COMMAND=oi;exports.KEY_TAB_COMMAND=gs;exports.LexicalEditorInput=h0;exports.LexicalToolbar=y_;exports.OUTDENT_CONTENT_COMMAND=nn;exports.PASTE_COMMAND=ri;exports.REDO_COMMAND=si;exports.REMOVE_LIST_COMMAND=uu;exports.SELECTION_CHANGE_COMMAND=ni;exports.SlashCommandPalette=d0;exports.TOGGLE_SLASH_COMMAND_PALETTE=kv;exports.TOOLBAR_SEPARATOR=k_;exports.TextNode=qe;exports.UNDO_COMMAND=ii;exports.applyMark=Uv;exports.createCommand=K;exports.createDefaultPluginConfig=_l;exports.createHeadlessEditor=Ns;exports.executeSlashCommand=vv;exports.exportEditorToFile=Tv;exports.exportToHtml=xt;exports.exportToMarkdown=bt;exports.getCharacterCount=Hv;exports.getMarkdownTransformers=h_;exports.getNodesForPlugins=ml;exports.getSelectionInfo=jv;exports.getTextContent=Ku;exports.getWordCount=Jv;exports.htmlToLexicalJson=e0;exports.importFileToEditor=Nv;exports.importFromHtml=Un;exports.importFromMarkdown=Bn;exports.insertTable=Ov;exports.lexicalJsonToHtml=t0;exports.lexicalJsonToMarkdown=Qv;exports.loadLexicalCore=d_;exports.loadOffsetUtils=Vv;exports.markdownToLexicalJson=Xv;exports.registerAutoLinkPlugin=zv;exports.registerClipboardPlugin=Fl;exports.registerCodePlugin=Mv;exports.registerCodeShikiPlugin=$v;exports.registerDragonPlugin=zl;exports.registerHashtagPlugin=Dv;exports.registerHistoryPlugin=Il;exports.registerHorizontalRulePlugin=Rl;exports.registerLinkPlugin=Ll;exports.registerListPlugin=Dl;exports.registerMarkPlugin=Bv;exports.registerOverflowPlugin=Wv;exports.registerPlainTextPlugin=$l;exports.registerRichTextPlugin=Ml;exports.registerSlashCommandsPlugin=wv;exports.registerTablePlugin=Pl;exports.registerYjsPlugin=Bl;exports.removeMark=Kv;
|