@payloadcms/richtext-lexical 3.42.0-internal.f9d0258 → 3.43.0-canary.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.
@@ -31,7 +31,7 @@ ${e.map(Fc).join(`
31
31
  `)}
32
32
  });
33
33
  });
34
- `},[t,e]),m=$e((k,_)=>{o(g=>{let S=e.length-1,M=e[S];if(M&&M.name===k){if(k==="type")return[...e.slice(0,S),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,S),{...M,count:M.count+1}]}return[...g,{name:k,count:1,value:_}]})},[e,o]);pn(()=>{let k=g=>{if(!r)return;let S=g.key;Pc(g)?m("selectAll",""):hn.has(S)?m("press",g.key):[...S].length>1?m("keydown",g.key):m("type",g.key)},_=g=>{if(!r)return;let S=g.key;!hn.has(S)&&[...S].length>1&&m("keyup",g.key)};return t.registerRootListener((g,S)=>{S!==null&&(S.removeEventListener("keydown",k),S.removeEventListener("keyup",_)),g!==null&&(g.addEventListener("keydown",k),g.addEventListener("keyup",_))})},[t,r,m]),pn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Ao(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Ao(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:g,editorState:S})=>{if(!r)return;let M=S._selection,O=c.current,F=u.current;if(O!==M){if(g.size===0&&_.size===0&&!F){let T=Do(t._window);if(T&&(T.anchorNode==null||T.focusNode==null))return}c.current=M}u.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Ao(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=$e(k=>{r||(k.update(()=>{let _=Ac();_.clear();let g=Dc();_.append(Mc().append(g)),g.select()}),o([])),n(_=>!_)},[r]),h=$e(()=>{if(!r)return;let k=Do(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:g,focusNode:S,focusOffset:M}=Bc(k),O=a().getRootElement(),F;_!==null&&(F=fn(_,O));let I;S!==null&&(I=fn(S,O)),m("snapshot",{anchorNode:_,anchorOffset:g,anchorPath:F,focusNode:S,focusOffset:M,focusPath:I})},[m,r,a]),x=$e(()=>{Oc(p())},[p]),b=$e(()=>{$c("test.js",p())},[p]);return[Fe("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:k=>{f(a()),k.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Fe("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{x(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{b(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Fe("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var xn=()=>{let t=Rc(3),[e]=vc(),[o,r]=Hc(e),n;return t[0]!==o||t[1]!==r?(n=$o(gn.Fragment,{children:[Fe("p",{children:"HI"}),o,r,Fe("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var jc=y({plugins:[{Component:xn,position:"bottom"}]});import{c as Uc}from"react/compiler-runtime";import{jsx as Gc}from"react/jsx-runtime";import{useLexicalComposerContext as Wc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Vc}from"@lexical/react/LexicalTreeView.js";import"react";var Cn=()=>{let t=Uc(2),[e]=Wc(),o;return t[0]!==e?(o=Gc(Vc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Kc=y({plugins:[{Component:Cn,position:"bottom"}]});import{$isTableSelection as Jc}from"@lexical/table";import{$isRangeSelection as Xc,FORMAT_TEXT_COMMAND as zc}from"lexical";import{jsx as bn}from"react/jsx-runtime";import"react";var kn=()=>bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:bn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var te=t=>({type:"buttons",items:t,key:"format",order:40});var _n={type:"text-format",format:["bold","italic"],tag:"***"},Tn={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},wn={type:"text-format",format:["bold"],tag:"**"},En={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var Nn=[te([{ChildComponent:kn,isActive:({selection:t})=>Xc(t)||Jc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(zc,"bold")},order:1}])],Zc=y(({featureProviderMap:t})=>{let e=[wn,En];return t.get("italic")&&e.push(Tn,_n),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Nn},toolbarInline:{groups:Nn}}});import{$isTableSelection as qc}from"@lexical/table";import{$isRangeSelection as Qc,FORMAT_TEXT_COMMAND as eu}from"lexical";import{jsx as Sn,jsxs as Yc}from"react/jsx-runtime";import"react";var Ln=()=>Yc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Sn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Sn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var yn={type:"text-format",format:["code"],tag:"`"};var In=[te([{ChildComponent:Ln,isActive:({selection:t})=>Qc(t)||qc(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(eu,"code")},order:7}])],tu=y({enableFormats:["code"],markdownTransformers:[yn],toolbarFixed:{groups:In},toolbarInline:{groups:In}});import{$isTableSelection as ou}from"@lexical/table";import{$isRangeSelection as ru,FORMAT_TEXT_COMMAND as nu}from"lexical";import{jsx as Rn}from"react/jsx-runtime";import"react";var vn=()=>Rn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rn("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var Mn={type:"text-format",format:["italic"],tag:"*"},Dn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var An=[te([{ChildComponent:vn,isActive:({selection:t})=>ru(t)||ou(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(nu,"italic")},order:2}])],lu=y({enableFormats:["italic"],markdownTransformers:[Mn,Dn],toolbarFixed:{groups:An},toolbarInline:{groups:An}});import{$isTableSelection as su}from"@lexical/table";import{$isRangeSelection as au,FORMAT_TEXT_COMMAND as cu}from"lexical";import{jsx as On,jsxs as iu}from"react/jsx-runtime";import"react";var $n=()=>iu("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[On("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),On("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var Fn={type:"text-format",format:["strikethrough"],tag:"~~"};var Pn=[te([{ChildComponent:$n,isActive:({selection:t})=>au(t)||su(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(cu,"strikethrough")},order:4}])],uu=y({enableFormats:["strikethrough"],markdownTransformers:[Fn],toolbarFixed:{groups:Pn},toolbarInline:{groups:Pn}});import{$isTableSelection as du}from"@lexical/table";import{$isRangeSelection as mu,FORMAT_TEXT_COMMAND as pu}from"lexical";import{jsx as Bn}from"react/jsx-runtime";import"react";var Hn=()=>Bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var jn=[te([{ChildComponent:Hn,isActive:({selection:t})=>mu(t)||du(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(pu,"subscript")},order:5}])],fu=y({enableFormats:["subscript"],toolbarFixed:{groups:jn},toolbarInline:{groups:jn}});import{$isTableSelection as hu}from"@lexical/table";import{$isRangeSelection as gu,FORMAT_TEXT_COMMAND as xu}from"lexical";import{jsx as Un}from"react/jsx-runtime";import"react";var Gn=()=>Un("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Un("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Wn=[te([{ChildComponent:Gn,isActive:({selection:t})=>gu(t)||hu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(xu,"superscript")},order:6}])],Cu=y({enableFormats:["superscript"],toolbarFixed:{groups:Wn},toolbarInline:{groups:Wn}});import{$isTableSelection as ku}from"@lexical/table";import{$isRangeSelection as _u,FORMAT_TEXT_COMMAND as Tu}from"lexical";import{jsx as Vn,jsxs as bu}from"react/jsx-runtime";import"react";var Kn=()=>bu("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Vn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Vn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Jn=[te([{ChildComponent:Kn,isActive:({selection:t})=>_u(t)||ku(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Tu,"underline")},order:3}])],wu=y({enableFormats:["underline"],toolbarFixed:{groups:Jn},toolbarInline:{groups:Jn}});import{jsx as Bo}from"react/jsx-runtime";import{jsx as Eu}from"react/jsx-runtime";function Nu(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Xt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Nu(o),r])):{};return Eu("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Su}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Lu}from"@lexical/selection";import{$getNodeByKey as yu,$getState as Iu,$setState as Ru,createState as vu,TextNode as Mu}from"lexical";import{useEffect as Du}from"react";var Fo=new Map;function Xn(t){for(let e in t){let o=t[e],r=vu(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Fo.set(e,{stateConfig:r,stateValues:o})}}function Po(t,e,o){t.update(()=>{Lu(r=>{let n=Fo.get(e);if(!n)throw new Error(`State config for ${e} not found`);Ru(r,n.stateConfig,o)})})}function zn(){let[t]=Su();return Du(()=>t.registerMutationListener(Mu,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=yu(o),l=t.getElementByKey(o);!n||!l||Fo.forEach((i,s)=>{let c=Iu(n,i.stateConfig);if(!c){delete l.dataset[s],l.style.cssText="";return}l.dataset[s]=c;let u=i.stateValues[c]?.css;u&&Object.entries(u).forEach(([d,a])=>{l.style.setProperty(d,a)})})}})}),[t]),null}var Zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Bo(Xt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Po(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Bo(Xt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Bo(Xt,{}),key:"clear-style",label:"Default style",onSelect:({editor:r})=>{for(let n in t.state)Po(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},Au=y(({props:t})=>(Xn(t.state),{plugins:[{Component:zn,position:"normal"}],toolbarFixed:{groups:Zn(t)},toolbarInline:{groups:Zn(t)}}));import{$createHeadingNode as Pu,$isHeadingNode as ul,HeadingNode as Bu}from"@lexical/rich-text";import{$setBlocksType as Hu}from"@lexical/selection";import{$getSelection as ju,$isRangeSelection as Uu}from"lexical";import{jsx as Yn}from"react/jsx-runtime";import"react";var qn=()=>Yn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Yn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as Qn}from"react/jsx-runtime";import"react";var el=()=>Qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as tl}from"react/jsx-runtime";import"react";var ol=()=>tl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:tl("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as rl}from"react/jsx-runtime";import"react";var nl=()=>rl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as ll}from"react/jsx-runtime";import"react";var il=()=>ll("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ll("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as sl}from"react/jsx-runtime";import"react";var al=()=>sl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Ou,$isHeadingNode as $u,HeadingNode as Fu}from"@lexical/rich-text";var Ho=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var cl=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Fu],export:(n,l)=>{if(!$u(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Ho(n=>{let l="h"+n[1]?.length;return Ou(l)})}};var dl=t=>{let e=ju();Hu(e,()=>Pu(t))},ml={h1:qn,h2:el,h3:ol,h4:nl,h5:il,h6:al},Gu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[le(e.map((r,n)=>({ChildComponent:ml[r],isActive:({selection:l})=>{if(!Uu(l))return!1;for(let i of l.getNodes()){if(ul(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(ul(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{dl(r)})},order:n+2})))];return{markdownTransformers:[cl(e)],nodes:[Bu],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[ee(e.map(r=>({Icon:ml[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{dl(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as ld}from"lexical";import{jsx as pl}from"react/jsx-runtime";import"react";var jo=()=>pl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:pl("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as fl,jsxs as Wu}from"react/jsx-runtime";import"react";var hl=()=>Wu("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[fl("path",{d:"M5 10h10",stroke:"currentColor"}),fl("path",{d:"M10 15V5",stroke:"currentColor"})]});var ke=t=>({type:"dropdown",ChildComponent:hl,items:t,key:"add",order:10});import{addClassNamesToElement as Vu}from"@lexical/utils";import{$applyNodeReplacement as Ku,createCommand as Ju,DecoratorNode as Xu}from"lexical";var gt=Ju("INSERT_HORIZONTAL_RULE_COMMAND"),ht=class extends Xu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:zu,priority:0})}}static importJSON(e){return gl()}createDOM(e){let o=document.createElement("hr");return Vu(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
34
+ `},[t,e]),m=$e((k,_)=>{o(g=>{let S=e.length-1,M=e[S];if(M&&M.name===k){if(k==="type")return[...e.slice(0,S),{...M,value:M.value+_}];if(M.value===_)return[...e.slice(0,S),{...M,count:M.count+1}]}return[...g,{name:k,count:1,value:_}]})},[e,o]);pn(()=>{let k=g=>{if(!r)return;let S=g.key;Pc(g)?m("selectAll",""):hn.has(S)?m("press",g.key):[...S].length>1?m("keydown",g.key):m("type",g.key)},_=g=>{if(!r)return;let S=g.key;!hn.has(S)&&[...S].length>1&&m("keyup",g.key)};return t.registerRootListener((g,S)=>{S!==null&&(S.removeEventListener("keydown",k),S.removeEventListener("keyup",_)),g!==null&&(g.addEventListener("keydown",k),g.addEventListener("keyup",_))})},[t,r,m]),pn(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),Ao(()=>{if(e){let k=p();k!==null&&s(k),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),Ao(()=>t.registerUpdateListener(({dirtyElements:_,dirtyLeaves:g,editorState:S})=>{if(!r)return;let M=S._selection,O=c.current,F=u.current;if(O!==M){if(g.size===0&&_.size===0&&!F){let T=Do(t._window);if(T&&(T.anchorNode==null||T.focusNode==null))return}c.current=M}u.current=!1;let I=p();I!==null&&s(I)}),[t,p,r,m]),Ao(()=>r?t.registerUpdateListener(()=>{let _=t.getRootElement();_!==null&&l(_?.innerHTML)}):void 0,[t,r]);let f=$e(k=>{r||(k.update(()=>{let _=Ac();_.clear();let g=Dc();_.append(Mc().append(g)),g.select()}),o([])),n(_=>!_)},[r]),h=$e(()=>{if(!r)return;let k=Do(t._window);if(k===null||k.anchorNode==null||k.focusNode==null)return;let{anchorNode:_,anchorOffset:g,focusNode:S,focusOffset:M}=Bc(k),O=a().getRootElement(),F;_!==null&&(F=fn(_,O));let I;S!==null&&(I=fn(S,O)),m("snapshot",{anchorNode:_,anchorOffset:g,anchorPath:F,focusNode:S,focusOffset:M,focusPath:I})},[m,r,a]),x=$e(()=>{Oc(p())},[p]),b=$e(()=>{$c("test.js",p())},[p]);return[Fe("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:k=>{f(a()),k.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?$o("div",{className:"test-recorder-output",children:[$o("div",{className:"test-recorder-toolbar",children:[Fe("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:k=>{h(),k.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:k=>{x(),k.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Fe("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:k=>{b(),k.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Fe("pre",{id:"test-recorder",ref:d,children:i})]}):null]}var xn=()=>{let t=Rc(3),[e]=vc(),[o,r]=Hc(e),n;return t[0]!==o||t[1]!==r?(n=$o(gn.Fragment,{children:[Fe("p",{children:"HI"}),o,r,Fe("p",{children:"DONE"})]}),t[0]=o,t[1]=r,t[2]=n):n=t[2],n};var jc=y({plugins:[{Component:xn,position:"bottom"}]});import{c as Uc}from"react/compiler-runtime";import{jsx as Gc}from"react/jsx-runtime";import{useLexicalComposerContext as Wc}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Vc}from"@lexical/react/LexicalTreeView.js";import"react";var Cn=()=>{let t=Uc(2),[e]=Wc(),o;return t[0]!==e?(o=Gc(Vc,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"}),t[0]=e,t[1]=o):o=t[1],o};var Kc=y({plugins:[{Component:Cn,position:"bottom"}]});import{$isTableSelection as Jc}from"@lexical/table";import{$isRangeSelection as Xc,FORMAT_TEXT_COMMAND as zc}from"lexical";import{jsx as bn}from"react/jsx-runtime";import"react";var kn=()=>bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:bn("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var te=t=>({type:"buttons",items:t,key:"format",order:40});var _n={type:"text-format",format:["bold","italic"],tag:"***"},Tn={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},wn={type:"text-format",format:["bold"],tag:"**"},En={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var Nn=[te([{ChildComponent:kn,isActive:({selection:t})=>Xc(t)||Jc(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(zc,"bold")},order:1}])],Zc=y(({featureProviderMap:t})=>{let e=[wn,En];return t.get("italic")&&e.push(Tn,_n),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Nn},toolbarInline:{groups:Nn}}});import{$isTableSelection as qc}from"@lexical/table";import{$isRangeSelection as Qc,FORMAT_TEXT_COMMAND as eu}from"lexical";import{jsx as Sn,jsxs as Yc}from"react/jsx-runtime";import"react";var Ln=()=>Yc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Sn("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Sn("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var yn={type:"text-format",format:["code"],tag:"`"};var In=[te([{ChildComponent:Ln,isActive:({selection:t})=>Qc(t)||qc(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(eu,"code")},order:7}])],tu=y({enableFormats:["code"],markdownTransformers:[yn],toolbarFixed:{groups:In},toolbarInline:{groups:In}});import{$isTableSelection as ou}from"@lexical/table";import{$isRangeSelection as ru,FORMAT_TEXT_COMMAND as nu}from"lexical";import{jsx as Rn}from"react/jsx-runtime";import"react";var vn=()=>Rn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Rn("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var Mn={type:"text-format",format:["italic"],tag:"*"},Dn={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var An=[te([{ChildComponent:vn,isActive:({selection:t})=>ru(t)||ou(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(nu,"italic")},order:2}])],lu=y({enableFormats:["italic"],markdownTransformers:[Mn,Dn],toolbarFixed:{groups:An},toolbarInline:{groups:An}});import{$isTableSelection as su}from"@lexical/table";import{$isRangeSelection as au,FORMAT_TEXT_COMMAND as cu}from"lexical";import{jsx as On,jsxs as iu}from"react/jsx-runtime";import"react";var $n=()=>iu("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[On("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),On("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var Fn={type:"text-format",format:["strikethrough"],tag:"~~"};var Pn=[te([{ChildComponent:$n,isActive:({selection:t})=>au(t)||su(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(cu,"strikethrough")},order:4}])],uu=y({enableFormats:["strikethrough"],markdownTransformers:[Fn],toolbarFixed:{groups:Pn},toolbarInline:{groups:Pn}});import{$isTableSelection as du}from"@lexical/table";import{$isRangeSelection as mu,FORMAT_TEXT_COMMAND as pu}from"lexical";import{jsx as Bn}from"react/jsx-runtime";import"react";var Hn=()=>Bn("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bn("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var jn=[te([{ChildComponent:Hn,isActive:({selection:t})=>mu(t)||du(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(pu,"subscript")},order:5}])],fu=y({enableFormats:["subscript"],toolbarFixed:{groups:jn},toolbarInline:{groups:jn}});import{$isTableSelection as hu}from"@lexical/table";import{$isRangeSelection as gu,FORMAT_TEXT_COMMAND as xu}from"lexical";import{jsx as Un}from"react/jsx-runtime";import"react";var Gn=()=>Un("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Un("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var Wn=[te([{ChildComponent:Gn,isActive:({selection:t})=>gu(t)||hu(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(xu,"superscript")},order:6}])],Cu=y({enableFormats:["superscript"],toolbarFixed:{groups:Wn},toolbarInline:{groups:Wn}});import{$isTableSelection as ku}from"@lexical/table";import{$isRangeSelection as _u,FORMAT_TEXT_COMMAND as Tu}from"lexical";import{jsx as Vn,jsxs as bu}from"react/jsx-runtime";import"react";var Kn=()=>bu("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Vn("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),Vn("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var Jn=[te([{ChildComponent:Kn,isActive:({selection:t})=>_u(t)||ku(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Tu,"underline")},order:3}])],wu=y({enableFormats:["underline"],toolbarFixed:{groups:Jn},toolbarInline:{groups:Jn}});import{jsx as Bo}from"react/jsx-runtime";import{jsx as Eu}from"react/jsx-runtime";function Nu(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var Xt=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,r])=>[Nu(o),r])):{};return Eu("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Su}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as Lu}from"@lexical/selection";import{$getNodeByKey as yu,$getState as Iu,$setState as Ru,createState as vu,TextNode as Mu}from"lexical";import{useEffect as Du}from"react";var Fo=new Map;function Xn(t){for(let e in t){let o=t[e],r=vu(e,{parse:n=>typeof n=="string"&&Object.keys(o).includes(n)?n:void 0});Fo.set(e,{stateConfig:r,stateValues:o})}}function Po(t,e,o){t.update(()=>{Lu(r=>{let n=Fo.get(e);if(!n)throw new Error(`State config for ${e} not found`);Ru(r,n.stateConfig,o)})})}function zn(){let[t]=Su();return Du(()=>t.registerMutationListener(Mu,e=>{t.getEditorState().read(()=>{for(let[o,r]of e){if(r==="destroyed")continue;let n=yu(o),l=t.getElementByKey(o);if(!n||!l)continue;let i=Object.create(null);Fo.forEach((s,c)=>{let u=Iu(n,s.stateConfig);if(!u){delete l.dataset[c];return}l.dataset[c]=u;let d=s.stateValues[u]?.css;d&&Object.assign(i,d)}),l.style.cssText="",Object.assign(l.style,i)}})}),[t]),null}var Zn=t=>{let e=[];for(let r in t.state){let n=t.state[r];for(let l in n){let i=n[l];e.push({ChildComponent:()=>Bo(Xt,{css:i.css}),key:l,label:i.label,onSelect:({editor:s})=>{Po(s,r,l)}})}}return[{type:"dropdown",ChildComponent:()=>Bo(Xt,{css:{color:"var(--theme-elevation-600)"}}),items:[...[{ChildComponent:()=>Bo(Xt,{}),key:"clear-style",label:"Default style",onSelect:({editor:r})=>{for(let n in t.state)Po(r,n,void 0)},order:1}],...e],key:"textState",order:30}]},Au=y(({props:t})=>(Xn(t.state),{plugins:[{Component:zn,position:"normal"}],toolbarFixed:{groups:Zn(t)},toolbarInline:{groups:Zn(t)}}));import{$createHeadingNode as Pu,$isHeadingNode as ul,HeadingNode as Bu}from"@lexical/rich-text";import{$setBlocksType as Hu}from"@lexical/selection";import{$getSelection as ju,$isRangeSelection as Uu}from"lexical";import{jsx as Yn}from"react/jsx-runtime";import"react";var qn=()=>Yn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Yn("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as Qn}from"react/jsx-runtime";import"react";var el=()=>Qn("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Qn("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as tl}from"react/jsx-runtime";import"react";var ol=()=>tl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:tl("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as rl}from"react/jsx-runtime";import"react";var nl=()=>rl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as ll}from"react/jsx-runtime";import"react";var il=()=>ll("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ll("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as sl}from"react/jsx-runtime";import"react";var al=()=>sl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sl("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as Ou,$isHeadingNode as $u,HeadingNode as Fu}from"@lexical/rich-text";var Ho=t=>(e,o,r)=>{let n=t(r);n&&(n.append(...o),e.replace(n),n.select(0,0))};var cl=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Fu],export:(n,l)=>{if(!$u(n))return null;let i=Number(n.getTag().slice(1));return"#".repeat(i)+" "+l(n)},regExp:r,replace:Ho(n=>{let l="h"+n[1]?.length;return Ou(l)})}};var dl=t=>{let e=ju();Hu(e,()=>Pu(t))},ml={h1:qn,h2:el,h3:ol,h4:nl,h5:il,h6:al},Gu=y(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[le(e.map((r,n)=>({ChildComponent:ml[r],isActive:({selection:l})=>{if(!Uu(l))return!1;for(let i of l.getNodes()){if(ul(i)&&i.getTag()===r)continue;let s=i.getParent();if(!(ul(s)&&s.getTag()===r))return!1}return!0},key:r,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{dl(r)})},order:n+2})))];return{markdownTransformers:[cl(e)],nodes:[Bu],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[ee(e.map(r=>({Icon:ml[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{dl(r)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}});import{$isNodeSelection as ld}from"lexical";import{jsx as pl}from"react/jsx-runtime";import"react";var jo=()=>pl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:pl("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as fl,jsxs as Wu}from"react/jsx-runtime";import"react";var hl=()=>Wu("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[fl("path",{d:"M5 10h10",stroke:"currentColor"}),fl("path",{d:"M10 15V5",stroke:"currentColor"})]});var ke=t=>({type:"dropdown",ChildComponent:hl,items:t,key:"add",order:10});import{addClassNamesToElement as Vu}from"@lexical/utils";import{$applyNodeReplacement as Ku,createCommand as Ju,DecoratorNode as Xu}from"lexical";var gt=Ju("INSERT_HORIZONTAL_RULE_COMMAND"),ht=class extends Xu{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:zu,priority:0})}}static importJSON(e){return gl()}createDOM(e){let o=document.createElement("hr");return Vu(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{type:"horizontalrule",version:1}}getTextContent(){return`
35
35
  `}isInline(){return!1}updateDOM(){return!1}};function zu(){return{node:gl()}}function gl(){return Ku(new ht)}import{$applyNodeReplacement as Zu}from"lexical";import"react";var ve=class extends ht{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return xt()}decorate(){return null}exportJSON(){return super.exportJSON()}};function xt(){return Zu(new ve)}function zt(t){return t instanceof ve}var xl={type:"element",dependencies:[ve],export:(t,e)=>zt(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=xt();e&&t.replace(e)}};import{c as Yu}from"react/compiler-runtime";import{useLexicalComposerContext as qu}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Qu}from"@lexical/utils";import{$getSelection as ed,$isRangeSelection as td,COMMAND_PRIORITY_EDITOR as od}from"lexical";import{useEffect as rd}from"react";var Cl=()=>{let t=Yu(3),[e]=qu(),o,r;return t[0]!==e?(o=()=>e.registerCommand(gt,nd,od),r=[e],t[0]=e,t[1]=o,t[2]=r):(o=t[1],r=t[2]),rd(o,r),null};function nd(t){let e=ed();if(!td(e))return!1;if(e.focus.getNode()!==null){let r=xt();Qu(r)}return!0}var id=y({markdownTransformers:[xl],nodes:[ve],plugins:[{Component:Cl,position:"normal"}],slashMenu:{groups:[ee([{Icon:jo,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(gt,void 0)}}])]},toolbarFixed:{groups:[ke([{ChildComponent:jo,isActive:({selection:t})=>{if(!ld(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return zt(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(gt,void 0)}}])]}});import{$findMatchingParent as yl}from"@lexical/utils";import{$isElementNode as bd,INDENT_CONTENT_COMMAND as kd,OUTDENT_CONTENT_COMMAND as _d}from"lexical";import{jsx as Zt,jsxs as sd}from"react/jsx-runtime";import"react";var bl=()=>sd("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Zt("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Zt("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as Yt,jsxs as ad}from"react/jsx-runtime";import"react";var kl=()=>ad("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Yt("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),Yt("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});import{jsx as cd}from"react/jsx-runtime";import{useLexicalComposerContext as ud}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as dd}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as md,mergeRegister as _l}from"@lexical/utils";import{$getSelection as pd,$isElementNode as Nl,$isRangeSelection as fd,COMMAND_PRIORITY_LOW as Tl,INDENT_CONTENT_COMMAND as wl,KEY_TAB_COMMAND as hd,OUTDENT_CONTENT_COMMAND as gd,TabNode as xd}from"lexical";import{useEffect as El}from"react";var Sl=({clientProps:t})=>{let[e]=ud(),{disabledNodes:o,disableTabNode:r}=t;return El(()=>{if(!(!e||!o?.length))return _l(e.registerCommand(wl,()=>Cd(n=>{if(!o.includes(n.getType())){let l=n.getIndent();n.setIndent(l+1)}}),Tl),e.registerUpdateListener(({dirtyElements:n,editorState:l})=>{e.update(()=>{for(let[i]of n){let s=l._nodeMap.get(i);Nl(s)&&o.includes(s.getType())&&s.getIndent()>0&&s.setIndent(0)}})}))},[e,o]),El(()=>{if(!(!e||!r))return _l(e.registerCommand(hd,n=>(n.preventDefault(),e.dispatchCommand(n.shiftKey?gd:wl,void 0)),Tl),e.registerNodeTransform(xd,n=>{n.remove()}))},[e,r]),cd(dd,{})};function Cd(t){let e=pd();if(!fd(e))return!1;let o=new Set,r=e.getNodes();for(let n=0;n<r.length;n++){let l=r[n],i=l.getKey();if(o.has(i))continue;let s=md(l,u=>Nl(u)&&!u.isInline());if(s===null)continue;let c=s.getKey();s.canIndent()&&!o.has(c)&&(o.add(c),t(s))}return o.size>0}var Ll=t=>({type:"buttons",items:t,key:"indent",order:35});var Il=({disabledNodes:t})=>[Ll([{ChildComponent:bl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Rl(n)&&n.getIndent()>0;return o.some(n=>r(n)||!!yl(n,r))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(_d,void 0)},order:1},{ChildComponent:kl,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],r=n=>Rl(n)&&!(t??[]).includes(n.getType());return o.some(n=>r(n)||!!yl(n,r))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(kd,void 0)},order:2}])],Td=y(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Sl,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Il({disabledNodes:e})},toolbarInline:{groups:Il({disabledNodes:e})}}}),Rl=t=>bd(t)&&t.canIndent();import{$findMatchingParent as Am}from"@lexical/utils";import{$getSelection as Zo,$isRangeSelection as si}from"lexical";import{jsx as vl}from"react/jsx-runtime";import"react";var Ml=()=>vl("svg",{"aria-hidden":"true",className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:vl("path",{d:"M8.5 11.5L11.5 8.5M8.5 7L9.625 5.875C10.868 4.633 12.882 4.633 14.125 5.875C15.368 7.118 15.368 9.133 14.125 10.375L13 11.5M7 8.5L5.746 9.754C4.56 10.94 4.519 12.85 5.652 14.087C6.814 15.354 8.78 15.449 10.058 14.298L11.5 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});import{$isAtNodeEnd as Dl}from"@lexical/selection";function ze(t){let{anchor:e}=t,{focus:o}=t,r=t.anchor.getNode(),n=t.focus.getNode();return r===n?r:t.isBackward()?Dl(o)?r:n:Dl(e)?r:n}var Uo=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Dd}from"lexical";import{addClassNamesToElement as wd,isHTMLAnchorElement as Ed}from"@lexical/utils";import Vo from"bson-objectid";import{$applyNodeReplacement as Nd,$createTextNode as Al,$getSelection as Sd,$isElementNode as Ol,$isRangeSelection as Wo,createCommand as Ld,ElementNode as yd}from"lexical";var Id=new Set(["http:","https:","mailto:","sms:","tel:"]),ie=class t extends yd{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:r}){super(r),this.__fields=o,this.__id=e}static clone(e){return new t({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Rd,priority:1})}}static importJSON(e){let o=_e({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),e.version===2&&!e.id&&(e.id=new Vo.default().toHexString(),e.version=3),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(e){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener")),wd(o,e.theme.link),o}exportJSON(){let e=this.getFields();e?.linkType==="internal"?delete e.url:e?.linkType==="custom"&&delete e.doc;let o={...super.exportJSON(),type:"link",fields:e,version:3},r=this.getID();return r&&(o.id=r),o}extractWithChild(e,o,r){if(!Wo(o))return!1;let n=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Ol(r)){let n=_e({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!Id.has(o.protocol))return"about:blank"}catch{return"https://"}return e}setFields(e){let o=this.getWritable();return o.__fields=e,o}setID(e){let o=this.getWritable();return o.__id=e,o}updateDOM(e,o,r){let n=this.__fields?.url,l=this.__fields?.newTab;return n!=null&&n!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=n),this.__fields?.linkType==="internal"&&e.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),l!==e.__fields?.newTab&&(l??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=Go(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=Go(o.rel,"remove","noopener"))),!1}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields).setID(e.id)}};function Rd(t){let e=null;if(Ed(t)){let o=t.textContent;o!==null&&o!==""&&(e=_e({id:new Vo.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function _e({id:t,fields:e}){return Nd(new ie({id:t??new Vo.default().toHexString(),fields:e}))}function Z(t){return t instanceof ie}var he=Ld("TOGGLE_LINK_COMMAND");function Ko(t){let e=Sd();if(!Wo(e)&&(t===null||!t.selectedNodes?.length))return;let o=Wo(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let i=l.getParent();Z(i)&&(i.getChildren().forEach(c=>{i.insertBefore(c)}),i.remove())});return}if(o?.length===1){let l=o[0],i=Z(l)?l:vd(l);if(i!==null){i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Al(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}}let r=null,n=null;o?.forEach(l=>{let i=l.getParent();if(!(i===n||i===null||Ol(l)&&!l.isInline())){if(Z(i)){n=i,i.setFields(t.fields),t.text!=null&&t.text!==i.getTextContent()&&(i.append(Al(t.text)),i.getChildren().forEach(s=>{s!==i.getLastChild()&&s.remove()}));return}if(i.is(r)||(r=i,n=_e({fields:t.fields}),Z(i)?l.getPreviousSibling()===null?i.insertBefore(n):i.insertAfter(n):l.insertBefore(n)),Z(l)){if(l.is(n))return;if(n!==null){let s=l.getChildren();n.append(...s)}l.remove();return}n!==null&&n.append(l)}})}function vd(t){return Md(t,e=>Z(e))}function Md(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function Go(t,e,o){let r,n=`${t}`;if(e==="add"){if(n.includes(o)){let l=new RegExp(o,"g");n=n.replace(l,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let l=new RegExp(o,"g");r=n.replace(l,"").trim()}return r}var $l={type:"text-match",dependencies:[ie],export:(t,e)=>{if(!Z(t))return null;let o=t,{url:r}=o.getFields();return`[${e(o)}](${r})`},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(t,e)=>{let[,o,r]=e,n=_e({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),l=Dd(o);return l.setFormat(t.getFormat()),n.append(l),t.replace(n),l},trigger:")"};import{$applyNodeReplacement as Ad,$isElementNode as Od}from"lexical";var Te=class t extends ie{static clone(e){return new t({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){let o=Ct({}).updateFromJSON(e);return e.version===1&&typeof e.fields?.doc?.value=="object"&&e.fields?.doc?.value?.id&&(e.fields.doc.value=e.fields.doc.value.id,e.version=2),o}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:2}}insertNewAfter(e,o=!0){let r=this.getParentOrThrow().insertNewAfter(e,o);if(Od(r)){let n=Ct({fields:this.__fields});return r.append(n),n}return null}updateFromJSON(e){return super.updateFromJSON(e).setFields(e.fields)}};function Ct({fields:t}){return Ad(new Te({id:"",fields:t}))}function we(t){return t instanceof Te}import{c as $d}from"react/compiler-runtime";import{useLexicalComposerContext as Fd}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Pd}from"@lexical/utils";import{$createTextNode as Fl,$getSelection as Bd,$isElementNode as Bl,$isLineBreakNode as Hl,$isNodeSelection as Hd,$isRangeSelection as jd,$isTextNode as bt,TextNode as Ud}from"lexical";import{useEffect as Gd}from"react";function Pl(t,e=o=>o){return o=>{let r=t.exec(o);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function jl(t,e){for(let o of e){let r=o(t);if(r!=null)return r}return null}var Wd=/[.,;\s]/;function Qt(t){return t!==void 0&&Wd.test(t)}function Ul(t){return Qt(t[t.length-1])}function Xo(t){return Qt(t[0])}function Vd(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Gl(t){let e=t.getPreviousSibling();return Bl(e)&&(e=e.getLastDescendant()),e===null||Hl(e)||bt(e)&&Ul(e.getTextContent())}function Wl(t){let e=t.getNextSibling();return Bl(e)&&(e=e.getFirstDescendant()),e===null||Hl(e)||bt(e)&&Xo(e.getTextContent())}function Kd(t,e,o,r){return(t>0?Qt(o[t-1]):Gl(r[0]))?e<o.length?Qt(o[e]):Wl(r[r.length-1]):!1}function Jd(t,e,o){let r=[],n=[],l=[],i=0,s=0,c=[...t];for(;c.length>0;){let u=c[0],a=u.getTextContent().length,p=s;s+a<=e?(r.push(u),i+=a):p>=o?l.push(u):n.push(u),s+=a,c.shift()}return[i,r,n,l]}function Xd(t,e,o,r){let n={linkType:"custom",url:r.url,...r.fields},l=Ct({fields:n});if(t.length===1){let i=t[0],s;if(e===0?[s]=i.splitText(o):[,s]=i.splitText(e,o),s){let c=Fl(r.text);c.setFormat(s.getFormat()),c.setDetail(s.getDetail()),c.setStyle(s.getStyle()),l.append(c),s.replace(l)}return i}else if(t.length>1){let i=t[0],s=i.getTextContent().length,c;e===0?c=i:[,c]=i.splitText(e);let u=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,f=s,h=s+m;if(f<o)if(h<=o)u.push(a);else{let[x,b]=a.splitText(o-f);x&&u.push(x),d=b}s+=m}),c){let a=Bd(),p=a?a.getNodes().find(bt):void 0,m=Fl(c.getTextContent());return m.setFormat(c.getFormat()),m.setDetail(c.getDetail()),m.setStyle(c.getStyle()),l.append(m,...u),p&&p===c&&(jd(a)?m.select(a.anchor.offset,a.focus.offset):Hd(a)&&m.select(0,m.getTextContent().length)),c.replace(l),d}}}function zd(t,e,o){let r=[...t],n=r.map(c=>c.getTextContent()).join(""),l=n,i,s=0;for(;(i=jl(l,e))!=null&&i!==null;){let c=i.index,u=i.length,d=c+u;if(Kd(s+c,s+d,n,r)){let[p,,m,f]=Jd(r,s+c,s+d),h=s+c-p,x=s+d-p,b=Xd(m,h,x,i);r=b?[b,...f]:f,o(i.url,null),s=0}else s+=d;l=l.substring(d)}}function Jo(t,e,o){let r=t.getChildren(),n=r.length;for(let c=0;c<n;c++){let u=r[c];if(!bt(u)||!u.isSimpleText()){qt(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),i=jl(l,e);if(i===null||i.text!==l){qt(t),o(null,t.getFields()?.url??null);return}if(!Gl(t)||!Wl(t)){qt(t),o(null,t.getFields()?.url??null);return}let s=t.getFields()?.url;if(s!==i?.url){let c=t.getFields();c.url=i?.url,t.setFields(c),o(i.url,s??null)}}function Zd(t,e,o){let r=t.getPreviousSibling(),n=t.getNextSibling(),l=t.getTextContent();if(we(r)){let i=r.getFields()?.url?r.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Xo(l)||Vd(l,i))&&(r.append(t),Jo(r,e,o),o(null,r.getFields()?.url??null))}we(n)&&!Ul(l)&&(qt(n),Jo(n,e,o),o(null,n.getFields()?.url??null))}function qt(t){let e=t.getChildren(),o=e.length;for(let r=o-1;r>=0;r--)t.insertAfter(e[r]);return t.remove(),e.map(r=>r.getLatest())}function Yd(t){let e=[t],o=t.getNextSibling();for(;o!==null&&bt(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function qd(t,e,o){let r=$d(5),n,l;r[0]!==t||r[1]!==e||r[2]!==o?(n=()=>{if(!t.hasNodes([Te]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let i=(s,c)=>{o?.(s,c)};return Pd(t.registerNodeTransform(Ud,s=>{let c=s.getParentOrThrow(),u=s.getPreviousSibling();if(we(c))Jo(c,e,i);else if(!Z(c)){if(s.isSimpleText()&&(Xo(s.getTextContent())||!we(u))){let d=Yd(s);zd(d,e,i)}Zd(s,e,i)}}))},l=[t,e,o],r[0]=t,r[1]=e,r[2]=o,r[3]=n,r[4]=l):(n=r[3],l=r[4]),Gd(n,l)}var Qd=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,em=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,tm=[Pl(Qd,t=>t.startsWith("http")?t:`https://${t}`),Pl(em,t=>`mailto:${t}`)],Vl=()=>{let[t]=Fd();return qd(t,tm),null};import{jsx as om}from"react/jsx-runtime";import{ClickableLinkPlugin as rm}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Kl=()=>om(rm,{});import{jsx as _m}from"react/jsx-runtime";import"react";import{createPortal as Tm}from"react-dom";import{jsx as Ee,jsxs as kt,Fragment as lm}from"react/jsx-runtime";import{useLexicalComposerContext as im}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as Jl,mergeRegister as Xl}from"@lexical/utils";import{getTranslation as zo}from"@payloadcms/translations";import{CloseMenuIcon as sm,EditIcon as am,ExternalLinkIcon as zl,formatDrawerSlug as cm,useConfig as um,useEditDepth as dm,useLocale as mm,useTranslation as pm}from"@payloadcms/ui";import{requests as fm}from"@payloadcms/ui/shared";import{$getSelection as Zl,$isLineBreakNode as hm,$isRangeSelection as Yl,COMMAND_PRIORITY_HIGH as gm,COMMAND_PRIORITY_LOW as ql,getDOMSelection as xm,KEY_ESCAPE_COMMAND as Cm,SELECTION_CHANGE_COMMAND as bm}from"lexical";import Ql,{useCallback as ei,useEffect as oo,useRef as km,useState as Pe}from"react";function eo(t,e,o,r=10,n=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let i=e.getBoundingClientRect(),s=o.getBoundingClientRect(),c=l.getBoundingClientRect(),u=t.top-r,d=t.left-n;u<c.top&&(u+=i.height+t.height+r*2),d+i.width>c.right&&(d=c.right-i.width-n),u-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${u}px)`}import{createCommand as nm}from"lexical";var to=nm("TOGGLE_LINK_WITH_MODAL_COMMAND");function ti(t){t.preventDefault()}function oi({anchorElem:t}){let[e]=im(),[o,r]=Pe(),n=km(null),[l,i]=Pe(null),[s,c]=Pe(null),{fieldProps:{schemaPath:u},uuid:d}=j(),{config:a,getEntityConfig:p}=um(),{i18n:m,t:f}=pm(),[h,x]=Pe(),b=dm(),[N,D]=Pe(!1),[k,_]=Pe([]),g=mm(),[S,M]=Pe(!1),O=cm({slug:"lexical-rich-text-link-"+d,depth:b}),{toggleDrawer:F}=xe(O),I=ei(()=>{D(!1),n&&n.current&&(n.current.style.opacity="0",n.current.style.transform="translate(-10000px, -10000px)"),M(!1),i(null),c(null),_([]),x(void 0)},[D,i,c,_]),T=ei(()=>{let C=Zl(),E;if(!Yl(C)||!C){I();return}let R=ze(C);E=e.getElementByKey(R.getKey())?.getBoundingClientRect();let L=Jl(R,Z),v=C.getNodes().filter(V=>!hm(V)).find(V=>{let U=Jl(V,Z);return L&&!L.is(U)||U&&!U.is(L)});if(L==null||v){I();return}r(L);let w=L.getFields(),$={...w,id:L.getID(),text:L.getTextContent()};if(w?.linkType==="custom")i(w?.url??null),c(null);else{i(`${a.routes.admin==="/"?"":a.routes.admin}/collections/${w?.doc?.relationTo}/${w?.doc?.value}`);let V=w?.doc?.relationTo?p({collectionSlug:w?.doc?.relationTo}):void 0;if(!V)c(w?.label?String(w?.label):null),i(w?.url?String(w?.url):null);else{let U=typeof w.doc?.value=="object"?w.doc.value.id:w.doc?.value,oe=w.doc?.relationTo;if(!U||!oe)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let ue=f("fields:linkedTo",{label:`${zo(V.labels.singular,m)} - ${f("lexical:link:loadingWithEllipsis",m)}`}).replace(/<[^>]*>?/g,"");c(ue),fm.get(`${a.serverURL}${a.routes.api}/${oe}/${U}`,{headers:{"Accept-Language":m.language},params:{depth:0,locale:g?.code}}).then(async q=>{if(!q.ok)throw new Error(`HTTP error! Status: ${q.status}`);let K=await q.json(),re=V?.admin?.useAsTitle||"id",ne=K[re],se=f("fields:linkedTo",{label:`${zo(V.labels.singular,m)} - ${ne}`}).replace(/<[^>]*>?/g,"");c(se)}).catch(()=>{let q=f("fields:linkedTo",{label:`${zo(V.labels.singular,m)} - ${f("general:untitled",m)} - ID: ${U}`}).replace(/<[^>]*>?/g,"");c(q)})}}x($),D(!0),_(C?C?.getNodes():[]),we(L)?M(!0):M(!1);let H=n.current,W=xm(e._window),{activeElement:Y}=document;if(H===null)return;let We=e.getRootElement();return W!==null&&We!==null&&We.contains(W.anchorNode)?(E||(E=W.getRangeAt(0).getBoundingClientRect()),E!=null&&(E.y+=40,eo(E,H,t))):(Y==null||Y.className!=="link-input")&&(We!==null&&eo(null,H,t),i(null),c(null)),!0},[e,I,a.routes.admin,a.routes.api,a.serverURL,p,f,m,g?.code,t]);return oo(()=>Xl(e.registerCommand(to,C=>(e.dispatchCommand(he,C),T(),F(),!0),ql)),[e,T,F,O]),oo(()=>{let C=t.parentElement,E=()=>{e.getEditorState().read(()=>{T()})};return window.addEventListener("resize",E),C?.addEventListener("scroll",E),()=>{window.removeEventListener("resize",E),C?.removeEventListener("scroll",E)}},[t.parentElement,e,T]),oo(()=>Xl(e.registerUpdateListener(({editorState:C})=>{C.read(()=>{T()})}),e.registerCommand(bm,()=>(T(),!0),ql),e.registerCommand(Cm,()=>N?(I(),!0):!1,gm)),[e,T,N,I]),oo(()=>{e.getEditorState().read(()=>{T()})},[e,T]),kt(Ql.Fragment,{children:[Ee("div",{className:"link-editor",ref:n,children:kt("div",{className:"link-input",children:[l&&l.length>0?kt("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:[o?.__fields.newTab?Ee(zl,{}):null,s!=null&&s.length>0?s:l]}):s!=null&&s.length>0?kt(lm,{children:[o?.__fields.newTab?Ee(zl,{}):null,Ee("span",{className:"link-input__label-pure",children:s})]}):null,e.isEditable()&&kt(Ql.Fragment,{children:[Ee("button",{"aria-label":"Edit link",className:"link-edit",onClick:C=>{C.preventDefault(),F()},onMouseDown:ti,tabIndex:0,type:"button",children:Ee(am,{})}),!S&&Ee("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(he,null)},onMouseDown:ti,tabIndex:0,type:"button",children:Ee(sm,{})})]})]})}),Ee(st,{className:"lexical-link-edit-drawer",data:h,drawerSlug:O,drawerTitle:f("fields:editLink"),featureKey:"link",handleDrawerSubmit:(C,E)=>{let R=E,L={...R};delete L.text,e.update(()=>{let v=Zl(),w=null;if(Yl(v)?w=ze(v).getParent():k.length&&(w=k[0]?.getParent()??null),w&&we(w)){let $=_e({fields:L});w.replace($,!0)}}),e.dispatchCommand(he,{fields:L,selectedNodes:k,text:R.text})},schemaPath:u,schemaPathSuffix:"fields"})]})}var ri=t=>{let{anchorElem:e=document.body}=t;return Tm(_m(oi,{anchorElem:e}),e)};import{c as Nm}from"react/compiler-runtime";import{useLexicalComposerContext as Sm}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Lm}from"@lexical/utils";import{$getSelection as ym,$isElementNode as Im,$isRangeSelection as Rm,COMMAND_PRIORITY_LOW as li,PASTE_COMMAND as vm}from"lexical";import{useEffect as Mm}from"react";var wm=/^(?:[a-zA-Z][a-zA-Z\d+.-]*:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|www\.[A-Za-z\d]+(?:\.[A-Za-z\d]+)+|(?:tel|mailto):[\w+.-]+)(?:\/[+~%/\w-]*)?(?:\?[-;&=%\w]*)?(?:#\w+)?$/,Em=/^(?:\/[\w\-./]*(?:#\w[\w-]*)?|#[\w\-]+)$/;function ni(t){if(!t)return!1;if(t==="https://"||wm.test(t)||Em.test(t))return!0;try{return new URL(t),!0}catch{}return!1}var ii=t=>{let e=Nm(5),{clientProps:o}=t,[r]=Sm(),n,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==r?(n=()=>{if(!r.hasNodes([ie]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Lm(r.registerCommand(he,i=>i===null?(Ko(null),!0):(i.fields?.linkType||(i.fields.linkType=o.defaultLinkType),i.fields?.url||(i.fields.url=o.defaultLinkURL),Ko(i),!0),li),r.registerCommand(vm,i=>{let s=ym();if(!Rm(s)||s.isCollapsed()||!(i instanceof ClipboardEvent)||i.clipboardData==null)return!1;let c=i.clipboardData.getData("text");if(!ni(c))return!1;if(!s.getNodes().some(Dm)){let u={doc:null,linkType:"custom",newTab:!1,url:c};return r.dispatchCommand(he,{fields:u,text:null}),i.preventDefault(),!0}return!1},li))},l=[o.defaultLinkType,o.defaultLinkURL,r],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=r,e[3]=n,e[4]=l):(n=e[3],l=e[4]),Mm(n,l),null};function Dm(t){return Im(t)}var ai=[Uo([{ChildComponent:Ml,isActive:({selection:t})=>{if(si(t)){let e=ze(t);return Am(e,Z)!=null}return!1},isEnabled:({selection:t})=>!!(si(t)&&Zo()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(he,null);else{let o,r=[];if(t.getEditorState().read(()=>{o=Zo()?.getTextContent(),r=Zo()?.getNodes()??[]}),!o?.length)return;let n={doc:null};t.dispatchCommand(to,{fields:n,selectedNodes:r,text:o})}},order:1}])],Om=y(({props:t})=>({markdownTransformers:[$l],nodes:[ie,t?.disableAutoLinks===!0?null:Te].filter(Boolean),plugins:[{Component:ii,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:Vl,position:"normal"},{Component:Kl,position:"normal"},{Component:ri,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:ai},toolbarInline:{groups:ai}}));import{$isListNode as Qo,INSERT_CHECK_LIST_COMMAND as fi,ListItemNode as Jm,ListNode as Xm}from"@lexical/list";import{$isRangeSelection as zm}from"lexical";import{jsx as ci,jsxs as $m}from"react/jsx-runtime";import"react";var Yo=()=>$m("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ci("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),ci("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Fm}from"react/jsx-runtime";import{ListPlugin as Pm}from"@lexical/react/LexicalListPlugin.js";import"react";var Ze=()=>Fm(Pm,{});function Ye(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as Um,ListItemNode as Gm,ListNode as Wm}from"@lexical/list";import{$createListItemNode as Bm,$createListNode as Hm,$isListItemNode as jm,$isListNode as qo}from"@lexical/list";var ui=4,qe=t=>(e,o,r)=>{let n=e.getPreviousSibling(),l=e.getNextSibling(),i=Bm(t==="check"?r[3]==="x":void 0);if(qo(l)&&l.getListType()===t){let c=l.getFirstChild();c!==null?c.insertBefore(i):l.append(i),e.remove()}else if(qo(n)&&n.getListType()===t)n.append(i),e.remove();else{let c=Hm(t,t==="number"?Number(r[2]):void 0);c.append(i),e.replace(c)}i.append(...o),i.select(0,0);let s=Math.floor(r[1].length/ui);s&&i.setIndent(s)},Be=(t,e,o)=>{let r=[],n=t.getChildren(),l=0;for(let i of n)if(jm(i)){if(i.getChildrenSize()===1){let d=i.getFirstChild();if(qo(d)){r.push(Be(d,e,o+1));continue}}let s=" ".repeat(o*ui),c=t.getListType(),u=c==="number"?`${t.getStart()+l}. `:c==="check"?`- [${i.getChecked()?"x":" "}] `:"- ";r.push(s+u+e(i)),l++}return r.join(`
36
36
  `)};var di={type:"element",dependencies:[Wm,Gm],export:(t,e)=>Um(t)?Be(t,e,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:qe("check")};import{jsx as Vm}from"react/jsx-runtime";import{CheckListPlugin as Km}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var mi=()=>Vm(Km,{});var pi=[le([{ChildComponent:Yo,isActive:({selection:t})=>{if(!zm(t))return!1;for(let e of t.getNodes()){if(Qo(e)&&e.getListType()==="check")continue;let o=e.getParent();if(Qo(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(Qo(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(fi,void 0)},order:12}])],Zm=y(({featureProviderMap:t})=>{let e=[{Component:mi,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&e.push({Component:Ze,position:"normal"}),{markdownTransformers:[di],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[Xm,Jm],plugins:e,slashMenu:{groups:[Ye([{Icon:Yo,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:o})=>o.t("lexical:checklist:label"),onSelect:({editor:o})=>{o.dispatchCommand(fi,void 0)}}])]},toolbarFixed:{groups:pi},toolbarInline:{groups:pi}}});import{$isListNode as tr,INSERT_ORDERED_LIST_COMMAND as xi,ListItemNode as tp,ListNode as op}from"@lexical/list";import{$isRangeSelection as rp}from"lexical";import{jsx as _t,jsxs as Ym}from"react/jsx-runtime";import"react";var er=()=>Ym("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[_t("path",{d:"M5.89284 12.479C5.89284 13.368 5.26284 13.788 4.38084 14.236C3.75084 14.558 3.43584 14.789 3.40784 15.062H5.89984V16H2.06384V15.573C2.06384 14.523 2.92484 13.935 3.66684 13.501C4.38084 13.088 4.75184 12.878 4.75184 12.458C4.75184 12.08 4.52084 11.835 4.06584 11.835C3.58984 11.835 3.30984 12.199 3.28184 12.654H2.11284C2.18984 11.681 2.87584 10.918 4.07284 10.918C5.15784 10.918 5.89284 11.555 5.89284 12.479Z",fill:"currentColor"}),_t("path",{d:"M2.68608 4.535V3.737C3.54008 3.737 3.90408 3.513 4.02308 2.995H4.89108V8H3.68008L3.68008 4.535H2.68608Z",fill:"currentColor"}),_t("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),_t("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as qm,ListItemNode as Qm,ListNode as ep}from"@lexical/list";var hi={type:"element",dependencies:[ep,Qm],export:(t,e)=>qm(t)?Be(t,e,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:qe("number")};var gi=[le([{ChildComponent:er,isActive:({selection:t})=>{if(!rp(t))return!1;for(let e of t.getNodes()){if(tr(e)&&e.getListType()==="number")continue;let o=e.getParent();if(tr(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(tr(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(xi,void 0)},order:10}])],np=y(({featureProviderMap:t})=>({markdownTransformers:[hi],nodes:t.has("orderedList")?[]:[op,tp],plugins:t.has("orderedList")?[]:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:er,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(xi,void 0)}}])]},toolbarFixed:{groups:gi},toolbarInline:{groups:gi}}));import{$isListNode as rr,INSERT_UNORDERED_LIST_COMMAND as ki,ListItemNode as cp,ListNode as up}from"@lexical/list";import{$isRangeSelection as dp}from"lexical";import{jsx as Qe,jsxs as lp}from"react/jsx-runtime";import"react";var or=()=>lp("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Qe("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),Qe("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),Qe("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as ip,ListItemNode as sp,ListNode as ap}from"@lexical/list";var Ci={type:"element",dependencies:[ap,sp],export:(t,e)=>ip(t)?Be(t,e,0):null,regExp:/^(\s*)[-*+]\s/,replace:qe("bullet")};var bi=[le([{ChildComponent:or,isActive:({selection:t})=>{if(!dp(t))return!1;for(let e of t.getNodes()){if(rr(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(rr(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(rr(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ki,void 0)},order:11}])],mp=y({markdownTransformers:[Ci],nodes:[up,cp],plugins:[{Component:Ze,position:"normal"}],slashMenu:{groups:[Ye([{Icon:or,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ki,void 0)}}])]},toolbarFixed:{groups:bi},toolbarInline:{groups:bi}});import{jsx as pp}from"react/jsx-runtime";import{addClassNamesToElement as fp}from"@lexical/utils";import{DecoratorNode as hp}from"lexical";import*as _i from"react";var gp=_i.lazy(()=>import("./Component-MBLHTKDK.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),Tt=class t extends hp{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return xp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return fp(o,"unknownConverted"),o}decorate(){return pp(gp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function xp({data:t}){return new Tt({data:t})}var Cp=y(()=>({nodes:[Tt]}));import{jsx as bp}from"react/jsx-runtime";import{addClassNamesToElement as kp}from"@lexical/utils";import{DecoratorNode as _p}from"lexical";import*as Ti from"react";var Tp=Ti.lazy(()=>import("./Component-DOSSWC76.js").then(t=>({default:t.UnknownConvertedNodeComponent}))),wt=class t extends _p{__data;constructor({data:e,key:o}){super(o),this.__data=e}static clone(e){return new t({data:e.__data,key:e.__key})}static getType(){return"unknownConverted"}static importJSON(e){return wp({data:e.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(e){let o=document.createElement("span");return kp(o,"unknownConverted"),o}decorate(){return bp(Tp,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(e,o){return!1}};function wp({data:t}){return new wt({data:t})}var Ep=y(()=>({nodes:[wt]}));import{$setBlocksType as Ni}from"@lexical/selection";import{$createParagraphNode as Si,$getSelection as Li,$isParagraphNode as wi,$isRangeSelection as Np}from"lexical";var Ei=[le([{ChildComponent:ct,isActive:({selection:t})=>{if(!Np(t))return!1;for(let e of t.getNodes())if(!wi(e)&&!wi(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Li();Ni(e,()=>Si())})},order:1}])],Sp=y({slashMenu:{groups:[ee([{Icon:ct,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Li();Ni(e,()=>Si())})}}])]},toolbarFixed:{groups:Ei},toolbarInline:{groups:Ei}});import{c as Jp}from"react/compiler-runtime";import{jsx as Xp}from"react/jsx-runtime";import{useLexicalComposerContext as zp}from"@lexical/react/LexicalComposerContext";import{useEffect as Zp,useState as Yp}from"react";import{jsx as Ki,Fragment as Kp}from"react/jsx-runtime";import"react";import{jsx as Lp}from"react/jsx-runtime";var yi={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Lp("blockquote",{children:o})}};import{jsx as yp}from"react/jsx-runtime";var Ii={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return yp(r,{children:o})}};import{jsx as Ip}from"react/jsx-runtime";var Ri={horizontalrule:Ip("hr",{})};import{jsx as Rp}from"react/jsx-runtime";var vi={linebreak:Rp("br",{})};import{jsx as Mi}from"react/jsx-runtime";var Di=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return Mi("a",{href:e.fields.url,rel:n,target:l,children:r})},link:({node:e,nodesToJSX:o})=>{let r=o({nodes:e.children}),n=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,i=e.fields.url??"";return e.fields.linkType==="internal"&&(t?i=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),i="#")),Mi("a",{href:i,rel:n,target:l,children:r})}});import{jsx as et,jsxs as vp,Fragment as Mp}from"react/jsx-runtime";import{v4 as Dp}from"uuid";var Ai={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.tag;return et(r,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let r=t.children.some(l=>l.type==="list"),n=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=Dp();return et("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${r?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:r?n:vp(Mp,{children:[et("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),et("label",{htmlFor:l,children:n}),et("br",{})]})})}else return et("li",{className:`${r?"nestedListItem":""}`,style:r?{listStyleType:"none"}:void 0,value:t?.value,children:n})}};import{jsx as nr}from"react/jsx-runtime";var Oi={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?nr("p",{children:o}):nr("p",{children:nr("br",{})})}};var $i={tab:" "};import{jsx as Et}from"react/jsx-runtime";var Fi={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Et("div",{className:"lexical-table-container",children:Et("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:Et("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),r=t.headerState>0?"th":"td",n=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},i=t.colSpan&&t.colSpan>1?t.colSpan:void 0,s=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return Et(r,{className:`lexical-table-cell ${n}`,colSpan:i,rowSpan:s,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Et("tr",{className:"lexical-table-row",children:o})}};import{jsx as He}from"react/jsx-runtime";import"react";var A={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},Ap=A.IS_BOLD|A.IS_ITALIC|A.IS_STRIKETHROUGH|A.IS_UNDERLINE|A.IS_CODE|A.IS_SUBSCRIPT|A.IS_SUPERSCRIPT|A.IS_HIGHLIGHT,Op="\xA0",$p=`
37
37