@payloadcms/richtext-lexical 4.0.0-internal.ea6e8f8 → 4.0.0-internal.ee5d8bd

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.
Files changed (177) hide show
  1. package/dist/exports/client/Field-334JNLRF.js +2 -0
  2. package/dist/exports/client/Field-334JNLRF.js.map +7 -0
  3. package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js → RelationshipComponent-TVK6I4W4.js} +2 -2
  4. package/dist/exports/client/chunk-BEKGION5.js +2 -0
  5. package/dist/exports/client/chunk-BEKGION5.js.map +7 -0
  6. package/dist/exports/client/{chunk-WSAPGI3Z.js → chunk-EA5BHQ2T.js} +1 -1
  7. package/dist/exports/client/{chunk-WSAPGI3Z.js.map → chunk-EA5BHQ2T.js.map} +1 -1
  8. package/dist/exports/client/chunk-FAJJXXCW.js +2 -0
  9. package/dist/exports/client/{chunk-3LRZDIIG.js.map → chunk-FAJJXXCW.js.map} +2 -2
  10. package/dist/exports/client/{chunk-5VIL27GI.js → chunk-IYBYNEKX.js} +1 -1
  11. package/dist/exports/client/{chunk-5VIL27GI.js.map → chunk-IYBYNEKX.js.map} +1 -1
  12. package/dist/exports/client/chunk-SE5IITBK.js +2 -0
  13. package/dist/exports/client/chunk-SE5IITBK.js.map +7 -0
  14. package/dist/exports/client/{component-6DQLENIE.js → component-QENB4QTS.js} +2 -2
  15. package/dist/exports/client/componentInline-AU7IBNY7.js +2 -0
  16. package/dist/exports/client/index.js +26 -26
  17. package/dist/exports/client/index.js.map +4 -4
  18. package/dist/features/align/client/index.js.map +1 -1
  19. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  20. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  21. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  22. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  23. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  24. package/dist/features/blocks/client/component/index.js +38 -16
  25. package/dist/features/blocks/client/component/index.js.map +1 -1
  26. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  27. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  28. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  29. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  30. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  31. package/dist/features/blocks/client/componentInline/index.js +5 -11
  32. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  33. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -1
  34. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  35. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +121 -78
  36. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  37. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +142 -87
  38. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  39. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  40. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  41. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  42. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  43. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  44. package/dist/features/heading/client/index.js.map +1 -1
  45. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  46. package/dist/features/indent/client/index.d.ts.map +1 -1
  47. package/dist/features/indent/client/index.js +0 -2
  48. package/dist/features/indent/client/index.js.map +1 -1
  49. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  50. package/dist/features/indent/server/i18n.js.map +1 -1
  51. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  52. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  53. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +10 -2
  54. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  55. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  56. package/dist/features/link/markdownTransformer.js +2 -2
  57. package/dist/features/link/markdownTransformer.js.map +1 -1
  58. package/dist/features/link/server/baseFields.js.map +1 -1
  59. package/dist/features/lists/shared/schema.d.ts.map +1 -1
  60. package/dist/features/lists/shared/schema.js.map +1 -1
  61. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  62. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  63. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  64. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.css +1 -1
  65. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  66. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +6 -6
  67. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  68. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  69. package/dist/features/table/client/plugins/TablePlugin/index.js +54 -18
  70. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -1
  71. package/dist/features/table/client/utils/useDebounce.js.map +1 -1
  72. package/dist/features/textState/defaultColors.js +1 -1
  73. package/dist/features/textState/defaultColors.js.map +1 -1
  74. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -1
  75. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  76. package/dist/features/toolbars/fixed/client/Toolbar/index.js +141 -70
  77. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  78. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  79. package/dist/features/toolbars/inline/client/Toolbar/index.js +82 -35
  80. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  81. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  82. package/dist/features/toolbars/shared/ToolbarButton/index.js +26 -2
  83. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  84. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +137 -72
  85. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  86. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  87. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +22 -6
  88. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  89. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  90. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  91. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +109 -0
  92. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  93. package/dist/features/upload/client/drawer/index.js.map +1 -1
  94. package/dist/features/upload/client/plugin/index.js.map +1 -1
  95. package/dist/field/RenderLexical/index.js.map +1 -1
  96. package/dist/field/ViewSelector.js +12 -4
  97. package/dist/field/ViewSelector.js.map +1 -1
  98. package/dist/field/bundled.css +1 -1
  99. package/dist/field/index.js.map +1 -1
  100. package/dist/field/rscEntry.d.ts +2 -2
  101. package/dist/field/rscEntry.d.ts.map +1 -1
  102. package/dist/field/rscEntry.js.map +1 -1
  103. package/dist/i18n.d.ts.map +1 -1
  104. package/dist/i18n.js +44 -0
  105. package/dist/i18n.js.map +1 -1
  106. package/dist/index.d.ts +3 -3
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/lexical/LexicalEditor.js.map +1 -1
  110. package/dist/lexical/plugins/ClipboardPlugin/index.js.map +1 -1
  111. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  112. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  113. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  114. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  115. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +234 -87
  116. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  117. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  118. package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
  119. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  120. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +16 -0
  121. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  122. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +126 -38
  123. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  124. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts +7 -0
  125. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts.map +1 -0
  126. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js +15 -0
  127. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js.map +1 -0
  128. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -1
  129. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +9 -12
  130. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -1
  131. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  132. package/dist/lexical/ui/ContentEditable.js +16 -9
  133. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  134. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  135. package/dist/lexical/utils/nodeFormat.js +0 -2
  136. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  137. package/dist/lexical/utils/url.d.ts.map +1 -1
  138. package/dist/lexical/utils/url.js +1 -1
  139. package/dist/lexical/utils/url.js.map +1 -1
  140. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  141. package/dist/populateGraphQL/populate.js +1 -2
  142. package/dist/populateGraphQL/populate.js.map +1 -1
  143. package/dist/types/index.d.ts +1 -4
  144. package/dist/types/index.d.ts.map +1 -1
  145. package/dist/types/index.js.map +1 -1
  146. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  147. package/dist/utilities/buildEditorState.js.map +1 -1
  148. package/dist/utilities/fieldsDrawer/Drawer.js +36 -36
  149. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  150. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  151. package/dist/utilities/fieldsDrawer/DrawerContent.js +6 -9
  152. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  153. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -1
  154. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  155. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
  156. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  157. package/dist/utilities/generateImportMap.d.ts +2 -2
  158. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  159. package/dist/utilities/generateImportMap.js.map +1 -1
  160. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  161. package/dist/utilities/initLexicalFeatures.js +38 -4
  162. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  163. package/dist/utilities/useLexicalFeature.js +15 -6
  164. package/dist/utilities/useLexicalFeature.js.map +1 -1
  165. package/dist/utilities/useRunDeprioritized.js.map +1 -1
  166. package/package.json +32 -35
  167. package/dist/exports/client/Field-MT4FK3IP.js +0 -2
  168. package/dist/exports/client/Field-MT4FK3IP.js.map +0 -7
  169. package/dist/exports/client/chunk-3LRZDIIG.js +0 -2
  170. package/dist/exports/client/chunk-E6LSRRP2.js +0 -2
  171. package/dist/exports/client/chunk-E6LSRRP2.js.map +0 -7
  172. package/dist/exports/client/chunk-ZQX5HXUL.js +0 -2
  173. package/dist/exports/client/chunk-ZQX5HXUL.js.map +0 -7
  174. package/dist/exports/client/componentInline-HNE5G4TE.js +0 -2
  175. /package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js.map → RelationshipComponent-TVK6I4W4.js.map} +0 -0
  176. /package/dist/exports/client/{component-6DQLENIE.js.map → component-QENB4QTS.js.map} +0 -0
  177. /package/dist/exports/client/{componentInline-HNE5G4TE.js.map → componentInline-AU7IBNY7.js.map} +0 -0
@@ -1,26 +1,26 @@
1
- "use client";import{a as Ir,b as kt,c as xe,e as _t,f as Tt,g as Et}from"./chunk-E6LSRRP2.js";import{a as et}from"./chunk-DBWINSQN.js";import{a as Wo,b as tt,c as ot,d as ye,e as nt}from"./chunk-ZQX5HXUL.js";import{a as yr,b as Rr,c as De}from"./chunk-5VIL27GI.js";import{a as cu}from"./chunk-WSAPGI3Z.js";import{a as se,b as vr,c as Mr,d as Vo,e as Ko,f as uu,g as du,i as mu,k as pu,n as fu}from"./chunk-3LRZDIIG.js";import{a as au,b as W}from"./chunk-RJ5MAOKZ.js";function q(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as bu}from"react/compiler-runtime";import{useLexicalComposerContext as ku}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as Ce}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as _u}from"@lexical/utils";import{$getSelection as Tu,$isElementNode as pe,$isNodeSelection as Eu,$isRangeSelection as wt,COMMAND_PRIORITY_LOW as wu,FORMAT_ELEMENT_COMMAND as St}from"lexical";import{useEffect as Su}from"react";import{jsx as Ar}from"react/jsx-runtime";import"react";var hu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Dr=({className:t})=>Ar("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ar("path",{clipRule:"evenodd",d:hu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as $r}from"react/jsx-runtime";import"react";var gu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Or=({className:t})=>$r("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:$r("path",{clipRule:"evenodd",d:gu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Fr}from"react/jsx-runtime";import"react";var xu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Jt=({className:t})=>Fr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Fr("path",{clipRule:"evenodd",d:xu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Pr}from"react/jsx-runtime";import"react";var Cu="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",Br=({className:t})=>Pr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Pr("path",{clipRule:"evenodd",d:Cu,fill:"currentColor",fillRule:"evenodd"})});var A=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:u,resolvedFeatures:d,schemaPath:c,unSanitizedEditorConfig:a})=>{let m=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:u,props:o,resolvedFeatures:d,schemaPath:c,unSanitizedEditorConfig:a});return m.sanitizedClientFeatureProps===null&&(m.sanitizedClientFeatureProps=o),m};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var jr=t=>({type:"dropdown",ChildComponent:Jt,iconOnly:!0,items:t,key:"align",order:30});var Re=t=>pe(t)?t.getFormatType():t.__format,Hr=[jr([{ChildComponent:Jt,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="left")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"left")},order:1},{ChildComponent:Dr,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="center")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"center")},order:2},{ChildComponent:Br,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="right")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"right")},order:3},{ChildComponent:Or,isActive:({selection:t})=>{if(!wt(t))return!1;for(let e of t.getNodes()){if((pe(e)||Ce(e))&&Re(e)==="justify")continue;let o=e.getParent();if(!((pe(o)||Ce(o))&&Re(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(St,"justify")},order:4}])],Nu=()=>{let t=bu(3),[e]=ku(),o,n;return t[0]!==e?(o=()=>e.registerCommand(St,Ru,wu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Su(o,n),null},Lu=A({plugins:[{Component:Nu,position:"normal"}],toolbarFixed:{groups:Hr},toolbarInline:{groups:Hr}});function yu(t){return(pe(t)||Ce(t))&&!t.isInline()}function Ru(t){let e=Tu();if(!wt(e)&&!Eu(e))return!1;let o=e.getNodes();for(let n of o){let r=_u(n,yu);r!==null&&r.setFormat(t)}return!0}import{QUOTE as Mu}from"@lexical/markdown";import{$createQuoteNode as Vr,$isQuoteNode as Ur,QuoteNode as Au}from"@lexical/rich-text";import{$setBlocksType as Kr}from"@lexical/selection";import{$getSelection as Jr,$isRangeSelection as Du}from"lexical";import{jsx as zr}from"react/jsx-runtime";import"react";var Iu="M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",Jo=({className:t})=>zr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:zr("path",{d:Iu,fill:"currentColor"})});import{jsx as Gr}from"react/jsx-runtime";import"react";var vu={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},Nt=({className:t,size:e=24})=>Gr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Gr("path",{clipRule:"evenodd",d:vu[e],fill:"currentColor",fillRule:"evenodd"})});var oe=t=>({type:"dropdown",ChildComponent:Nt,items:t,key:"text",order:25});var Wr=[oe([{ChildComponent:Jo,isActive:({selection:t})=>{if(!Du(t))return!1;for(let e of t.getNodes())if(!Ur(e)&&!Ur(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Jr();Kr(e,()=>Vr())})},order:20}])],$u=A({markdownTransformers:[Mu],nodes:[Au],slashMenu:{groups:[q([{Icon:Jo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Jr();Kr(e,()=>Vr())})}}])]},toolbarFixed:{groups:Wr},toolbarInline:{groups:Wr}});import{getTranslation as ro}from"@payloadcms/translations";import{jsx as Xr}from"react/jsx-runtime";import"react";var Ou="M10.5 7C11.3284 7 12 7.67157 12 8.5V11.5C12 11.7329 11.9453 11.9527 11.8506 12.1494C12.0473 12.0547 12.2671 12 12.5 12H15.5C16.3284 12 17 12.6716 17 13.5V16.5C17 17.3284 16.3284 18 15.5 18H12.5C12.1151 18 11.7655 17.8535 11.5 17.6152C11.2345 17.8535 10.8849 18 10.5 18H7.5C6.67157 18 6 17.3284 6 16.5V13.5C6 13.1154 6.14578 12.7655 6.38379 12.5C6.14578 12.2345 6 11.8846 6 11.5V8.5C6 7.67157 6.67157 7 7.5 7H10.5ZM12.5 13C12.2239 13 12 13.2239 12 13.5V16.5C12 16.7761 12.2239 17 12.5 17H15.5C15.7761 17 16 16.7761 16 16.5V13.5C16 13.2239 15.7761 13 15.5 13H12.5ZM7.5 13C7.22386 13 7 13.2239 7 13.5V16.5C7 16.7761 7.22386 17 7.5 17H10.5C10.7761 17 11 16.7761 11 16.5V13.5C11 13.2239 10.7761 13 10.5 13H7.5ZM7.5 8C7.22386 8 7 8.22386 7 8.5V11.5C7 11.7761 7.22386 12 7.5 12H10.5C10.7761 12 11 11.7761 11 11.5V8.5C11 8.22386 10.7761 8 10.5 8H7.5ZM17.5 5C18.3284 5 19 5.67157 19 6.5V9.5C19 10.3284 18.3284 11 17.5 11H14.5C13.6716 11 13 10.3284 13 9.5V6.5C13 5.67157 13.6716 5 14.5 5H17.5ZM14.5 6C14.2239 6 14 6.22386 14 6.5V9.5C14 9.77614 14.2239 10 14.5 10H17.5C17.7761 10 18 9.77614 18 9.5V6.5C18 6.22386 17.7761 6 17.5 6H14.5Z",Xo=({className:t})=>Xr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Xr("path",{d:Ou,fill:"currentColor"})});import{jsx as Yr}from"react/jsx-runtime";import"react";var Fu="M17 8C18.1046 8 19 8.89543 19 10V14L18.9893 14.2041C18.8938 15.1457 18.1457 15.8938 17.2041 15.9893L17 16H7L6.7959 15.9893C5.78722 15.887 5 15.0357 5 14V10C5 8.89543 5.89543 8 7 8H17ZM7 9C6.44772 9 6 9.44772 6 10V14C6 14.5523 6.44772 15 7 15H17C17.5523 15 18 14.5523 18 14V10C18 9.44772 17.5523 9 17 9H7ZM9 11C9.55228 11 10 11.4477 10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11ZM12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11ZM15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11Z",Yo=({className:t})=>Yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Yr("path",{clipRule:"evenodd",d:Fu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Pu}from"react/jsx-runtime";import"react";function Zr(t,e){let{admin:o,imageAltText:n,imageURL:r}=t,l=o?.images,s,i;if(l?.icon?(s=typeof l.icon=="string"?l.icon:l.icon.url,i=typeof l.icon=="string"?void 0:l.icon.alt):l?.thumbnail?(s=typeof l.thumbnail=="string"?l.thumbnail:l.thumbnail.url,i=typeof l.thumbnail=="string"?void 0:l.thumbnail.alt):(s=r,i=n),!s)return e;let u=i??"Block Image";return()=>Pu("img",{alt:u,className:"lexical-block-custom-image",src:s,style:{maxHeight:20,maxWidth:20}})}import{$parseSerializedNode as gl}from"lexical";import{JSOX as Zo}from"jsox";function Xt({propsString:t}){let e={},o="",n=!0;for(let r=0;r<t.length;r++){let l=t[r];if(n)l==="="||l===" "?o&&(l===" "?(e[o]=!0,o=""):n=!1):o+=l;else{let s=Bu(t,r);e[o]=s.value,r=s.newIndex,o="",n=!0}}return o&&(e[o]=!0),e}function Bu(t,e){let o=t[e];return o==='"'?qr(t,e):o==="'"?qr(t,e,!0):o==="{"?Hu(t,e):o==="["?ju(t,e):Gu(t,e)}function ju(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="["?o++:t[r]==="]"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Zo.parse(`[${n}]`)}}function qr(t,e,o=!1){let n="",r=e+1;for(;r<t.length&&(t[r]!==(o?"'":'"')||t[r-1]==="\\");)n+=t[r],r++;return{newIndex:r,value:n}}function Hu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="{"?o++:t[r]==="}"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:zu(n)}}function zu(t){return t[0]!=="{"?Zo.parse(t):Zo.parse(t.replace(/(\w+):/g,'"$1":'))}function Gu(t,e){let o="",n=e;for(;n<t.length&&t[n]!==" ";)o+=t[n],n++;return{newIndex:n-1,value:o}}function Lt({props:t}){let e=[];for(let[o,n]of Object.entries(t))typeof n=="string"?e.push(`${o}="${Uu(n)}"`):typeof n=="number"?e.push(`${o}={${n}}`):typeof n=="boolean"?n&&e.push(`${o}`):n!==null&&typeof n=="object"&&(Array.isArray(n)?e.push(`${o}={[${n.map(r=>JSON.stringify(r,Qr)).join(", ")}]}`):e.push(`${o}={${JSON.stringify(n,Qr)}}`));return e.join(" ")}function Uu(t){return t.replace(/"/g,"&quot;")}function Qr(t,e){return typeof e=="string"?e.replace(/'/g,"\\'"):e}function Yt({isEndOptional:t,lines:e,regexpEndRegex:o,startLineIndex:n,startMatch:r,trimChildren:l}){let s="",i="",u=e.slice(n),d=!1,c=0,a=0,m=null,p=!1,h=0,f=u[0].slice(0,r.index),g=0,C=n;e:for(let[L,x]of u.entries()){let b=l?x.trim():x,k=0;if(l)for(let T=0;T<x.length&&x[T]===" ";T++)k++;let _=0;for(L===0&&(_=(r.index??0)+r[0].length-k);_<b.length;){let T=b[_],v=b[_+1];if(d){if(T==="`"&&h++,h%2===0)if(T==="<"&&v==="/"){if(c--,c<0){i[i.length-1]===`
2
- `&&(i=i.slice(0,-1)),C=L;for(let N=_;N<b.length;N++)if(b[N]===">"){g=N+1;break}break e}}else if(T==="/"&&v===">"){if(c--,c<0){i[i.length-1]===`
3
- `&&(i=i.slice(0,-1)),C=L,g=_+2;break e}}else T==="<"&&v!=="/"&&c++;i+=T}else{if(T==="{"&&!m?a++:T==="}"&&!m?a--:(T==='"'||T==="'")&&!m?m=T:T===m&&(m=null),T==="/"&&v===">"&&a===0&&!m){p=!0,C=L,g=_+2;break e}else if(T===">"&&a===0&&!m){d=!0,_++;continue}s+=T}_++}if(d?i?.length>0&&L>0&&(i+=`
1
+ "use client";import{a as Ir,b as Tt,c as ge,e as Et,f as wt,g as St}from"./chunk-SE5IITBK.js";import{a as ot}from"./chunk-DBWINSQN.js";import{a as Wo,b as nt,c as rt,d as Re,e as lt}from"./chunk-BEKGION5.js";import{a as yr,b as Rr,c as $e}from"./chunk-IYBYNEKX.js";import{a as hu}from"./chunk-EA5BHQ2T.js";import{a as se,b as vr,c as Mr,d as Vo,e as Ko,f as gu,g as bu,i as xu,k as Cu,n as ku}from"./chunk-FAJJXXCW.js";import{a as fu,b as W}from"./chunk-RJ5MAOKZ.js";function q(t){return{items:t,key:"basic",label:({i18n:e})=>e.t("lexical:general:slashMenuBasicGroupLabel")}}import{c as Su}from"react/compiler-runtime";import{useLexicalComposerContext as Nu}from"@lexical/react/LexicalComposerContext";import{$isDecoratorBlockNode as be}from"@lexical/react/LexicalDecoratorBlockNode";import{$findMatchingParent as Lu}from"@lexical/utils";import{$getSelection as yu,$isElementNode as me,$isNodeSelection as Ru,$isRangeSelection as Nt,COMMAND_PRIORITY_LOW as Iu,FORMAT_ELEMENT_COMMAND as Lt}from"lexical";import{useEffect as vu}from"react";import{jsx as Ar}from"react/jsx-runtime";import"react";var _u="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m3 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 15a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Dr=({className:t})=>Ar("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ar("path",{clipRule:"evenodd",d:_u,fill:"currentColor",fillRule:"evenodd"})});import{jsx as $r}from"react/jsx-runtime";import"react";var Tu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Or=({className:t})=>$r("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:$r("path",{clipRule:"evenodd",d:Tu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Fr}from"react/jsx-runtime";import"react";var Eu="M5 7.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m0 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1z",Kt=({className:t})=>Fr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Fr("path",{clipRule:"evenodd",d:Eu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Pr}from"react/jsx-runtime";import"react";var wu="M19 7.5a.5.5 0 0 0-.5-.5h-13a.5.5 0 0 0 0 1h13a.5.5 0 0 0 .5-.5m0 4a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0 0 1h7a.5.5 0 0 0 .5-.5m-.5 3.5a.5.5 0 0 1 0 1h-9a.5.5 0 0 1 0-1z",Br=({className:t})=>Pr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Pr("path",{clipRule:"evenodd",d:wu,fill:"currentColor",fillRule:"evenodd"})});var A=t=>o=>{let n={clientFeatureProps:o};if(typeof t=="function")n.feature=({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:c,resolvedFeatures:u,schemaPath:d,unSanitizedEditorConfig:a})=>{let p=t({config:r,featureClientImportMap:l,featureClientSchemaMap:s,featureProviderMap:i,field:c,props:o,resolvedFeatures:u,schemaPath:d,unSanitizedEditorConfig:a});return p.sanitizedClientFeatureProps===null&&(p.sanitizedClientFeatureProps=o),p};else{let r={...t};r.sanitizedClientFeatureProps=o,n.feature=r}return n};var jr=t=>({type:"dropdown",ChildComponent:Kt,iconOnly:!0,items:t,key:"align",order:30});var Ie=t=>me(t)?t.getFormatType():t.__format,Hr=[jr([{ChildComponent:Kt,isActive:({selection:t})=>{if(!Nt(t))return!1;for(let e of t.getNodes()){if((me(e)||be(e))&&Ie(e)==="left")continue;let o=e.getParent();if(!((me(o)||be(o))&&Ie(o)==="left"))return!1}return!0},key:"alignLeft",label:({i18n:t})=>t.t("lexical:align:alignLeftLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,"left")},order:1},{ChildComponent:Dr,isActive:({selection:t})=>{if(!Nt(t))return!1;for(let e of t.getNodes()){if((me(e)||be(e))&&Ie(e)==="center")continue;let o=e.getParent();if(!((me(o)||be(o))&&Ie(o)==="center"))return!1}return!0},key:"alignCenter",label:({i18n:t})=>t.t("lexical:align:alignCenterLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,"center")},order:2},{ChildComponent:Br,isActive:({selection:t})=>{if(!Nt(t))return!1;for(let e of t.getNodes()){if((me(e)||be(e))&&Ie(e)==="right")continue;let o=e.getParent();if(!((me(o)||be(o))&&Ie(o)==="right"))return!1}return!0},key:"alignRight",label:({i18n:t})=>t.t("lexical:align:alignRightLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,"right")},order:3},{ChildComponent:Or,isActive:({selection:t})=>{if(!Nt(t))return!1;for(let e of t.getNodes()){if((me(e)||be(e))&&Ie(e)==="justify")continue;let o=e.getParent();if(!((me(o)||be(o))&&Ie(o)==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:t})=>t.t("lexical:align:alignJustifyLabel"),onSelect:({editor:t})=>{t.dispatchCommand(Lt,"justify")},order:4}])],Mu=()=>{let t=Su(3),[e]=Nu(),o,n;return t[0]!==e?(o=()=>e.registerCommand(Lt,$u,Iu),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),vu(o,n),null},Au=A({plugins:[{Component:Mu,position:"normal"}],toolbarFixed:{groups:Hr},toolbarInline:{groups:Hr}});function Du(t){return(me(t)||be(t))&&!t.isInline()}function $u(t){let e=yu();if(!Nt(e)&&!Ru(e))return!1;let o=e.getNodes();for(let n of o){let r=Lu(n,Du);r!==null&&r.setFormat(t)}return!0}import{QUOTE as Pu}from"@lexical/markdown";import{$createQuoteNode as Vr,$isQuoteNode as Ur,QuoteNode as Bu}from"@lexical/rich-text";import{$setBlocksType as Kr}from"@lexical/selection";import{$getSelection as Jr,$isRangeSelection as ju}from"lexical";import{jsx as zr}from"react/jsx-runtime";import"react";var Ou="M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",Jo=({className:t})=>zr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:zr("path",{d:Ou,fill:"currentColor"})});import{jsx as Gr}from"react/jsx-runtime";import"react";var Fu={16:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 .5.5V5a.5.5 0 0 1-1 0V4H8.5v8h1a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1h1V4H4v1a.5.5 0 0 1-1 0z",24:"M6 6.5a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 .5.5V9a.5.5 0 0 1-1 0V7h-4.5v10h2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2V7H7v2a.5.5 0 0 1-1 0z"},yt=({className:t,size:e=24})=>Gr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Gr("path",{clipRule:"evenodd",d:Fu[e],fill:"currentColor",fillRule:"evenodd"})});var oe=t=>({type:"dropdown",ChildComponent:yt,items:t,key:"text",order:25});var Wr=[oe([{ChildComponent:Jo,isActive:({selection:t})=>{if(!ju(t))return!1;for(let e of t.getNodes())if(!Ur(e)&&!Ur(e.getParent()))return!1;return!0},key:"blockquote",label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Jr();Kr(e,()=>Vr())})},order:20}])],Hu=A({markdownTransformers:[Pu],nodes:[Bu],slashMenu:{groups:[q([{Icon:Jo,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Jr();Kr(e,()=>Vr())})}}])]},toolbarFixed:{groups:Wr},toolbarInline:{groups:Wr}});import{getTranslation as no}from"@payloadcms/translations";import{jsx as Xr}from"react/jsx-runtime";import"react";var zu="M10.5 7C11.3284 7 12 7.67157 12 8.5V11.5C12 11.7329 11.9453 11.9527 11.8506 12.1494C12.0473 12.0547 12.2671 12 12.5 12H15.5C16.3284 12 17 12.6716 17 13.5V16.5C17 17.3284 16.3284 18 15.5 18H12.5C12.1151 18 11.7655 17.8535 11.5 17.6152C11.2345 17.8535 10.8849 18 10.5 18H7.5C6.67157 18 6 17.3284 6 16.5V13.5C6 13.1154 6.14578 12.7655 6.38379 12.5C6.14578 12.2345 6 11.8846 6 11.5V8.5C6 7.67157 6.67157 7 7.5 7H10.5ZM12.5 13C12.2239 13 12 13.2239 12 13.5V16.5C12 16.7761 12.2239 17 12.5 17H15.5C15.7761 17 16 16.7761 16 16.5V13.5C16 13.2239 15.7761 13 15.5 13H12.5ZM7.5 13C7.22386 13 7 13.2239 7 13.5V16.5C7 16.7761 7.22386 17 7.5 17H10.5C10.7761 17 11 16.7761 11 16.5V13.5C11 13.2239 10.7761 13 10.5 13H7.5ZM7.5 8C7.22386 8 7 8.22386 7 8.5V11.5C7 11.7761 7.22386 12 7.5 12H10.5C10.7761 12 11 11.7761 11 11.5V8.5C11 8.22386 10.7761 8 10.5 8H7.5ZM17.5 5C18.3284 5 19 5.67157 19 6.5V9.5C19 10.3284 18.3284 11 17.5 11H14.5C13.6716 11 13 10.3284 13 9.5V6.5C13 5.67157 13.6716 5 14.5 5H17.5ZM14.5 6C14.2239 6 14 6.22386 14 6.5V9.5C14 9.77614 14.2239 10 14.5 10H17.5C17.7761 10 18 9.77614 18 9.5V6.5C18 6.22386 17.7761 6 17.5 6H14.5Z",Xo=({className:t})=>Xr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Xr("path",{d:zu,fill:"currentColor"})});import{jsx as Yr}from"react/jsx-runtime";import"react";var Gu="M17 8C18.1046 8 19 8.89543 19 10V14L18.9893 14.2041C18.8938 15.1457 18.1457 15.8938 17.2041 15.9893L17 16H7L6.7959 15.9893C5.78722 15.887 5 15.0357 5 14V10C5 8.89543 5.89543 8 7 8H17ZM7 9C6.44772 9 6 9.44772 6 10V14C6 14.5523 6.44772 15 7 15H17C17.5523 15 18 14.5523 18 14V10C18 9.44772 17.5523 9 17 9H7ZM9 11C9.55228 11 10 11.4477 10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11ZM12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11ZM15 11C15.5523 11 16 11.4477 16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11Z",Yo=({className:t})=>Yr("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Yr("path",{clipRule:"evenodd",d:Gu,fill:"currentColor",fillRule:"evenodd"})});import{jsx as Uu}from"react/jsx-runtime";import"react";function Zr(t,e){let{admin:o,imageAltText:n,imageURL:r}=t,l=o?.images,s,i;if(l?.icon?(s=typeof l.icon=="string"?l.icon:l.icon.url,i=typeof l.icon=="string"?void 0:l.icon.alt):l?.thumbnail?(s=typeof l.thumbnail=="string"?l.thumbnail:l.thumbnail.url,i=typeof l.thumbnail=="string"?void 0:l.thumbnail.alt):(s=r,i=n),!s)return e;let c=i??"Block Image";return()=>Uu("img",{alt:c,className:"lexical-block-custom-image",src:s,style:{maxHeight:20,maxWidth:20}})}import{$parseSerializedNode as xl}from"lexical";import{JSOX as Zo}from"jsox";function Jt({propsString:t}){let e={},o="",n=!0;for(let r=0;r<t.length;r++){let l=t[r];if(n)l==="="||l===" "?o&&(l===" "?(e[o]=!0,o=""):n=!1):o+=l;else{let s=Wu(t,r);e[o]=s.value,r=s.newIndex,o="",n=!0}}return o&&(e[o]=!0),e}function Wu(t,e){let o=t[e];return o==='"'?qr(t,e):o==="'"?qr(t,e,!0):o==="{"?Ku(t,e):o==="["?Vu(t,e):Xu(t,e)}function Vu(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="["?o++:t[r]==="]"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Zo.parse(`[${n}]`)}}function qr(t,e,o=!1){let n="",r=e+1;for(;r<t.length&&(t[r]!==(o?"'":'"')||t[r-1]==="\\");)n+=t[r],r++;return{newIndex:r,value:n}}function Ku(t,e){let o=1,n="",r=e+1;for(;r<t.length&&o>0;)t[r]==="{"?o++:t[r]==="}"&&o--,o>0&&(n+=t[r]),r++;return{newIndex:r,value:Ju(n)}}function Ju(t){return t[0]!=="{"?Zo.parse(t):Zo.parse(t.replace(/(\w+):/g,'"$1":'))}function Xu(t,e){let o="",n=e;for(;n<t.length&&t[n]!==" ";)o+=t[n],n++;return{newIndex:n-1,value:o}}function Rt({props:t}){let e=[];for(let[o,n]of Object.entries(t))typeof n=="string"?e.push(`${o}="${Yu(n)}"`):typeof n=="number"?e.push(`${o}={${n}}`):typeof n=="boolean"?n&&e.push(`${o}`):n!==null&&typeof n=="object"&&(Array.isArray(n)?e.push(`${o}={[${n.map(r=>JSON.stringify(r,Qr)).join(", ")}]}`):e.push(`${o}={${JSON.stringify(n,Qr)}}`));return e.join(" ")}function Yu(t){return t.replace(/"/g,"&quot;")}function Qr(t,e){return typeof e=="string"?e.replace(/'/g,"\\'"):e}function Xt({isEndOptional:t,lines:e,regexpEndRegex:o,startLineIndex:n,startMatch:r,trimChildren:l}){let s="",i="",c=e.slice(n),u=!1,d=0,a=0,p=null,m=!1,h=0,f=c[0].slice(0,r.index),g=0,C=n;e:for(let[N,b]of c.entries()){let x=l?b.trim():b,_=0;if(l)for(let T=0;T<b.length&&b[T]===" ";T++)_++;let k=0;for(N===0&&(k=(r.index??0)+r[0].length-_);k<x.length;){let T=x[k],y=x[k+1];if(u){if(T==="`"&&h++,h%2===0)if(T==="<"&&y==="/"){if(d--,d<0){i[i.length-1]===`
2
+ `&&(i=i.slice(0,-1)),C=N;for(let E=k;E<x.length;E++)if(x[E]===">"){g=E+1;break}break e}}else if(T==="/"&&y===">"){if(d--,d<0){i[i.length-1]===`
3
+ `&&(i=i.slice(0,-1)),C=N,g=k+2;break e}}else T==="<"&&y!=="/"&&d++;i+=T}else{if(T==="{"&&!p?a++:T==="}"&&!p?a--:(T==='"'||T==="'")&&!p?p=T:T===p&&(p=null),T==="/"&&y===">"&&a===0&&!p){m=!0,C=N,g=k+2;break e}else if(T===">"&&a===0&&!p){u=!0,k++;continue}s+=T}k++}if(u?i?.length>0&&N>0&&(i+=`
4
4
  `):s+=`
5
- `,o&&c<0){let T=b.match(o);if(T?.index!==void 0){C=L,g=T.index+T[0].length-1;break}}if(L===u.length-1&&!t&&!p)throw new Error("End match not found for lines "+e.join(`
5
+ `,o&&d<0){let T=x.match(o);if(T?.index!==void 0){C=N,g=T.index+T[0].length-1;break}}if(N===c.length-1&&!t&&!m)throw new Error("End match not found for lines "+e.join(`
6
6
  `)+`
7
7
 
8
- . Start match: `+JSON.stringify(r))}return{afterEndLine:u[C].trim().slice(g),beforeStartLine:f,content:i,endLineIndex:n+C,endlineLastCharIndex:g,propsString:s}}import{jsx as Ad}from"react/jsx-runtime";import Dd from"bson-objectid";import{$applyNodeReplacement as $d}from"lexical";import"react";import{DecoratorBlockNode as Wu}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as Vu}from"@lexical/utils";import Ku from"bson-objectid";import{$applyNodeReplacement as Ju}from"lexical";var yt=class extends Wu{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:n,key:r}){super(n,r),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){let o=Xu(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return Vu(o,e?.theme?.block),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields()}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let n=this.getWritable();n.__fields=e,o||n.__cacheBuster++}};function Xu(t){return Ju(new yt({fields:{...t,id:t?.id||new Ku.default().toHexString()}}))}import{jsx as G,jsxs as Ie,Fragment as cd}from"react/jsx-runtime";import{useLexicalComposerContext as ud}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as dd}from"@lexical/react/useLexicalEditable";import{getTranslation as md}from"@payloadcms/translations";import{Button as ll,Collapsible as pd,Drawer as fd,EditDepthProvider as hd,ErrorPill as gd,Form as xd,formatDrawerSlug as Cd,MoreIcon as bd,Pill as kd,Popup as _d,PopupList as Rt,RenderFields as Td,SectionTitle as Ed,useConfig as wd,useDocumentForm as Sd,useDocumentInfo as il,useEditDepth as Nd,useFormSubmitted as Ld,useServerFunctions as yd,useTranslation as Rd,XIcon as Id}from"@payloadcms/ui";import{abortAndIgnore as en}from"@payloadcms/ui/shared";import{$getNodeByKey as Qt,$getRoot as vd,SKIP_DOM_SELECTION_TAG as tn}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as It}from"payload/shared";import $e,{useCallback as on,useEffect as eo,useMemo as Oe,useRef as to}from"react";import{v4 as Md}from"uuid";import{c as Yu}from"react/compiler-runtime";import{jsx as Zt,jsxs as Zu}from"react/jsx-runtime";import{useLexicalEditable as qu}from"@lexical/react/useLexicalEditable";import{RenderFields as Qu,useFormSubmitted as ed}from"@payloadcms/ui";import td,{createContext as od}from"react";var el=od({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ae=()=>td.use(el),tl=t=>{let e=Yu(4),{Collapsible:o,CustomBlock:n,CustomLabel:r,...l}=t,{BlockDrawer:s,errorCount:i,formSchema:u}=l,c=ed()&&i>0,a=qu(),m;e[0]!==o||e[1]!==i||e[2]!==c?(m=f=>{let{children:g,...C}=f;return Zt(o,{errorCount:i,fieldHasErrors:c,...C,children:g})},e[0]=o,e[1]=i,e[2]=c,e[3]=m):m=e[3];let p=m,h={...l,BlockCollapsible:p};return n?Zu(el,{value:h,children:[n,Zt(s,{})]}):Zt(p,{children:Zt(Qu,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!a})})};import{useId as ad}from"react";import{$getNodeByKey as qt,COMMAND_PRIORITY_HIGH as nd,KEY_DOWN_COMMAND as rd,SKIP_DOM_SELECTION_TAG as ld}from"lexical";import{useCallback as qo,useEffect as ol,useLayoutEffect as id,useRef as Qo,useState as sd}from"react";function nl({editor:t,nodeKey:e}){let[o,n]=sd(null),r=Qo(null),l=Qo(!1),s=Qo(!1),i=o!==null;ol(()=>t.registerCommand(rd,a=>{let m=a?.target;return m instanceof HTMLElement&&!!t.getElementByKey(e)?.contains(m)&&!!m.closest(".collapsible__actions button")},nd),[t,e]),ol(()=>{if(!i)return;let a,m=()=>{l.current=!0},p=()=>{l.current=!1,s.current&&(a=setTimeout(()=>{r.current=null,n(null)},0))};return document.addEventListener("pointerdown",m,!0),document.addEventListener("pointerup",p,!0),document.addEventListener("pointercancel",p,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("pointerup",p,!0),document.removeEventListener("pointercancel",p,!0),clearTimeout(a),l.current=!1,s.current=!1}},[i]),id(()=>{if(o===null)return;let a=[];return t.getEditorState().read(()=>{let m=qt(e),p=m?.getParent()?.getChildren(),h=m?.getIndexWithinParent();if(!p||h===void 0||h===o)return;let f=p.map(v=>t.getElementByKey(v.getKey())),g=f[h],C=f[o],E=f[h+(o>h?1:-1)];if(!g||!C||!E)return;let L=g.getBoundingClientRect(),x=C.getBoundingClientRect(),b=E.getBoundingClientRect(),k=o>h,_=k?x.bottom-L.bottom:x.top-L.top,T=k?L.top-b.top:L.bottom-b.bottom;for(let v=Math.min(h,o);v<=Math.max(h,o);v++){let N=f[v];if(N){let w=N.style.translate;a.push(()=>{N.style.translate=w}),N.style.translate=`0 ${v===h?_:T}px`}}g.querySelector(".collapsible__drag")?.scrollIntoView({block:"nearest"})}),()=>a.forEach(m=>m())},[t,e,o]);let u=qo(({direction:a,index:m})=>{t.isEditable()&&t.update(()=>{let p=qt(e),h=p?.getParent()?.getChildren();if(!p||!h)return;let f=p.getIndexWithinParent(),g=m??f+(a??0),C=h[g];C&&C!==p&&(g<f?C.insertBefore(p):C.insertAfter(p))},{onUpdate:()=>{requestAnimationFrame(()=>{let p=t.getElementByKey(e)?.querySelector(".collapsible__toggle-wrap");(p?.querySelector(".collapsible__drag")??p?.querySelector(".LexicalEditorTheme__block__actions-button"))?.focus()})},tag:ld})},[t,e]),d=qo(a=>{t.isEditable()&&(a.key===" "||a.key==="Enter"?(a.preventDefault(),a.stopPropagation(),r.current===null?(t.getEditorState().read(()=>{r.current=qt(e)?.getIndexWithinParent()??null}),n(r.current)):(u({index:r.current}),r.current=null,n(null))):r.current!==null&&(a.key==="Escape"||a.key==="Tab"?(r.current=null,n(null),a.key==="Escape"&&(a.preventDefault(),a.stopPropagation())):(a.key==="ArrowUp"||a.key==="ArrowDown")&&(a.preventDefault(),a.stopPropagation(),t.getEditorState().read(()=>{let m=qt(e)?.getParent()?.getChildrenSize()??0;r.current=Math.max(0,Math.min(m-1,(r.current??0)+(a.key==="ArrowDown"?1:-1)))}),n(r.current))))},[t,u,e]),c=qo(()=>{if(l.current){s.current=!0;return}r.current=null,n(null)},[]);return{isReordering:i,move:u,onBlur:c,onKeyDown:d,targetIndex:o}}function rl({children:t,editor:e,nodeKey:o}){let n=nl({editor:e,nodeKey:o}),r=ad();return t({...n,reorderInstructionsID:r})}var sl=t=>{let{cacheBuster:e,className:o,CustomBlock:n,CustomLabel:r,formData:l,nodeKey:s}=t,i=Ld(),{id:u,collectionSlug:d,globalSlug:c}=il(),{fieldProps:{featureClientSchemaMap:a,field:m,initialLexicalFormState:p,schemaPath:h},uuid:f}=W(),{fields:g}=Sd(),C=to(new AbortController),E=Nd(),[L,x]=$e.useState(0),{config:b}=wd(),k=Cd({slug:`lexical-blocks-create-${f}-${l.id}`,depth:E}),{toggleDrawer:_}=De(k),{getDocPreferences:T,setDocFieldPreferences:v}=il(),[N]=ud(),w=dd(),y=l.blockType,S=to(l);S.current=l;let R=`${h}.lexical_internal_feature.blocks.lexical_blocks.${y}`,F=a.blocks?.[R]?.[0]?.blocks?.[0],M=typeof F=="string"?b.blocksMap[F]:F,{getFormState:B}=yd(),$=`${h}.lexical_internal_feature.blocks.lexical_blocks.${y}.fields`,[P,V]=$e.useState(()=>{let H=p?.[l.id],Z=H?.formState;if(!Z)return!1;let K=Ir({cachedFormState:Z,cachedSchemaPath:H.schemaPath,currentSchemaPath:$,formData:l});return K?{...K,blockName:{initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName}}:!1}),Xe=to(!1),xt=to(e);eo(()=>{Xe.current?(xt.current!==e&&V(!1),xt.current=e):Xe.current=!0},[e]);let[Ye]=$e.useState(()=>Md()),[ie,me]=$e.useState(()=>{if(!r)return P?._components?.customComponents?.BlockLabel??void 0}),[Ct,Wt]=$e.useState(()=>{if(!n)return P?._components?.customComponents?.Block??void 0}),ce=Oe(()=>n?G(n,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):Ct,[n,o,l,s,Ct]),Ae=Oe(()=>r?G(r,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):ie,[r,o,l,s,ie]);eo(()=>{let H=new AbortController;return M&&l&&!P&&(async()=>{let{state:K}=await B({id:u,collectionSlug:d,data:l,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:It(g,{excludeFiles:!0}),globalSlug:c,initialBlockData:l,operation:"update",readOnly:!w,renderAllFields:!0,schemaPath:$,signal:H.signal});if(K){K.blockName={initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName};let ee=kt(It(K,{excludeFiles:!0}));N.update(()=>{let U=Qt(s);if(U&&ve(U)){let qe=ee;qe.blockType=y,U.setFields(qe,!0)}},{tag:tn}),V(K),r||me(K._components?.customComponents?.BlockLabel??void 0),n||Wt(K._components?.customComponents?.Block??void 0)}})(),()=>{en(H)}},[B,$,w,u,r,n,l,N,s,P,d,c,T,g,y,M]);let[Vt,Bo]=$e.useState(p?.[l.id]?.collapsed??!1),{i18n:bt,t:Y}=Rd(),jo=on(async({formState:H,submit:Z})=>{en(C.current);let K=new AbortController;C.current=K;let ee=kt(It(H,{excludeFiles:!0}),S.current),{state:U}=await B({id:u,collectionSlug:d,data:ee,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:It(g,{excludeFiles:!0}),formState:H,globalSlug:c,initialBlockData:ee,operation:"update",readOnly:!w,renderAllFields:!!Z,schemaPath:$,signal:K.signal});if(!U)return H;H.blockName&&(U.blockName=H.blockName);let qe=kt(It(U,{excludeFiles:!0}),ee);if(setTimeout(()=>{N.update(()=>{let ge=Qt(s);if(ge&&ve(ge)){let Qe=qe;Qe.blockType=y,ge.setFields(Qe,!0)}},{tag:tn})},0),Z){r||me(U._components?.customComponents?.BlockLabel??void 0),n||Wt(U._components?.customComponents?.Block??void 0);let ge=0;for(let Qe of Object.values(U))Qe?.valid===!1&&ge++;x(ge)}return U},[B,u,d,T,c,$,y,g,w,N,s,n,r]);eo(()=>()=>{en(C.current)},[]);let Kt=on(()=>{N.update(()=>{Qt(s)?.remove()})},[N,s]),[gr,eu]=$e.useState(0);eo(()=>{let H=()=>{N.getEditorState().read(()=>{let K=vd().getChildren(),ee=0;for(let U of K)if(ve(U)){if(U.getKey()===s){eu(ee);return}ee++}})};return H(),N.registerUpdateListener(()=>{H()})},[N,s]);let Ze=M?.labels?.singular?md(M.labels.singular,bt):M?.slug,xr=on(H=>{T().then(Z=>{let ee=Z?.fields?.[m.name]?.collapsed,U=ee&&ee?.length?ee:[];H?U.includes(l.id)||U.push(l.id):U.includes(l.id)&&U.splice(U.indexOf(l.id),1),v(m.name,{collapsed:U,hello:"hi"})})},[T,m.name,v,l.id]),Cr=Oe(()=>()=>G(ll,{buttonStyle:"ghost",className:`${o}__editButton`,disabled:!w,el:"button",icon:"edit",onClick:H=>(H.preventDefault(),H.stopPropagation(),_(),!1),onMouseDown:H=>{H.preventDefault()},round:!0,size:"medium",tooltip:Y("lexical:blocks:inlineBlocks:edit",{label:Ze})}),[o,w,Y,Ze,_]),br=Oe(()=>()=>G(ll,{buttonStyle:"ghost",className:`${o}__removeButton`,disabled:!w,icon:"x",onClick:H=>{H.preventDefault(),Kt()},round:!0,tooltip:"Remove Block"}),[o,w,Kt]),Ho=Oe(()=>function({Actions:Z,children:K,className:ee,collapsibleProps:U,disableBlockName:qe,editButton:ge,errorCount:Qe,fieldHasErrors:zo,Label:wr,Pill:Sr,removeButton:ou,showDragHandle:nu=!0,showRowNumber:ru=!0}){return G(rl,{editor:N,nodeKey:s,children:({isReordering:Go,move:Nr,onBlur:lu,onKeyDown:iu,reorderInstructionsID:Lr,targetIndex:su})=>G("div",{className:`${o}__container ${o}-${y}`,onKeyDownCapture:J=>{let Uo=J.target;J.altKey||J.ctrlKey||J.metaKey||Uo.closest(".collapsible")?.parentElement!==J.currentTarget||(Uo.matches(".collapsible__drag")&&(J.key!=="Escape"||Go)&&[" ","ArrowDown","ArrowUp","Enter","Escape","Tab"].includes(J.key)?(iu(J),J.stopPropagation()):J.key==="Tab"&&Uo.matches(".collapsible__toggle")&&J.stopPropagation())},children:Ie(pd,{actions:typeof Z<"u"?Z:w?G(_d,{button:G(bd,{}),buttonAriaLabel:Y("general:moreOptions"),buttonClassName:`${o}__actions-button`,caret:!1,horizontalAlign:"right",popupType:"menu",render:({close:J})=>Ie(Rt.ButtonGroup,{buttonSize:"medium",children:[G(Rt.Button,{onClick:()=>{J(),Nr({direction:-1})},children:Y("general:moveUp")}),G(Rt.Button,{onClick:()=>{J(),Nr({direction:1})},children:Y("general:moveDown")}),(ce&&ge!==!1||!ce&&ge)&&G(Rt.Button,{onClick:()=>{_(),J()},children:Y("general:edit")}),ou!==!1&&Ie(Rt.Button,{onClick:()=>{Kt(),J()},children:[G(Id,{}),Y("general:remove")]})]}),size:"large"}):null,className:[`${o}__row`,zo?`${o}__row--has-errors`:`${o}__row--no-errors`,ee].filter(Boolean).join(" "),collapsibleStyle:zo?"error":"default",dragHandleProps:nu&&w?{id:s,attributes:{"aria-describedby":Lr,"aria-pressed":Go,role:"button",tabIndex:0},listeners:{onBlur:lu}}:void 0,header:G("div",{className:`${o}__block-header`,children:typeof wr<"u"?wr:typeof Ae<"u"?Ae:Ie("div",{className:`${o}__block-label`,children:[ru&&G("span",{className:`${o}__block-number`,children:String(gr+1).padStart(2,"0")}),typeof Sr<"u"?Sr:G(kd,{className:`${o}__block-pill ${o}__block-pill-${y}`,pillStyle:"white",size:"small",children:Ze??y}),!qe&&!M?.admin?.disableBlockName&&G(Ed,{path:"blockName",readOnly:!w}),zo&&G(gd,{count:Qe??0,i18n:bt,withMessage:!0})]})}),isCollapsed:Vt,onToggle:J=>{xr(J),Bo(J)},...U||{},AfterCollapsible:Ie(cd,{children:[U?.AfterCollapsible,G("span",{className:"sr-only",role:"status",children:Go?`${Y("general:order")}: ${(su??0)+1}`:""})]}),children:[Ie("span",{className:"sr-only",id:Lr,children:["Space / Enter \xB7 ",Y("general:moveUp")," \u2191 \xB7 ",Y("general:moveDown")," \u2193 \xB7"," ",Y("general:cancel")," Escape"]}),K]},0)})})},[N,ce,Ae,Ze,o,M?.admin?.disableBlockName,y,bt,Vt,xr,w,s,Kt,gr,Y,_]),kr=l?.id,{headerActions:_r,submitRef:Tr}=yr(),Er=Oe(()=>()=>G(hd,{children:G(fd,{className:"",headerActions:_r,slug:k,title:Y(`lexical:blocks:inlineBlocks:${kr?"edit":"create"}`,{label:Ze??Y("lexical:blocks:inlineBlocks:label")}),children:P?Ie("div",{className:"fields-drawer",children:[G(Td,{fields:M?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:$,permissions:!0,readOnly:!w}),G(Rr,{submitRef:Tr})]}):null})}),[P,k,kr,Ze,Y,w,M?.fields,$,_r,Tr]),tu=Oe(()=>P?G("div",{"data-block-drawer-slug":k,style:{display:"contents"},children:G(xd,{beforeSubmit:[async({formState:H})=>await jo({formState:H,submit:!0})],el:"div",fields:M?.fields??[],initialState:P,onChange:[jo],onSubmit:H=>{let Z=kt(H,S.current);Z.blockType=y,N.update(()=>{let K=Qt(s);K&&ve(K)&&K.setFields(Z,!0)},{tag:tn}),_()},submitted:i,uuid:Ye,children:G(tl,{baseClass:o,BlockDrawer:Er,Collapsible:Ho,CustomBlock:ce,CustomLabel:Ae,EditButton:Cr,errorCount:L,formSchema:M?.fields??[],initialState:P,nodeKey:s,RemoveButton:br})})}):null,[Ho,Er,ce,Ae,y,k,br,Cr,o,N,L,_,M?.fields,Ye,P,s,jo,i]);return M?tu:G(Ho,{disableBlockName:!0,fieldHasErrors:!0,children:Ie("div",{className:`${o}-not-found`,children:["Error: Block '",y,"' not found in the config but exists in the lexical data"]})})};var ue=class extends yt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){let o=Fe(e.fields);return o.setFormat(e.format),o}decorate(...[e,o,n,r]){return Ad(sl,{cacheBuster:this.getCacheBuster(),className:o.theme.block??"LexicalEditorTheme__block",CustomBlock:n,CustomLabel:r,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Fe(t){return $d(new ue({fields:{...t,id:t?.id||new Dd.default().toHexString()}}))}function ve(t){return t instanceof ue}import{createHeadlessEditor as Od}from"@lexical/headless";import{$convertToMarkdownString as Fd}from"@lexical/markdown";function nn(t,e){return({editorState:n})=>{let r=Od({nodes:t});try{r.setEditorState(r.parseEditorState(n))}catch(s){console.error("getLexicalToMarkdown: ERROR parsing editor state",s)}let l="";return r.getEditorState().read(()=>{l=Fd(e)}),l}}import{createHeadlessEditor as Kd}from"@lexical/headless";import{$convertFromMarkdownString as hl,TRANSFORMERS as Vd}from"@lexical/markdown";var al=/^[\t ]*$/,Pd=/^(\s*)(\d+)\.\s/,Bd=/^(\s*)[-*+]\s/,jd=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,cl=/^(#{1,6})\s/,Hd=/^>\s/,zd=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,ul=/[ \t]*(\\`\\`\\`|```)$/,Gd=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Ud=/^\|(.+)\|\s?$/,Wd=/^(\| ?:?-*:? ?)+\|\s?$/,dl=/^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,ml=/^[ \t]*<\/[a-z_][\w-]*\s*>/i;function pl(t){if(t.endsWith("\\"))return[t.slice(0,-1),"\\"];let e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function fl(t,e){let o=t.split(`
9
- `),n=!1,r=[],l=0;for(let s=0;s<o.length;s++){let i=o[s],u=r[r.length-1],d=s<o.length-1?pl(i):null,c=u!==void 0&&pl(u)!==null;if(Gd.test(i)){r.push(i);continue}if(ul.test(i)){l===0&&(n=!0),l===1&&(n=!1),l>0&&l--,r.push(i);continue}if(zd.test(i)){n=!0,l++,r.push(i);continue}if(n){r.push(i);continue}al.test(i)||al.test(u)||!u||cl.test(u)||cl.test(i)||Hd.test(i)||Pd.test(i)||Bd.test(i)||jd.test(i)||Ud.test(i)||Wd.test(i)||c||!e||dl.test(i)||ml.test(i)||dl.test(u)||ml.test(u)||ul.test(u)?r.push(i):r[r.length-1]=u+" "+(d===null?i.trim():i.trimStart())}return r.join(`
10
- `)}function oo(t,e=Vd,o,n=!1,r=!1){if(n)return hl(t,e,o,!0);let l=fl(t,r);return hl(l,e,o,!1,!1)}function no(t,e){return({markdown:n})=>{let r=Kd({nodes:t});return r.update(()=>{oo(n,e,void 0,!1,!0)},{discrete:!0}),r.getEditorState().toJSON()}}function Jd(t){let e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{regExpEnd:new RegExp(`</(${e})\\s*>|<${e}[^>]*?/>`,"i"),regExpStart:new RegExp(`<(${e})([^>]*?)\\s*(/?)>`,"i")}}var Cl=({blocks:t,inlineBlocks:e})=>{if(!t?.length&&!e?.length)return[];let o=[];if(t?.length)for(let n of t){let r=xl(n,!1);r&&(o=o.concat(r))}if(e?.length)for(let n of e){let r=xl(n,!0);r&&(o=o.concat(r))}return o};function xl(t,e){if(!t.jsx)return null;let o=Jd(t.slug),n=[];return e?(n.push(({allNodes:r,allTransformers:l})=>({type:"text-match",dependencies:[_t],export:s=>{if(!Et(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),u=nn(r,l),d=t.jsx.export({fields:i,lexicalToMarkdown:u});if(d===!1)return null;if(typeof d=="string")return d;let c=d.props&&Object.keys(d.props)?.length>0,a=d.props??{};return d?.children?.length?`<${i.blockType}${c?" "+Lt({props:a}):""}>${d.children}</${i.blockType}>`:`<${i.blockType}${c?" "+Lt({props:a}):""}/>`},getEndIndex:(s,i)=>{let{endlineLastCharIndex:u}=Yt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:i,trimChildren:!1});return u},importRegExp:t.jsx?.customStartRegex??o.regExpStart,regExp:/___ignoreignoreignore___/g,replace(s,i){let{content:u,propsString:d}=Yt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:{...i,index:0},trimChildren:!1});if(!t?.jsx?.import)return;let c=no(r,l),a=t.jsx.import({children:u,closeMatch:null,htmlToLexical:null,markdownToLexical:c,openMatch:i,props:d?Xt({propsString:d}):{}});if(a===!1)return;let m=Tt({blockType:t.slug,...a});s.replace(m)}})),n):(n.push(({allNodes:r,allTransformers:l})=>({dependencies:[ue],export:s=>{if(!ve(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),u=nn(r,l),d=t.jsx.export({fields:i,lexicalToMarkdown:u});if(d===!1)return null;if(typeof d=="string")return d;let c=d.props&&Object.keys(d.props)?.length>0,a=d.props??{};if(d?.children?.length){let m=d.children,p="";if(m.includes(`
11
- `))for(let h of m.split(`
8
+ . Start match: `+JSON.stringify(r))}return{afterEndLine:c[C].trim().slice(g),beforeStartLine:f,content:i,endLineIndex:n+C,endlineLastCharIndex:g,propsString:s}}import{jsx as jd}from"react/jsx-runtime";import Hd from"bson-objectid";import{$applyNodeReplacement as zd}from"lexical";import"react";import{DecoratorBlockNode as Zu}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as qu}from"@lexical/utils";import Qu from"bson-objectid";import{$applyNodeReplacement as ed}from"lexical";var It=class extends Zu{__cacheBuster;__fields;constructor({cacheBuster:e,fields:o,format:n,key:r}){super(n,r),this.__fields=o,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,format:e.__format,key:e.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(e){let o=td(e.fields);return o.setFormat(e.format),o}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return qu(o,e?.theme?.block),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div"),o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),type:"block",fields:this.getFields()}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(e,o){let n=this.getWritable();n.__fields=e,o||n.__cacheBuster++}};function td(t){return ed(new It({fields:{...t,id:t?.id||new Qu.default().toHexString()}}))}import{c as hd}from"react/compiler-runtime";import{jsx as U,jsxs as ve,Fragment as gd}from"react/jsx-runtime";import{useLexicalComposerContext as bd}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as xd}from"@lexical/react/useLexicalEditable";import{getTranslation as Cd}from"@payloadcms/translations";import{Button as ll,Collapsible as kd,Drawer as _d,EditDepthProvider as Td,ErrorPill as Ed,Form as wd,formatDrawerSlug as Sd,MoreIcon as Nd,Pill as Ld,Popup as yd,PopupList as vt,RenderFields as Rd,SectionTitle as Id,useConfig as vd,useDocumentForm as Md,useDocumentInfo as il,useEditDepth as Ad,useFormSubmitted as Dd,useServerFunctions as $d,useTranslation as al,XIcon as Od}from"@payloadcms/ui";import{abortAndIgnore as en}from"@payloadcms/ui/shared";import{$getNodeByKey as qt,$getRoot as Fd,SKIP_DOM_SELECTION_TAG as tn}from"lexical";import{deepCopyObjectSimpleWithoutReactComponents as sl}from"payload/shared";import Oe,{useCallback as on,useEffect as Qt,useMemo as Fe,useRef as eo}from"react";import{v4 as Pd}from"uuid";import{c as od}from"react/compiler-runtime";import{jsx as Yt,jsxs as nd}from"react/jsx-runtime";import{useLexicalEditable as rd}from"@lexical/react/useLexicalEditable";import{RenderFields as ld,useFormSubmitted as id}from"@payloadcms/ui";import sd,{createContext as ad}from"react";var el=ad({baseClass:"LexicalEditorTheme__block",BlockCollapsible:()=>null,BlockDrawer:()=>null,EditButton:()=>null,errorCount:0,formSchema:[],initialState:!1,nodeKey:"",RemoveButton:()=>null}),ae=()=>sd.use(el),tl=t=>{let e=od(4),{Collapsible:o,CustomBlock:n,CustomLabel:r,...l}=t,{BlockDrawer:s,errorCount:i,formSchema:c}=l,d=id()&&i>0,a=rd(),p;e[0]!==o||e[1]!==i||e[2]!==d?(p=f=>{let{children:g,...C}=f;return Yt(o,{errorCount:i,fieldHasErrors:d,...C,children:g})},e[0]=o,e[1]=i,e[2]=d,e[3]=p):p=e[3];let m=p,h={...l,BlockCollapsible:m};return n?nd(el,{value:h,children:[n,Yt(s,{})]}):Yt(m,{children:Yt(ld,{fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!a})})};import{useId as fd}from"react";import{$getNodeByKey as Zt,COMMAND_PRIORITY_HIGH as cd,KEY_DOWN_COMMAND as ud,SKIP_DOM_SELECTION_TAG as dd}from"lexical";import{useCallback as qo,useEffect as ol,useLayoutEffect as md,useRef as Qo,useState as pd}from"react";function nl({editor:t,nodeKey:e}){let[o,n]=pd(null),r=Qo(null),l=Qo(!1),s=Qo(!1),i=o!==null;ol(()=>t.registerCommand(ud,a=>{let p=a?.target;return p instanceof HTMLElement&&!!t.getElementByKey(e)?.contains(p)&&!!p.closest(".collapsible__actions button")},cd),[t,e]),ol(()=>{if(!i)return;let a,p=()=>{l.current=!0},m=()=>{l.current=!1,s.current&&(a=setTimeout(()=>{r.current=null,n(null)},0))};return document.addEventListener("pointerdown",p,!0),document.addEventListener("pointerup",m,!0),document.addEventListener("pointercancel",m,!0),()=>{document.removeEventListener("pointerdown",p,!0),document.removeEventListener("pointerup",m,!0),document.removeEventListener("pointercancel",m,!0),clearTimeout(a),l.current=!1,s.current=!1}},[i]),md(()=>{if(o===null)return;let a=[];return t.getEditorState().read(()=>{let p=Zt(e),m=p?.getParent()?.getChildren(),h=p?.getIndexWithinParent();if(!m||h===void 0||h===o)return;let f=m.map(y=>t.getElementByKey(y.getKey())),g=f[h],C=f[o],S=f[h+(o>h?1:-1)];if(!g||!C||!S)return;let N=g.getBoundingClientRect(),b=C.getBoundingClientRect(),x=S.getBoundingClientRect(),_=o>h,k=_?b.bottom-N.bottom:b.top-N.top,T=_?N.top-x.top:N.bottom-x.bottom;for(let y=Math.min(h,o);y<=Math.max(h,o);y++){let E=f[y];if(E){let w=E.style.translate;a.push(()=>{E.style.translate=w}),E.style.translate=`0 ${y===h?k:T}px`}}g.querySelector(".collapsible__drag")?.scrollIntoView({block:"nearest"})}),()=>a.forEach(p=>p())},[t,e,o]);let c=qo(({direction:a,index:p})=>{t.isEditable()&&t.update(()=>{let m=Zt(e),h=m?.getParent()?.getChildren();if(!m||!h)return;let f=m.getIndexWithinParent(),g=p??f+(a??0),C=h[g];C&&C!==m&&(g<f?C.insertBefore(m):C.insertAfter(m))},{onUpdate:()=>{requestAnimationFrame(()=>{let m=t.getElementByKey(e)?.querySelector(".collapsible__toggle-wrap");(m?.querySelector(".collapsible__drag")??m?.querySelector(".LexicalEditorTheme__block__actions-button"))?.focus()})},tag:dd})},[t,e]),u=qo(a=>{t.isEditable()&&(a.key===" "||a.key==="Enter"?(a.preventDefault(),a.stopPropagation(),r.current===null?(t.getEditorState().read(()=>{r.current=Zt(e)?.getIndexWithinParent()??null}),n(r.current)):(c({index:r.current}),r.current=null,n(null))):r.current!==null&&(a.key==="Escape"||a.key==="Tab"?(r.current=null,n(null),a.key==="Escape"&&(a.preventDefault(),a.stopPropagation())):(a.key==="ArrowUp"||a.key==="ArrowDown")&&(a.preventDefault(),a.stopPropagation(),t.getEditorState().read(()=>{let p=Zt(e)?.getParent()?.getChildrenSize()??0;r.current=Math.max(0,Math.min(p-1,(r.current??0)+(a.key==="ArrowDown"?1:-1)))}),n(r.current))))},[t,c,e]),d=qo(()=>{if(l.current){s.current=!0;return}r.current=null,n(null)},[]);return{isReordering:i,move:c,onBlur:d,onKeyDown:u,targetIndex:o}}function rl({children:t,editor:e,nodeKey:o}){let n=nl({editor:e,nodeKey:o}),r=fd();return t({...n,reorderInstructionsID:r})}var cl=t=>{let{cacheBuster:e,className:o,CustomBlock:n,CustomLabel:r,formData:l,nodeKey:s}=t,i=Dd(),{id:c,collectionSlug:u,globalSlug:d}=il(),{fieldProps:{featureClientSchemaMap:a,field:p,initialLexicalFormState:m,schemaPath:h},uuid:f}=W(),{fields:g}=Md(),C=eo(new AbortController),S=Ad(),[N,b]=Oe.useState(0),{config:x}=vd(),_=Sd({slug:`lexical-blocks-create-${f}-${l.id}`,depth:S}),{toggleDrawer:k}=$e(_),{getDocPreferences:T,setDocFieldPreferences:y}=il(),[E]=bd(),w=xd(),R=l.blockType,L=eo(l);L.current=l;let I=`${h}.lexical_internal_feature.blocks.lexical_blocks.${R}`,D=a.blocks?.[I]?.[0]?.blocks?.[0],M=typeof D=="string"?x.blocksMap[D]:D,{getFormState:B}=$d(),F=`${h}.lexical_internal_feature.blocks.lexical_blocks.${R}.fields`,[j,P]=Oe.useState(()=>{let z=m?.[l.id],Z=z?.formState;if(!Z)return!1;let K=Ir({cachedFormState:Z,cachedSchemaPath:z.schemaPath,currentSchemaPath:F,formData:l});return K?{...K,blockName:{initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName}}:!1}),Ye=eo(!1),Ct=eo(e);Qt(()=>{Ye.current?(Ct.current!==e&&P(!1),Ct.current=e):Ye.current=!0},[e]);let[Ze]=Oe.useState(()=>Pd()),[kt,qe]=Oe.useState(()=>{if(!r)return j?._components?.customComponents?.BlockLabel??void 0}),[ie,de]=Oe.useState(()=>{if(!n)return j?._components?.customComponents?.Block??void 0}),Le=Fe(()=>n?U(n,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):ie,[n,o,l,s,ie]),De=Fe(()=>r?U(r,{className:o,formData:l,isEditor:!0,isJSXConverter:!1,nodeKey:s,useBlockComponentContext:ae}):kt,[r,o,l,s,kt]);Qt(()=>{let z=new AbortController;return M&&l&&!j&&(async()=>{let{state:K}=await B({id:c,collectionSlug:u,data:l,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:g,globalSlug:d,initialBlockData:l,operation:"update",readOnly:!w,renderAllFields:!0,schemaPath:F,signal:z.signal});if(K){K.blockName={initialValue:l.blockName,passesCondition:!0,valid:!0,value:l.blockName};let ee=Tt(sl(K,{excludeFiles:!0}));E.update(()=>{let V=qt(s);if(V&&Me(V)){let et=ee;et.blockType=R,V.setFields(et,!0)}},{tag:tn}),P(K),r||qe(K._components?.customComponents?.BlockLabel??void 0),n||de(K._components?.customComponents?.Block??void 0)}})(),()=>{en(z)}},[B,F,w,c,r,n,l,E,s,j,u,d,T,g,R,M]);let[ye,Bo]=Oe.useState(m?.[l.id]?.collapsed??!1),{i18n:jo,t:X}=al(),_t=on(async({formState:z,submit:Z})=>{en(C.current);let K=new AbortController;C.current=K;let ee=Tt(z,L.current),{state:V}=await B({id:c,collectionSlug:u,data:ee,docPermissions:{fields:!0},docPreferences:await T(),documentFormState:g,formState:z,globalSlug:d,initialBlockData:ee,operation:"update",readOnly:!w,renderAllFields:!!Z,schemaPath:F,signal:K.signal});if(!V)return z;z.blockName&&(V.blockName=z.blockName);let et=Tt(sl(V,{excludeFiles:!0}),ee);if(setTimeout(()=>{E.update(()=>{let he=qt(s);if(he&&Me(he)){let tt=et;tt.blockType=R,he.setFields(tt,!0)}},{tag:tn})},0),Z){r||qe(V._components?.customComponents?.BlockLabel??void 0),n||de(V._components?.customComponents?.Block??void 0);let he=0;for(let tt of Object.values(V))tt?.valid===!1&&he++;b(he)}return V},[B,c,u,T,d,F,R,g,w,E,s,n,r]);Qt(()=>()=>{en(C.current)},[]);let Vt=on(()=>{E.update(()=>{qt(s)?.remove()})},[E,s]),[gr,iu]=Oe.useState(0);Qt(()=>{let z=()=>{E.getEditorState().read(()=>{let K=Fd().getChildren(),ee=0;for(let V of K)if(Me(V)){if(V.getKey()===s){iu(ee);return}ee++}})};return z(),E.registerUpdateListener(()=>{z()})},[E,s]);let Qe=M?.labels?.singular?Cd(M.labels.singular,jo):M?.slug,br=on(z=>{T().then(Z=>{let ee=Z?.fields?.[p.name]?.collapsed,V=ee&&ee?.length?ee:[];z?V.includes(l.id)||V.push(l.id):V.includes(l.id)&&V.splice(V.indexOf(l.id),1),y(p.name,{collapsed:V,hello:"hi"})})},[T,p.name,y,l.id]),xr=Fe(()=>()=>U(ll,{buttonStyle:"ghost",className:`${o}__editButton`,disabled:!w,el:"button",icon:"edit",onClick:z=>(z.preventDefault(),z.stopPropagation(),k(),!1),onMouseDown:z=>{z.preventDefault()},round:!0,size:"medium",tooltip:X("lexical:blocks:inlineBlocks:edit",{label:Qe})}),[o,w,X,Qe,k]),Cr=Fe(()=>()=>U(ll,{buttonStyle:"ghost",className:`${o}__removeButton`,disabled:!w,icon:"x",onClick:z=>{z.preventDefault(),Vt()},round:!0,tooltip:"Remove Block"}),[o,w,Vt]),Ho=Fe(()=>function({Actions:Z,children:K,className:ee,collapsibleProps:V,disableBlockName:et,editButton:he,errorCount:tt,fieldHasErrors:zo,Label:wr,Pill:Sr,removeButton:au,showDragHandle:cu=!0,showRowNumber:uu=!0}){return U(rl,{editor:E,nodeKey:s,children:({isReordering:Go,move:Nr,onBlur:du,onKeyDown:mu,reorderInstructionsID:Lr,targetIndex:pu})=>U("div",{className:`${o}__container ${o}-${R}`,onKeyDownCapture:J=>{let Uo=J.target;J.altKey||J.ctrlKey||J.metaKey||Uo.closest(".collapsible")?.parentElement!==J.currentTarget||(Uo.matches(".collapsible__drag")&&(J.key!=="Escape"||Go)&&[" ","ArrowDown","ArrowUp","Enter","Escape","Tab"].includes(J.key)?(mu(J),J.stopPropagation()):J.key==="Tab"&&Uo.matches(".collapsible__toggle")&&J.stopPropagation())},children:ve(kd,{actions:typeof Z<"u"?Z:w?U(yd,{button:U(Nd,{}),buttonAriaLabel:X("general:moreOptions"),buttonClassName:`${o}__actions-button`,caret:!1,horizontalAlign:"right",popupType:"menu",render:({close:J})=>ve(vt.ButtonGroup,{buttonSize:"medium",children:[U(vt.Button,{onClick:()=>{J(),Nr({direction:-1})},children:X("general:moveUp")}),U(vt.Button,{onClick:()=>{J(),Nr({direction:1})},children:X("general:moveDown")}),(Le&&he!==!1||!Le&&he)&&U(vt.Button,{onClick:()=>{k(),J()},children:X("general:edit")}),au!==!1&&ve(vt.Button,{onClick:()=>{Vt(),J()},children:[U(Od,{}),X("general:remove")]})]}),size:"large"}):null,className:[`${o}__row`,zo?`${o}__row--has-errors`:`${o}__row--no-errors`,ee].filter(Boolean).join(" "),collapsibleStyle:zo?"error":"default",dragHandleProps:cu&&w?{id:s,attributes:{"aria-describedby":Lr,"aria-pressed":Go,role:"button",tabIndex:0},draggable:!0,listeners:{onBlur:du}}:void 0,header:U("div",{className:`${o}__block-header`,children:typeof wr<"u"?wr:typeof De<"u"?De:ve("div",{className:`${o}__block-label`,children:[uu&&U("span",{className:`${o}__block-number`,children:String(gr+1).padStart(2,"0")}),typeof Sr<"u"?Sr:U(Ld,{className:`${o}__block-pill ${o}__block-pill-${R}`,pillStyle:"white",size:"small",children:Qe??R}),!et&&!M?.admin?.disableBlockName&&U(Id,{path:"blockName",readOnly:!w}),zo&&U(Bd,{count:tt??0})]})}),isCollapsed:ye,onToggle:J=>{br(J),Bo(J)},...V||{},AfterCollapsible:ve(gd,{children:[V?.AfterCollapsible,U("span",{className:"sr-only",role:"status",children:Go?`${X("general:order")}: ${(pu??0)+1}`:""})]}),children:[ve("span",{className:"sr-only",id:Lr,children:["Space / Enter \xB7 ",X("general:moveUp")," \u2191 \xB7 ",X("general:moveDown")," \u2193 \xB7"," ",X("general:cancel")," Escape"]}),K]},0)})})},[E,Le,De,Qe,o,M?.admin?.disableBlockName,R,ye,br,w,s,Vt,gr,X,k]),kr=l?.id,{headerActions:_r,submitRef:Tr}=yr(),Er=Fe(()=>()=>U(Td,{children:U(_d,{className:"",headerActions:_r,slug:_,title:X(`lexical:blocks:inlineBlocks:${kr?"edit":"create"}`,{label:Qe??X("lexical:blocks:inlineBlocks:label")}),children:j?ve("div",{className:"fields-drawer",children:[U(Rd,{fields:M?.fields??[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:F,permissions:!0,readOnly:!w}),U(Rr,{submitRef:Tr})]}):null})}),[j,_,kr,Qe,X,w,M?.fields,F,_r,Tr]),su=Fe(()=>j?U("div",{"data-block-drawer-slug":_,style:{display:"contents"},children:U(wd,{beforeSubmit:[async({formState:z})=>await _t({formState:z,submit:!0})],el:"div",fields:M?.fields??[],initialState:j,onChange:[_t],onSubmit:z=>{let Z=Tt(z,L.current);Z.blockType=R,E.update(()=>{let K=qt(s);K&&Me(K)&&K.setFields(Z,!0)},{tag:tn}),k()},submitted:i,uuid:Ze,children:U(tl,{baseClass:o,BlockDrawer:Er,Collapsible:Ho,CustomBlock:Le,CustomLabel:De,EditButton:xr,errorCount:N,formSchema:M?.fields??[],initialState:j,nodeKey:s,RemoveButton:Cr})})}):null,[Ho,Er,Le,De,R,_,Cr,xr,o,E,N,k,M?.fields,Ze,j,s,_t,i]);return M?su:U(Ho,{disableBlockName:!0,fieldHasErrors:!0,children:ve("div",{className:`${o}-not-found`,children:["Error: Block '",R,"' not found in the config but exists in the lexical data"]})})},Bd=t=>{let e=hd(3),{count:o}=t,{i18n:n}=al(),r;return e[0]!==o||e[1]!==n?(r=U(Ed,{count:o,i18n:n,withMessage:!0}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};var ce=class extends It{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){let o=Pe(e.fields);return o.setFormat(e.format),o}decorate(...[e,o,n,r]){return jd(cl,{cacheBuster:this.getCacheBuster(),className:o.theme.block??"LexicalEditorTheme__block",CustomBlock:n,CustomLabel:r,formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Pe(t){return zd(new ce({fields:{...t,id:t?.id||new Hd.default().toHexString()}}))}function Me(t){return t instanceof ce}import{createHeadlessEditor as Gd}from"@lexical/headless";import{$convertToMarkdownString as Ud}from"@lexical/markdown";function nn(t,e){return({editorState:n})=>{let r=Gd({nodes:t});try{r.setEditorState(r.parseEditorState(n))}catch(s){console.error("getLexicalToMarkdown: ERROR parsing editor state",s)}let l="";return r.getEditorState().read(()=>{l=Ud(e)}),l}}import{createHeadlessEditor as em}from"@lexical/headless";import{$convertFromMarkdownString as bl,TRANSFORMERS as Qd}from"@lexical/markdown";var ul=/^[\t ]*$/,Wd=/^(\s*)(\d+)\.\s/,Vd=/^(\s*)[-*+]\s/,Kd=/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,dl=/^(#{1,6})\s/,Jd=/^>\s/,Xd=/^[ \t]*(\\`\\`\\`|```)(\w+)?/,ml=/[ \t]*(\\`\\`\\`|```)$/,Yd=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,Zd=/^\|(.+)\|\s?$/,qd=/^(\| ?:?-*:? ?)+\|\s?$/,pl=/^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,fl=/^[ \t]*<\/[a-z_][\w-]*\s*>/i;function hl(t){if(t.endsWith("\\"))return[t.slice(0,-1),"\\"];let e=t.match(/^(.*?\S)( {2,})$/);return e?[e[1],e[2]]:null}function gl(t,e){let o=t.split(`
9
+ `),n=!1,r=[],l=0;for(let s=0;s<o.length;s++){let i=o[s],c=r[r.length-1],u=s<o.length-1?hl(i):null,d=c!==void 0&&hl(c)!==null;if(Yd.test(i)){r.push(i);continue}if(ml.test(i)){l===0&&(n=!0),l===1&&(n=!1),l>0&&l--,r.push(i);continue}if(Xd.test(i)){n=!0,l++,r.push(i);continue}if(n){r.push(i);continue}ul.test(i)||ul.test(c)||!c||dl.test(c)||dl.test(i)||Jd.test(i)||Wd.test(i)||Vd.test(i)||Kd.test(i)||Zd.test(i)||qd.test(i)||d||!e||pl.test(i)||fl.test(i)||pl.test(c)||fl.test(c)||ml.test(c)?r.push(i):r[r.length-1]=c+" "+(u===null?i.trim():i.trimStart())}return r.join(`
10
+ `)}function to(t,e=Qd,o,n=!1,r=!1){if(n)return bl(t,e,o,!0);let l=gl(t,r);return bl(l,e,o,!1,!1)}function oo(t,e){return({markdown:n})=>{let r=em({nodes:t});return r.update(()=>{to(n,e,void 0,!1,!0)},{discrete:!0}),r.getEditorState().toJSON()}}function tm(t){let e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{regExpEnd:new RegExp(`</(${e})\\s*>|<${e}[^>]*?/>`,"i"),regExpStart:new RegExp(`<(${e})([^>]*?)\\s*(/?)>`,"i")}}var kl=({blocks:t,inlineBlocks:e})=>{if(!t?.length&&!e?.length)return[];let o=[];if(t?.length)for(let n of t){let r=Cl(n,!1);r&&(o=o.concat(r))}if(e?.length)for(let n of e){let r=Cl(n,!0);r&&(o=o.concat(r))}return o};function Cl(t,e){if(!t.jsx)return null;let o=tm(t.slug),n=[];return e?(n.push(({allNodes:r,allTransformers:l})=>({type:"text-match",dependencies:[Et],export:s=>{if(!St(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),c=nn(r,l),u=t.jsx.export({fields:i,lexicalToMarkdown:c});if(u===!1)return null;if(typeof u=="string")return u;let d=u.props&&Object.keys(u.props)?.length>0,a=u.props??{};return u?.children?.length?`<${i.blockType}${d?" "+Rt({props:a}):""}>${u.children}</${i.blockType}>`:`<${i.blockType}${d?" "+Rt({props:a}):""}/>`},getEndIndex:(s,i)=>{let{endlineLastCharIndex:c}=Xt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:i,trimChildren:!1});return c},importRegExp:t.jsx?.customStartRegex??o.regExpStart,regExp:/___ignoreignoreignore___/g,replace(s,i){let{content:c,propsString:u}=Xt({isEndOptional:!1,lines:[s.getTextContent()],regexpEndRegex:o.regExpEnd,startLineIndex:0,startMatch:{...i,index:0},trimChildren:!1});if(!t?.jsx?.import)return;let d=oo(r,l),a=t.jsx.import({children:c,closeMatch:null,htmlToLexical:null,markdownToLexical:d,openMatch:i,props:u?Jt({propsString:u}):{}});if(a===!1)return;let p=wt({blockType:t.slug,...a});s.replace(p)}})),n):(n.push(({allNodes:r,allTransformers:l})=>({dependencies:[ce],export:s=>{if(!Me(s)||s.getFields()?.blockType?.toLowerCase()!==t.slug.toLowerCase())return null;let i=s.getFields(),c=nn(r,l),u=t.jsx.export({fields:i,lexicalToMarkdown:c});if(u===!1)return null;if(typeof u=="string")return u;let d=u.props&&Object.keys(u.props)?.length>0,a=u.props??{};if(u?.children?.length){let p=u.children,m="";if(p.includes(`
11
+ `))for(let h of p.split(`
12
12
  `)){let f="";!t?.jsx?.doNotTrimChildren&&h!==""&&(f=" "),f+=h+`
13
- `,p+=f}else p=(t?.jsx?.doNotTrimChildren?"":" ")+m+`
14
- `;return`<${i.blockType}${c?" "+Lt({props:a}):""}>
15
- ${p}</${i.blockType}>`}return`<${i.blockType}${c?" "+Lt({props:a}):""}/>`},handleImportAfterStartMatch:t.jsx?.customEndRegex?void 0:({lines:s,rootNode:i,startLineIndex:u,startMatch:d,transformer:c})=>{let a=typeof c.regExpEnd=="object"&&"regExp"in c.regExpEnd?c.regExpEnd.regExp:c.regExpEnd,m=c.regExpEnd&&typeof c.regExpEnd=="object"&&"optional"in c.regExpEnd?c.regExpEnd.optional:!c.regExpEnd,{afterEndLine:p,beforeStartLine:h,content:f,endLineIndex:g,propsString:C}=Yt({isEndOptional:m,lines:s,regexpEndRegex:a,startLineIndex:u,startMatch:d,trimChildren:!1}),E="";if(t?.jsx?.doNotTrimChildren)E=f.endsWith(`
13
+ `,m+=f}else m=(t?.jsx?.doNotTrimChildren?"":" ")+p+`
14
+ `;return`<${i.blockType}${d?" "+Rt({props:a}):""}>
15
+ ${m}</${i.blockType}>`}return`<${i.blockType}${d?" "+Rt({props:a}):""}/>`},handleImportAfterStartMatch:t.jsx?.customEndRegex?void 0:({lines:s,rootNode:i,startLineIndex:c,startMatch:u,transformer:d})=>{let a=typeof d.regExpEnd=="object"&&"regExp"in d.regExpEnd?d.regExpEnd.regExp:d.regExpEnd,p=d.regExpEnd&&typeof d.regExpEnd=="object"&&"optional"in d.regExpEnd?d.regExpEnd.optional:!d.regExpEnd,{afterEndLine:m,beforeStartLine:h,content:f,endLineIndex:g,propsString:C}=Xt({isEndOptional:p,lines:s,regexpEndRegex:a,startLineIndex:c,startMatch:u,trimChildren:!1}),S="";if(t?.jsx?.doNotTrimChildren)S=f.endsWith(`
16
16
  `)?f.slice(0,-1):f;else if(f.includes(`
17
- `)){let k=f.split(`
18
- `),_=0;for(let T of k){if(_++,T.startsWith(" "))E+=T.slice(2);else if(T==="")E+=T;else{E=f.endsWith(`
19
- `)?f.slice(0,-1):f;break}E+=_===k.length?"":`
20
- `}}else E=(f.startsWith(" ")?f.slice(2):f)+`
21
- `;if(!t?.jsx?.import)return[!1,u];let L=no(r,l),x=t.jsx.import({children:E,closeMatch:null,htmlToLexical:null,markdownToLexical:L,openMatch:d,props:C?Xt({propsString:C}):{}});if(x===!1)return[!1,u];let b=Fe({...x,blockType:t.slug});if(b){let k=null,_=null;if(h?.length){k=L({markdown:h})?.root?.children??[];let T=k?.[0];T&&i.append(gl(T))}if(i.append(b),p?.length){_=L({markdown:p})?.root?.children;let T=i.getChildren()[i.getChildren().length-1],v=gl(_[0])?.getChildren();if(v?.length)for(let N of v)T.append(N)}}return[!0,g]},regExpEnd:t.jsx?.customEndRegex??o.regExpEnd,regExpStart:t.jsx?.customStartRegex??o.regExpStart,type:"multiline-element",replace:(s,i,u,d,c)=>{if(t?.jsx?.import){if(!c){let g="";if(i)for(let C of i)g+=C.getTextContent();c=[g]}let a="";t?.jsx?.doNotTrimChildren?a=c.join(`
22
- `):a=c.join(`
23
- `).trim();let m=u[1]?.trim(),p=no(r,l),h=t.jsx.import({children:a,closeMatch:d,htmlToLexical:null,markdownToLexical:p,openMatch:u,props:m?Xt({propsString:m}):{}});if(h===!1)return!1;let f=Fe({...h,blockType:t.slug});f&&s.append(f);return}return!1}})),n)}import{createCommand as bl}from"lexical";var rt=bl("INSERT_BLOCK_COMMAND"),lt=bl("INSERT_INLINE_BLOCK_COMMAND");import{c as Xd}from"react/compiler-runtime";import{useLexicalComposerContext as Yd}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Zd,$wrapNodeInElement as qd,mergeRegister as Qd}from"@lexical/utils";import{formatDrawerSlug as em,useEditDepth as tm}from"@payloadcms/ui";import{$createParagraphNode as om,$getNodeByKey as nm,$getPreviousSelection as rm,$getSelection as lm,$insertNodes as im,$isParagraphNode as sm,$isRangeSelection as am,$isRootOrShadowRoot as cm,COMMAND_PRIORITY_EDITOR as kl}from"lexical";import{useEffect as um,useState as dm}from"react";var _l=()=>{let t=Xd(12),[e]=Yd(),[o,n]=dm(null),{setCreatedInlineBlock:r,uuid:l}=W(),s=tm(),i="lexical-inlineBlocks-create-"+l,u;t[0]!==s||t[1]!==i?(u=em({slug:i,depth:s}),t[0]=s,t[1]=i,t[2]=u):u=t[2];let d=u,{toggleDrawer:c}=De(d,!0),a;t[3]!==e||t[4]!==r||t[5]!==o?(a=()=>{if(!e.hasNodes([ue]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return Qd(e.registerCommand(rt,p=>(e.update(()=>{let h=lm()||rm();if(am(h)){let f=Fe(p),{focus:g}=h,C=g.getNode();Zd(f),sm(C)&&!C.__first&&C.remove()}}),!0),kl),e.registerCommand(lt,p=>{if(o){let f=nm(o);return!f||!Et(f)?!1:(f.setFields(p),n(null),!0)}let h=Tt(p);return r?.(h),im([h]),cm(h.getParentOrThrow())&&qd(h,om).selectEnd(),!0},kl))},t[3]=e,t[4]=r,t[5]=o,t[6]=a):a=t[6];let m;return t[7]!==e||t[8]!==r||t[9]!==o||t[10]!==c?(m=[e,r,o,c],t[7]=e,t[8]=r,t[9]=o,t[10]=c,t[11]=m):m=t[11],um(a,m),null};var mm=A(({config:t,featureClientSchemaMap:e,props:o,schemaPath:n})=>{let r=`${n}.lexical_internal_feature.blocks.lexical_blocks`,l=`${n}.lexical_internal_feature.blocks.lexical_inline_blocks`,s=e.blocks;if(!s)return{};let i=Object.entries(s).filter(([a])=>a.startsWith(r+".")&&!a.replace(r+".","").includes(".")).map(([,a])=>a[0]),u=Object.entries(s).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),d=i.map(a=>{let m=a.blocks[0];return typeof m=="string"?t.blocksMap[m]:m}).filter(a=>a!==void 0),c=u.map(a=>{let m=a.blocks[0];return typeof m=="string"?t.blocksMap[m]:m}).filter(a=>a!==void 0);return{markdownTransformers:Cl({blocks:d,inlineBlocks:c}),nodes:[ue,_t],plugins:[{Component:_l,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[d?.length?{items:d.map(a=>({Icon:Zr(a,Xo),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:m})=>a?.labels?.singular?ro(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(rt,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,c?.length?{items:c.map(a=>({Icon:Yo,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:m})=>a?.labels?.singular?ro(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(lt,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[d.length?{type:"dropdown",ChildComponent:Xo,items:d.map((a,m)=>({isActive:void 0,key:"block-"+a.slug,label:({i18n:p})=>a?.labels?.singular?ro(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(rt,{blockName:"",blockType:a.slug})},order:m})),key:"blocks",order:20}:null,c?.length?{type:"dropdown",ChildComponent:Yo,items:c.map((a,m)=>({isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:p})=>a?.labels?.singular?ro(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(lt,{blockName:"",blockType:a.slug})},order:m})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as hm}from"react/compiler-runtime";import{jsx as Be,jsxs as an}from"react/jsx-runtime";import{useLexicalComposerContext as gm}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as xm,$createTextNode as Cm,$getRoot as bm,getDOMSelection as rn}from"lexical";import*as Nl from"react";import{useCallback as Pe,useEffect as ln,useLayoutEffect as El,useRef as sn,useState as lo}from"react";var pm=se&&"documentMode"in document?document.documentMode:null,Tl=se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U7=se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),W7=se&&"InputEvent"in window&&!pm?"getTargetRanges"in new window.InputEvent("input"):!1,V7=se&&/Version\/[\d.].*Safari/.test(navigator.userAgent),K7=se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,J7=se&&/Android/.test(navigator.userAgent),X7=se&&/Win/.test(navigator.platform),fm=se&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Y7=se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!fm;var km=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},_m=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Tm=t=>{let o=((n,r)=>{switch(n){case"click":return` await page.mouse.click(${r.x}, ${r.y});`;case"keydown":return` await page.keyboard.keydown('${r}');`;case"keyup":return` await page.keyboard.keyup('${r}');`;case"press":return` await page.keyboard.press('${r}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
17
+ `)){let _=f.split(`
18
+ `),k=0;for(let T of _){if(k++,T.startsWith(" "))S+=T.slice(2);else if(T==="")S+=T;else{S=f.endsWith(`
19
+ `)?f.slice(0,-1):f;break}S+=k===_.length?"":`
20
+ `}}else S=(f.startsWith(" ")?f.slice(2):f)+`
21
+ `;if(!t?.jsx?.import)return[!1,c];let N=oo(r,l),b=t.jsx.import({children:S,closeMatch:null,htmlToLexical:null,markdownToLexical:N,openMatch:u,props:C?Jt({propsString:C}):{}});if(b===!1)return[!1,c];let x=Pe({...b,blockType:t.slug});if(x){let _=null,k=null;if(h?.length){_=N({markdown:h})?.root?.children??[];let T=_?.[0];T&&i.append(xl(T))}if(i.append(x),m?.length){k=N({markdown:m})?.root?.children;let T=i.getChildren()[i.getChildren().length-1],y=xl(k[0])?.getChildren();if(y?.length)for(let E of y)T.append(E)}}return[!0,g]},regExpEnd:t.jsx?.customEndRegex??o.regExpEnd,regExpStart:t.jsx?.customStartRegex??o.regExpStart,type:"multiline-element",replace:(s,i,c,u,d)=>{if(t?.jsx?.import){if(!d){let g="";if(i)for(let C of i)g+=C.getTextContent();d=[g]}let a="";t?.jsx?.doNotTrimChildren?a=d.join(`
22
+ `):a=d.join(`
23
+ `).trim();let p=c[1]?.trim(),m=oo(r,l),h=t.jsx.import({children:a,closeMatch:u,htmlToLexical:null,markdownToLexical:m,openMatch:c,props:p?Jt({propsString:p}):{}});if(h===!1)return!1;let f=Pe({...h,blockType:t.slug});f&&s.append(f);return}return!1}})),n)}import{createCommand as _l}from"lexical";var it=_l("INSERT_BLOCK_COMMAND"),st=_l("INSERT_INLINE_BLOCK_COMMAND");import{c as om}from"react/compiler-runtime";import{useLexicalComposerContext as nm}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as rm,$wrapNodeInElement as lm,mergeRegister as im}from"@lexical/utils";import{formatDrawerSlug as sm,useEditDepth as am}from"@payloadcms/ui";import{$createParagraphNode as cm,$getNodeByKey as um,$getPreviousSelection as dm,$getSelection as mm,$insertNodes as pm,$isParagraphNode as fm,$isRangeSelection as hm,$isRootOrShadowRoot as gm,COMMAND_PRIORITY_EDITOR as Tl}from"lexical";import{useEffect as bm,useState as xm}from"react";var El=()=>{let t=om(12),[e]=nm(),[o,n]=xm(null),{setCreatedInlineBlock:r,uuid:l}=W(),s=am(),i="lexical-inlineBlocks-create-"+l,c;t[0]!==s||t[1]!==i?(c=sm({slug:i,depth:s}),t[0]=s,t[1]=i,t[2]=c):c=t[2];let u=c,{toggleDrawer:d}=$e(u,!0),a;t[3]!==e||t[4]!==r||t[5]!==o?(a=()=>{if(!e.hasNodes([ce]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return im(e.registerCommand(it,m=>(e.update(()=>{let h=mm()||dm();if(hm(h)){let f=Pe(m),{focus:g}=h,C=g.getNode();rm(f),fm(C)&&!C.__first&&C.remove()}}),!0),Tl),e.registerCommand(st,m=>{if(o){let f=um(o);return!f||!St(f)?!1:(f.setFields(m),n(null),!0)}let h=wt(m);return r?.(h),pm([h]),gm(h.getParentOrThrow())&&lm(h,cm).selectEnd(),!0},Tl))},t[3]=e,t[4]=r,t[5]=o,t[6]=a):a=t[6];let p;return t[7]!==e||t[8]!==r||t[9]!==o||t[10]!==d?(p=[e,r,o,d],t[7]=e,t[8]=r,t[9]=o,t[10]=d,t[11]=p):p=t[11],bm(a,p),null};var Cm=A(({config:t,featureClientSchemaMap:e,props:o,schemaPath:n})=>{let r=`${n}.lexical_internal_feature.blocks.lexical_blocks`,l=`${n}.lexical_internal_feature.blocks.lexical_inline_blocks`,s=e.blocks;if(!s)return{};let i=Object.entries(s).filter(([a])=>a.startsWith(r+".")&&!a.replace(r+".","").includes(".")).map(([,a])=>a[0]),c=Object.entries(s).filter(([a])=>a.startsWith(l+".")&&!a.replace(l+".","").includes(".")).map(([,a])=>a[0]),u=i.map(a=>{let p=a.blocks[0];return typeof p=="string"?t.blocksMap[p]:p}).filter(a=>a!==void 0),d=c.map(a=>{let p=a.blocks[0];return typeof p=="string"?t.blocksMap[p]:p}).filter(a=>a!==void 0);return{markdownTransformers:kl({blocks:u,inlineBlocks:d}),nodes:[ce,Et],plugins:[{Component:El,position:"normal"}],sanitizedClientFeatureProps:o,slashMenu:{groups:[u?.length?{items:u.map(a=>({Icon:Zr(a,Xo),key:"block-"+a.slug,keywords:["block","blocks",a.slug],label:({i18n:p})=>a?.labels?.singular?no(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(it,{blockName:"",blockType:a.slug})}})),key:"blocks",label:({i18n:a})=>a.t("lexical:blocks:label")}:null,d?.length?{items:d.map(a=>({Icon:Yo,key:"inlineBlocks-"+a.slug,keywords:["inlineBlock","inline block",a.slug],label:({i18n:p})=>a?.labels?.singular?no(a.labels.singular,p):a?.slug,onSelect:({editor:p})=>{p.dispatchCommand(st,{blockName:"",blockType:a.slug})}})),key:"inlineBlocks",label:({i18n:a})=>a.t("lexical:blocks:inlineBlocks:label")}:null].filter(Boolean)},toolbarFixed:{groups:[u.length?{type:"dropdown",ChildComponent:Xo,items:u.map((a,p)=>({isActive:void 0,key:"block-"+a.slug,label:({i18n:m})=>a?.labels?.singular?no(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(it,{blockName:"",blockType:a.slug})},order:p})),key:"blocks",order:20}:null,d?.length?{type:"dropdown",ChildComponent:Yo,items:d.map((a,p)=>({isActive:void 0,key:"inlineBlock-"+a.slug,label:({i18n:m})=>a?.labels?.singular?no(a.labels.singular,m):a?.slug,onSelect:({editor:m})=>{m.dispatchCommand(st,{blockName:"",blockType:a.slug})},order:p})),key:"inlineBlocks",order:25}:null].filter(Boolean)}}});import{c as Tm}from"react/compiler-runtime";import{jsx as je,jsxs as an}from"react/jsx-runtime";import{useLexicalComposerContext as Em}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as wm,$createTextNode as Sm,$getRoot as Nm,getDOMSelection as rn}from"lexical";import*as yl from"react";import{useCallback as Be,useEffect as ln,useLayoutEffect as Sl,useRef as sn,useState as ro}from"react";var km=se&&"documentMode"in document?document.documentMode:null,wl=se&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),u3=se&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),d3=se&&"InputEvent"in window&&!km?"getTargetRanges"in new window.InputEvent("input"):!1,m3=se&&/Version\/[\d.].*Safari/.test(navigator.userAgent),p3=se&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,f3=se&&/Android/.test(navigator.userAgent),h3=se&&/Win/.test(navigator.platform),_m=se&&/^(?=.*Chrome).*/i.test(navigator.userAgent),g3=se&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!_m;var Lm=t=>{let e=document.createElement("textarea");e.value=t||"",e.style.position="absolute",e.style.opacity="0",document.body?.appendChild(e),e.focus(),e.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(e)},ym=(t,e)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(e||"")),o.setAttribute("download",t),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Rm=t=>{let o=((n,r)=>{switch(n){case"click":return` await page.mouse.click(${r.x}, ${r.y});`;case"keydown":return` await page.keyboard.keydown('${r}');`;case"keyup":return` await page.keyboard.keyup('${r}');`;case"press":return` await page.keyboard.press('${r}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
24
24
  await assertSelection(page, {
25
25
  anchorPath: [${r.anchorPath.toString()}],
26
26
  anchorOffset: ${r.anchorOffset},
@@ -30,7 +30,7 @@ ${p}</${i.blockType}>`}return`<${i.blockType}${c?" "+Lt({props:a}):""}/>`},handl
30
30
  `;case"type":return` await page.keyboard.type('${r}');`;default:return""}})(t.name,t.value);switch(t.count){case 1:return o;case 2:return[o,o].join(`
31
31
  `);default:return` await repeat(${t.count}, async () => {
32
32
  ${o}
33
- );`}};function Em(t){return t.key.toLowerCase()==="a"&&(Tl?t.metaKey:t.ctrlKey)}function wm(t){let{anchorNode:e,focusNode:o}=t,{anchorOffset:n,focusOffset:r}=t;return n!==0&&n--,r!==0&&r--,{anchorNode:e,anchorOffset:n,focusNode:o,focusOffset:r}}function wl(t,e){let o=t,n=[];for(;o!==e;)o!=null&&n.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return n}var Sl=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function Sm(t){let[e,o]=lo([]),[n,r]=lo(!1),[,l]=lo(""),[s,i]=lo(""),u=sn(null),d=sn(!1),c=sn(null),a=Pe(()=>t,[t]),m=Pe(()=>{let x=t.getRootElement(),b=rn(t._window);return x==null||b==null||b.anchorNode==null||b.focusNode==null||!x.contains(b.anchorNode)||!x.contains(b.focusNode)?null:`
33
+ );`}};function Im(t){return t.key.toLowerCase()==="a"&&(wl?t.metaKey:t.ctrlKey)}function vm(t){let{anchorNode:e,focusNode:o}=t,{anchorOffset:n,focusOffset:r}=t;return n!==0&&n--,r!==0&&r--,{anchorNode:e,anchorOffset:n,focusNode:o,focusOffset:r}}function Nl(t,e){let o=t,n=[];for(;o!==e;)o!=null&&n.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return n}var Ll=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Backspace","Delete","Enter","Escape"]);function Mm(t){let[e,o]=ro([]),[n,r]=ro(!1),[,l]=ro(""),[s,i]=ro(""),c=sn(null),u=sn(!1),d=sn(null),a=Be(()=>t,[t]),p=Be(()=>{let b=t.getRootElement(),x=rn(t._window);return b==null||x==null||x.anchorNode==null||x.focusNode==null||!b.contains(x.anchorNode)||!b.contains(x.focusNode)?null:`
34
34
  import {
35
35
  initializeE2E,
36
36
  assertHTMLSnapshot,
@@ -47,19 +47,19 @@ describe('Test case', () => {
47
47
  const {page} = e2e;
48
48
 
49
49
  await page.focus('div[contenteditable="true"]');
50
- ${e.map(Tm).join(`
50
+ ${e.map(Rm).join(`
51
51
  `)}
52
52
  });
53
53
  });
54
- `},[t,e]),p=Pe((x,b)=>{o(k=>{let _=e.length-1,T=e[_];if(T&&T.name===x){if(x==="type")return[...e.slice(0,_),{...T,value:T.value+b}];if(T.value===b)return[...e.slice(0,_),{...T,count:T.count+1}]}return[...k,{name:x,count:1,value:b}]})},[e,o]);El(()=>{let x=k=>{if(!n)return;let _=k.key;Em(k)?p("selectAll",""):Sl.has(_)?p("press",k.key):[..._].length>1?p("keydown",k.key):p("type",k.key)},b=k=>{if(!n)return;let _=k.key;!Sl.has(_)&&[..._].length>1&&p("keyup",k.key)};return t.registerRootListener((k,_)=>{_!==null&&(_.removeEventListener("keydown",x),_.removeEventListener("keyup",b)),k!==null&&(k.addEventListener("keydown",x),k.addEventListener("keyup",b))})},[t,n,p]),El(()=>{c.current&&c.current.scrollTo(0,c.current.scrollHeight)},[m]),ln(()=>{if(e){let x=m();x!==null&&i(x),c.current&&c.current.scrollTo(0,c.current.scrollHeight)}},[m,e]),ln(()=>t.registerUpdateListener(({dirtyElements:b,dirtyLeaves:k,editorState:_})=>{if(!n)return;let T=_._selection,v=u.current,N=d.current;if(v!==T){if(k.size===0&&b.size===0&&!N){let y=rn(t._window);if(y&&(y.anchorNode==null||y.focusNode==null))return}u.current=T}d.current=!1;let w=m();w!==null&&i(w)}),[t,m,n,p]),ln(()=>n?t.registerUpdateListener(()=>{let b=t.getRootElement();b!==null&&l(b?.innerHTML)}):void 0,[t,n]);let h=Pe(x=>{n||(x.update(()=>{let b=bm();b.clear();let k=Cm();b.append(xm().append(k)),k.select()}),o([])),r(b=>!b)},[n]),f=Pe(()=>{if(!n)return;let x=rn(t._window);if(x===null||x.anchorNode==null||x.focusNode==null)return;let{anchorNode:b,anchorOffset:k,focusNode:_,focusOffset:T}=wm(x),v=a().getRootElement(),N;b!==null&&(N=wl(b,v));let w;_!==null&&(w=wl(_,v)),p("snapshot",{anchorNode:b,anchorOffset:k,anchorPath:N,focusNode:_,focusOffset:T,focusPath:w})},[p,n,a]),g=Pe(()=>{km(m())},[m]),C=Pe(()=>{_m("test.js",m())},[m]);return[Be("button",{className:`editor-dev-button ${n?"active":""}`,id:"test-recorder-button",onClick:x=>{h(a()),x.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?an("div",{className:"test-recorder-output",children:[an("div",{className:"test-recorder-toolbar",children:[Be("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:x=>{f(),x.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Be("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:x=>{g(),x.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Be("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:x=>{C(),x.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Be("pre",{id:"test-recorder",ref:c,children:s})]}):null]}var Ll=()=>{let t=hm(3),[e]=gm(),[o,n]=Sm(e),r;return t[0]!==o||t[1]!==n?(r=an(Nl.Fragment,{children:[Be("p",{children:"HI"}),o,n,Be("p",{children:"DONE"})]}),t[0]=o,t[1]=n,t[2]=r):r=t[2],r};var Nm=A({plugins:[{Component:Ll,position:"bottom"}]});import{c as Lm}from"react/compiler-runtime";import{jsx as ym}from"react/jsx-runtime";import{useLexicalComposerContext as Rm}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Im}from"@lexical/react/LexicalTreeView.js";import"react";var yl=()=>{let t=Lm(2),[e]=Rm(),o;return t[0]!==e?(o=ym(Im,{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 vm=A({plugins:[{Component:yl,position:"bottom"}]});import{BOLD_ITALIC_STAR as Am,BOLD_ITALIC_UNDERSCORE as Dm,BOLD_STAR as $m,BOLD_UNDERSCORE as Om}from"@lexical/markdown";import{$isTableSelection as Fm}from"@lexical/table";import{$isRangeSelection as Pm,FORMAT_TEXT_COMMAND as Bm}from"lexical";import{jsx as Rl}from"react/jsx-runtime";import"react";var Mm="M14.5 9.25A1.75 1.75 0 0 1 12.75 11H9.5V7.5h3.25c.966 0 1.75.784 1.75 1.75M8 11V7.5A1.5 1.5 0 0 1 9.5 6h3.25a3.25 3.25 0 0 1 2.418 5.422A3.5 3.5 0 0 1 13.5 18h-4A1.5 1.5 0 0 1 8 16.5zm1.5 1.5v4h4a2 2 0 1 0 0-4z",Il=({className:t})=>Rl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Rl("path",{clipRule:"evenodd",d:Mm,fill:"currentColor",fillRule:"evenodd"})});var Q=t=>({type:"buttons",items:t,key:"format",order:40});var vl=[Q([{ChildComponent:Il,isActive:({selection:t})=>Pm(t)||Fm(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Bm,"bold")},order:1}])],jm=A(({featureProviderMap:t})=>{let e=[$m,Om];return t.get("italic")&&e.push(Dm,Am),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:vl},toolbarInline:{groups:vl}}});import{INLINE_CODE as zm}from"@lexical/markdown";import{$isTableSelection as Gm}from"@lexical/table";import{$isRangeSelection as Um,FORMAT_TEXT_COMMAND as Wm}from"lexical";import{jsx as Ml}from"react/jsx-runtime";import"react";var Hm="M9.64645 8.14645C9.84171 7.95118 10.1582 7.95118 10.3535 8.14645C10.5487 8.34171 10.5487 8.65822 10.3535 8.85348L7.20699 12L10.3535 15.1464C10.5487 15.3417 10.5487 15.6582 10.3535 15.8535C10.1582 16.0487 9.84171 16.0487 9.64645 15.8535L6.14645 12.3535C5.95118 12.1582 5.95118 11.8417 6.14645 11.6464L9.64645 8.14645ZM13.6464 8.14645C13.8417 7.95118 14.1582 7.95118 14.3535 8.14645L17.8535 11.6464C18.0487 11.8417 18.0487 12.1582 17.8535 12.3535L14.3535 15.8535C14.1582 16.0487 13.8417 16.0487 13.6464 15.8535C13.4512 15.6582 13.4512 15.3417 13.6464 15.1464L16.7929 12L13.6464 8.85348C13.4512 8.65822 13.4512 8.34171 13.6464 8.14645Z",Al=({className:t})=>Ml("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ml("path",{clipRule:"evenodd",d:Hm,fill:"currentColor",fillRule:"evenodd"})});var Dl=[Q([{ChildComponent:Al,isActive:({selection:t})=>Um(t)||Gm(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(Wm,"code")},order:7}])],Vm=A({enableFormats:["code"],markdownTransformers:[zm],toolbarFixed:{groups:Dl},toolbarInline:{groups:Dl}});import{ITALIC_STAR as Jm,ITALIC_UNDERSCORE as Xm}from"@lexical/markdown";import{$isTableSelection as Ym}from"@lexical/table";import{$isRangeSelection as Zm,FORMAT_TEXT_COMMAND as qm}from"lexical";import{jsx as $l}from"react/jsx-runtime";import"react";var Km="M10 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-2.083L11.6 17h1.9a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2.083L12.4 7h-1.9a.5.5 0 0 1-.5-.5",Ol=({className:t})=>$l("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:$l("path",{clipRule:"evenodd",d:Km,fill:"currentColor",fillRule:"evenodd"})});var Fl=[Q([{ChildComponent:Ol,isActive:({selection:t})=>Zm(t)||Ym(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(qm,"italic")},order:2}])],Qm=A({enableFormats:["italic"],markdownTransformers:[Jm,Xm],toolbarFixed:{groups:Fl},toolbarInline:{groups:Fl}});import{STRIKETHROUGH as tp}from"@lexical/markdown";import{$isTableSelection as op}from"@lexical/table";import{$isRangeSelection as np,FORMAT_TEXT_COMMAND as rp}from"lexical";import{jsx as Pl}from"react/jsx-runtime";import"react";var ep="M15.835 13.5a.27.27 0 0 1 .24.138q.306.554.306 1.316 0 1.01-.543 1.816-.543.8-1.554 1.268-1.01.462-2.409.462-1.323 0-2.295-.419-.972-.424-1.534-1.175a3.2 3.2 0 0 1-.533-1.135c-.082-.326.187-.614.522-.614.299 0 .539.233.625.519q.13.43.415.768.448.524 1.17.8.73.271 1.63.272.996 0 1.764-.32.773-.327 1.215-.906a2.16 2.16 0 0 0 .44-1.348q0-.645-.345-1.09c-.1-.132-.016-.352.15-.352zm-3.846-8q1.215 0 2.142.438.933.43 1.476 1.187.38.518.519 1.134c.07.31-.19.577-.507.577-.286 0-.518-.22-.6-.493q-.22-.738-.875-1.224-.864-.646-2.18-.646-.92 0-1.63.313-.703.308-1.1.85a2.04 2.04 0 0 0-.395 1.237q0 .492.217.874.216.376.588.652.376.278.843.475.474.197.972.338l1.052.288H18.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3.94a4.4 4.4 0 0 1-.844-.602q-.844-.781-.844-1.982 0-1.009.562-1.778t1.522-1.2q.959-.438 2.153-.438",Bl=({className:t})=>Pl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Pl("path",{d:ep,fill:"currentColor"})});var jl=[Q([{ChildComponent:Bl,isActive:({selection:t})=>np(t)||op(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(rp,"strikethrough")},order:4}])],lp=A({enableFormats:["strikethrough"],markdownTransformers:[tp],toolbarFixed:{groups:jl},toolbarInline:{groups:jl}});import{$isTableSelection as sp}from"@lexical/table";import{$isRangeSelection as ap,FORMAT_TEXT_COMMAND as cp}from"lexical";import{jsx as Hl}from"react/jsx-runtime";import"react";var ip="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652 3.925a.436.436 0 0 1-.287-.765l1.64-1.431q.259-.228.433-.407.175-.178.266-.345a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.195-.4 0-.643.21a.7.7 0 0 0-.133.151c-.127.197-.3.403-.534.403s-.432-.194-.367-.418q.11-.378.434-.642.494-.402 1.257-.403.513 0 .897.183.387.181.604.501.217.316.217.714 0 .316-.13.586-.125.27-.395.555a9 9 0 0 1-.695.634l-.927.798a.023.023 0 0 0 .016.042h1.895a.357.357 0 0 1 0 .714z",zl=({className:t})=>Hl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Hl("path",{d:ip,fill:"currentColor"})});var Gl=[Q([{ChildComponent:zl,isActive:({selection:t})=>ap(t)||sp(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(cp,"subscript")},order:5}])],up=A({enableFormats:["subscript"],toolbarFixed:{groups:Gl},toolbarInline:{groups:Gl}});import{$isTableSelection as mp}from"@lexical/table";import{$isRangeSelection as pp,FORMAT_TEXT_COMMAND as fp}from"lexical";import{jsx as Ul}from"react/jsx-runtime";import"react";var dp="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652-1.303a.436.436 0 0 1-.287-.765l1.64-1.432q.259-.228.433-.406.175-.179.266-.346a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.194-.4 0-.643.209a.7.7 0 0 0-.133.152c-.127.196-.3.403-.534.403s-.432-.194-.367-.419q.11-.378.434-.641.494-.403 1.257-.403.513 0 .897.182.387.183.604.502.217.315.217.714 0 .315-.13.585-.125.27-.395.555a9 9 0 0 1-.695.635l-.927.798a.023.023 0 0 0 .016.041h1.895a.357.357 0 1 1 0 .715z",Wl=({className:t})=>Ul("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ul("path",{d:dp,fill:"currentColor"})});var Vl=[Q([{ChildComponent:Wl,isActive:({selection:t})=>pp(t)||mp(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(fp,"superscript")},order:6}])],hp=A({enableFormats:["superscript"],toolbarFixed:{groups:Vl},toolbarInline:{groups:Vl}});import{$isTableSelection as xp}from"@lexical/table";import{$isRangeSelection as Cp,FORMAT_TEXT_COMMAND as bp}from"lexical";import{jsx as Kl}from"react/jsx-runtime";import"react";var gp="M9 7.5a.5.5 0 0 0-1 0V12a4 4 0 0 0 8 0V7.5a.5.5 0 0 0-1 0V12a3 3 0 1 1-6 0zM16.5 19a.5.5 0 0 0 0-1h-9a.5.5 0 0 0 0 1z",Jl=({className:t})=>Kl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Kl("path",{clipRule:"evenodd",d:gp,fill:"currentColor",fillRule:"evenodd"})});var Xl=[Q([{ChildComponent:Jl,isActive:({selection:t})=>Cp(t)||xp(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(bp,"underline")},order:3}])],kp=A({enableFormats:["underline"],toolbarFixed:{groups:Xl},toolbarInline:{groups:Xl}});import{jsx as un}from"react/jsx-runtime";import{jsx as _p}from"react/jsx-runtime";function Tp(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var io=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,n])=>[Tp(o),n])):{};return _p("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Ep}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as wp}from"@lexical/selection";import{$getNodeByKey as Sp,$getState as Np,$setState as Lp,createState as yp,TextNode as Rp}from"lexical";import{useEffect as Ip}from"react";function Yl(t){let e=new Map;for(let o in t){let n=t[o],r=yp(o,{parse:l=>typeof l=="string"&&Object.keys(n).includes(l)?l:void 0});e.set(o,{stateConfig:r,stateValues:n})}return e}function cn(t,e,o,n){t.update(()=>{wp(r=>{let l=e.get(o);if(!l)throw new Error(`State config for ${o} not found`);Lp(r,l.stateConfig,n)})})}function Zl({stateMap:t}){let[e]=Ep();return Ip(()=>e.registerMutationListener(Rp,o=>{e.getEditorState().read(()=>{for(let[n,r]of o){if(r==="destroyed")continue;let l=Sp(n),s=e.getElementByKey(n);if(!l||!s)continue;let i=Object.create(null);t.forEach((u,d)=>{let c=Np(l,u.stateConfig);if(!c){delete s.dataset[d];return}s.dataset[d]=c;let a=u.stateValues[c]?.css;a&&Object.assign(i,a)}),s.style.cssText="",Object.assign(s.style,i)}})}),[e]),null}var ql=(t,e)=>{let o=[];for(let r in t.state){let l=t.state[r];for(let s in l){let i=l[s];o.push({ChildComponent:()=>un(io,{css:i.css}),key:s,label:i.label,onSelect:({editor:u})=>{cn(u,e,r,s)}})}}return[{type:"dropdown",ChildComponent:()=>un(io,{css:{color:"var(--color-icon-secondary)"}}),items:[...[{ChildComponent:()=>un(io,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let l in t.state)cn(r,e,l,void 0)},order:1}],...o],key:"textState",order:30}]},vp=A(({props:t})=>{let e=Yl(t.state);return{plugins:[{Component:()=>Zl({stateMap:e}),position:"normal"}],toolbarFixed:{groups:ql(t,e)},toolbarInline:{groups:ql(t,e)}}});import{c as Kp}from"react/compiler-runtime";import{useLexicalComposerContext as Jp}from"@lexical/react/LexicalComposerContext";import{$createHeadingNode as Xp,$isHeadingNode as mi,HeadingNode as hi}from"@lexical/rich-text";import{$setBlocksType as Yp}from"@lexical/selection";import{$getSelection as Zp,$isRangeSelection as qp}from"lexical";import{useEffect as Qp}from"react";import{jsx as Ql}from"react/jsx-runtime";import"react";var Mp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm11 6a.5.5 0 0 0-.777-.416l-1.5 1a.5.5 0 1 0 .554.832l.723-.482V17.5a.5.5 0 0 0 1 0z",ei=({className:t})=>Ql("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ql("path",{d:Mp,fill:"currentColor"})});import{jsx as ti}from"react/jsx-runtime";import"react";var Ap="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm9.034 10.952c0 .303.245.548.548.548h2.97a.448.448 0 0 0 0-.896H17.48v-.04l.997-1.038q.562-.555.873-.945.314-.39.438-.711t.124-.653q0-.497-.245-.885a1.7 1.7 0 0 0-.684-.61A2.24 2.24 0 0 0 17.96 12a2.2 2.2 0 0 0-1.017.228 1.71 1.71 0 0 0-.888 1.13c-.064.268.168.495.444.495.275 0 .479-.236.595-.485l.019-.039q.12-.22.333-.338a1 1 0 0 1 .5-.121q.278 0 .495.11a.83.83 0 0 1 .341.312.9.9 0 0 1 .125.48q0 .245-.096.462t-.288.448-.48.529l-1.85 1.854a.55.55 0 0 0-.16.387",oi=({className:t})=>ti("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ti("path",{d:Ap,fill:"currentColor"})});import{jsx as ni,jsxs as Dp}from"react/jsx-runtime";import"react";var $p="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Op="M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68",ri=({className:t})=>Dp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ni("path",{d:$p,fill:"currentColor"}),ni("path",{d:Op,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as li,jsxs as Fp}from"react/jsx-runtime";import"react";var Pp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Bp="M18.85 17.5 V12.5 L16.5 15.85 H19.5",ii=({className:t})=>Fp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[li("path",{d:Pp,fill:"currentColor"}),li("path",{d:Bp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as si,jsxs as jp}from"react/jsx-runtime";import"react";var Hp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",zp="M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9",ai=({className:t})=>jp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[si("path",{d:Hp,fill:"currentColor"}),si("path",{d:zp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as ci,jsxs as Gp}from"react/jsx-runtime";import"react";var Up="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Wp="M18.85 12.55 C17.45 13.05 16.5 14.25 16.5 16 A1.5 1.5 0 1 1 19.5 16 A1.5 1.5 0 1 1 16.5 16",ui=({className:t})=>Gp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ci("path",{d:Up,fill:"currentColor"}),ci("path",{d:Wp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{HEADING as Vp}from"@lexical/markdown";var di=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`;return{...Vp,regExp:new RegExp(o)}};var pi=t=>{let e=Zp();Yp(e,()=>Xp(t))},fi={h1:ei,h2:oi,h3:ri,h4:ii,h5:ai,h6:ui},ef=A(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[oe(e.map((n,r)=>({ChildComponent:fi[n],isActive:({selection:l})=>{if(!qp(l))return!1;for(let s of l.getNodes()){if(mi(s)&&s.getTag()===n)continue;let i=s.getParent();if(!(mi(i)&&i.getTag()===n))return!1}return!0},key:n,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{pi(n)})},order:r+2})))];return{markdownTransformers:[di(e)],nodes:[hi],plugins:[{Component:tf,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[q(e.map(n=>({Icon:fi[n],key:`heading-${n.charAt(1)}`,keywords:["heading",n],label:({i18n:r})=>r.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:r})=>{r.update(()=>{pi(n)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}}),tf=t=>{let e=Kp(9),{clientProps:o}=t,{enabledHeadingSizes:n}=o,r;e[0]!==n?(r=n===void 0?["h1","h2","h3","h4","h5","h6"]:n,e[0]=n,e[1]=r):r=e[1];let l=r,s;e[2]!==l?(s=l.at(-1),e[2]=l,e[3]=s):s=e[3];let i=s,[u]=Jp(),d,c;return e[4]!==u||e[5]!==l||e[6]!==i?(d=()=>{if(!(!i||l.length===6))return u.registerNodeTransform(hi,a=>{l.includes(a.getTag())||a.setTag(i)})},c=[u,l,i],e[4]=u,e[5]=l,e[6]=i,e[7]=d,e[8]=c):(d=e[7],c=e[8]),Qp(d,c),null};import{$isNodeSelection as kf}from"lexical";import{jsx as gi}from"react/jsx-runtime";import"react";var of="M18 12a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1 0-1h11a.5.5 0 0 1 .5.5",dn=({className:t})=>gi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:gi("path",{d:of,fill:"currentColor"})});var be=t=>({type:"dropdown",ChildComponent:vr,items:t,key:"add",order:10});import{addClassNamesToElement as nf}from"@lexical/utils";import{$applyNodeReplacement as rf,createCommand as lf,DecoratorNode as sf}from"lexical";var Mt=lf("INSERT_HORIZONTAL_RULE_COMMAND"),vt=class extends sf{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:af,priority:0})}}static importJSON(e){return xi()}createDOM(e){let o=document.createElement("hr");return nf(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{...super.exportJSON(),type:"horizontalrule"}}getTextContent(){return`
55
- `}isInline(){return!1}updateDOM(){return!1}};function af(){return{node:xi()}}function xi(){return rf(new vt)}import{$applyNodeReplacement as cf}from"lexical";import"react";var ke=class extends vt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{hr:()=>({conversion:uf,priority:0})}}static importJSON(e){return je()}decorate(){return null}exportJSON(){return super.exportJSON()}};function uf(){return{node:je()}}function je(){return cf(new ke)}function He(t){return t instanceof ke}var Ci={type:"element",dependencies:[ke],export:(t,e)=>He(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=je();e&&t.replace(e)}};import{c as df}from"react/compiler-runtime";import{useLexicalComposerContext as mf}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as bi,$insertNodeToNearestRoot as pf}from"@lexical/utils";import{$getRoot as ff,$getSelection as ki,$isRangeSelection as _i,$isRootOrShadowRoot as Ti,COMMAND_PRIORITY_EDITOR as hf}from"lexical";import{useEffect as gf}from"react";var mn="LexicalEditorTheme__hrSelected",Ei=()=>{let t=df(3),[e]=mf(),o,n;return t[0]!==e?(o=()=>{let r=e.registerCommand(Mt,xf,hf),l=e.registerUpdateListener(s=>{let{editorState:i}=s;i.read(()=>{let d=ff().getChildren(),c=ki(),a=[];for(let x=0;x<d.length;x++){let b=d[x];if(He(b)){let k=e.getElementByKey(b.getKey());k&&a.push({element:k,index:x})}}if(a.length===0)return;if(!_i(c)||c.isCollapsed()){for(let{element:x}of a)x.classList.remove(mn);return}let m=c.anchor.getNode(),p=c.focus.getNode(),h=bi(m,Cf)||m,f=bi(p,bf)||p,g=d.indexOf(h),C=d.indexOf(f);if(g===-1||C===-1)return;let E=Math.min(g,C),L=Math.max(g,C);for(let{element:x,index:b}of a)b>=E&&b<=L?x.classList.add(mn):x.classList.remove(mn)})});return()=>{r(),l()}},n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),gf(o,n),null};function xf(t){let e=ki();if(!_i(e))return!1;if(e.focus.getNode()!==null){let n=je();pf(n)}return!0}function Cf(t){return Ti(t.getParent())}function bf(t){return Ti(t.getParent())}var _f=A({markdownTransformers:[Ci],nodes:[ke],plugins:[{Component:Ei,position:"normal"}],slashMenu:{groups:[q([{Icon:dn,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Mt,void 0)}}])]},toolbarFixed:{groups:[be([{ChildComponent:dn,isActive:({selection:t})=>{if(!kf(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return He(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(Mt,void 0)}}])]}});import{$findMatchingParent as Di}from"@lexical/utils";import{$isElementNode as Of,INDENT_CONTENT_COMMAND as Ff,OUTDENT_CONTENT_COMMAND as Pf}from"lexical";import{jsx as pn}from"react/jsx-runtime";import"react";var Tf="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",wi=({className:t})=>pn("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:pn("g",{transform:"scale(-1, 1) translate(-24, 0)",children:pn("path",{clipRule:"evenodd",d:Tf,fill:"currentColor",fillRule:"evenodd"})})});import{jsx as Si}from"react/jsx-runtime";import"react";var Ef="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Ni=({className:t})=>Si("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Si("path",{clipRule:"evenodd",d:Ef,fill:"currentColor",fillRule:"evenodd"})});import{jsx as wf}from"react/jsx-runtime";import{useLexicalComposerContext as Sf}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as Nf}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as Lf,mergeRegister as fn}from"@lexical/utils";import{$addUpdateTag as hn,$getSelection as Ri,$isElementNode as Ii,$isRangeSelection as vi,$isRootOrShadowRoot as yf,BLUR_COMMAND as Rf,COMMAND_PRIORITY_HIGH as so,COMMAND_PRIORITY_LOW as gn,FOCUS_COMMAND as If,INDENT_CONTENT_COMMAND as Li,KEY_ESCAPE_COMMAND as vf,KEY_TAB_COMMAND as yi,OUTDENT_CONTENT_COMMAND as Mf,SELECTION_CHANGE_COMMAND as Af,SKIP_DOM_SELECTION_TAG as xn,TabNode as Df}from"lexical";import{useEffect as Cn}from"react";var Mi=({clientProps:t})=>{let[e]=Sf(),{disabledNodes:o,disableTabNode:n}=t;return Cn(()=>{let r=!1,l=!1,s=()=>{r=!1},i,u,d;function c(){s(),l=!1}function a(f){if(f.key!=="Tab"||!r){["Escape","Shift","Tab"].includes(f.key)||s();return}let g=e.getRootElement();if(!g)return;s(),l=!0,f.stopPropagation(),i?.(),clearTimeout(u);let C=g.closest(".rich-text-lexical")??g,E=new Set([g,...C.querySelectorAll('[tabindex], [contenteditable="true"], a[href], button, input, select, textarea, summary, iframe, audio[controls], video[controls]')]),L=new Map;for(let x of E)L.set(x,x.getAttribute("tabindex")),x.setAttribute("tabindex","-1");i=()=>{for(let[x,b]of L)b===null?x.removeAttribute("tabindex"):x.setAttribute("tabindex",b);i=void 0},u=setTimeout(()=>i?.(),0),e.update(()=>hn(xn))}function m(f){if(f.key==="Escape"&&!f.defaultPrevented&&e.isEditable()){if(r&&!f.repeat)return;f.preventDefault(),f.stopPropagation(),r=!0}}let p=e.registerRootListener(f=>{d?.abort(),d=new AbortController;let{signal:g}=d;f?.addEventListener("pointerdown",c,{signal:g}),f?.addEventListener("keydown",a,{capture:!0,signal:g}),f?.addEventListener("keydown",m,{signal:g})}),h=fn(e.registerCommand(vf,f=>e.isEditable()?(m(f),!0):!1,gn),e.registerCommand(yi,()=>{let f=Ri();return vi(f)&&f.isCollapsed()&&yf(f.anchor.getNode())?(s(),l=!0,hn(xn),!0):!1},so),e.registerCommand(Rf,()=>(s(),!1),so),e.registerCommand(If,()=>(c(),!1),so),e.registerCommand(Af,()=>{let f=e.getRootElement();return l&&f?.ownerDocument.activeElement!==f&&hn(xn),!1},so));return()=>{h(),p(),d?.abort(),clearTimeout(u),i?.()}},[e]),Cn(()=>{if(!(!e||!o?.length))return fn(e.registerCommand(Li,()=>$f(r=>{if(!o.includes(r.getType())){let l=r.getIndent();r.setIndent(l+1)}}),gn),e.registerUpdateListener(({dirtyElements:r,editorState:l})=>{e.update(()=>{for(let[s]of r){let i=l._nodeMap.get(s);Ii(i)&&o.includes(i.getType())&&i.getIndent()>0&&i.setIndent(0)}})}))},[e,o]),Cn(()=>{if(!(!e||!n))return fn(e.registerCommand(yi,r=>(r.preventDefault(),e.dispatchCommand(r.shiftKey?Mf:Li,void 0)),gn),e.registerNodeTransform(Df,r=>{r.remove()}))},[e,n]),wf(Nf,{})};function $f(t){let e=Ri();if(!vi(e))return!1;let o=new Set,n=e.getNodes();for(let r=0;r<n.length;r++){let l=n[r],s=l.getKey();if(o.has(s))continue;let i=Lf(l,d=>Ii(d)&&!d.isInline());if(i===null)continue;let u=i.getKey();i.canIndent()&&!o.has(u)&&(o.add(u),t(i))}return o.size>0}var Ai=t=>({type:"buttons",items:t,key:"indent",order:35});var $i=({disabledNodes:t})=>[Ai([{ChildComponent:wi,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Oi(r)&&r.getIndent()>0;return o.some(r=>n(r)||!!Di(r,n))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Pf,void 0)},order:1},{ChildComponent:Ni,isActive:()=>!1,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Oi(r)&&!(t??[]).includes(r.getType());return o.some(r=>n(r)||!!Di(r,n))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ff,void 0)},order:2}])],Bf=A(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Mi,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:$i({disabledNodes:e})},toolbarInline:{groups:$i({disabledNodes:e})}}}),Oi=t=>Of(t)&&t.canIndent();import{$findMatchingParent as n0}from"@lexical/utils";import{$getSelection as yn,$isRangeSelection as Cs}from"lexical";import{jsx as Fi}from"react/jsx-runtime";import"react";var jf={16:"M8.38 6.381a.29.29 0 0 1 .347-.056q.293.161.541.408a2.5 2.5 0 0 1 0 3.535l-2 2a2.5 2.5 0 0 1-3.535-3.535l.571-.573c.25-.249.692-.107.81.224a.46.46 0 0 1-.098.478l-.576.578a1.5 1.5 0 1 0 2.121 2.12l2-2a1.5 1.5 0 0 0 0-2.12c-.23-.23-.493-.509-.358-.805a.9.9 0 0 1 .178-.254m.352-2.648a2.5 2.5 0 1 1 3.535 3.535l-.471.47c-.253.254-.717.082-.819-.261a.44.44 0 0 1 .102-.435l.481-.481A1.5 1.5 0 0 0 9.44 4.44l-2 2a1.5 1.5 0 0 0 0 2.12c.136.138.168.365.031.502l-.182.181c-.154.154-.403.179-.557.025a2.5 2.5 0 0 1 0-3.535z",24:"M12.4436 10.3708C12.6861 10.5041 12.9148 10.6721 13.1204 10.8776C14.2919 12.0492 14.2918 13.9482 13.1204 15.1198L11.1204 17.1198C9.94879 18.2914 8.04975 18.2914 6.87817 17.1198C5.70664 15.9482 5.70661 14.0492 6.87817 12.8776L8.1477 11.6071C8.4098 11.345 8.89329 11.5392 8.97388 11.9011C9.00617 12.0462 8.96861 12.2012 8.86353 12.3063L7.5852 13.5847C6.80417 14.3657 6.80419 15.6317 7.5852 16.4128C8.36625 17.1938 9.63228 17.1938 10.4133 16.4128L12.4133 14.4128C13.1942 13.6317 13.1943 12.3657 12.4133 11.5847C12.4042 11.5755 12.3953 11.5662 12.386 11.5573C12.2925 11.468 12.1984 11.3736 12.1614 11.2497C12.0724 10.9515 12.1448 10.6149 12.3801 10.3796C12.397 10.3628 12.4228 10.3594 12.4436 10.3708ZM12.8782 6.87764C14.0497 5.70615 15.9488 5.70616 17.1204 6.87764C18.2919 8.04919 18.2919 9.94825 17.1204 11.1198L15.8508 12.3903C15.5887 12.6522 15.1053 12.4581 15.0247 12.0964C14.9924 11.9512 15.0308 11.7963 15.136 11.6911L16.4133 10.4128C17.1943 9.63175 17.1943 8.3657 16.4133 7.58467C15.6323 6.80371 14.3662 6.8037 13.5852 7.58467L11.5852 9.58467C10.8046 10.3657 10.8044 11.6319 11.5852 12.4128C11.5943 12.4219 11.6042 12.4303 11.6135 12.4392C11.7064 12.5278 11.7999 12.622 11.8372 12.7448C11.9276 13.044 11.8545 13.3827 11.6184 13.6188C11.6023 13.6347 11.5778 13.6383 11.5579 13.6276C11.3146 13.4942 11.0843 13.3259 10.8782 13.1198C9.7068 11.9484 9.707 10.0492 10.8782 8.87764L12.8782 6.87764Z"},ao=({className:t,size:e=24})=>Fi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Fi("path",{d:jf[e],fill:"currentColor"})});import{$isAtNodeEnd as Pi}from"@lexical/selection";function it(t){let{anchor:e}=t,{focus:o}=t,n=t.anchor.getNode(),r=t.focus.getNode();return n===r?n:t.isBackward()?Pi(o)?n:r:Pi(e)?n:r}var bn=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as Qf}from"lexical";function kn(t){let e=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i;return t=String(t).trim(),t.match(e)!=null||t.match(o)!=null?t:"https://"}var Hf=/^(?:[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+)?$/,zf=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w\-]+)$/;function Bi(t){if(!t||t.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(t))return!1;if(t==="https://"||Hf.test(t)||zf.test(t))return!0;try{let e=new URL(t);return!(["ftp:","http:","https:"].includes(e.protocol)&&!e.hostname.includes("."))}catch{}return!1}import{addClassNamesToElement as Gf,isHTMLAnchorElement as Uf}from"@lexical/utils";import Hi from"bson-objectid";import{$applyNodeReplacement as Wf,$createTextNode as ji,$getSelection as Vf,$isElementNode as zi,$isRangeSelection as Tn,createCommand as Kf,ElementNode as Jf}from"lexical";var Xf=new Set(["http:","https:","mailto:","sms:","tel:"]),ne=class extends Jf{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:n}){super(n),this.__fields=o,this.__id=e}static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:Yf,priority:1})}}static importJSON(e){return _e({}).updateFromJSON(e)}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=_n(o.rel,"add","noopener")),Gf(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},n=this.getID();return n&&(o.id=n),o}extractWithChild(e,o,n){if(!Tn(o))return!1;let r=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(r)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(zi(n)){let r=_e({fields:this.__fields});return n.append(r),r}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!Xf.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,n){let r=this.__fields?.url,l=this.__fields?.newTab;return r!=null&&r!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=r),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=_n(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=_n(o.rel,"remove","noopener"))),!1}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields).setID(o.id)}};function Yf(t){let e=null;if(Uf(t)){let o=t.textContent;o!==null&&o!==""&&(e=_e({id:new Hi.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 Wf(new ne({id:t??new Hi.default().toHexString(),fields:e}))}function X(t){return t instanceof ne}var fe=Kf("TOGGLE_LINK_COMMAND");function En(t){let e=Vf();if(!Tn(e)&&(t===null||!t.selectedNodes?.length))return;let o=Tn(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let s=l.getParent();X(s)&&(s.getChildren().forEach(u=>{s.insertBefore(u)}),s.remove())});return}if(o?.length===1){let l=o[0],s=X(l)?l:Zf(l);if(s!==null){s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(ji(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}}let n=null,r=null;o?.forEach(l=>{let s=l.getParent();if(!(s===r||s===null||zi(l)&&!l.isInline())){if(X(s)){r=s,s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(ji(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}if(s.is(n)||(n=s,r=_e({fields:t.fields}),X(s)?l.getPreviousSibling()===null?s.insertBefore(r):s.insertAfter(r):l.insertBefore(r)),X(l)){if(l.is(r))return;if(r!==null){let i=l.getChildren();r.append(...i)}l.remove();return}r!==null&&r.append(l)}})}function Zf(t){return qf(t,e=>X(e))}function qf(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function _n(t,e,o){let n,r=`${t}`;if(e==="add"){if(r.includes(o)){let l=new RegExp(o,"g");r=r.replace(l,"").trim()}r=r.trim(),n=r.length===0?`${o}`:`${r} ${o}`}else{let l=new RegExp(o,"g");n=r.replace(l,"").trim()}return n}var e1=(t,e)=>{let[,o,n]=e,r=_e({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),l=Qf(o);return l.setFormat(t.getFormat()),r.append(l),t.replace(r),l},t1=t=>({type:"text-match",dependencies:[ne],export:(e,o)=>{if(!X(e))return null;let n=e,r=n.getFields(),l;return r.linkType==="internal"?t?.internalDocToHref?l=kn(t.internalDocToHref({linkNode:n.exportJSON()})):(console.warn("Lexical \u2192 Markdown converter: found internal link but internalDocToHref is not provided \u2014 link will have an empty href"),l=""):l=kn(r.url??""),`[${o(n)}](${l})`},importRegExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:e1,trigger:")"}),Gi=t1();import{$applyNodeReplacement as o1,$isElementNode as n1}from"lexical";var Te=class extends ne{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){return At({}).updateFromJSON(e)}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:e.version}}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(n1(n)){let r=At({fields:this.__fields});return n.append(r),r}return null}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields)}};function At({fields:t}){return o1(new Te({id:"",fields:t}))}function Ee(t){return t instanceof Te}import{c as r1}from"react/compiler-runtime";import{useLexicalComposerContext as l1}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as i1}from"@lexical/utils";import{$createTextNode as Ui,$getSelection as s1,$isElementNode as Vi,$isLineBreakNode as Ki,$isNodeSelection as a1,$isRangeSelection as c1,$isTextNode as Dt,TextNode as u1}from"lexical";import{useEffect as d1}from"react";function Wi(t,e=o=>o){return o=>{let n=t.exec(o);return n===null?null:{index:n.index,length:n[0].length,text:n[0],url:e(n[0])}}}function Ji(t,e){for(let o of e){let n=o(t);if(n!=null)return n}return null}var m1=/[.,;\s]/;function uo(t){return t!==void 0&&m1.test(t)}function Xi(t){return uo(t[t.length-1])}function Sn(t){return uo(t[0])}function p1(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function Yi(t){let e=t.getPreviousSibling();return Vi(e)&&(e=e.getLastDescendant()),e===null||Ki(e)||Dt(e)&&Xi(e.getTextContent())}function Zi(t){let e=t.getNextSibling();return Vi(e)&&(e=e.getFirstDescendant()),e===null||Ki(e)||Dt(e)&&Sn(e.getTextContent())}function f1(t,e,o,n){return(t>0?uo(o[t-1]):Yi(n[0]))?e<o.length?uo(o[e]):Zi(n[n.length-1]):!1}function h1(t,e,o){let n=[],r=[],l=[],s=0,i=0,u=[...t];for(;u.length>0;){let d=u[0],a=d.getTextContent().length,m=i;i+a<=e?(n.push(d),s+=a):m>=o?l.push(d):r.push(d),i+=a,u.shift()}return[s,n,r,l]}function g1(t,e,o,n){let r={linkType:"custom",url:n.url,...n.fields},l=At({fields:r});if(t.length===1){let s=t[0],i;if(e===0?[i]=s.splitText(o):[,i]=s.splitText(e,o),i){let u=Ui(n.text);u.setFormat(i.getFormat()),u.setDetail(i.getDetail()),u.setStyle(i.getStyle()),l.append(u),i.replace(l)}return s}else if(t.length>1){let s=t[0],i=s.getTextContent().length,u;e===0?u=s:[,u]=s.splitText(e);let d=[],c;if(t.forEach(a=>{let p=a.getTextContent().length,h=i,f=i+p;if(h<o)if(f<=o)d.push(a);else{let[g,C]=a.splitText(o-h);g&&d.push(g),c=C}i+=p}),u){let a=s1(),m=a?a.getNodes().find(Dt):void 0,p=Ui(u.getTextContent());return p.setFormat(u.getFormat()),p.setDetail(u.getDetail()),p.setStyle(u.getStyle()),l.append(p,...d),m&&m===u&&(c1(a)?p.select(a.anchor.offset,a.focus.offset):a1(a)&&p.select(0,p.getTextContent().length)),u.replace(l),c}}}function x1(t,e,o){let n=[...t],r=n.map(u=>u.getTextContent()).join(""),l=r,s,i=0;for(;(s=Ji(l,e))!=null&&s!==null;){let u=s.index,d=s.length,c=u+d;if(f1(i+u,i+c,r,n)){let[m,,p,h]=h1(n,i+u,i+c),f=i+u-m,g=i+c-m,C=g1(p,f,g,s);n=C?[C,...h]:h,o(s.url,null),i=0}else i+=c;l=l.substring(c)}}function wn(t,e,o){let n=t.getChildren(),r=n.length;for(let u=0;u<r;u++){let d=n[u];if(!Dt(d)||!d.isSimpleText()){co(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),s=Ji(l,e);if(s===null||s.text!==l){co(t),o(null,t.getFields()?.url??null);return}if(!Yi(t)||!Zi(t)){co(t),o(null,t.getFields()?.url??null);return}let i=t.getFields()?.url;if(i!==s?.url){let u=t.getFields();u.url=s?.url,t.setFields(u),o(s.url,i??null)}}function C1(t,e,o){let n=t.getPreviousSibling(),r=t.getNextSibling(),l=t.getTextContent();if(Ee(n)){let s=n.getFields()?.url?n.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Sn(l)||p1(l,s))&&(n.append(t),wn(n,e,o),o(null,n.getFields()?.url??null))}Ee(r)&&!Xi(l)&&(co(r),wn(r,e,o),o(null,r.getFields()?.url??null))}function co(t){let e=t.getChildren(),o=e.length;for(let n=o-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map(n=>n.getLatest())}function b1(t){let e=[t],o=t.getNextSibling();for(;o!==null&&Dt(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function k1(t,e,o){let n=r1(5),r,l;n[0]!==t||n[1]!==e||n[2]!==o?(r=()=>{if(!t.hasNodes([Te]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let s=(i,u)=>{o?.(i,u)};return i1(t.registerNodeTransform(u1,i=>{let u=i.getParentOrThrow(),d=i.getPreviousSibling();if(Ee(u))wn(u,e,s);else if(!X(u)){if(i.isSimpleText()&&(Sn(i.getTextContent())||!Ee(d))){let c=b1(i);x1(c,e,s)}C1(i,e,s)}}))},l=[t,e,o],n[0]=t,n[1]=e,n[2]=o,n[3]=r,n[4]=l):(r=n[3],l=n[4]),d1(r,l)}var _1=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,T1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,E1=[Wi(_1,t=>t.startsWith("http")?t:`https://${t}`),Wi(T1,t=>`mailto:${t}`)],qi=()=>{let[t]=l1();return k1(t,E1),null};import{jsx as w1}from"react/jsx-runtime";import{ClickableLinkPlugin as S1}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var Qi=()=>w1(S1,{});import{jsx as V1}from"react/jsx-runtime";import"react";import{createPortal as K1}from"react-dom";import{jsx as re,jsxs as ze,Fragment as Nn}from"react/jsx-runtime";import{useLexicalComposerContext as y1}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as R1}from"@lexical/react/useLexicalEditable";import{$findMatchingParent as ls,mergeRegister as is}from"@lexical/utils";import{getTranslation as Ln}from"@payloadcms/translations";import{formatDrawerSlug as I1,NewTabIcon as ss,useConfig as v1,useEditDepth as M1,useLocale as A1,useTranslation as D1,WriteIcon as $1}from"@payloadcms/ui";import{requests as O1}from"@payloadcms/ui/shared";import{$getSelection as as,$isLineBreakNode as F1,$isRangeSelection as cs,$onUpdate as P1,COMMAND_PRIORITY_HIGH as B1,COMMAND_PRIORITY_LOW as us,getDOMSelection as j1,KEY_ESCAPE_COMMAND as H1,SELECTION_CHANGE_COMMAND as z1}from"lexical";import{formatAdminURL as G1}from"payload/shared";import U1,{useCallback as ds,useEffect as fo,useLayoutEffect as W1,useRef as ms,useState as Ge}from"react";import{jsx as es}from"react/jsx-runtime";import"react";var N1="M12.5 5C12.6326 5 12.7597 5.05272 12.8535 5.14648L16.8535 9.14648C16.9965 9.28948 17.0393 9.50457 16.9619 9.69141C16.8845 9.87821 16.7022 10 16.5 10H12.5C12.2239 10 12 9.77614 12 9.5V6H8.5C8.22386 6 8 6.22386 8 6.5V17.5C8 17.7761 8.22386 18 8.5 18H15.5C15.7761 18 16 17.7761 16 17.5V11.5C16 11.2239 16.2239 11 16.5 11C16.7761 11 17 11.2239 17 11.5V17.5C17 18.3284 16.3284 19 15.5 19H8.5C7.67157 19 7 18.3284 7 17.5V6.5C7 5.67157 7.67157 5 8.5 5H12.5ZM13 9H15.293L13 6.70703V9Z",ts=({className:t})=>es("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:es("path",{d:N1,fill:"currentColor"})});import{jsx as os}from"react/jsx-runtime";import"react";var ns={default:"M6 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .496.5h12.008a.5.5 0 0 0 .496-.5v-1A.5.5 0 0 0 18 5zM4.5 6.5a1.5 1.5 0 0 0 1.037 1.427L5.725 10H5a.5.5 0 0 0 0 1h.816l.653 7.181A2 2 0 0 0 8.46 20h7.078a2 2 0 0 0 1.992-1.819L18.184 11H19a.5.5 0 0 0 0-1h-.725l.188-2.073A1.5 1.5 0 0 0 19.5 6.5v-1A1.5 1.5 0 0 0 18 4H6a1.5 1.5 0 0 0-1.5 1.5zm2.965 11.59L6.548 8h10.905l-.918 10.09a1 1 0 0 1-.996.91H8.461a1 1 0 0 1-.996-.91M11 10.5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0zm3 0a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z",small:"M6.5 7a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-.039l-.08 1H17a.5.5 0 0 1 0 1h-.7l-.455 5.62A1.5 1.5 0 0 1 14.35 18h-4.7a1.5 1.5 0 0 1-1.495-1.38L7.7 11H7a.5.5 0 0 1 0-1h.62l-.081-1H7.5a1 1 0 0 1-1-1zm9.494 1h.506V7h-9v1zm-.536 1H8.542l.61 7.54a.5.5 0 0 0 .498.46h4.7a.5.5 0 0 0 .499-.46zM11.5 11.5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0zm2 0a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0z"},rs=({className:t,small:e})=>os("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:os("path",{clipRule:"evenodd",d:e?ns.small:ns.default,fill:"currentColor",fillRule:"evenodd"})});function mo(t,e,o,n=10,r=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let s=o.getBoundingClientRect(),i=l.getBoundingClientRect(),u=t.top-n,d=t.left-r;e.style.width="max-content",e.style.maxWidth="none";let c=e.scrollWidth,a=i.right-d,m=d-i.left,p;if(c<=a)p=e.getBoundingClientRect();else{let h=m+t.width,f=m>a,C=Math.min(c,f?h:a);C<c&&(e.style.width=`${C}px`,e.style.maxWidth=`${C}px`,e.offsetHeight),f&&(d=t.right-C),p=e.getBoundingClientRect()}u<i.top&&(u+=p.height+t.height+n*2),d+p.width>i.right&&(d=i.right-p.width-r),u-=s.top,d-=s.left,e.style.opacity="1",e.style.transform=`translate(${d}px, ${u}px)`}import{createCommand as L1}from"lexical";var po=L1("TOGGLE_LINK_WITH_MODAL_COMMAND");function ps(t){t.preventDefault()}function fs({anchorElem:t}){let[e]=y1(),[o,n]=Ge(),r=ms(null),l=ms(null),[s,i]=Ge(null),[u,d]=Ge(null),{fieldProps:{schemaPath:c},uuid:a}=W(),m=R1(),{config:p,getEntityConfig:h}=v1(),{i18n:f,t:g}=D1(),[C,E]=Ge(),L=M1(),[x,b]=Ge(!1),[k,_]=Ge([]),T=A1(),[v,N]=Ge(!1),w=I1({slug:"lexical-rich-text-link-"+a,depth:L}),{toggleDrawer:y}=De(w),S=ds(()=>{b(!1),r&&r.current&&(r.current.style.opacity="0",r.current.style.transform="translate(-10000px, -10000px)"),N(!1),i(null),d(null),_([]),E(void 0)},[b,i,d,_]),R=ds(()=>{let I=as(),D;if(!cs(I)||!I){S();return}let F=it(I);D=e.getElementByKey(F.getKey())?.getBoundingClientRect();let M=ls(F,X),B=I.getNodes().filter(ie=>!F1(ie)).find(ie=>{let me=ls(ie,X);return M&&!M.is(me)||me&&!me.is(M)});if(M==null||B){S();return}n(M);let $=M.getFields(),P={...$,id:M.getID(),text:M.getTextContent()};if($?.linkType==="custom")i($?.url??null),d(null);else{i(`${p.routes.admin==="/"?"":p.routes.admin}/collections/${$?.doc?.relationTo}/${$?.doc?.value}`);let ie=$?.doc?.relationTo?h({collectionSlug:$?.doc?.relationTo}):void 0;if(!ie)d($?.label?String($?.label):null),i($?.url?String($?.url):null);else{let me=typeof $.doc?.value=="object"?$.doc.value.id:$.doc?.value,Ct=$.doc?.relationTo;if(!me||!Ct)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let Wt=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${g("lexical:link:loadingWithEllipsis",f)}`}).replace(/<[^>]*>?/g,"");d(Wt),O1.get(G1({apiRoute:p.routes.api,path:`/${Ct}/${me}`,serverURL:p.serverURL}),{headers:{"Accept-Language":f.language},params:{depth:0,locale:T?.code}}).then(async ce=>{if(!ce.ok)throw new Error(`HTTP error! Status: ${ce.status}`);let Ae=await ce.json(),Vt=ie?.admin?.useAsTitle||"id",Bo=Ae[Vt],bt=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${Bo}`}).replace(/<[^>]*>?/g,"");d(bt)}).catch(()=>{let ce=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${g("general:untitled",f)} - ID: ${me}`}).replace(/<[^>]*>?/g,"");d(ce)})}}E(P),b(!0),_(I?I?.getNodes():[]),Ee(M)?N(!0):N(!1);let V=r.current,Xe=j1(e._window),{activeElement:xt}=document;if(V===null)return;let Ye=e.getRootElement();return Xe!==null&&Ye!==null&&Ye.contains(Xe.anchorNode)?(D||(D=Xe.getRangeAt(0).getBoundingClientRect()),D!=null&&(D.y+=40,l.current=D)):(xt==null||xt.className!=="link-input")&&(Ye!==null&&mo(null,V,t),i(null),d(null)),!0},[e,S,p.routes.admin,p.routes.api,p.serverURL,h,g,f,T?.code,t]);return fo(()=>is(e.registerCommand(po,I=>(e.dispatchCommand(fe,I),R(),y(),!0),us)),[e,R,y,w]),fo(()=>{let I=t.parentElement,D=()=>{e.getEditorState().read(()=>{R()})};return window.addEventListener("resize",D),I?.addEventListener("scroll",D),()=>{window.removeEventListener("resize",D),I?.removeEventListener("scroll",D)}},[t.parentElement,e,R]),fo(()=>is(e.registerUpdateListener(({editorState:I})=>{I.read(()=>{R()})}),e.registerCommand(z1,()=>(P1(()=>e.read("latest",R)),!0),us),e.registerCommand(H1,I=>x?(I.preventDefault(),I.stopImmediatePropagation(),S(),!0):!1,B1)),[e,R,x,S]),fo(()=>{e.getEditorState().read(()=>{R()})},[e,R]),W1(()=>{!x||!r.current||!t||!l.current||mo(l.current,r.current,t)},[s,u,x,t,o]),ze(U1.Fragment,{children:[re("div",{className:"link-editor","data-theme":"dark",hidden:!x,ref:r,children:ze("div",{className:"link-input",children:[o?.__fields?.linkType==="custom"?re(ao,{}):re(ts,{}),s&&s.length>0?ze("a",{className:"link-input__url",href:s,rel:"noopener noreferrer",target:"_blank",children:[u!=null&&u.length>0?u:s,o?.__fields.newTab?ze(Nn,{children:[re(ss,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):u!=null&&u.length>0?ze(Nn,{children:[re("span",{className:"link-input__label-pure",children:u}),o?.__fields.newTab?ze(Nn,{children:[re(ss,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):null,m&&ze("div",{className:"link-input__actions",children:[re("button",{"aria-label":"Edit link",className:"link-edit",onClick:I=>{I.preventDefault(),y()},onMouseDown:ps,tabIndex:0,type:"button",children:re($1,{})}),!v&&re("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(fe,null)},onMouseDown:ps,tabIndex:0,type:"button",children:re(rs,{small:!0})})]})]})}),re(Wo,{className:"lexical-link-edit-drawer",data:C,drawerSlug:w,drawerTitle:g("fields:editLink"),featureKey:"link",handleDrawerSubmit:(I,D)=>{let F=D,M={...F};delete M.text,e.update(()=>{let B=as(),$=null;if(cs(B)?$=it(B).getParent():k.length&&($=k[0]?.getParent()??null),$&&Ee($)){let P=_e({fields:M});$.replace(P,!0)}}),e.dispatchCommand(fe,{fields:M,selectedNodes:k,text:F.text})},schemaPath:c,schemaPathSuffix:"fields"})]})}var hs=t=>{let{anchorElem:e=document.body}=t;return K1(V1(fs,{anchorElem:e}),e)};import{c as J1}from"react/compiler-runtime";import{useLexicalComposerContext as X1}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Y1}from"@lexical/utils";import{$getSelection as Z1,$isElementNode as q1,$isRangeSelection as Q1,COMMAND_PRIORITY_LOW as gs,PASTE_COMMAND as e0}from"lexical";import{useEffect as t0}from"react";var xs=t=>{let e=J1(5),{clientProps:o}=t,[n]=X1(),r,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==n?(r=()=>{if(!n.hasNodes([ne]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Y1(n.registerCommand(fe,s=>s===null?(En(null),!0):(s.fields?.linkType||(s.fields.linkType=o.defaultLinkType),s.fields?.url||(s.fields.url=o.defaultLinkURL),En(s),!0),gs),n.registerCommand(e0,s=>{let i=Z1();if(!Q1(i)||i.isCollapsed()||!(s instanceof ClipboardEvent)||s.clipboardData==null)return!1;let u=s.clipboardData.getData("text");if(!Bi(u))return!1;if(!i.getNodes().some(o0)){let d={doc:null,linkType:"custom",newTab:!1,url:u};return n.dispatchCommand(fe,{fields:d,text:null}),s.preventDefault(),!0}return!1},gs))},l=[o.defaultLinkType,o.defaultLinkURL,n],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=n,e[3]=r,e[4]=l):(r=e[3],l=e[4]),t0(r,l),null};function o0(t){return q1(t)}var bs=[bn([{ChildComponent:ao,isActive:({selection:t})=>{if(Cs(t)){let e=it(t);return n0(e,X)!=null}return!1},isEnabled:({selection:t})=>!!(Cs(t)&&yn()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(fe,null);else{let o,n=[];if(t.getEditorState().read(()=>{o=yn()?.getTextContent(),n=yn()?.getNodes()??[]}),!o?.length)return;let r={doc:null};t.dispatchCommand(po,{fields:r,selectedNodes:n,text:o})}},order:1}])],r0=A(({props:t})=>({markdownTransformers:[Gi],nodes:[ne,t?.disableAutoLinks===!0?null:Te].filter(Boolean),plugins:[{Component:xs,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:qi,position:"normal"},{Component:Qi,position:"normal"},{Component:hs,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:bs},toolbarInline:{groups:bs}}));import{$isListNode as In,INSERT_CHECK_LIST_COMMAND as Es,ListItemNode as u0,ListNode as d0}from"@lexical/list";import{CHECK_LIST as m0}from"@lexical/markdown";import{$isRangeSelection as p0}from"lexical";import{jsx as ks}from"react/jsx-runtime";import"react";var l0={16:"M5.584 8.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM13 10a.5.5 0 0 1 0 1H8a.5.5 0 0 1 0-1zM5.583 3.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 0 1 .708-.707l.568.569zM13 5a.5.5 0 1 1 0 1H8a.5.5 0 0 1 0-1z",24:"M9.084 15.223a.5.5 0 1 1 .832.554l-2 3a.5.5 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM17.5 17a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zm-8.416-6.777a.5.5 0 0 1 .832.554l-2 3a.5.5 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.707l.568.568zM17.5 12a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zM9.084 5.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.708l.568.569zM17.5 7a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1z"},Rn=({className:t,size:e=24})=>ks("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:ks("path",{d:l0[e],fill:"currentColor"})});import{jsx as i0}from"react/jsx-runtime";import{ListPlugin as s0}from"@lexical/react/LexicalListPlugin.js";import"react";var st=()=>i0(s0,{});function ho(t,e){return t==="ordered"?!e.has("unorderedList"):t==="checklist"?!e.has("unorderedList")&&!e.has("orderedList"):!1}function at(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{jsx as a0}from"react/jsx-runtime";import{CheckListPlugin as c0}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var _s=()=>a0(c0,{});var Ts=[oe([{ChildComponent:Rn,isActive:({selection:t})=>{if(!p0(t))return!1;for(let e of t.getNodes()){if(In(e)&&e.getListType()==="check")continue;let o=e.getParent();if(In(o)&&o.getListType()==="check")continue;let n=o?.getParent();if(!(In(n)&&n.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(Es,void 0)},order:12}])],f0=A(({featureProviderMap:t})=>{let e=[{Component:_s,position:"normal"}],o=ho("checklist",t);return o&&e.push({Component:st,position:"normal"}),{markdownTransformers:[m0],nodes:o?[d0,u0]:[],plugins:e,slashMenu:{groups:[at([{Icon:Rn,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:n})=>n.t("lexical:checklist:label"),onSelect:({editor:n})=>{n.dispatchCommand(Es,void 0)}}])]},toolbarFixed:{groups:Ts},toolbarInline:{groups:Ts}}});import{$isListNode as Mn,INSERT_ORDERED_LIST_COMMAND as Ns,ListItemNode as g0,ListNode as x0}from"@lexical/list";import{ORDERED_LIST as C0}from"@lexical/markdown";import{$isRangeSelection as b0}from"lexical";import{jsx as ws}from"react/jsx-runtime";import"react";var h0={16:"M5.6 9.01a.5.5 0 0 1 .4.49v1a.5.5 0 0 1-.276.447L4 11.81V12h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-1l.005-.07a.5.5 0 0 1 .271-.377L5 10.19V10H3.5a.5.5 0 0 1 0-1h2zM12.5 12a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zm0-4.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zM4.6 3.01a.5.5 0 0 1 .4.49v3a.5.5 0 0 1-1 0V4h-.5a.5.5 0 0 1 0-1h1zM12.5 3a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1z",24:"M11 7a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6A.5.5 0 0 1 11 7M6 7a.5.5 0 0 1 .5-.5h1A.5.5 0 0 1 8 7v3.5a.5.5 0 1 1-1 0v-3h-.5A.5.5 0 0 1 6 7m0 6.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.276.447L7 16.31v.191h1.5a.5.5 0 0 1 0 1h-2A.5.5 0 0 1 6 17v-1a.5.5 0 0 1 .276-.447L8 14.69V14H6.5a.5.5 0 0 1-.5-.5m5.5 3a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1zm0-5a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1z"},vn=({className:t,size:e=24})=>ws("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:ws("path",{clipRule:"evenodd",d:h0[e],fill:"currentColor",fillRule:"evenodd"})});var Ss=[oe([{ChildComponent:vn,isActive:({selection:t})=>{if(!b0(t))return!1;for(let e of t.getNodes()){if(Mn(e)&&e.getListType()==="number")continue;let o=e.getParent();if(Mn(o)&&o.getListType()==="number")continue;let n=o?.getParent();if(!(Mn(n)&&n.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ns,void 0)},order:10}])],k0=A(({featureProviderMap:t})=>{let e=ho("ordered",t);return{markdownTransformers:[C0],nodes:e?[x0,g0]:[],plugins:e?[{Component:st,position:"normal"}]:[],slashMenu:{groups:[at([{Icon:vn,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:o})=>o.t("lexical:orderedList:label"),onSelect:({editor:o})=>{o.dispatchCommand(Ns,void 0)}}])]},toolbarFixed:{groups:Ss},toolbarInline:{groups:Ss}}});import{$isListNode as Dn,INSERT_UNORDERED_LIST_COMMAND as Rs,ListItemNode as T0,ListNode as E0}from"@lexical/list";import{UNORDERED_LIST as w0}from"@lexical/markdown";import{$isRangeSelection as S0}from"lexical";import{jsx as Ls}from"react/jsx-runtime";import"react";var _0="M7 16C7.55228 16 8 16.4477 8 17C8 17.5523 7.55228 18 7 18C6.44772 18 6 17.5523 6 17C6 16.4477 6.44772 16 7 16ZM17.5 16.5C17.7761 16.5 18 16.7239 18 17C18 17.2761 17.7761 17.5 17.5 17.5H10.5C10.2239 17.5 10 17.2761 10 17C10 16.7239 10.2239 16.5 10.5 16.5H17.5ZM7 11C7.55228 11 8 11.4477 8 12C8 12.5523 7.55228 13 7 13C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11ZM17.5 11.5C17.7761 11.5 18 11.7239 18 12C18 12.2761 17.7761 12.5 17.5 12.5H10.5C10.2239 12.5 10 12.2761 10 12C10 11.7239 10.2239 11.5 10.5 11.5H17.5ZM7 6C7.55228 6 8 6.44772 8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7C6 6.44772 6.44772 6 7 6ZM17.5 6.5C17.7761 6.5 18 6.72386 18 7C18 7.27614 17.7761 7.5 17.5 7.5H10.5C10.2239 7.5 10 7.27614 10 7C10 6.72386 10.2239 6.5 10.5 6.5H17.5Z",An=({className:t})=>Ls("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Ls("path",{d:_0,fill:"currentColor"})});var ys=[oe([{ChildComponent:An,isActive:({selection:t})=>{if(!S0(t))return!1;for(let e of t.getNodes()){if(Dn(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(Dn(o)&&o.getListType()==="bullet")continue;let n=o?.getParent();if(!(Dn(n)&&n.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Rs,void 0)},order:11}])],N0=A({markdownTransformers:[w0],nodes:[E0,T0],plugins:[{Component:st,position:"normal"}],slashMenu:{groups:[at([{Icon:An,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(Rs,void 0)}}])]},toolbarFixed:{groups:ys},toolbarInline:{groups:ys}});import{$setBlocksType as Ms}from"@lexical/selection";import{$createParagraphNode as As,$getSelection as Ds,$isParagraphNode as Is,$isRangeSelection as L0}from"lexical";var vs=[oe([{ChildComponent:Nt,isActive:({selection:t})=>{if(!L0(t))return!1;for(let e of t.getNodes())if(!Is(e)&&!Is(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Ds();Ms(e,()=>As())})},order:1}])],y0=A({slashMenu:{groups:[q([{Icon:Nt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Ds();Ms(e,()=>As())})}}])]},toolbarFixed:{groups:vs},toolbarInline:{groups:vs}});import{c as Z0}from"react/compiler-runtime";import{jsx as oa}from"react/jsx-runtime";import{useLexicalComposerContext as q0}from"@lexical/react/LexicalComposerContext";import{useEffect as Q0,useState as eh}from"react";import{jsx as ta,Fragment as Y0}from"react/jsx-runtime";import"react";import{jsx as R0}from"react/jsx-runtime";var $s={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return R0("blockquote",{children:o})}};import{jsx as I0}from"react/jsx-runtime";var Os=new Set(["h1","h2","h3","h4","h5","h6"]);var Fs={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=Os.has(t.tag)?t.tag:"h1";return I0(n,{children:o})}};import{jsx as v0}from"react/jsx-runtime";var Ps={horizontalrule:v0("hr",{})};import{jsx as M0}from"react/jsx-runtime";var Bs={linebreak:M0("br",{})};import{jsx as js}from"react/jsx-runtime";var Hs=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return js("a",{href:e.fields.url,rel:r,target:l,children:n})},link:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,s=e.fields.url??"";return e.fields.linkType==="internal"&&(t?s=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),js("a",{href:s,rel:r,target:l,children:n})}});import{jsx as ct,jsxs as A0,Fragment as D0}from"react/jsx-runtime";import{v4 as $0}from"uuid";var zs=new Set(["ol","ul"]);var Gs={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=zs.has(t.tag)?t.tag:"ul";return ct(n,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let n=t.children.some(l=>l.type==="list"),r=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=$0();return ct("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${n?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:n?r:A0(D0,{children:[ct("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),ct("label",{htmlFor:l,children:r}),ct("br",{})]})})}else return ct("li",{className:`${n?"nestedListItem":""}`,style:n?{listStyleType:"none"}:void 0,value:t?.value,children:r})}};import{jsx as $n}from"react/jsx-runtime";var Us={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?$n("p",{children:o}):$n("p",{children:$n("br",{})})}};var Ws={tab:" "};import{jsx as $t}from"react/jsx-runtime";var Vs={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return $t("div",{className:"lexical-table-container",children:$t("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:$t("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.headerState>0?"th":"td",r=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},s=t.colSpan&&t.colSpan>1?t.colSpan:void 0,i=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return $t(n,{className:`lexical-table-cell ${r}`,colSpan:s,rowSpan:i,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return $t("tr",{className:"lexical-table-row",children:o})}};import{jsx as Ue}from"react/jsx-runtime";import"react";var O={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},O0=O.IS_BOLD|O.IS_ITALIC|O.IS_STRIKETHROUGH|O.IS_UNDERLINE|O.IS_CODE|O.IS_SUBSCRIPT|O.IS_SUPERSCRIPT|O.IS_HIGHLIGHT,F0="\xA0",P0=`
54
+ `},[t,e]),m=Be((b,x)=>{o(_=>{let k=e.length-1,T=e[k];if(T&&T.name===b){if(b==="type")return[...e.slice(0,k),{...T,value:T.value+x}];if(T.value===x)return[...e.slice(0,k),{...T,count:T.count+1}]}return[..._,{name:b,count:1,value:x}]})},[e,o]);Sl(()=>{let b=_=>{if(!n)return;let k=_.key;Im(_)?m("selectAll",""):Ll.has(k)?m("press",_.key):[...k].length>1?m("keydown",_.key):m("type",_.key)},x=_=>{if(!n)return;let k=_.key;!Ll.has(k)&&[...k].length>1&&m("keyup",_.key)};return t.registerRootListener((_,k)=>{k!==null&&(k.removeEventListener("keydown",b),k.removeEventListener("keyup",x)),_!==null&&(_.addEventListener("keydown",b),_.addEventListener("keyup",x))})},[t,n,m]),Sl(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[p]),ln(()=>{if(e){let b=p();b!==null&&i(b),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[p,e]),ln(()=>t.registerUpdateListener(({dirtyElements:x,dirtyLeaves:_,editorState:k})=>{if(!n)return;let T=k._selection,y=c.current,E=u.current;if(y!==T){if(_.size===0&&x.size===0&&!E){let R=rn(t._window);if(R&&(R.anchorNode==null||R.focusNode==null))return}c.current=T}u.current=!1;let w=p();w!==null&&i(w)}),[t,p,n,m]),ln(()=>n?t.registerUpdateListener(()=>{let x=t.getRootElement();x!==null&&l(x?.innerHTML)}):void 0,[t,n]);let h=Be(b=>{n||(b.update(()=>{let x=Nm();x.clear();let _=Sm();x.append(wm().append(_)),_.select()}),o([])),r(x=>!x)},[n]),f=Be(()=>{if(!n)return;let b=rn(t._window);if(b===null||b.anchorNode==null||b.focusNode==null)return;let{anchorNode:x,anchorOffset:_,focusNode:k,focusOffset:T}=vm(b),y=a().getRootElement(),E;x!==null&&(E=Nl(x,y));let w;k!==null&&(w=Nl(k,y)),m("snapshot",{anchorNode:x,anchorOffset:_,anchorPath:E,focusNode:k,focusOffset:T,focusPath:w})},[m,n,a]),g=Be(()=>{Lm(p())},[p]),C=Be(()=>{ym("test.js",p())},[p]);return[je("button",{className:`editor-dev-button ${n?"active":""}`,id:"test-recorder-button",onClick:b=>{h(a()),b.preventDefault()},title:n?"Disable test recorder":"Enable test recorder",type:"button",children:n?"Disable test recorder":"Enable test recorder"}),n?an("div",{className:"test-recorder-output",children:[an("div",{className:"test-recorder-toolbar",children:[je("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:b=>{f(),b.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),je("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:b=>{g(),b.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),je("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:b=>{C(),b.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),je("pre",{id:"test-recorder",ref:d,children:s})]}):null]}var Rl=()=>{let t=Tm(3),[e]=Em(),[o,n]=Mm(e),r;return t[0]!==o||t[1]!==n?(r=an(yl.Fragment,{children:[je("p",{children:"HI"}),o,n,je("p",{children:"DONE"})]}),t[0]=o,t[1]=n,t[2]=r):r=t[2],r};var Am=A({plugins:[{Component:Rl,position:"bottom"}]});import{c as Dm}from"react/compiler-runtime";import{jsx as $m}from"react/jsx-runtime";import{useLexicalComposerContext as Om}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Fm}from"@lexical/react/LexicalTreeView.js";import"react";var Il=()=>{let t=Dm(2),[e]=Om(),o;return t[0]!==e?(o=$m(Fm,{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 Pm=A({plugins:[{Component:Il,position:"bottom"}]});import{BOLD_ITALIC_STAR as jm,BOLD_ITALIC_UNDERSCORE as Hm,BOLD_STAR as zm,BOLD_UNDERSCORE as Gm}from"@lexical/markdown";import{$isTableSelection as Um}from"@lexical/table";import{$isRangeSelection as Wm,FORMAT_TEXT_COMMAND as Vm}from"lexical";import{jsx as vl}from"react/jsx-runtime";import"react";var Bm="M14.5 9.25A1.75 1.75 0 0 1 12.75 11H9.5V7.5h3.25c.966 0 1.75.784 1.75 1.75M8 11V7.5A1.5 1.5 0 0 1 9.5 6h3.25a3.25 3.25 0 0 1 2.418 5.422A3.5 3.5 0 0 1 13.5 18h-4A1.5 1.5 0 0 1 8 16.5zm1.5 1.5v4h4a2 2 0 1 0 0-4z",Ml=({className:t})=>vl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vl("path",{clipRule:"evenodd",d:Bm,fill:"currentColor",fillRule:"evenodd"})});var Q=t=>({type:"buttons",items:t,key:"format",order:40});var Al=[Q([{ChildComponent:Ml,isActive:({selection:t})=>Wm(t)||Um(t)?t.hasFormat("bold"):!1,key:"bold",onSelect:({editor:t})=>{t.dispatchCommand(Vm,"bold")},order:1}])],Km=A(({featureProviderMap:t})=>{let e=[zm,Gm];return t.get("italic")&&e.push(Hm,jm),{enableFormats:["bold"],markdownTransformers:e,toolbarFixed:{groups:Al},toolbarInline:{groups:Al}}});import{INLINE_CODE as Xm}from"@lexical/markdown";import{$isTableSelection as Ym}from"@lexical/table";import{$isRangeSelection as Zm,FORMAT_TEXT_COMMAND as qm}from"lexical";import{jsx as Dl}from"react/jsx-runtime";import"react";var Jm="M9.64645 8.14645C9.84171 7.95118 10.1582 7.95118 10.3535 8.14645C10.5487 8.34171 10.5487 8.65822 10.3535 8.85348L7.20699 12L10.3535 15.1464C10.5487 15.3417 10.5487 15.6582 10.3535 15.8535C10.1582 16.0487 9.84171 16.0487 9.64645 15.8535L6.14645 12.3535C5.95118 12.1582 5.95118 11.8417 6.14645 11.6464L9.64645 8.14645ZM13.6464 8.14645C13.8417 7.95118 14.1582 7.95118 14.3535 8.14645L17.8535 11.6464C18.0487 11.8417 18.0487 12.1582 17.8535 12.3535L14.3535 15.8535C14.1582 16.0487 13.8417 16.0487 13.6464 15.8535C13.4512 15.6582 13.4512 15.3417 13.6464 15.1464L16.7929 12L13.6464 8.85348C13.4512 8.65822 13.4512 8.34171 13.6464 8.14645Z",$l=({className:t})=>Dl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Dl("path",{clipRule:"evenodd",d:Jm,fill:"currentColor",fillRule:"evenodd"})});var Ol=[Q([{ChildComponent:$l,isActive:({selection:t})=>Zm(t)||Ym(t)?t.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:t})=>{t.dispatchCommand(qm,"code")},order:7}])],Qm=A({enableFormats:["code"],markdownTransformers:[Xm],toolbarFixed:{groups:Ol},toolbarInline:{groups:Ol}});import{ITALIC_STAR as tp,ITALIC_UNDERSCORE as op}from"@lexical/markdown";import{$isTableSelection as np}from"@lexical/table";import{$isRangeSelection as rp,FORMAT_TEXT_COMMAND as lp}from"lexical";import{jsx as Fl}from"react/jsx-runtime";import"react";var ep="M10 6.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-2.083L11.6 17h1.9a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h2.083L12.4 7h-1.9a.5.5 0 0 1-.5-.5",Pl=({className:t})=>Fl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Fl("path",{clipRule:"evenodd",d:ep,fill:"currentColor",fillRule:"evenodd"})});var Bl=[Q([{ChildComponent:Pl,isActive:({selection:t})=>rp(t)||np(t)?t.hasFormat("italic"):!1,key:"italic",onSelect:({editor:t})=>{t.dispatchCommand(lp,"italic")},order:2}])],ip=A({enableFormats:["italic"],markdownTransformers:[tp,op],toolbarFixed:{groups:Bl},toolbarInline:{groups:Bl}});import{STRIKETHROUGH as ap}from"@lexical/markdown";import{$isTableSelection as cp}from"@lexical/table";import{$isRangeSelection as up,FORMAT_TEXT_COMMAND as dp}from"lexical";import{jsx as jl}from"react/jsx-runtime";import"react";var sp="M15.835 13.5a.27.27 0 0 1 .24.138q.306.554.306 1.316 0 1.01-.543 1.816-.543.8-1.554 1.268-1.01.462-2.409.462-1.323 0-2.295-.419-.972-.424-1.534-1.175a3.2 3.2 0 0 1-.533-1.135c-.082-.326.187-.614.522-.614.299 0 .539.233.625.519q.13.43.415.768.448.524 1.17.8.73.271 1.63.272.996 0 1.764-.32.773-.327 1.215-.906a2.16 2.16 0 0 0 .44-1.348q0-.645-.345-1.09c-.1-.132-.016-.352.15-.352zm-3.846-8q1.215 0 2.142.438.933.43 1.476 1.187.38.518.519 1.134c.07.31-.19.577-.507.577-.286 0-.518-.22-.6-.493q-.22-.738-.875-1.224-.864-.646-2.18-.646-.92 0-1.63.313-.703.308-1.1.85a2.04 2.04 0 0 0-.395 1.237q0 .492.217.874.216.376.588.652.376.278.843.475.474.197.972.338l1.052.288H18.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1h3.94a4.4 4.4 0 0 1-.844-.602q-.844-.781-.844-1.982 0-1.009.562-1.778t1.522-1.2q.959-.438 2.153-.438",Hl=({className:t})=>jl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:jl("path",{d:sp,fill:"currentColor"})});var zl=[Q([{ChildComponent:Hl,isActive:({selection:t})=>up(t)||cp(t)?t.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:t})=>{t.dispatchCommand(dp,"strikethrough")},order:4}])],mp=A({enableFormats:["strikethrough"],markdownTransformers:[ap],toolbarFixed:{groups:zl},toolbarInline:{groups:zl}});import{$isTableSelection as fp}from"@lexical/table";import{$isRangeSelection as hp,FORMAT_TEXT_COMMAND as gp}from"lexical";import{jsx as Gl}from"react/jsx-runtime";import"react";var pp="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652 3.925a.436.436 0 0 1-.287-.765l1.64-1.431q.259-.228.433-.407.175-.178.266-.345a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.195-.4 0-.643.21a.7.7 0 0 0-.133.151c-.127.197-.3.403-.534.403s-.432-.194-.367-.418q.11-.378.434-.642.494-.402 1.257-.403.513 0 .897.183.387.181.604.501.217.316.217.714 0 .316-.13.586-.125.27-.395.555a9 9 0 0 1-.695.634l-.927.798a.023.023 0 0 0 .016.042h1.895a.357.357 0 0 1 0 .714z",Ul=({className:t})=>Gl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Gl("path",{d:pp,fill:"currentColor"})});var Wl=[Q([{ChildComponent:Ul,isActive:({selection:t})=>hp(t)||fp(t)?t.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:t})=>{t.dispatchCommand(gp,"subscript")},order:5}])],bp=A({enableFormats:["subscript"],toolbarFixed:{groups:Wl},toolbarInline:{groups:Wl}});import{$isTableSelection as Cp}from"@lexical/table";import{$isRangeSelection as kp,FORMAT_TEXT_COMMAND as _p}from"lexical";import{jsx as Vl}from"react/jsx-runtime";import"react";var xp="M7.51 15.65a.523.523 0 1 1-.985-.352l2.377-6.534a.83.83 0 0 1 1.56 0l2.374 6.534a.523.523 0 1 1-.985.351L9.722 9.57a.043.043 0 0 0-.08 0zm.162-2.238c0-.252.204-.456.456-.456h3.1a.456.456 0 0 1 0 .912h-3.1a.456.456 0 0 1-.456-.456m6.652-1.303a.436.436 0 0 1-.287-.765l1.64-1.432q.259-.228.433-.406.175-.179.266-.346a.76.76 0 0 0 .091-.365.61.61 0 0 0-.258-.52q-.255-.195-.63-.194-.4 0-.643.209a.7.7 0 0 0-.133.152c-.127.196-.3.403-.534.403s-.432-.194-.367-.419q.11-.378.434-.641.494-.403 1.257-.403.513 0 .897.182.387.183.604.502.217.315.217.714 0 .315-.13.585-.125.27-.395.555a9 9 0 0 1-.695.635l-.927.798a.023.023 0 0 0 .016.041h1.895a.357.357 0 1 1 0 .715z",Kl=({className:t})=>Vl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Vl("path",{d:xp,fill:"currentColor"})});var Jl=[Q([{ChildComponent:Kl,isActive:({selection:t})=>kp(t)||Cp(t)?t.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:t})=>{t.dispatchCommand(_p,"superscript")},order:6}])],Tp=A({enableFormats:["superscript"],toolbarFixed:{groups:Jl},toolbarInline:{groups:Jl}});import{$isTableSelection as wp}from"@lexical/table";import{$isRangeSelection as Sp,FORMAT_TEXT_COMMAND as Np}from"lexical";import{jsx as Xl}from"react/jsx-runtime";import"react";var Ep="M9 7.5a.5.5 0 0 0-1 0V12a4 4 0 0 0 8 0V7.5a.5.5 0 0 0-1 0V12a3 3 0 1 1-6 0zM16.5 19a.5.5 0 0 0 0-1h-9a.5.5 0 0 0 0 1z",Yl=({className:t})=>Xl("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Xl("path",{clipRule:"evenodd",d:Ep,fill:"currentColor",fillRule:"evenodd"})});var Zl=[Q([{ChildComponent:Yl,isActive:({selection:t})=>Sp(t)||wp(t)?t.hasFormat("underline"):!1,key:"underline",onSelect:({editor:t})=>{t.dispatchCommand(Np,"underline")},order:3}])],Lp=A({enableFormats:["underline"],toolbarFixed:{groups:Zl},toolbarInline:{groups:Zl}});import{jsx as un}from"react/jsx-runtime";import{jsx as yp}from"react/jsx-runtime";function Rp(t){return t.replace(/-([a-z])/g,(e,o)=>o.toUpperCase())}var lo=({css:t})=>{let e=t?Object.fromEntries(Object.entries(t).map(([o,n])=>[Rp(o),n])):{};return yp("span",{style:{...e,alignItems:"center",borderRadius:"4px",display:"flex",fontSize:"16px",height:"20px",justifyContent:"center",width:"20px"},children:"A"})};import{useLexicalComposerContext as Ip}from"@lexical/react/LexicalComposerContext";import{$forEachSelectedTextNode as vp}from"@lexical/selection";import{$getNodeByKey as Mp,$getState as Ap,$setState as Dp,createState as $p,TextNode as Op}from"lexical";import{useEffect as Fp}from"react";function ql(t){let e=new Map;for(let o in t){let n=t[o],r=$p(o,{parse:l=>typeof l=="string"&&Object.keys(n).includes(l)?l:void 0});e.set(o,{stateConfig:r,stateValues:n})}return e}function cn(t,e,o,n){t.update(()=>{vp(r=>{let l=e.get(o);if(!l)throw new Error(`State config for ${o} not found`);Dp(r,l.stateConfig,n)})})}function Ql({stateMap:t}){let[e]=Ip();return Fp(()=>e.registerMutationListener(Op,o=>{e.getEditorState().read(()=>{for(let[n,r]of o){if(r==="destroyed")continue;let l=Mp(n),s=e.getElementByKey(n);if(!l||!s)continue;let i=Object.create(null);t.forEach((c,u)=>{let d=Ap(l,c.stateConfig);if(!d){delete s.dataset[u];return}s.dataset[u]=d;let a=c.stateValues[d]?.css;a&&Object.assign(i,a)}),s.style.cssText="",Object.assign(s.style,i)}})}),[e]),null}var ei=(t,e)=>{let o=[];for(let r in t.state){let l=t.state[r];for(let s in l){let i=l[s];o.push({ChildComponent:()=>un(lo,{css:i.css}),key:s,label:i.label,onSelect:({editor:c})=>{cn(c,e,r,s)}})}}return[{type:"dropdown",ChildComponent:()=>un(lo,{css:{color:"var(--color-icon-secondary)"}}),items:[...[{ChildComponent:()=>un(lo,{}),key:"clear-style",label:({i18n:r})=>r.t("lexical:textState:defaultStyle"),onSelect:({editor:r})=>{for(let l in t.state)cn(r,e,l,void 0)},order:1}],...o],key:"textState",order:30}]},Pp=A(({props:t})=>{let e=ql(t.state);return{plugins:[{Component:()=>Ql({stateMap:e}),position:"normal"}],toolbarFixed:{groups:ei(t,e)},toolbarInline:{groups:ei(t,e)}}});import{c as ef}from"react/compiler-runtime";import{useLexicalComposerContext as tf}from"@lexical/react/LexicalComposerContext";import{$createHeadingNode as of,$isHeadingNode as fi,HeadingNode as bi}from"@lexical/rich-text";import{$setBlocksType as nf}from"@lexical/selection";import{$getSelection as rf,$isRangeSelection as lf}from"lexical";import{useEffect as sf}from"react";import{jsx as ti}from"react/jsx-runtime";import"react";var Bp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm11 6a.5.5 0 0 0-.777-.416l-1.5 1a.5.5 0 1 0 .554.832l.723-.482V17.5a.5.5 0 0 0 1 0z",oi=({className:t})=>ti("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ti("path",{d:Bp,fill:"currentColor"})});import{jsx as ni}from"react/jsx-runtime";import"react";var jp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7zm9.034 10.952c0 .303.245.548.548.548h2.97a.448.448 0 0 0 0-.896H17.48v-.04l.997-1.038q.562-.555.873-.945.314-.39.438-.711t.124-.653q0-.497-.245-.885a1.7 1.7 0 0 0-.684-.61A2.24 2.24 0 0 0 17.96 12a2.2 2.2 0 0 0-1.017.228 1.71 1.71 0 0 0-.888 1.13c-.064.268.168.495.444.495.275 0 .479-.236.595-.485l.019-.039q.12-.22.333-.338a1 1 0 0 1 .5-.121q.278 0 .495.11a.83.83 0 0 1 .341.312.9.9 0 0 1 .125.48q0 .245-.096.462t-.288.448-.48.529l-1.85 1.854a.55.55 0 0 0-.16.387",ri=({className:t})=>ni("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ni("path",{d:jp,fill:"currentColor"})});import{jsx as li,jsxs as Hp}from"react/jsx-runtime";import"react";var zp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Gp="M16.59 13.32 A1.5 1.25 0 1 1 18 15 A1.5 1.25 0 1 1 16.59 16.68",ii=({className:t})=>Hp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[li("path",{d:zp,fill:"currentColor"}),li("path",{d:Gp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as si,jsxs as Up}from"react/jsx-runtime";import"react";var Wp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Vp="M18.85 17.5 V12.5 L16.5 15.85 H19.5",ai=({className:t})=>Up("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[si("path",{d:Wp,fill:"currentColor"}),si("path",{d:Vp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as ci,jsxs as Kp}from"react/jsx-runtime";import"react";var Jp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",Xp="M19.2 12.5 H16.8 V14.9 A1.5 1.5 0 1 1 16.7 16.9",ui=({className:t})=>Kp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[ci("path",{d:Jp,fill:"currentColor"}),ci("path",{d:Xp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{jsx as di,jsxs as Yp}from"react/jsx-runtime";import"react";var Zp="M7 6.5a.5.5 0 0 0-1 0v11a.5.5 0 0 0 1 0V12h6v5.5a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-1 0V11H7z",qp="M18.85 12.55 C17.45 13.05 16.5 14.25 16.5 16 A1.5 1.5 0 1 1 19.5 16 A1.5 1.5 0 1 1 16.5 16",mi=({className:t})=>Yp("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:[di("path",{d:Zp,fill:"currentColor"}),di("path",{d:qp,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1})]});import{HEADING as Qp}from"@lexical/markdown";var pi=t=>{let o=`^(${t.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`;return{...Qp,regExp:new RegExp(o)}};var hi=t=>{let e=rf();nf(e,()=>of(t))},gi={h1:oi,h2:ri,h3:ii,h4:ai,h5:ui,h6:mi},af=A(({props:t})=>{let{enabledHeadingSizes:e=["h1","h2","h3","h4","h5","h6"]}=t,o=[oe(e.map((n,r)=>({ChildComponent:gi[n],isActive:({selection:l})=>{if(!lf(l))return!1;for(let s of l.getNodes()){if(fi(s)&&s.getTag()===n)continue;let i=s.getParent();if(!(fi(i)&&i.getTag()===n))return!1}return!0},key:n,label:({i18n:l})=>l.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:l})=>{l.update(()=>{hi(n)})},order:r+2})))];return{markdownTransformers:[pi(e)],nodes:[bi],plugins:[{Component:cf,position:"normal"}],sanitizedClientFeatureProps:t,slashMenu:{groups:e?.length?[q(e.map(n=>({Icon:gi[n],key:`heading-${n.charAt(1)}`,keywords:["heading",n],label:({i18n:r})=>r.t("lexical:heading:label",{headingLevel:n.charAt(1)}),onSelect:({editor:r})=>{r.update(()=>{hi(n)})}})))]:[]},toolbarFixed:{groups:e?.length?o:[]},toolbarInline:{groups:e?.length?o:[]}}}),cf=t=>{let e=ef(9),{clientProps:o}=t,{enabledHeadingSizes:n}=o,r;e[0]!==n?(r=n===void 0?["h1","h2","h3","h4","h5","h6"]:n,e[0]=n,e[1]=r):r=e[1];let l=r,s;e[2]!==l?(s=l.at(-1),e[2]=l,e[3]=s):s=e[3];let i=s,[c]=tf(),u,d;return e[4]!==c||e[5]!==l||e[6]!==i?(u=()=>{if(!(!i||l.length===6))return c.registerNodeTransform(bi,a=>{l.includes(a.getTag())||a.setTag(i)})},d=[c,l,i],e[4]=c,e[5]=l,e[6]=i,e[7]=u,e[8]=d):(u=e[7],d=e[8]),sf(u,d),null};import{$isNodeSelection as Lf}from"lexical";import{jsx as xi}from"react/jsx-runtime";import"react";var uf="M18 12a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1 0-1h11a.5.5 0 0 1 .5.5",dn=({className:t})=>xi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:xi("path",{d:uf,fill:"currentColor"})});var xe=t=>({type:"dropdown",ChildComponent:vr,items:t,key:"add",order:10});import{addClassNamesToElement as df}from"@lexical/utils";import{$applyNodeReplacement as mf,createCommand as pf,DecoratorNode as ff}from"lexical";var At=pf("INSERT_HORIZONTAL_RULE_COMMAND"),Mt=class extends ff{static clone(e){return new this(e.__key)}static getType(){return"horizontalrule"}static importDOM(){return{hr:()=>({conversion:hf,priority:0})}}static importJSON(e){return Ci()}createDOM(e){let o=document.createElement("hr");return df(o,e.theme.hr),o}decorate(){return null}exportDOM(){return{element:document.createElement("hr")}}exportJSON(){return{...super.exportJSON(),type:"horizontalrule"}}getTextContent(){return`
55
+ `}isInline(){return!1}updateDOM(){return!1}};function hf(){return{node:Ci()}}function Ci(){return mf(new Mt)}import{$applyNodeReplacement as gf}from"lexical";import"react";var Ce=class extends Mt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{hr:()=>({conversion:bf,priority:0})}}static importJSON(e){return He()}decorate(){return null}exportJSON(){return super.exportJSON()}};function bf(){return{node:He()}}function He(){return gf(new Ce)}function ze(t){return t instanceof Ce}var ki={type:"element",dependencies:[Ce],export:(t,e)=>ze(t)?"---":null,regExp:/^---\s*$/,replace:t=>{let e=He();e&&t.replace(e)}};import{c as xf}from"react/compiler-runtime";import{useLexicalComposerContext as Cf}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as _i,$insertNodeToNearestRoot as kf}from"@lexical/utils";import{$getRoot as _f,$getSelection as Ti,$isRangeSelection as Ei,$isRootOrShadowRoot as wi,COMMAND_PRIORITY_EDITOR as Tf}from"lexical";import{useEffect as Ef}from"react";var mn="LexicalEditorTheme__hrSelected",Si=()=>{let t=xf(3),[e]=Cf(),o,n;return t[0]!==e?(o=()=>{let r=e.registerCommand(At,wf,Tf),l=e.registerUpdateListener(s=>{let{editorState:i}=s;i.read(()=>{let u=_f().getChildren(),d=Ti(),a=[];for(let b=0;b<u.length;b++){let x=u[b];if(ze(x)){let _=e.getElementByKey(x.getKey());_&&a.push({element:_,index:b})}}if(a.length===0)return;if(!Ei(d)||d.isCollapsed()){for(let{element:b}of a)b.classList.remove(mn);return}let p=d.anchor.getNode(),m=d.focus.getNode(),h=_i(p,Sf)||p,f=_i(m,Nf)||m,g=u.indexOf(h),C=u.indexOf(f);if(g===-1||C===-1)return;let S=Math.min(g,C),N=Math.max(g,C);for(let{element:b,index:x}of a)x>=S&&x<=N?b.classList.add(mn):b.classList.remove(mn)})});return()=>{r(),l()}},n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Ef(o,n),null};function wf(t){let e=Ti();if(!Ei(e))return!1;if(e.focus.getNode()!==null){let n=He();kf(n)}return!0}function Sf(t){return wi(t.getParent())}function Nf(t){return wi(t.getParent())}var yf=A({markdownTransformers:[ki],nodes:[Ce],plugins:[{Component:Si,position:"normal"}],slashMenu:{groups:[q([{Icon:dn,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(At,void 0)}}])]},toolbarFixed:{groups:[xe([{ChildComponent:dn,isActive:({selection:t})=>{if(!Lf(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return ze(e)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(At,void 0)}}])]}});import{$findMatchingParent as Oi}from"@lexical/utils";import{$isElementNode as Gf,INDENT_CONTENT_COMMAND as Uf,OUTDENT_CONTENT_COMMAND as Wf}from"lexical";import{jsx as pn}from"react/jsx-runtime";import"react";var Rf="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",Ni=({className:t})=>pn("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:pn("g",{transform:"scale(-1, 1) translate(-24, 0)",children:pn("path",{clipRule:"evenodd",d:Rf,fill:"currentColor",fillRule:"evenodd"})})});import{jsx as Li}from"react/jsx-runtime";import"react";var If="M7.854 6.146a.5.5 0 1 0-.708.708L8.293 8H5.5a.5.5 0 0 0 0 1h2.793l-1.147 1.146a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708zM11.5 8a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1zM5 12.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 0 1h-13a.5.5 0 0 1-.5-.5m.5 3.5a.5.5 0 0 0 0 1h13a.5.5 0 0 0 0-1z",yi=({className:t})=>Li("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Li("path",{clipRule:"evenodd",d:If,fill:"currentColor",fillRule:"evenodd"})});import{jsx as vf}from"react/jsx-runtime";import{useLexicalComposerContext as Mf}from"@lexical/react/LexicalComposerContext";import{TabIndentationPlugin as Af}from"@lexical/react/LexicalTabIndentationPlugin";import{$findMatchingParent as Df,mergeRegister as fn}from"@lexical/utils";import{$addUpdateTag as hn,$getSelection as vi,$isElementNode as Mi,$isRangeSelection as Ai,$isRootOrShadowRoot as $f,BLUR_COMMAND as Of,COMMAND_PRIORITY_HIGH as io,COMMAND_PRIORITY_LOW as gn,FOCUS_COMMAND as Ff,INDENT_CONTENT_COMMAND as Ri,KEY_ESCAPE_COMMAND as Pf,KEY_TAB_COMMAND as Ii,OUTDENT_CONTENT_COMMAND as Bf,SELECTION_CHANGE_COMMAND as jf,SKIP_DOM_SELECTION_TAG as bn,TabNode as Hf}from"lexical";import{useEffect as xn}from"react";var Di=({clientProps:t})=>{let[e]=Mf(),{disabledNodes:o,disableTabNode:n}=t;return xn(()=>{let r=!1,l=!1,s=()=>{r=!1},i,c,u;function d(){s(),l=!1}function a(f){if(f.key!=="Tab"||!r){["Escape","Shift","Tab"].includes(f.key)||s();return}let g=e.getRootElement();if(!g)return;s(),l=!0,f.stopPropagation(),i?.(),clearTimeout(c);let C=g.closest(".rich-text-lexical")??g,S=new Set([g,...C.querySelectorAll('[tabindex], [contenteditable="true"], a[href], button, input, select, textarea, summary, iframe, audio[controls], video[controls]')]),N=new Map;for(let b of S)N.set(b,b.getAttribute("tabindex")),b.setAttribute("tabindex","-1");i=()=>{for(let[b,x]of N)x===null?b.removeAttribute("tabindex"):b.setAttribute("tabindex",x);i=void 0},c=setTimeout(()=>i?.(),0),e.update(()=>hn(bn))}function p(f){if(f.key==="Escape"&&!f.defaultPrevented&&e.isEditable()){if(r&&!f.repeat)return;f.preventDefault(),f.stopPropagation(),r=!0}}let m=e.registerRootListener(f=>{u?.abort(),u=new AbortController;let{signal:g}=u;f?.addEventListener("pointerdown",d,{signal:g}),f?.addEventListener("keydown",a,{capture:!0,signal:g}),f?.addEventListener("keydown",p,{signal:g})}),h=fn(e.registerCommand(Pf,f=>e.isEditable()?(p(f),!0):!1,gn),e.registerCommand(Ii,()=>{let f=vi();return Ai(f)&&f.isCollapsed()&&$f(f.anchor.getNode())?(s(),l=!0,hn(bn),!0):!1},io),e.registerCommand(Of,()=>(s(),!1),io),e.registerCommand(Ff,()=>(d(),!1),io),e.registerCommand(jf,()=>{let f=e.getRootElement();return l&&f?.ownerDocument.activeElement!==f&&hn(bn),!1},io));return()=>{h(),m(),u?.abort(),clearTimeout(c),i?.()}},[e]),xn(()=>{if(!(!e||!o?.length))return fn(e.registerCommand(Ri,()=>zf(r=>{if(!o.includes(r.getType())){let l=r.getIndent();r.setIndent(l+1)}}),gn),e.registerUpdateListener(({dirtyElements:r,editorState:l})=>{e.update(()=>{for(let[s]of r){let i=l._nodeMap.get(s);Mi(i)&&o.includes(i.getType())&&i.getIndent()>0&&i.setIndent(0)}})}))},[e,o]),xn(()=>{if(!(!e||!n))return fn(e.registerCommand(Ii,r=>(r.preventDefault(),e.dispatchCommand(r.shiftKey?Bf:Ri,void 0)),gn),e.registerNodeTransform(Hf,r=>{r.remove()}))},[e,n]),vf(Af,{})};function zf(t){let e=vi();if(!Ai(e))return!1;let o=new Set,n=e.getNodes();for(let r=0;r<n.length;r++){let l=n[r],s=l.getKey();if(o.has(s))continue;let i=Df(l,u=>Mi(u)&&!u.isInline());if(i===null)continue;let c=i.getKey();i.canIndent()&&!o.has(c)&&(o.add(c),t(i))}return o.size>0}var $i=t=>({type:"buttons",items:t,key:"indent",order:35});var Fi=({disabledNodes:t})=>[$i([{ChildComponent:Ni,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Pi(r)&&r.getIndent()>0;return o.some(r=>n(r)||!!Oi(r,n))},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Wf,void 0)},order:1},{ChildComponent:yi,isEnabled:({selection:e})=>{let o=e?.getNodes()??[],n=r=>Pi(r)&&!(t??[]).includes(r.getType());return o.some(r=>n(r)||!!Oi(r,n))},key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Uf,void 0)},order:2}])],Vf=A(({props:t})=>{let e=t.disabledNodes??[];return{plugins:[{Component:Di,position:"normal"}],sanitizedClientFeatureProps:t,toolbarFixed:{groups:Fi({disabledNodes:e})},toolbarInline:{groups:Fi({disabledNodes:e})}}}),Pi=t=>Gf(t)&&t.canIndent();import{$findMatchingParent as d0}from"@lexical/utils";import{$getSelection as yn,$isRangeSelection as ks}from"lexical";import{jsx as Bi}from"react/jsx-runtime";import"react";var Kf={16:"M8.38 6.381a.29.29 0 0 1 .347-.056q.293.161.541.408a2.5 2.5 0 0 1 0 3.535l-2 2a2.5 2.5 0 0 1-3.535-3.535l.571-.573c.25-.249.692-.107.81.224a.46.46 0 0 1-.098.478l-.576.578a1.5 1.5 0 1 0 2.121 2.12l2-2a1.5 1.5 0 0 0 0-2.12c-.23-.23-.493-.509-.358-.805a.9.9 0 0 1 .178-.254m.352-2.648a2.5 2.5 0 1 1 3.535 3.535l-.471.47c-.253.254-.717.082-.819-.261a.44.44 0 0 1 .102-.435l.481-.481A1.5 1.5 0 0 0 9.44 4.44l-2 2a1.5 1.5 0 0 0 0 2.12c.136.138.168.365.031.502l-.182.181c-.154.154-.403.179-.557.025a2.5 2.5 0 0 1 0-3.535z",24:"M12.4436 10.3708C12.6861 10.5041 12.9148 10.6721 13.1204 10.8776C14.2919 12.0492 14.2918 13.9482 13.1204 15.1198L11.1204 17.1198C9.94879 18.2914 8.04975 18.2914 6.87817 17.1198C5.70664 15.9482 5.70661 14.0492 6.87817 12.8776L8.1477 11.6071C8.4098 11.345 8.89329 11.5392 8.97388 11.9011C9.00617 12.0462 8.96861 12.2012 8.86353 12.3063L7.5852 13.5847C6.80417 14.3657 6.80419 15.6317 7.5852 16.4128C8.36625 17.1938 9.63228 17.1938 10.4133 16.4128L12.4133 14.4128C13.1942 13.6317 13.1943 12.3657 12.4133 11.5847C12.4042 11.5755 12.3953 11.5662 12.386 11.5573C12.2925 11.468 12.1984 11.3736 12.1614 11.2497C12.0724 10.9515 12.1448 10.6149 12.3801 10.3796C12.397 10.3628 12.4228 10.3594 12.4436 10.3708ZM12.8782 6.87764C14.0497 5.70615 15.9488 5.70616 17.1204 6.87764C18.2919 8.04919 18.2919 9.94825 17.1204 11.1198L15.8508 12.3903C15.5887 12.6522 15.1053 12.4581 15.0247 12.0964C14.9924 11.9512 15.0308 11.7963 15.136 11.6911L16.4133 10.4128C17.1943 9.63175 17.1943 8.3657 16.4133 7.58467C15.6323 6.80371 14.3662 6.8037 13.5852 7.58467L11.5852 9.58467C10.8046 10.3657 10.8044 11.6319 11.5852 12.4128C11.5943 12.4219 11.6042 12.4303 11.6135 12.4392C11.7064 12.5278 11.7999 12.622 11.8372 12.7448C11.9276 13.044 11.8545 13.3827 11.6184 13.6188C11.6023 13.6347 11.5778 13.6383 11.5579 13.6276C11.3146 13.4942 11.0843 13.3259 10.8782 13.1198C9.7068 11.9484 9.707 10.0492 10.8782 8.87764L12.8782 6.87764Z"},so=({className:t,size:e=24})=>Bi("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Bi("path",{d:Kf[e],fill:"currentColor"})});import{$isAtNodeEnd as ji}from"@lexical/selection";function at(t){let{anchor:e}=t,{focus:o}=t,n=t.anchor.getNode(),r=t.focus.getNode();return n===r?n:t.isBackward()?ji(o)?n:r:ji(e)?n:r}var Cn=t=>({type:"buttons",items:t,key:"features",order:50});import{$createTextNode as i1}from"lexical";function kn(t){let e=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i;return t=String(t).trim(),t.match(e)!=null||t.match(o)!=null?t:"https://"}var Jf=/^(?:[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+)?$/,Xf=/^(?:\/[\w\-./]*(?:\?[-;&=%\w]*)?(?:#[\w-]+)?|#[\w-]+)$/;function Hi(t){if(!t||t.includes(" ")||/^[a-z][a-z\d+.-]*:\/[^/]/i.test(t))return!1;if(t==="https://"||Jf.test(t)||Xf.test(t))return!0;try{let e=new URL(t);return!(["ftp:","http:","https:"].includes(e.protocol)&&!e.hostname.includes("."))}catch{}return!1}import{addClassNamesToElement as Yf,isHTMLAnchorElement as Zf}from"@lexical/utils";import Gi from"bson-objectid";import{$applyNodeReplacement as qf,$createTextNode as zi,$getSelection as Qf,$isElementNode as Ui,$isRangeSelection as Tn,createCommand as e1,ElementNode as t1}from"lexical";var o1=new Set(["http:","https:","mailto:","sms:","tel:"]),ne=class extends t1{__fields;__id;constructor({id:e,fields:o={linkType:"custom",newTab:!1},key:n}){super(n),this.__fields=o,this.__id=e}static clone(e){return new this({id:e.__id,fields:e.__fields,key:e.__key})}static getType(){return"link"}static importDOM(){return{a:e=>({conversion:n1,priority:1})}}static importJSON(e){return ke({}).updateFromJSON(e)}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=_n(o.rel,"add","noopener")),Yf(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},n=this.getID();return n&&(o.id=n),o}extractWithChild(e,o,n){if(!Tn(o))return!1;let r=o.anchor.getNode(),l=o.focus.getNode();return this.isParentOf(r)&&this.isParentOf(l)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(Ui(n)){let r=ke({fields:this.__fields});return n.append(r),r}return null}isInline(){return!0}sanitizeUrl(e){try{let o=new URL(e);if(!o1.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,n){let r=this.__fields?.url,l=this.__fields?.newTab;return r!=null&&r!==e.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=r),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=_n(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=_n(o.rel,"remove","noopener"))),!1}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields).setID(o.id)}};function n1(t){let e=null;if(Zf(t)){let o=t.textContent;o!==null&&o!==""&&(e=ke({id:new Gi.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:t.getAttribute("target")==="_blank",url:t.getAttribute("href")??""}}))}return{node:e}}function ke({id:t,fields:e}){return qf(new ne({id:t??new Gi.default().toHexString(),fields:e}))}function Y(t){return t instanceof ne}var pe=e1("TOGGLE_LINK_COMMAND");function En(t){let e=Qf();if(!Tn(e)&&(t===null||!t.selectedNodes?.length))return;let o=Tn(e)?e.extract():t===null?[]:t.selectedNodes;if(t===null){o?.forEach(l=>{let s=l.getParent();Y(s)&&(s.getChildren().forEach(c=>{s.insertBefore(c)}),s.remove())});return}if(o?.length===1){let l=o[0],s=Y(l)?l:r1(l);if(s!==null){s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(zi(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}}let n=null,r=null;o?.forEach(l=>{let s=l.getParent();if(!(s===r||s===null||Ui(l)&&!l.isInline())){if(Y(s)){r=s,s.setFields(t.fields),t.text!=null&&t.text!==s.getTextContent()&&(s.append(zi(t.text)),s.getChildren().forEach(i=>{i!==s.getLastChild()&&i.remove()}));return}if(s.is(n)||(n=s,r=ke({fields:t.fields}),Y(s)?l.getPreviousSibling()===null?s.insertBefore(r):s.insertAfter(r):l.insertBefore(r)),Y(l)){if(l.is(r))return;if(r!==null){let i=l.getChildren();r.append(...i)}l.remove();return}r!==null&&r.append(l)}})}function r1(t){return l1(t,e=>Y(e))}function l1(t,e){let o=t;for(;o!==null&&(o=o.getParent(),!(o===null||e(o))););return o}function _n(t,e,o){let n,r=`${t}`;if(e==="add"){if(r.includes(o)){let l=new RegExp(o,"g");r=r.replace(l,"").trim()}r=r.trim(),n=r.length===0?`${o}`:`${r} ${o}`}else{let l=new RegExp(o,"g");n=r.replace(l,"").trim()}return n}var s1=(t,e)=>{let[,o,n]=e,r=ke({fields:{doc:null,linkType:"custom",newTab:!1,url:n}}),l=i1(o);return l.setFormat(t.getFormat()),r.append(l),t.replace(r),l},a1=t=>({type:"text-match",dependencies:[ne],export:(e,o)=>{if(!Y(e))return null;let n=e,r=n.getFields(),l;return r.linkType==="internal"?t?.internalDocToHref?l=kn(t.internalDocToHref({linkNode:n.exportJSON()})):(console.warn("Lexical \u2192 Markdown converter: found internal link but internalDocToHref is not provided \u2014 link will have an empty href"),l=""):l=kn(r.url??""),`[${o(n)}](${l})`},importRegExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/(?<!!)\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:s1,trigger:")"}),Wi=a1();import{$applyNodeReplacement as c1,$isElementNode as u1}from"lexical";var _e=class extends ne{static clone(e){return new this({id:"",fields:e.__fields,key:e.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(e){return Dt({}).updateFromJSON(e)}exportJSON(){let e=super.exportJSON();return{type:"autolink",children:e.children,direction:e.direction,fields:e.fields,format:e.format,indent:e.indent,version:e.version}}insertNewAfter(e,o=!0){let n=this.getParentOrThrow().insertNewAfter(e,o);if(u1(n)){let r=Dt({fields:this.__fields});return n.append(r),r}return null}updateFromJSON(e){let o=e;return super.updateFromJSON(o).setFields(o.fields)}};function Dt({fields:t}){return c1(new _e({id:"",fields:t}))}function Te(t){return t instanceof _e}import{c as d1}from"react/compiler-runtime";import{useLexicalComposerContext as m1}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as p1}from"@lexical/utils";import{$createTextNode as Vi,$getSelection as f1,$isElementNode as Ji,$isLineBreakNode as Xi,$isNodeSelection as h1,$isRangeSelection as g1,$isTextNode as $t,TextNode as b1}from"lexical";import{useEffect as x1}from"react";function Ki(t,e=o=>o){return o=>{let n=t.exec(o);return n===null?null:{index:n.index,length:n[0].length,text:n[0],url:e(n[0])}}}function Yi(t,e){for(let o of e){let n=o(t);if(n!=null)return n}return null}var C1=/[.,;\s]/;function co(t){return t!==void 0&&C1.test(t)}function Zi(t){return co(t[t.length-1])}function Sn(t){return co(t[0])}function k1(t,e){return e?/^\.[a-z]{2,}/i.test(t):/^\.[a-z0-9]+/i.test(t)}function qi(t){let e=t.getPreviousSibling();return Ji(e)&&(e=e.getLastDescendant()),e===null||Xi(e)||$t(e)&&Zi(e.getTextContent())}function Qi(t){let e=t.getNextSibling();return Ji(e)&&(e=e.getFirstDescendant()),e===null||Xi(e)||$t(e)&&Sn(e.getTextContent())}function _1(t,e,o,n){return(t>0?co(o[t-1]):qi(n[0]))?e<o.length?co(o[e]):Qi(n[n.length-1]):!1}function T1(t,e,o){let n=[],r=[],l=[],s=0,i=0,c=[...t];for(;c.length>0;){let u=c[0],a=u.getTextContent().length,p=i;i+a<=e?(n.push(u),s+=a):p>=o?l.push(u):r.push(u),i+=a,c.shift()}return[s,n,r,l]}function E1(t,e,o,n){let r={linkType:"custom",url:n.url,...n.fields},l=Dt({fields:r});if(t.length===1){let s=t[0],i;if(e===0?[i]=s.splitText(o):[,i]=s.splitText(e,o),i){let c=Vi(n.text);c.setFormat(i.getFormat()),c.setDetail(i.getDetail()),c.setStyle(i.getStyle()),l.append(c),i.replace(l)}return s}else if(t.length>1){let s=t[0],i=s.getTextContent().length,c;e===0?c=s:[,c]=s.splitText(e);let u=[],d;if(t.forEach(a=>{let m=a.getTextContent().length,h=i,f=i+m;if(h<o)if(f<=o)u.push(a);else{let[g,C]=a.splitText(o-h);g&&u.push(g),d=C}i+=m}),c){let a=f1(),p=a?a.getNodes().find($t):void 0,m=Vi(c.getTextContent());return m.setFormat(c.getFormat()),m.setDetail(c.getDetail()),m.setStyle(c.getStyle()),l.append(m,...u),p&&p===c&&(g1(a)?m.select(a.anchor.offset,a.focus.offset):h1(a)&&m.select(0,m.getTextContent().length)),c.replace(l),d}}}function w1(t,e,o){let n=[...t],r=n.map(c=>c.getTextContent()).join(""),l=r,s,i=0;for(;(s=Yi(l,e))!=null&&s!==null;){let c=s.index,u=s.length,d=c+u;if(_1(i+c,i+d,r,n)){let[p,,m,h]=T1(n,i+c,i+d),f=i+c-p,g=i+d-p,C=E1(m,f,g,s);n=C?[C,...h]:h,o(s.url,null),i=0}else i+=d;l=l.substring(d)}}function wn(t,e,o){let n=t.getChildren(),r=n.length;for(let c=0;c<r;c++){let u=n[c];if(!$t(u)||!u.isSimpleText()){ao(t),o(null,t.getFields()?.url??null);return}}let l=t.getTextContent(),s=Yi(l,e);if(s===null||s.text!==l){ao(t),o(null,t.getFields()?.url??null);return}if(!qi(t)||!Qi(t)){ao(t),o(null,t.getFields()?.url??null);return}let i=t.getFields()?.url;if(i!==s?.url){let c=t.getFields();c.url=s?.url,t.setFields(c),o(s.url,i??null)}}function S1(t,e,o){let n=t.getPreviousSibling(),r=t.getNextSibling(),l=t.getTextContent();if(Te(n)){let s=n.getFields()?.url?n.getFields()?.url?.startsWith("mailto:")??!1:!1;(!Sn(l)||k1(l,s))&&(n.append(t),wn(n,e,o),o(null,n.getFields()?.url??null))}Te(r)&&!Zi(l)&&(ao(r),wn(r,e,o),o(null,r.getFields()?.url??null))}function ao(t){let e=t.getChildren(),o=e.length;for(let n=o-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map(n=>n.getLatest())}function N1(t){let e=[t],o=t.getNextSibling();for(;o!==null&&$t(o)&&o.isSimpleText()&&(e.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return e}function L1(t,e,o){let n=d1(5),r,l;n[0]!==t||n[1]!==e||n[2]!==o?(r=()=>{if(!t.hasNodes([_e]))throw new Error("LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let s=(i,c)=>{o?.(i,c)};return p1(t.registerNodeTransform(b1,i=>{let c=i.getParentOrThrow(),u=i.getPreviousSibling();if(Te(c))wn(c,e,s);else if(!Y(c)){if(i.isSimpleText()&&(Sn(i.getTextContent())||!Te(u))){let d=N1(i);w1(d,e,s)}S1(i,e,s)}}))},l=[t,e,o],n[0]=t,n[1]=e,n[2]=o,n[3]=r,n[4]=l):(r=n[3],l=n[4]),x1(r,l)}var y1=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)(?<![-.+():%])/,R1=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,I1=[Ki(y1,t=>t.startsWith("http")?t:`https://${t}`),Ki(R1,t=>`mailto:${t}`)],es=()=>{let[t]=m1();return L1(t,I1),null};import{jsx as v1}from"react/jsx-runtime";import{ClickableLinkPlugin as M1}from"@lexical/react/LexicalClickableLinkPlugin.js";import"react";var ts=()=>v1(M1,{});import{jsx as e0}from"react/jsx-runtime";import"react";import{createPortal as t0}from"react-dom";import{jsx as re,jsxs as Ge,Fragment as Nn}from"react/jsx-runtime";import{useLexicalComposerContext as $1}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as O1}from"@lexical/react/useLexicalEditable";import{$findMatchingParent as ss,mergeRegister as as}from"@lexical/utils";import{getTranslation as Ln}from"@payloadcms/translations";import{formatDrawerSlug as F1,NewTabIcon as cs,useConfig as P1,useEditDepth as B1,useLocale as j1,useModal as H1,useTranslation as z1,WriteIcon as G1}from"@payloadcms/ui";import{requests as U1}from"@payloadcms/ui/shared";import{$getSelection as us,$isLineBreakNode as W1,$isRangeSelection as ds,$onUpdate as V1,COMMAND_PRIORITY_HIGH as K1,COMMAND_PRIORITY_LOW as ms,getDOMSelection as J1,KEY_ESCAPE_COMMAND as X1,SELECTION_CHANGE_COMMAND as Y1}from"lexical";import{formatAdminURL as Z1}from"payload/shared";import q1,{useCallback as ps,useEffect as po,useLayoutEffect as Q1,useRef as fs,useState as Ue}from"react";import{jsx as os}from"react/jsx-runtime";import"react";var A1="M12.5 5C12.6326 5 12.7597 5.05272 12.8535 5.14648L16.8535 9.14648C16.9965 9.28948 17.0393 9.50457 16.9619 9.69141C16.8845 9.87821 16.7022 10 16.5 10H12.5C12.2239 10 12 9.77614 12 9.5V6H8.5C8.22386 6 8 6.22386 8 6.5V17.5C8 17.7761 8.22386 18 8.5 18H15.5C15.7761 18 16 17.7761 16 17.5V11.5C16 11.2239 16.2239 11 16.5 11C16.7761 11 17 11.2239 17 11.5V17.5C17 18.3284 16.3284 19 15.5 19H8.5C7.67157 19 7 18.3284 7 17.5V6.5C7 5.67157 7.67157 5 8.5 5H12.5ZM13 9H15.293L13 6.70703V9Z",ns=({className:t})=>os("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:os("path",{d:A1,fill:"currentColor"})});import{jsx as rs}from"react/jsx-runtime";import"react";var ls={default:"M6 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .496.5h12.008a.5.5 0 0 0 .496-.5v-1A.5.5 0 0 0 18 5zM4.5 6.5a1.5 1.5 0 0 0 1.037 1.427L5.725 10H5a.5.5 0 0 0 0 1h.816l.653 7.181A2 2 0 0 0 8.46 20h7.078a2 2 0 0 0 1.992-1.819L18.184 11H19a.5.5 0 0 0 0-1h-.725l.188-2.073A1.5 1.5 0 0 0 19.5 6.5v-1A1.5 1.5 0 0 0 18 4H6a1.5 1.5 0 0 0-1.5 1.5zm2.965 11.59L6.548 8h10.905l-.918 10.09a1 1 0 0 1-.996.91H8.461a1 1 0 0 1-.996-.91M11 10.5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0zm3 0a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z",small:"M6.5 7a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-.039l-.08 1H17a.5.5 0 0 1 0 1h-.7l-.455 5.62A1.5 1.5 0 0 1 14.35 18h-4.7a1.5 1.5 0 0 1-1.495-1.38L7.7 11H7a.5.5 0 0 1 0-1h.62l-.081-1H7.5a1 1 0 0 1-1-1zm9.494 1h.506V7h-9v1zm-.536 1H8.542l.61 7.54a.5.5 0 0 0 .498.46h4.7a.5.5 0 0 0 .499-.46zM11.5 11.5a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0zm2 0a.5.5 0 0 0-1 0v3a.5.5 0 0 0 1 0z"},is=({className:t,small:e})=>rs("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:rs("path",{clipRule:"evenodd",d:e?ls.small:ls.default,fill:"currentColor",fillRule:"evenodd"})});function uo(t,e,o,n=10,r=5){let l=o.parentElement;if(t===null||l==null){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let s=o.getBoundingClientRect(),i=l.getBoundingClientRect(),c=t.top-n,u=t.left-r;e.style.width="max-content",e.style.maxWidth="none";let d=e.scrollWidth,a=i.right-u,p=u-i.left,m;if(d<=a)m=e.getBoundingClientRect();else{let h=p+t.width,f=p>a,C=Math.min(d,f?h:a);C<d&&(e.style.width=`${C}px`,e.style.maxWidth=`${C}px`,e.offsetHeight),f&&(u=t.right-C),m=e.getBoundingClientRect()}c<i.top&&(c+=m.height+t.height+n*2),u+m.width>i.right&&(u=i.right-m.width-r),c-=s.top,u-=s.left,e.style.opacity="1",e.style.transform=`translate(${u}px, ${c}px)`}import{createCommand as D1}from"lexical";var mo=D1("TOGGLE_LINK_WITH_MODAL_COMMAND");function hs(t){t.preventDefault()}function gs({anchorElem:t}){let[e]=$1(),[o,n]=Ue(),r=fs(null),l=fs(null),[s,i]=Ue(null),[c,u]=Ue(null),{fieldProps:{schemaPath:d},uuid:a}=W(),p=O1(),{config:m,getEntityConfig:h}=P1(),{i18n:f,t:g}=z1(),[C,S]=Ue(),N=B1(),[b,x]=Ue(!1),[_,k]=Ue([]),T=j1(),[y,E]=Ue(!1),w=F1({slug:"lexical-rich-text-link-"+a,depth:N}),{toggleDrawer:R}=$e(w),{modalState:L}=H1(),I=!!L[w]?.isOpen,v=ps(()=>{x(!1),r&&r.current&&(r.current.style.opacity="0",r.current.style.transform="translate(-10000px, -10000px)"),E(!1),i(null),u(null),k([]),S(void 0)},[x,i,u,k]),O=ps(()=>{if(I)return;let D=us(),M;if(!ds(D)||!D){v();return}let B=at(D);M=e.getElementByKey(B.getKey())?.getBoundingClientRect();let F=ss(B,Y),j=D.getNodes().filter(ie=>!W1(ie)).find(ie=>{let de=ss(ie,Y);return F&&!F.is(de)||de&&!de.is(F)});if(F==null||j){v();return}n(F);let P=F.getFields(),Ye={...P,id:F.getID(),text:F.getTextContent()};if(P?.linkType==="custom")i(P?.url??null),u(null);else{i(`${m.routes.admin==="/"?"":m.routes.admin}/collections/${P?.doc?.relationTo}/${P?.doc?.value}`);let ie=P?.doc?.relationTo?h({collectionSlug:P?.doc?.relationTo}):void 0;if(!ie)u(P?.label?String(P?.label):null),i(P?.url?String(P?.url):null);else{let de=typeof P.doc?.value=="object"?P.doc.value.id:P.doc?.value,Le=P.doc?.relationTo;if(!de||!Le)throw new Error("Focus link parent is missing doc.value or doc.relationTo");let De=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${g("lexical:link:loadingWithEllipsis",f)}`}).replace(/<[^>]*>?/g,"");u(De),U1.get(Z1({apiRoute:m.routes.api,path:`/${Le}/${de}`,serverURL:m.serverURL}),{headers:{"Accept-Language":f.language},params:{depth:0,locale:T?.code}}).then(async ye=>{if(!ye.ok)throw new Error(`HTTP error! Status: ${ye.status}`);let Bo=await ye.json(),jo=ie?.admin?.useAsTitle||"id",X=Bo[jo],_t=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${X}`}).replace(/<[^>]*>?/g,"");u(_t)}).catch(()=>{let ye=g("fields:linkedTo",{label:`${Ln(ie.labels.singular,f)} - ${g("general:untitled",f)} - ID: ${de}`}).replace(/<[^>]*>?/g,"");u(ye)})}}S(Ye),x(!0),k(D?D?.getNodes():[]),Te(F)?E(!0):E(!1);let Ct=r.current,Ze=J1(e._window),{activeElement:kt}=document;if(Ct===null)return;let qe=e.getRootElement();return Ze!==null&&qe!==null&&qe.contains(Ze.anchorNode)?(M||(M=Ze.getRangeAt(0).getBoundingClientRect()),M!=null&&(M.y+=40,l.current=M)):(kt==null||kt.className!=="link-input")&&(qe!==null&&uo(null,Ct,t),i(null),u(null)),!0},[e,I,v,m.routes.admin,m.routes.api,m.serverURL,h,g,f,T?.code,t]);return po(()=>as(e.registerCommand(mo,D=>(e.dispatchCommand(pe,D),O(),R(),!0),ms)),[e,O,R,w]),po(()=>{let D=t.parentElement,M=()=>{e.getEditorState().read(()=>{O()})};return window.addEventListener("resize",M),D?.addEventListener("scroll",M),()=>{window.removeEventListener("resize",M),D?.removeEventListener("scroll",M)}},[t.parentElement,e,O]),po(()=>as(e.registerUpdateListener(({editorState:D})=>{D.read(()=>{O()})}),e.registerCommand(Y1,()=>(V1(()=>e.read("latest",O)),!0),ms),e.registerCommand(X1,D=>b?(D.preventDefault(),D.stopImmediatePropagation(),v(),!0):!1,K1)),[e,O,b,v]),po(()=>{e.getEditorState().read(()=>{O()})},[e,O]),Q1(()=>{!b||!r.current||!t||!l.current||uo(l.current,r.current,t)},[s,c,b,t,o]),Ge(q1.Fragment,{children:[re("div",{className:"link-editor","data-theme":"dark",hidden:!b,ref:r,children:Ge("div",{className:"link-input",children:[o?.__fields?.linkType==="custom"?re(so,{}):re(ns,{}),s&&s.length>0?Ge("a",{className:"link-input__url",href:s,rel:"noopener noreferrer",target:"_blank",children:[c!=null&&c.length>0?c:s,o?.__fields.newTab?Ge(Nn,{children:[re(cs,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):c!=null&&c.length>0?Ge(Nn,{children:[re("span",{className:"link-input__label-pure",children:c}),o?.__fields.newTab?Ge(Nn,{children:[re(cs,{size:16})," ",re("div",{className:"link-input__divider"})," "]}):null]}):null,p&&Ge("div",{className:"link-input__actions",children:[re("button",{"aria-label":"Edit link",className:"link-edit",onClick:D=>{D.preventDefault(),R()},onMouseDown:hs,tabIndex:0,type:"button",children:re(G1,{})}),!y&&re("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{e.dispatchCommand(pe,null)},onMouseDown:hs,tabIndex:0,type:"button",children:re(is,{small:!0})})]})]})}),re(Wo,{className:"lexical-link-edit-drawer",data:C,drawerSlug:w,drawerTitle:g("fields:editLink"),featureKey:"link",handleDrawerSubmit:(D,M)=>{let B=M,F={...B};delete F.text,e.update(()=>{let j=us(),P=null;if(ds(j)?P=at(j).getParent():_.length&&(P=_[0]?.getParent()??null),P&&Te(P)){let Ye=ke({fields:F});P.replace(Ye,!0)}}),e.dispatchCommand(pe,{fields:F,selectedNodes:_,text:B.text})},schemaPath:d,schemaPathSuffix:"fields"})]})}var bs=t=>{let{anchorElem:e=document.body}=t;return t0(e0(gs,{anchorElem:e}),e)};import{c as o0}from"react/compiler-runtime";import{useLexicalComposerContext as n0}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as r0}from"@lexical/utils";import{$getSelection as l0,$isElementNode as i0,$isRangeSelection as s0,COMMAND_PRIORITY_LOW as xs,PASTE_COMMAND as a0}from"lexical";import{useEffect as c0}from"react";var Cs=t=>{let e=o0(5),{clientProps:o}=t,[n]=n0(),r,l;return e[0]!==o.defaultLinkType||e[1]!==o.defaultLinkURL||e[2]!==n?(r=()=>{if(!n.hasNodes([ne]))throw new Error("LinkPlugin: LinkNode not registered on editor");return r0(n.registerCommand(pe,s=>s===null?(En(null),!0):(s.fields?.linkType||(s.fields.linkType=o.defaultLinkType),s.fields?.url||(s.fields.url=o.defaultLinkURL),En(s),!0),xs),n.registerCommand(a0,s=>{let i=l0();if(!s0(i)||i.isCollapsed()||!(s instanceof ClipboardEvent)||s.clipboardData==null)return!1;let c=s.clipboardData.getData("text");if(!Hi(c))return!1;if(!i.getNodes().some(u0)){let u={doc:null,linkType:"custom",newTab:!1,url:c};return n.dispatchCommand(pe,{fields:u,text:null}),s.preventDefault(),!0}return!1},xs))},l=[o.defaultLinkType,o.defaultLinkURL,n],e[0]=o.defaultLinkType,e[1]=o.defaultLinkURL,e[2]=n,e[3]=r,e[4]=l):(r=e[3],l=e[4]),c0(r,l),null};function u0(t){return i0(t)}var _s=[Cn([{ChildComponent:so,isActive:({selection:t})=>{if(ks(t)){let e=at(t);return d0(e,Y)!=null}return!1},isEnabled:({selection:t})=>!!(ks(t)&&yn()?.getTextContent()?.length),key:"link",label:({i18n:t})=>t.t("lexical:link:label"),onSelect:({editor:t,isActive:e})=>{if(e)t.dispatchCommand(pe,null);else{let o,n=[];if(t.getEditorState().read(()=>{o=yn()?.getTextContent(),n=yn()?.getNodes()??[]}),!o?.length)return;let r={doc:null};t.dispatchCommand(mo,{fields:r,selectedNodes:n,text:o})}},order:1}])],m0=A(({props:t})=>({markdownTransformers:[Wi],nodes:[ne,t?.disableAutoLinks===!0?null:_e].filter(Boolean),plugins:[{Component:Cs,position:"normal"},t?.disableAutoLinks===!0||t?.disableAutoLinks==="creationOnly"?null:{Component:es,position:"normal"},{Component:ts,position:"normal"},{Component:bs,position:"floatingAnchorElem"}].filter(Boolean),sanitizedClientFeatureProps:t,toolbarFixed:{groups:_s},toolbarInline:{groups:_s}}));import{$isListNode as In,INSERT_CHECK_LIST_COMMAND as Ss,ListItemNode as x0,ListNode as C0}from"@lexical/list";import{CHECK_LIST as k0}from"@lexical/markdown";import{$isRangeSelection as _0}from"lexical";import{jsx as Ts}from"react/jsx-runtime";import"react";var p0={16:"M5.584 8.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM13 10a.5.5 0 0 1 0 1H8a.5.5 0 0 1 0-1zM5.583 3.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.076l-1-1a.5.5 0 0 1 .708-.707l.568.569zM13 5a.5.5 0 1 1 0 1H8a.5.5 0 0 1 0-1z",24:"M9.084 15.223a.5.5 0 1 1 .832.554l-2 3a.5.5 0 0 1-.77.076l-1-1a.5.5 0 1 1 .708-.707l.568.569zM17.5 17a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zm-8.416-6.777a.5.5 0 0 1 .832.554l-2 3a.5.5 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.707l.568.568zM17.5 12a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1zM9.084 5.223a.5.5 0 0 1 .832.554l-2 3a.502.502 0 0 1-.77.077l-1-1a.5.5 0 1 1 .708-.708l.568.569zM17.5 7a.5.5 0 0 1 0 1h-6a.5.5 0 0 1 0-1z"},Rn=({className:t,size:e=24})=>Ts("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ts("path",{d:p0[e],fill:"currentColor"})});import{jsx as f0}from"react/jsx-runtime";import{ListPlugin as h0}from"@lexical/react/LexicalListPlugin.js";import"react";var ct=()=>f0(h0,{});function fo(t,e){return t==="ordered"?!e.has("unorderedList"):t==="checklist"?!e.has("unorderedList")&&!e.has("orderedList"):!1}function ut(t){return{items:t,key:"lists",label:({i18n:e})=>e.t("lexical:general:slashMenuListGroupLabel")}}import{jsx as g0}from"react/jsx-runtime";import{CheckListPlugin as b0}from"@lexical/react/LexicalCheckListPlugin.js";import"react";var Es=()=>g0(b0,{});var ws=[oe([{ChildComponent:Rn,isActive:({selection:t})=>{if(!_0(t))return!1;for(let e of t.getNodes()){if(In(e)&&e.getListType()==="check")continue;let o=e.getParent();if(In(o)&&o.getListType()==="check")continue;let n=o?.getParent();if(!(In(n)&&n.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:t})=>t.t("lexical:checklist:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ss,void 0)},order:12}])],T0=A(({featureProviderMap:t})=>{let e=[{Component:Es,position:"normal"}],o=fo("checklist",t);return o&&e.push({Component:ct,position:"normal"}),{markdownTransformers:[k0],nodes:o?[C0,x0]:[],plugins:e,slashMenu:{groups:[ut([{Icon:Rn,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:n})=>n.t("lexical:checklist:label"),onSelect:({editor:n})=>{n.dispatchCommand(Ss,void 0)}}])]},toolbarFixed:{groups:ws},toolbarInline:{groups:ws}}});import{$isListNode as Mn,INSERT_ORDERED_LIST_COMMAND as ys,ListItemNode as w0,ListNode as S0}from"@lexical/list";import{ORDERED_LIST as N0}from"@lexical/markdown";import{$isRangeSelection as L0}from"lexical";import{jsx as Ns}from"react/jsx-runtime";import"react";var E0={16:"M5.6 9.01a.5.5 0 0 1 .4.49v1a.5.5 0 0 1-.276.447L4 11.81V12h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-1l.005-.07a.5.5 0 0 1 .271-.377L5 10.19V10H3.5a.5.5 0 0 1 0-1h2zM12.5 12a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zm0-4.5a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1zM4.6 3.01a.5.5 0 0 1 .4.49v3a.5.5 0 0 1-1 0V4h-.5a.5.5 0 0 1 0-1h1zM12.5 3a.5.5 0 0 1 0 1h-4a.5.5 0 0 1 0-1z",24:"M11 7a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1h-6A.5.5 0 0 1 11 7M6 7a.5.5 0 0 1 .5-.5h1A.5.5 0 0 1 8 7v3.5a.5.5 0 1 1-1 0v-3h-.5A.5.5 0 0 1 6 7m0 6.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.276.447L7 16.31v.191h1.5a.5.5 0 0 1 0 1h-2A.5.5 0 0 1 6 17v-1a.5.5 0 0 1 .276-.447L8 14.69V14H6.5a.5.5 0 0 1-.5-.5m5.5 3a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1zm0-5a.5.5 0 1 0 0 1h6a.5.5 0 0 0 0-1z"},vn=({className:t,size:e=24})=>Ns("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ns("path",{clipRule:"evenodd",d:E0[e],fill:"currentColor",fillRule:"evenodd"})});var Ls=[oe([{ChildComponent:vn,isActive:({selection:t})=>{if(!L0(t))return!1;for(let e of t.getNodes()){if(Mn(e)&&e.getListType()==="number")continue;let o=e.getParent();if(Mn(o)&&o.getListType()==="number")continue;let n=o?.getParent();if(!(Mn(n)&&n.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:t})=>t.t("lexical:orderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(ys,void 0)},order:10}])],y0=A(({featureProviderMap:t})=>{let e=fo("ordered",t);return{markdownTransformers:[N0],nodes:e?[S0,w0]:[],plugins:e?[{Component:ct,position:"normal"}]:[],slashMenu:{groups:[ut([{Icon:vn,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:o})=>o.t("lexical:orderedList:label"),onSelect:({editor:o})=>{o.dispatchCommand(ys,void 0)}}])]},toolbarFixed:{groups:Ls},toolbarInline:{groups:Ls}}});import{$isListNode as Dn,INSERT_UNORDERED_LIST_COMMAND as vs,ListItemNode as I0,ListNode as v0}from"@lexical/list";import{UNORDERED_LIST as M0}from"@lexical/markdown";import{$isRangeSelection as A0}from"lexical";import{jsx as Rs}from"react/jsx-runtime";import"react";var R0="M7 16C7.55228 16 8 16.4477 8 17C8 17.5523 7.55228 18 7 18C6.44772 18 6 17.5523 6 17C6 16.4477 6.44772 16 7 16ZM17.5 16.5C17.7761 16.5 18 16.7239 18 17C18 17.2761 17.7761 17.5 17.5 17.5H10.5C10.2239 17.5 10 17.2761 10 17C10 16.7239 10.2239 16.5 10.5 16.5H17.5ZM7 11C7.55228 11 8 11.4477 8 12C8 12.5523 7.55228 13 7 13C6.44772 13 6 12.5523 6 12C6 11.4477 6.44772 11 7 11ZM17.5 11.5C17.7761 11.5 18 11.7239 18 12C18 12.2761 17.7761 12.5 17.5 12.5H10.5C10.2239 12.5 10 12.2761 10 12C10 11.7239 10.2239 11.5 10.5 11.5H17.5ZM7 6C7.55228 6 8 6.44772 8 7C8 7.55228 7.55228 8 7 8C6.44772 8 6 7.55228 6 7C6 6.44772 6.44772 6 7 6ZM17.5 6.5C17.7761 6.5 18 6.72386 18 7C18 7.27614 17.7761 7.5 17.5 7.5H10.5C10.2239 7.5 10 7.27614 10 7C10 6.72386 10.2239 6.5 10.5 6.5H17.5Z",An=({className:t})=>Rs("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Rs("path",{d:R0,fill:"currentColor"})});var Is=[oe([{ChildComponent:An,isActive:({selection:t})=>{if(!A0(t))return!1;for(let e of t.getNodes()){if(Dn(e)&&e.getListType()==="bullet")continue;let o=e.getParent();if(Dn(o)&&o.getListType()==="bullet")continue;let n=o?.getParent();if(!(Dn(n)&&n.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(vs,void 0)},order:11}])],D0=A({markdownTransformers:[M0],nodes:[v0,I0],plugins:[{Component:ct,position:"normal"}],slashMenu:{groups:[ut([{Icon:An,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(vs,void 0)}}])]},toolbarFixed:{groups:Is},toolbarInline:{groups:Is}});import{$setBlocksType as Ds}from"@lexical/selection";import{$createParagraphNode as $s,$getSelection as Os,$isParagraphNode as Ms,$isRangeSelection as $0}from"lexical";var As=[oe([{ChildComponent:yt,isActive:({selection:t})=>{if(!$0(t))return!1;for(let e of t.getNodes())if(!Ms(e)&&!Ms(e.getParent()))return!1;return!0},key:"paragraph",label:({i18n:t})=>t.t("lexical:paragraph:label2"),onSelect:({editor:t})=>{t.update(()=>{let e=Os();Ds(e,()=>$s())})},order:1}])],O0=A({slashMenu:{groups:[q([{Icon:yt,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let e=Os();Ds(e,()=>$s())})}}])]},toolbarFixed:{groups:As},toolbarInline:{groups:As}});import{c as lh}from"react/compiler-runtime";import{jsx as ra}from"react/jsx-runtime";import{useLexicalComposerContext as ih}from"@lexical/react/LexicalComposerContext";import{useEffect as sh,useState as ah}from"react";import{jsx as na,Fragment as rh}from"react/jsx-runtime";import"react";import{jsx as F0}from"react/jsx-runtime";var Fs={quote:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return F0("blockquote",{children:o})}};import{jsx as P0}from"react/jsx-runtime";var Ps=new Set(["h1","h2","h3","h4","h5","h6"]);var Bs={heading:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=Ps.has(t.tag)?t.tag:"h1";return P0(n,{children:o})}};import{jsx as B0}from"react/jsx-runtime";var js={horizontalrule:B0("hr",{})};import{jsx as j0}from"react/jsx-runtime";var Hs={linebreak:j0("br",{})};import{jsx as zs}from"react/jsx-runtime";var Gs=({internalDocToHref:t})=>({autolink:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0;return zs("a",{href:e.fields.url,rel:r,target:l,children:n})},link:({node:e,nodesToJSX:o})=>{let n=o({nodes:e.children}),r=e.fields.newTab?"noopener noreferrer":void 0,l=e.fields.newTab?"_blank":void 0,s=e.fields.url??"";return e.fields.linkType==="internal"&&(t?s=t({linkNode:e}):(console.error("Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided"),s="#")),zs("a",{href:s,rel:r,target:l,children:n})}});import{jsx as dt,jsxs as H0,Fragment as z0}from"react/jsx-runtime";import{v4 as G0}from"uuid";var Us=new Set(["ol","ul"]);var Ws={list:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=Us.has(t.tag)?t.tag:"ul";return dt(n,{className:`list-${t?.listType}`,children:o})},listitem:({node:t,nodesToJSX:e,parent:o})=>{let n=t.children.some(l=>l.type==="list"),r=e({nodes:t.children});if("listType"in o&&o?.listType==="check"){let l=G0();return dt("li",{"aria-checked":t.checked?"true":"false",className:`list-item-checkbox${t.checked?" list-item-checkbox-checked":" list-item-checkbox-unchecked"}${n?" nestedListItem":""}`,role:"checkbox",style:{listStyleType:"none"},tabIndex:-1,value:t?.value,children:n?r:H0(z0,{children:[dt("input",{checked:t.checked,id:l,readOnly:!0,type:"checkbox"}),dt("label",{htmlFor:l,children:r}),dt("br",{})]})})}else return dt("li",{className:`${n?"nestedListItem":""}`,style:n?{listStyleType:"none"}:void 0,value:t?.value,children:r})}};import{jsx as $n}from"react/jsx-runtime";var Vs={paragraph:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return o?.length?$n("p",{children:o}):$n("p",{children:$n("br",{})})}};var Ks={tab:" "};import{jsx as Ot}from"react/jsx-runtime";var Js={table:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Ot("div",{className:"lexical-table-container",children:Ot("table",{className:"lexical-table",style:{borderCollapse:"collapse"},children:Ot("tbody",{children:o})})})},tablecell:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children}),n=t.headerState>0?"th":"td",r=`lexical-table-cell-header-${t.headerState}`,l={backgroundColor:t.backgroundColor||void 0,border:"1px solid #ccc",padding:"8px"},s=t.colSpan&&t.colSpan>1?t.colSpan:void 0,i=t.rowSpan&&t.rowSpan>1?t.rowSpan:void 0;return Ot(n,{className:`lexical-table-cell ${r}`,colSpan:s,rowSpan:i,style:l,children:o})},tablerow:({node:t,nodesToJSX:e})=>{let o=e({nodes:t.children});return Ot("tr",{className:"lexical-table-row",children:o})}};import{jsx as We}from"react/jsx-runtime";import"react";var $={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},U0=$.IS_BOLD|$.IS_ITALIC|$.IS_STRIKETHROUGH|$.IS_UNDERLINE|$.IS_CODE|$.IS_SUBSCRIPT|$.IS_SUPERSCRIPT|$.IS_HIGHLIGHT,W0="\xA0",V0=`
56
56
 
57
- `,Ks="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Js="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",B0=new RegExp("^[^"+Js+"]*["+Ks+"]"),j0=new RegExp("^[^"+Ks+"]*["+Js+"]"),H0={bold:O.IS_BOLD,code:O.IS_CODE,highlight:O.IS_HIGHLIGHT,italic:O.IS_ITALIC,strikethrough:O.IS_STRIKETHROUGH,subscript:O.IS_SUBSCRIPT,superscript:O.IS_SUPERSCRIPT,underline:O.IS_UNDERLINE},z0={directionless:O.IS_DIRECTIONLESS,unmergeable:O.IS_UNMERGEABLE},G0={center:O.IS_ALIGN_CENTER,end:O.IS_ALIGN_END,justify:O.IS_ALIGN_JUSTIFY,left:O.IS_ALIGN_LEFT,right:O.IS_ALIGN_RIGHT,start:O.IS_ALIGN_START},U0={[O.IS_ALIGN_CENTER]:"center",[O.IS_ALIGN_END]:"end",[O.IS_ALIGN_JUSTIFY]:"justify",[O.IS_ALIGN_LEFT]:"left",[O.IS_ALIGN_RIGHT]:"right",[O.IS_ALIGN_START]:"start"},W0={normal:O.IS_NORMAL,segmented:O.IS_SEGMENTED,token:O.IS_TOKEN},V0={[O.IS_NORMAL]:"normal",[O.IS_SEGMENTED]:"segmented",[O.IS_TOKEN]:"token"};var Xs={text:({node:t})=>{let e=t.text;return t.format&O.IS_BOLD&&(e=Ue("strong",{children:e})),t.format&O.IS_ITALIC&&(e=Ue("em",{children:e})),t.format&O.IS_STRIKETHROUGH&&(e=Ue("span",{style:{textDecoration:"line-through"},children:e})),t.format&O.IS_UNDERLINE&&(e=Ue("span",{style:{textDecoration:"underline"},children:e})),t.format&O.IS_CODE&&(e=Ue("code",{children:e})),t.format&O.IS_SUBSCRIPT&&(e=Ue("sub",{children:e})),t.format&O.IS_SUPERSCRIPT&&(e=Ue("sup",{children:e})),e}};import{jsx as Ot}from"react/jsx-runtime";var Ys={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,n=e.fields?.alt||o?.alt||"",r=o.url;if(!o.mimeType.startsWith("image"))return Ot("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.variants||!Object.keys(o.variants).length)return Ot("img",{alt:n,height:o.height,src:r,width:o.width});let l=[];for(let s in o.variants){let i=o.variants[s];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let u=i?.url;l.push(Ot("source",{media:`(max-width: ${i.width}px)`,srcSet:u,type:i.mimeType},s))}return l.push(Ot("img",{alt:n,height:o?.height,src:r,width:o?.width},"image")),Ot("picture",{children:l})}};var ut={...Us,...Xs,...Bs,...$s,...Vs,...Fs,...Ps,...Gs,...Hs({}),...Ys,...Ws};import{jsx as xo,Fragment as K0}from"react/jsx-runtime";import go from"react";function Zs(t){if(!!!t?.root?.children?.length)return!1;let o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let n=t?.root?.children[0];if(!n?.children||n?.children?.length===0)o=!0;else if(n?.children?.length===1){let r=n?.children[0];r?.type==="text"&&(r?.text?.length||(o=!0))}}return!o}function J0(t){return e=>{let o={...e,isEditor:!1,isJSXConverter:!0};if(t.Component)return t.Component(o);if(t.html){let n=typeof t.html=="function"?t.html(o):t.html;return xo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function qs(t){return e=>{if(t.Component){let o={...e,isEditor:!1,isJSXConverter:!0};return t.Component(o)}if(t.Block){let o=e.node,n={childIndex:e.childIndex,converters:e.converters,formData:o.fields??{},isEditor:!1,isJSXConverter:!0,node:o,nodesToJSX:e.nodesToJSX,parent:e.parent};return go.createElement(t.Block,n)}if(t.html){let o={...e,isEditor:!1,isJSXConverter:!0},n=typeof t.html=="function"?t.html(o):t.html;return xo("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function X0(t){let e={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object")continue;if(o==="blocks"){e.blocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.blocks[l]=qs(i))}continue}if(o==="inlineBlocks"){e.inlineBlocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.inlineBlocks[l]=qs(i))}continue}let r=n;(r.Component||r.html)&&(e[o]=J0(r))}return e}function Qs({converters:t,data:e,disableIndent:o,disableTextAlign:n,nodeMap:r}){if(Zs(e)){let l=r?X0(r):void 0,s=l?{...t,...l,blocks:{...t.blocks,...l.blocks},inlineBlocks:{...t.inlineBlocks,...l.inlineBlocks}}:t;return ea({converters:s,disableIndent:o,disableTextAlign:n,nodes:e.root.children,parent:e.root})}return xo(K0,{})}function ea({converters:t,disableIndent:e,disableTextAlign:o,nodes:n,parent:r}){let l=t.unknown;return n.map((i,u)=>{let d;i.type==="block"?(d=t?.blocks?.[i?.fields?.blockType],!d&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${i?.fields?.blockType} block, but no converter is provided`)):i.type==="inlineBlock"?(d=t?.inlineBlocks?.[i?.fields?.blockType],!d&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${i?.fields?.blockType} inline block, but no converter is provided`)):d=t[i.type];try{!d&&l&&(d=l);let c;d?c=typeof d=="function"?d({childIndex:u,converters:t,node:i,nodesToJSX:p=>ea({converters:p.converters??t,disableIndent:p.disableIndent??e,disableTextAlign:p.disableTextAlign??o,nodes:p.nodes,parent:p.parent??{...i,parent:r}}),parent:r}):d:c=xo("span",{children:"unknown node"},u);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(i.type))&&"format"in i&&i.format)switch(i.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(i.type))&&"indent"in i&&i.indent&&i.type!=="listitem"&&(a.paddingInlineStart=`${Number(i.indent)*40}px`),go.isValidElement(c)){if(a.textAlign||a.paddingInlineStart){let m={...a,...c?.props?.style??{}};return go.cloneElement(c,{key:u,style:m})}return go.cloneElement(c,{key:u})}return c}catch(c){return console.error("Error converting lexical node to JSX:",c,"node:",i),null}}).filter(Boolean)}function On({className:t,converters:e,data:o,disableContainer:n,disableIndent:r,disableTextAlign:l,nodeMap:s}){if(!o)return null;let i=e,u={};i?typeof i=="function"?u=i({defaultConverters:ut}):u=i:u=ut;let d=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&Qs({converters:u,data:o,disableIndent:r,disableTextAlign:l,nodeMap:s});return n?ta(Y0,{children:d}):ta("div",{className:t??"payload-richtext",children:d})}function na(){let t=Z0(7),[e]=q0(),o;t[0]!==e?(o=()=>e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[n,r]=eh(o),l,s;t[2]!==e?(l=()=>e.registerUpdateListener(u=>{let{editorState:d}=u;r(d.toJSON())}),s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),Q0(l,s);let i;return t[5]!==n?(i=oa("div",{className:"debug-jsx-converter",children:oa(On,{converters:ut,data:n})}),t[5]=n,t[6]=i):i=t[6],i}var th=A({plugins:[{Component:na,position:"bottom"}]});var z={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},oh={text:{"text-red":{css:{color:`light-dark(${z.red[600]}, ${z.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${z.orange[600]}, ${z.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${z.yellow[700]}, ${z.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${z.green[700]}, ${z.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${z.blue[600]}, ${z.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${z.purple[600]}, ${z.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${z.pink[600]}, ${z.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${z.red[400]}, ${z.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${z.orange[400]}, ${z.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${z.yellow[300]}, ${z.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${z.green[400]}, ${z.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${z.blue[400]}, ${z.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${z.purple[400]}, ${z.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${z.pink[400]}, ${z.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as Vh}from"lexical";import{jsx as ra}from"react/jsx-runtime";import"react";var nh="M9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7H7.5C7.22386 7 7 7.22386 7 7.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V14.5C17 14.2239 17.2239 14 17.5 14C17.7761 14 18 14.2239 18 14.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V7.5C6 6.67157 6.67157 6 7.5 6H9.5ZM17.5 6C17.7761 6 18 6.22386 18 6.5V11.5C18 11.7761 17.7761 12 17.5 12C17.2239 12 17 11.7761 17 11.5V7.70703L12.8535 11.8535C12.6583 12.0488 12.3417 12.0488 12.1465 11.8535C11.9512 11.6583 11.9512 11.3417 12.1465 11.1465L16.293 7H12.5C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6H17.5Z",Fn=({className:t})=>ra("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ra("path",{d:nh,fill:"currentColor"})});import{jsx as ah}from"react/jsx-runtime";import{$applyNodeReplacement as ch}from"lexical";import*as ia from"react";import{DecoratorBlockNode as rh}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as lh}from"@lexical/utils";import{$applyNodeReplacement as ih}from"lexical";function sh(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:la({relationTo:o,value:e})}:null}var Ft=class extends rh{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:sh,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=la(o);return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return lh(o,e?.theme?.relationship),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship"}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function la(t){return ih(new Ft({data:t}))}var uh=ia.lazy(()=>import("./RelationshipComponent-YCPAKOL7.js").then(t=>({default:t.RelationshipComponent})));function dh(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:We({relationTo:o,value:e})}:null}var we=class extends Ft{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:dh,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=We(o);return n.setFormat(e.format),n}decorate(e,o){return ah(uh,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function We(t){return ch(new we({data:t}))}function Pn(t){return t instanceof we}import{c as Dh}from"react/compiler-runtime";import{jsx as $h}from"react/jsx-runtime";import{useLexicalComposerContext as Oh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Fh}from"@lexical/utils";import{$getPreviousSelection as Ph,$getSelection as Bh,$isParagraphNode as jh,$isRangeSelection as Hh,COMMAND_PRIORITY_EDITOR as zh,createCommand as Gh}from"lexical";import{useEffect as Uh}from"react";import{c as ca}from"react/compiler-runtime";import{jsx as Bn}from"react/jsx-runtime";import{useLexicalComposerContext as ua}from"@lexical/react/LexicalComposerContext.js";import{toast as Eh}from"@payloadcms/ui";import{$getNodeByKey as wh,COMMAND_PRIORITY_EDITOR as da}from"lexical";import{useEffect as ma,useState as Sh}from"react";import{c as mh}from"react/compiler-runtime";import{jsx as ph}from"react/jsx-runtime";import{useLexicalComposerContext as fh}from"@lexical/react/LexicalComposerContext";import{useListDrawer as hh,useModal as gh}from"@payloadcms/ui";import{$getNodeByKey as sa,$getPreviousSelection as xh,$getRoot as Ch,$getSelection as bh,$isRangeSelection as kh,$setSelection as _h}from"lexical";import{useEffect as Th,useState as aa}from"react";var Pt=t=>{let e=mh(23),[o]=fh(),[n,r]=aa(null),[l,s]=aa(!1),[i,u,d]=hh(t),{closeDrawer:c,drawerSlug:a,isDrawerOpen:m,openDrawer:p}=d,{modalState:h}=gh(),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let N=bh()??xh();r(N)},e[0]=f):f=e[0];let g=f,C;e[1]!==o||e[2]!==n?(C=()=>{n&&o.update(()=>{if(kh(n)){let{anchor:N,focus:w}=n;sa(N.key)&&sa(w.key)&&_h(n.clone())}else Ch().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=n,e[3]=C):C=e[3];let E=C,L;e[4]!==c?(L=()=>{c()},e[4]=c,e[5]=L):L=e[5];let x=L,b,k;e[6]!==a||e[7]!==h||e[8]!==E||e[9]!==l?(b=()=>{if(!l)return;let N=h[a];N&&!N?.isOpen&&(s(!1),setTimeout(()=>{E()},1))},k=[h,a,E,l],e[6]=a,e[7]=h,e[8]=E,e[9]=l,e[10]=b,e[11]=k):(b=e[10],k=e[11]),Th(b,k);let _;e[12]!==u?(_=N=>ph(u,{...N,onClick:()=>{g()}}),e[12]=u,e[13]=_):_=e[13];let T;e[14]!==p?(T=()=>{g(),p(),s(!0)},e[14]=p,e[15]=T):T=e[15];let v;return e[16]!==i||e[17]!==x||e[18]!==m||e[19]!==a||e[20]!==_||e[21]!==T?(v={closeListDrawer:x,isListDrawerOpen:m,ListDrawer:i,listDrawerSlug:a,ListDrawerToggler:_,openListDrawer:T},e[16]=i,e[17]=x,e[18]=m,e[19]=a,e[20]=_,e[21]=T,e[22]=v):v=e[22],v};var Nh=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=wh(o);r&&r.replace(We({relationTo:e,value:n}))}):t.dispatchCommand(jn,{relationTo:e,value:n})},Lh=t=>{let e=ca(14),{enabledCollectionSlugs:o}=t,[n]=ua(),[r,l]=Sh(null),s=o?.[0],i;e[0]!==o||e[1]!==s?(i={collectionSlugs:o,selectedCollection:s},e[0]=o,e[1]=s,e[2]=i):i=e[2];let{closeListDrawer:u,ListDrawer:d,openListDrawer:c}=Pt(i),a,m;e[3]!==n||e[4]!==c?(a=()=>n.registerCommand(et,g=>(l(g?.replace?g?.replace.nodeKey:null),c(),!0),da),m=[n,c],e[3]=n,e[4]=c,e[5]=a,e[6]=m):(a=e[5],m=e[6]),ma(a,m);let p;e[7]!==u||e[8]!==n||e[9]!==r?(p=g=>{let{collectionSlug:C,doc:E}=g;Nh({editor:n,relationTo:C,replaceNodeKey:r,value:E.id}),u()},e[7]=u,e[8]=n,e[9]=r,e[10]=p):p=e[10];let h=p,f;return e[11]!==d||e[12]!==h?(f=Bn(d,{onSelect:h}),e[11]=d,e[12]=h,e[13]=f):f=e[13],f},yh=()=>{let t=ca(3),[e]=ua(),o,n;return t[0]!==e?(o=()=>e.registerCommand(et,Rh,da),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),ma(o,n),null},pa=({enabledCollectionSlugs:t})=>t?.length?Bn(Lh,{enabledCollectionSlugs:t}):Bn(yh,{});function Rh(){return Eh.error("No relationship collections enabled"),!0}import{c as Ih}from"react/compiler-runtime";import{useConfig as vh,useEntityVisibility as Mh}from"@payloadcms/ui";import"react";var Co=t=>{let e=Ih(11),{enabledCollectionSlugs:o}=t,{config:n}=vh(),{collections:r}=n,{visibleEntities:l}=Mh(),s,i;if(e[0]!==r||e[1]!==o||e[2]!==l){let d;e[5]!==o||e[6]!==l?(d=a=>{let{slug:m}=a;return o.includes(m)&&(!l?.collections||l.collections.includes(m))},e[5]=o,e[6]=l,e[7]=d):d=e[7];let c=r.filter(d);s=c,i=c.map(Ah),e[0]=r,e[1]=o,e[2]=l,e[3]=s,e[4]=i}else s=e[3],i=e[4];let u;return e[8]!==s||e[9]!==i?(u={enabledCollections:s,enabledCollectionSlugs:i},e[8]=s,e[9]=i,e[10]=u):u=e[10],u};function Ah(t){return t.slug}var jn=Gh("INSERT_RELATIONSHIP_COMMAND"),fa=t=>{let e=Dh(7),{clientProps:o}=t,[n]=Oh(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=Co(r),s,i;e[2]!==n?(s=()=>{if(!n.hasNodes([we]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return n.registerCommand(jn,Wh,zh)},i=[n],e[2]=n,e[3]=s,e[4]=i):(s=e[3],i=e[4]),Uh(s,i);let u;return e[5]!==l?(u=$h(pa,{enabledCollectionSlugs:l}),e[5]=l,e[6]=u):u=e[6],u};function Wh(t){let e=Bh()||Ph();if(Hh(e)){let o=We(t),{focus:n}=e,r=n.getNode();Fh(o),jh(r)&&!r.__first&&r.remove()}return!0}var Kh=A({nodes:[we],plugins:[{Component:fa,position:"normal"}],slashMenu:{groups:[q([{Icon:Fn,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]},toolbarFixed:{groups:[be([{ChildComponent:Fn,isActive:({selection:t})=>{if(!Vh(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Pn(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(et,{replace:!1})}}])]}});import{c as y5}from"react/compiler-runtime";import{jsx as he,jsxs as R5}from"react/jsx-runtime";import{useLexicalComposerContext as I5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as Na}from"@lexical/react/useLexicalEditable";import{useScrollInfo as v5,useThrottledEffect as M5,useTranslation as A5}from"@payloadcms/ui";import*as La from"react";import{useMemo as Wn}from"react";import{jsx as Jh,jsxs as Xh}from"react/jsx-runtime";import{Tooltip as Yh,useTranslation as Zh}from"@payloadcms/ui";import{$addUpdateTag as qh}from"lexical";import{useCallback as ha,useEffect as Qh,useMemo as ga,useRef as e5,useState as t5}from"react";var Hn="toolbar-popup__button",Bt=({active:t=!1,children:e,editor:o,enabled:n=!0,item:r})=>{let{i18n:l}=Zh(),{fieldProps:{featureClientSchemaMap:s,schemaPath:i}}=W(),[u,d]=t5(!1),c=e5(null);Qh(()=>{c.current?.removeAttribute("data-pressing")},[t]);let a=ga(()=>r.label?typeof r.label=="function"?r.label({featureClientSchemaMap:s,i18n:l,schemaPath:i}):r.label:r.key.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,f=>f.toUpperCase()),[s,l,i,r]),m=ga(()=>[Hn,n?"":"disabled",t?"active":"",r.key?`${Hn}-${r.key}`:""].filter(Boolean).join(" "),[t,n,r.key]),p=ha(()=>{n&&o.focus(()=>{o.update(()=>{qh("toolbar")}),r.onSelect?.({editor:o,isActive:t})})},[o,r,t,n]),h=ha(f=>{f.preventDefault(),f.currentTarget.setAttribute("data-pressing","")},[]);return Xh("button",{"aria-label":a,"aria-pressed":r.isActive?t:void 0,className:m,"data-button-key":r.key,disabled:!n,onClick:p,onMouseDown:h,onPointerEnter:()=>d(!0),onPointerLeave:()=>{d(!1),c.current?.removeAttribute("data-pressing")},ref:c,type:"button",children:[Jh(Yh,{className:`${Hn}__tooltip`,show:u,children:a}),e]})};import{c as a5}from"react/compiler-runtime";import{jsx as dt}from"react/jsx-runtime";import c5,{useMemo as u5}from"react";import{useTranslation as d5}from"@payloadcms/ui";import{jsx as Ve,jsxs as xa}from"react/jsx-runtime";import{Button as o5}from"@payloadcms/ui";import{$addUpdateTag as n5,isDOMNode as r5}from"lexical";import Gn,{useCallback as l5,useEffect as ko,useId as i5,useMemo as ba,useRef as bo,useState as zn}from"react";var Ca="toolbar-popup__dropdown-item",ka=Gn.createContext(null);function _a({active:t,children:e,editor:o,enabled:n,Icon:r,item:l,itemKey:s,tooltip:i}){let u=ba(()=>[Ca,n===!1?"disabled":"",t?"active":"",l?.key?`${Ca}-${l.key}`:""].filter(Boolean).join(" "),[n,t,l.key]),d=bo(null),c=Gn.use(ka);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=c;return ko(()=>{d?.current!=null&&a(d)},[d,a]),Ve(o5,{"aria-label":i,buttonStyle:"ghost",className:u,disabled:n===!1,extraButtonProps:{"aria-checked":l.isActive?!!t:void 0,"data-item-key":s,role:l.isActive?"menuitemcheckbox":"menuitem",tabIndex:-1},icon:r,iconPosition:"left",onClick:()=>{n!==!1&&o.focus(()=>{o.update(()=>{n5("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:m=>{m.preventDefault()},ref:d,tooltip:i,type:"button",children:e})}function s5({id:t,children:e,dropdownKey:o,dropDownRef:n,itemsContainerClassNames:r,onClose:l,shouldAutoFocus:s}){let[i,u]=zn(),[d,c]=zn(),a=l5(h=>{u(f=>f!=null?[...f,h]:[h])},[u]),m=h=>{if(i==null)return;let{key:f}=h,g=i.filter(C=>!C.current?.disabled);["ArrowDown","ArrowUp","Escape"].includes(f)&&h.preventDefault(),f==="Escape"?l():f==="Tab"?setTimeout(()=>l({restoreFocus:!1})):f==="ArrowUp"?c(C=>{if(C==null)return g[0];let E=g.indexOf(C)-1;return g[E===-1?g.length-1:E]}):f==="ArrowDown"&&c(C=>{if(C==null)return g[0];let E=g.indexOf(C);return g[E===g.length-1?0:E+1]})},p=ba(()=>({registerItem:a}),[a]);return ko(()=>{s&&i!=null&&d==null&&c(i.find(h=>!h.current?.disabled)),d!=null&&d?.current!=null&&d.current.focus()},[i,d,s]),Ve(ka,{value:p,children:Ve("div",{className:(r??["toolbar-popup__dropdown-items"]).join(" "),"data-dropdown-key":o,"data-theme":"dark",id:t,onKeyDown:m,popover:"manual",ref:n,role:"menu",tabIndex:-1,children:e})})}function Ta({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:n=!1,dropdownKey:r,Icon:l,itemsContainerClassNames:s,label:i,stopCloseOnClickSelf:u}){let d=bo(null),c=bo(null),a=bo(!1),m=i5(),p=`toolbar-dropdown-${r}-${m}`,[h,f]=zn(!1),g=({restoreFocus:C=!0}={})=>{f(!1),C&&c?.current!=null&&c.current.focus()};return ko(()=>{let C=c.current,E=d.current;if(h&&C!==null&&E!==null){E.matches(":popover-open")||E.showPopover();let L=()=>{let{bottom:x,left:b,top:k}=C.getBoundingClientRect(),_=8,T=5,v=x+T,N=k-E.offsetHeight-T,w=Math.max(_,window.innerHeight-E.offsetHeight-_),y=v+E.offsetHeight+_<=window.innerHeight?v:N>=_?N:v;E.style.position="fixed",E.style.top=`${Math.max(_,Math.min(y,w))}px`,E.style.left=`${Math.max(8,Math.min(b-5,window.innerWidth-E.offsetWidth-20))}px`};return L(),window.addEventListener("resize",L),window.addEventListener("scroll",L,{capture:!0,passive:!0}),()=>{window.removeEventListener("resize",L),window.removeEventListener("scroll",L,{capture:!0})}}},[d,c,h]),ko(()=>{let C=c.current;if(C!==null&&h){let E=L=>{let x=L.target;r5(x)&&(u&&d.current&&d.current.contains(x)||C.contains(x)||f(!1))};return document.addEventListener("click",E),()=>{document.removeEventListener("click",E)}}},[d,c,h,u]),xa(Gn.Fragment,{children:[xa("button",{"aria-controls":p,"aria-expanded":h,"aria-haspopup":"menu","aria-label":t,className:e+(h?" active":""),"data-dropdown-key":r,disabled:n,onClick:C=>{C.preventDefault(),a.current=!1,f(!h)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a.current=!0,f(!h))},onMouseDown:C=>{C.preventDefault()},ref:c,type:"button",children:[l&&Ve(l,{}),i&&Ve("span",{className:"toolbar-popup__dropdown-label",children:i}),Ve("i",{className:"toolbar-popup__dropdown-caret"})]}),h&&Ve(s5,{dropdownKey:r,dropDownRef:d,id:p,itemsContainerClassNames:s,onClose:g,shouldAutoFocus:a.current,children:o})]})}var Un="toolbar-popup__dropdown",m5=t=>{let e=a5(15),{active:o,anchorElem:n,editor:r,enabled:l,iconOnly:s,item:i}=t,{i18n:u}=d5(),{fieldProps:d}=W(),{featureClientSchemaMap:c,schemaPath:a}=d;if(i.Component){let p;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i?(p=i?.Component&&dt(i.Component,{active:o,anchorElem:n,editor:r,enabled:l,item:i},i.key),e[0]=o,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=p):p=e[5],p}let m;if(e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==c||e[10]!==u||e[11]!==s||e[12]!==i||e[13]!==a){let p=i.key,h;i.label&&(p=typeof i.label=="function"?i.label({featureClientSchemaMap:c,i18n:u,schemaPath:a}):i.label),p.length>25?h=p.substring(0,25)+"...":h=p,m=dt(_a,{active:o,editor:r,enabled:l,Icon:i?.ChildComponent?dt(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:s?p:void 0,children:dt("span",{className:"text",children:h})},i.key),e[6]=o,e[7]=r,e[8]=l,e[9]=c,e[10]=u,e[11]=s,e[12]=i,e[13]=a,e[14]=m}else m=e[14];return m},p5=c5.memo(m5),jt=({anchorElem:t,classNames:e,editor:o,group:n,groupState:r,Icon:l,itemsContainerClassNames:s,label:i})=>{let{items:u,key:d}=n,c=u5(()=>u?.length?u.map(a=>dt(p5,{active:r.activeItemKeys.includes(a.key),anchorElem:t,editor:o,enabled:r.enabledItemKeys.includes(a.key),iconOnly:n.iconOnly,item:a},a.key)):null,[u,r.activeItemKeys,r.enabledItemKeys,t,o]);return dt(Ta,{buttonAriaLabel:`${d} dropdown`,buttonClassName:[Un,`${Un}-${d}`,...e||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:d,Icon:l,itemsContainerClassNames:[`${Un}-items`,...s||[]],label:i,children:c},d)};import{mergeRegister as f5}from"@lexical/utils";import{$getSelection as h5}from"lexical";import{useCallback as g5,useDeferredValue as x5,useEffect as C5,useRef as Ea,useState as b5}from"react";function k5(t){let e=new Map,o=new Map;if(!t?.length)return{groupStates:o,itemStates:e};for(let n of t){let r=[];for(let l of n.items)e.set(l.key,{active:!1,enabled:!0}),r.push(l.key);o.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:r})}return{groupStates:o,itemStates:e}}function _o(t,e){let[o,n]=b5(()=>k5(e)),r=x5(o),l=W(),s=Ea(l);s.current=l;let i=Ea(e);i.current=e;let u=Mr(),d=g5(()=>{t.getEditorState().read(()=>{let c=h5();if(!c)return;let a=i.current;if(!a?.length)return;let m=s.current,p=new Map,h=new Map;for(let f of a){let g=[],C=[],E=[],L=f.type==="dropdown"?f.maxActiveItems??1:void 0;for(let b of f.items){let k=b.isActive?(!L||g.length<L)&&b.isActive({editor:t,editorConfigContext:m,selection:c}):!1,_=b.isEnabled?b.isEnabled({editor:t,editorConfigContext:m,selection:c}):!0;k&&(g.push(b.key),C.push(b)),_&&E.push(b.key),p.set(b.key,{active:k,enabled:_})}let x=f.type==="dropdown"&&f.isEnabled?f.isEnabled({editor:t,editorConfigContext:m,selection:c}):!0;h.set(f.key,{activeItemKeys:g,activeItems:C,enabledGroup:x,enabledItemKeys:E})}n({groupStates:h,itemStates:p})})},[t]);return C5(()=>{u(d);let c=()=>{u(d)},a=f5(t.registerUpdateListener(c));return document.addEventListener("mouseup",c),()=>{a(),document.removeEventListener("mouseup",c)}},[t,u,d]),r}import{c as _5}from"react/compiler-runtime";import{useEffect as T5}from"react";var E5=".fixed-toolbar__scroll",w5=40;function S5({clientWidth:t,deltaMode:e,deltaY:o,isRightToLeft:n}){let r=e===1?o*w5:e===2?o*t:o;return n?-r:r}function wa(t){if(!(Math.abs(t.deltaY)>Math.abs(t.deltaX)))return;let o=t.target;if(!(o instanceof Element))return;let n=o.closest(E5);!n||!(n.scrollWidth>n.clientWidth)||(t.preventDefault(),n.scrollLeft+=S5({clientWidth:n.clientWidth,deltaMode:t.deltaMode,deltaY:t.deltaY,isRightToLeft:getComputedStyle(n).direction==="rtl"}))}var mt=0;function Sa(){let t=_5(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],T5(N5,e)}function N5(){return mt===0&&document.addEventListener("wheel",wa,{passive:!1}),mt=mt+1,L5}function L5(){mt=mt-1,mt===0&&document.removeEventListener("wheel",wa)}function D5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&he(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?he(Bt,{active:t,editor:o,enabled:n,item:r,children:he(r.ChildComponent,{})},r.key):null}function $5({anchorElem:t,editor:e,editorConfig:o,group:n,index:r,toolbarStates:l}){let{i18n:s}=A5(),{fieldProps:{featureClientSchemaMap:i,schemaPath:u}}=W(),d=l.groupStates.get(n.key),c=Wn(()=>{if(n.type!=="dropdown")return;let m=d?.activeItems?.[0];return m?m.ChildComponent:n.ChildComponent},[n,d?.activeItems]),a=Wn(()=>{if(n.type!=="dropdown")return;let m=d?.activeItems;if(!m?.length)return;if(m.length>1)return s.t("lexical:general:toolbarItemsActive",{count:m.length});let p=m[0],h=p.key;return p.label&&(h=typeof p.label=="function"?p.label({featureClientSchemaMap:i,i18n:s,schemaPath:u}):p.label),h.length>25&&(h=h.substring(0,25)+"..."),h},[n,d?.activeItems,s,i,u]);return R5("div",{className:`fixed-toolbar__group fixed-toolbar__group-${n.key}`,"data-toolbar-group-key":n.key,children:[n.type==="dropdown"&&n.items.length&&d?he(jt,{anchorElem:t,editor:e,group:n,groupState:d,Icon:c,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:a}):null,n.type==="buttons"&&n.items.length?n.items.map(m=>{let p=l.itemStates.get(m.key);return he(D5,{active:p?.active??!1,anchorElem:t,editor:e,enabled:p?.enabled??!0,item:m},m.key)}):null,r<o.features.toolbarFixed?.groups.length-1&&he("div",{className:"divider"})]},n.key)}function O5({anchorElem:t,clientProps:e,editor:o,editorConfig:n,parentWithFixedToolbar:r}){let l=La.useRef(null),s=Na(),{y:i}=v5();Sa();let u=_o(o,n?.features?.toolbarFixed?.groups),d=Wn(()=>{if(!r||e?.disableIfParentHasFixedToolbar)return null;let a=r.editorContainerRef.current.previousElementSibling;for(;a;){if(a.classList.contains("fixed-toolbar"))return a;a=a.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,r]);return M5(()=>{if(!d)return;let c=l.current;if(!c)return;let a=c.getBoundingClientRect(),m=d.getBoundingClientRect();if(!(a.bottom<m.top||a.top>m.bottom))c.classList.remove("fixed-toolbar"),c.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),d.classList.remove("fixed-toolbar"),d.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!c.classList.contains("fixed-toolbar--overlapping"))return;c.classList.remove("fixed-toolbar--overlapping"),c.classList.add("fixed-toolbar"),d.classList.remove("fixed-toolbar--hide"),d.classList.add("fixed-toolbar")}},50,[l,d,i]),he("div",{className:"fixed-toolbar",onFocus:c=>{c.stopPropagation()},ref:l,children:s&&he("div",{className:"fixed-toolbar__scroll",children:n?.features&&n.features?.toolbarFixed?.groups.map((c,a)=>he($5,{anchorElem:t,editor:o,editorConfig:n,group:c,index:a,toolbarStates:u},c.key))})})}var ya=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return ya(t.parentEditor)}return!1},Ra=t=>{let e=y5(6),{clientProps:o}=t,[n]=I5(),r=W();if(!Na())return null;let{editorConfig:s}=r,i=o.applyToFocusedEditor&&r.focusedEditor?.editor||n,u=o.applyToFocusedEditor&&r.focusedEditor?.editorConfig||s,d,c;if(e[0]!==o||e[1]!==i||e[2]!==u||e[3]!==r){c=Symbol.for("react.early_return_sentinel");e:{let a=ya(r);if(o?.disableIfParentHasFixedToolbar&&a){c=null;break e}if(!u?.features?.toolbarFixed?.groups?.length){c=null;break e}d=he(O5,{anchorElem:document.body,clientProps:o,editor:i,editorConfig:u,parentWithFixedToolbar:a})}e[0]=o,e[1]=i,e[2]=u,e[3]=r,e[4]=d,e[5]=c}else d=e[4],c=e[5];return c!==Symbol.for("react.early_return_sentinel")?c:d};var F5=A({plugins:[{Component:Ra,position:"aboveContainer"}]});import{c as P5}from"react/compiler-runtime";import{jsx as Se,jsxs as Ma}from"react/jsx-runtime";import{useLexicalComposerContext as B5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as j5}from"@lexical/react/useLexicalEditable";import{mergeRegister as Aa}from"@lexical/utils";import{$getSelection as Da,$isRangeSelection as Ia,$isTextNode as H5,$onUpdate as z5,COMMAND_PRIORITY_LOW as G5,getDOMSelection as $a,SELECTION_CHANGE_COMMAND as U5}from"lexical";import{useCallback as Eo,useEffect as Ht,useMemo as W5,useRef as va,useState as V5}from"react";import"react";import{createPortal as K5}from"react-dom";function Vn(t,e){let o=t.getRangeAt(0),n;if(t.anchorNode===e){let r=e;for(;r.firstElementChild!=null;)r=r.firstElementChild;n=r.getBoundingClientRect()}else n=o.getBoundingClientRect();return n}function To(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:l=32,horizontalPosition:s="left",specialHandlingForCaret:i=!1,targetRect:u,verticalGap:d=10}=t,c=o.parentElement;if(u===null||c==null){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let a=r.getBoundingClientRect(),m=o.getBoundingClientRect(),p=c.getBoundingClientRect(),h=u.top-a.height-d,f=u.left-l;s==="center"&&(f=u.left+u.width/2-a.width/2);let g=0;return!e&&h<p.top&&!i&&(g=a.height+u.height+d*2,h+=g),s==="center"?f+a.width>p.right?f=p.right-a.width-l:f<p.left&&(f=p.left+l):f+a.width>p.right&&(f=p.right-a.width-l),f-=m.left,r.style.opacity="1",i&&n!==0?(h-=m.bottom-n+a.height-3,r.style.transform=`translate(${f}px, ${h}px) rotate(180deg)`):(h-=m.top,r.style.transform=`translate(${f}px, ${h}px)`),g}function J5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&Se(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?Se(Bt,{active:t,editor:o,enabled:n,item:r,children:Se(r.ChildComponent,{})},r.key):null}function X5({anchorElem:t,editor:e,group:o,index:n,toolbarStates:r}){let{editorConfig:l}=W(),s=r.groupStates.get(o.key),i=W5(()=>o.type!=="dropdown"?void 0:s?.activeItems?.[0]?.ChildComponent??o.ChildComponent,[o,s?.activeItems]);return Ma("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${o.key}`,"data-toolbar-group-key":o.key,children:[o.type==="dropdown"&&o.items.length&&s?Se(jt,{anchorElem:t,editor:e,group:o,groupState:s,Icon:i}):null,o.type==="buttons"&&o.items.length?o.items.map(u=>{let d=r.itemStates.get(u.key);return Se(J5,{active:d?.active??!1,anchorElem:t,editor:e,enabled:d?.enabled??!0,item:u},u.key)}):null,n<l.features.toolbarInline?.groups.length-1&&Se("div",{className:"divider"})]},o.key)}function Y5({anchorElem:t,editor:e}){let o=va(null),n=va(null),{editorConfig:r}=W(),l=_o(e,r?.features?.toolbarInline?.groups),s=Eo(()=>{if(o?.current){let c=o.current.style.opacity==="0",a=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),a||(o.current.style.pointerEvents="none")}},[o]),i=Eo(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let a=o.current.style.opacity==="0",m=o.current.style.pointerEvents==="none";if(!a||!m){let p=c.clientX,h=c.clientY,f=document.elementFromPoint(p,h);o.current.contains(f)||s()}}},[s]),u=Eo(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);Ht(()=>(document.addEventListener("mousemove",i),document.addEventListener("mouseup",u),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",u)}),[o,i,u]);let d=Eo(()=>{let c=Da(),a=$a(e._window);if(o.current===null)return;let m=t.querySelector(":scope > .link-editor"),p=m!==null&&"style"in m&&m?.style?.opacity==="1",h=e.getRootElement();if(c!==null&&a!==null&&!a.isCollapsed&&h!==null&&h.contains(a.anchorNode)){let f=Vn(a,h),g=To({alwaysDisplayOnTop:p,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:f});n.current&&To({anchorElem:o.current,anchorFlippedOffset:g,floatingElem:n.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:8})}else s()},[e,s,t]);return Ht(()=>{let c=t.parentElement,a=()=>{e.getEditorState().read(()=>{d()})};return window.addEventListener("resize",a),c&&c.addEventListener("scroll",a),()=>{window.removeEventListener("resize",a),c&&c.removeEventListener("scroll",a)}},[e,d,t]),Ht(()=>(e.getEditorState().read(()=>{d()}),Aa(e.registerUpdateListener(({editorState:c})=>{c.read(()=>{d()})}),e.registerCommand(U5,()=>(z5(()=>e.read("latest",d)),!1),G5))),[e,d]),Ma("div",{className:"inline-toolbar-popup",ref:o,children:[Se("div",{className:"caret",ref:n}),r?.features&&r.features?.toolbarInline?.groups.map((c,a)=>Se(X5,{anchorElem:t,editor:e,group:c,index:a,toolbarStates:l},c.key))]})}function Z5(t,e){let o=P5(12),[n,r]=V5(!1),l=j5(),s;o[0]!==t?(s=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let p=Da(),h=$a(t._window),f=t.getRootElement();if(h!==null&&(!Ia(p)||f===null||!f.contains(h.anchorNode))){r(!1);return}if(!Ia(p))return;if(p.getTextContent()!==""){let C=p.getNodes(),E=!1;for(let L of C)if(H5(L)){r(!0),E=!0;break}E||r(!1)}else r(!1);let g=p.getTextContent().replace(/\n/g,"");if(!p.isCollapsed()&&g===""){r(!1);return}})},o[0]=t,o[1]=s):s=o[1];let i=s,u,d;o[2]!==i?(u=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),d=[i],o[2]=i,o[3]=u,o[4]=d):(u=o[3],d=o[4]),Ht(u,d);let c,a;if(o[5]!==t||o[6]!==i?(c=()=>Aa(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&r(!1)})),a=[t,i],o[5]=t,o[6]=i,o[7]=c,o[8]=a):(c=o[7],a=o[8]),Ht(c,a),!n||!l)return null;let m;return o[9]!==e||o[10]!==t?(m=K5(Se(Y5,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=m):m=o[11],m}var Oa=t=>{let{anchorElem:e}=t,[o]=B5();return Z5(o,e)};var q5=A({plugins:[{Component:Oa,position:"floatingAnchorElem"}]});import{TableCellNode as K2,TableNode as J2,TableRowNode as X2}from"@lexical/table";import{jsx as Fa}from"react/jsx-runtime";import"react";var Q5={16:"M7 4h4.5a.5.5 0 0 1 .5.5V6H7zM6 4H4.5a.5.5 0 0 0-.5.5V6h2zm0 3H4v2h2zm0 3H4v1.5a.5.5 0 0 0 .5.5H6zm1 2h4.5a.5.5 0 0 0 .5-.5V10H7zm0-3V7h5v2zM3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5z",24:"M17.204 6.51A2 2 0 0 1 19 8.5V16l-.011.204a2 2 0 0 1-1.785 1.785L17 18H7l-.204-.01a2 2 0 0 1-1.786-1.786L5 16V8.5a2 2 0 0 1 1.796-1.99L7 6.5h10zM6 16a1 1 0 0 0 1 1h2v-2.5H6zm4-1.5V17h7a1 1 0 0 0 .995-.898L18 16v-1.5zm-4-1h3V11H6zm4-2.5v2.5h8V11zM7 7.5a1 1 0 0 0-.995.897L6 8.5V10h3V7.5zm3 2.5h8V8.5a1 1 0 0 0-1-1h-7z"},Kn=({className:t,size:e=24})=>Fa("svg",{className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Fa("path",{clipRule:"evenodd",d:Q5[e],fill:"currentColor",fillRule:"evenodd"})});import{$convertToMarkdownString as eg}from"@lexical/markdown";import{$createTableCellNode as tg,$createTableNode as og,$createTableRowNode as ng,$isTableCellNode as Pa,$isTableNode as Jn,$isTableRowNode as Xn,TableCellHeaderStates as wo,TableCellNode as rg,TableNode as lg,TableRowNode as ig}from"@lexical/table";import{$isParagraphNode as sg,$isTextNode as ag}from"lexical";var ja=/^\|(.+)\|\s?$/,cg=/^(\| ?:?-*:? ?)+\|\s?$/,Ha=({allTransformers:t})=>({type:"element",dependencies:[lg,ig,rg],export:e=>{if(!Jn(e))return null;let o=[];for(let n of e.getChildren()){let r=[];if(!Xn(n))continue;let l=!1;for(let s of n.getChildren())Pa(s)&&(r.push(eg(t,s).replace(/\n/g,"\\n").trim()),s.__headerState===wo.ROW&&(l=!0));o.push(`| ${r.join(" | ")} |`),l&&o.push(`| ${r.map(s=>"---").join(" | ")} |`)}return o.join(`
58
- `)},regExp:ja,replace:(e,o,n)=>{let r=n[0];if(!r)return;if(cg.test(r)){let a=e.getPreviousSibling();if(!a||!Jn(a))return;let m=a.getChildren(),p=m[m.length-1];if(!p||!Xn(p))return;p.getChildren().forEach(h=>{Pa(h)&&h.setHeaderStyles(wo.ROW,wo.ROW)}),e.remove();return}let l=Ba(r,t);if(l==null)return;let s=[l],i=e.getPreviousSibling(),u=l.length;for(;i&&!(!sg(i)||i.getChildrenSize()!==1);){let a=i.getFirstChild();if(!ag(a))break;let m=Ba(a.getTextContent(),t);if(m==null)break;u=Math.max(u,m.length),s.unshift(m);let p=i.getPreviousSibling();i.remove(),i=p}let d=og();for(let a of s){let m=ng();d.append(m);for(let p=0;p<u;p++)m.append(p<a.length?a[p]:za("",t))}let c=e.getPreviousSibling();Jn(c)&&ug(c)===u?(c.append(...d.getChildren()),e.remove()):e.replace(d),d.selectEnd()}});function ug(t){let e=t.getFirstChild();return Xn(e)?e.getChildrenSize():0}var za=(t,e)=>{t=t.replace(/\\n/g,`
59
- `);let o=tg(wo.NO_STATUS);return oo(t,e,o,!1,!0),o},Ba=(t,e)=>{let o=t.match(ja);return!o||!o[1]?null:o[1].split("|").map(n=>za(n,e))};import{c as fg}from"react/compiler-runtime";import{jsx as j,jsxs as Ne}from"react/jsx-runtime";import{useLexicalComposerContext as Ja}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as hg}from"@lexical/react/useLexicalEditable";import{$computeTableMap as gg,$deleteTableColumnAtSelection as xg,$deleteTableRowAtSelection as Cg,$getNodeTriplet as bg,$getTableCellNodeFromLexicalNode as Ka,$getTableNodeFromLexicalNodeOrThrow as Me,$getTableRowIndexFromTableCellNode as kg,$insertTableColumnAtSelection as _g,$insertTableRowAtSelection as Tg,$isTableCellNode as Xa,$isTableSelection as zt,$mergeCells as Eg,$setTableColumnIsHeader as wg,$setTableRowIsHeader as Sg,$unmergeCell as Ng,getTableElement as Yn,getTableObserverFromTableElement as Zn,TableCellHeaderStates as pt,TableCellNode as Lg}from"@lexical/table";import{mergeRegister as yg}from"@lexical/utils";import{useScrollInfo as Rg}from"@payloadcms/ui";import{$getSelection as No,$isElementNode as Ig,$isRangeSelection as qn,$isTextNode as vg,$setSelection as Mg,COMMAND_PRIORITY_CRITICAL as Ag,getDOMSelection as Dg,isDOMNode as $g,SELECTION_CHANGE_COMMAND as Og}from"lexical";import*as Qn from"react";import{useCallback as de,useEffect as ft,useRef as So,useState as ht}from"react";import{createPortal as Ya}from"react-dom";import{jsx as Ga}from"react/jsx-runtime";import"react";var dg={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},Ua=({className:t,size:e=24})=>Ga("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ga("path",{clipRule:"evenodd",d:dg[e],fill:"currentColor",fillRule:"evenodd"})});import{$computeTableCellRectBoundary as mg,$computeTableMap as pg,$getNodeTriplet as Wa}from"@lexical/table";function Va({selection:t}){let[e,,o]=Wa(t.anchor),[n]=Wa(t.focus),[r,l,s]=pg(o,e,n),{maxColumn:i,maxRow:u,minColumn:d,minRow:c}=mg(r,l,s);return{columns:i-d+1,rows:u-c+1}}function Fg(){let t=No();if(qn(t)&&!t.isCollapsed()||zt(t)&&!t.anchor.is(t.focus)||!qn(t)&&!zt(t))return!1;let[e]=bg(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function Pg(t){let e=t.getLastDescendant();vg(e)?e.select():Ig(e)?e.selectEnd():e!==null&&e.selectNext()}function Bg({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=Ja(),s=So(null),[i,u]=ht(r),[d,c]=ht({columns:1,rows:1}),[a,m]=ht(!1),[p,h]=ht(!1),{y:f}=Rg();ft(()=>l.registerMutationListener(Lg,S=>{S.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{u(i.getLatest())})},{skipInitialization:!0}),[l,i]),ft(()=>{l.getEditorState().read(()=>{let S=No();if(zt(S)){let R=Va({selection:S});c(R);let I=S.anchor.is(S.focus);m(!I&&(R.columns>1||R.rows>1))}h(Fg())})},[l]),ft(()=>{let S=e.current,R=s.current,I=l.getRootElement();if(S!=null&&R!=null&&I!=null){let D=I.getBoundingClientRect(),F=S.getBoundingClientRect();R.style.opacity="1";let M=R.getBoundingClientRect(),B=5,$=F.right+B;if($+M.width>window.innerWidth||$+M.width>D.right){let V=F.left-M.width-B;$=(V<0?B:V)+window.pageXOffset}R.style.left=`${$+window.pageXOffset}px`;let P=F.top;if(P+M.height>window.innerHeight){let V=F.bottom-M.height;P=V<0?B:V}R.style.top=`${P}px`}},[e,s,l,f]),ft(()=>{function S(R){s.current!=null&&e.current!=null&&$g(R.target)&&!s.current.contains(R.target)&&!e.current.contains(R.target)&&n(!1)}return window.addEventListener("click",S),()=>window.removeEventListener("click",S)},[n,e]);let g=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i),R=Yn(S,l.getElementByKey(S.getKey()));if(R===null)throw new Error("Expected to find tableElement in DOM");let I=Zn(R);I!==null&&I.$clearHighlight(),S.markDirty(),u(i.getLatest())}Mg(null)})},[l,i]),C=()=>{l.update(()=>{let S=No();if(!zt(S))return;let I=S.getNodes().filter(Xa),D=Eg(I);D&&(Pg(D),o())})},E=()=>{l.update(()=>{Ng()}),g()},L=de(S=>{l.update(()=>{for(let R=0;R<d.rows;R++)Tg(S);o()})},[l,o,d.rows]),x=de(S=>{l.update(()=>{for(let R=0;R<d.columns;R++)_g(S);o()})},[l,o,d.columns]),b=de(()=>{l.update(()=>{Cg(),o()})},[l,o]),k=de(()=>{l.update(()=>{Me(i).remove(),g(),o()})},[l,i,g,o]),_=de(()=>{l.update(()=>{xg(),o()})},[l,o]),T=de(()=>{l.update(()=>{let S=Me(i),R=kg(i),I=!i.hasHeaderState(pt.ROW);Sg(S,R,I),g(),o()})},[l,i,g,o]),v=de(()=>{l.update(()=>{let S=Me(i),[,R]=gg(S,i,i),I=!i.hasHeaderState(pt.COLUMN);wg(S,R.startColumn,I),g(),o()})},[l,i,g,o]),N=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i);S&&S.setRowStriping(!S.getRowStriping())}g(),o()})},[l,i,g,o]),w=de(()=>{l.update(()=>{if(i.isAttached()){let S=Me(i);S&&S.setFrozenColumns(S.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),y=null;return t&&(a?y=j("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>C(),type:"button",children:j("span",{className:"text",children:"Merge cells"})}):p&&(y=j("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>E(),type:"button",children:j("span",{className:"text",children:"Unmerge cells"})}))),Ya(Ne("div",{className:"table-action-menu-dropdown",onClick:S=>{S.stopPropagation()},ref:s,children:[y?Ne(Qn.Fragment,{children:[y,j("hr",{})]}):null,j("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>N(),type:"button",children:j("span",{className:"text",children:"Toggle row striping"})}),j("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>w(),type:"button",children:j("span",{className:"text",children:"Toggle first column freeze"})}),j("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>L(!1),type:"button",children:Ne("span",{className:"text",children:["Insert ",d.rows===1?"row":`${d.rows} rows`," above"]})}),j("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>L(!0),type:"button",children:Ne("span",{className:"text",children:["Insert ",d.rows===1?"row":`${d.rows} rows`," below"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>x(!1),type:"button",children:Ne("span",{className:"text",children:["Insert ",d.columns===1?"column":`${d.columns} columns`," ","left"]})}),j("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>x(!0),type:"button",children:Ne("span",{className:"text",children:["Insert ",d.columns===1?"column":`${d.columns} columns`," ","right"]})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>_(),type:"button",children:j("span",{className:"text",children:"Delete column"})}),j("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>b(),type:"button",children:j("span",{className:"text",children:"Delete row"})}),j("button",{className:"item","data-test-id":"table-delete",onClick:()=>k(),type:"button",children:j("span",{className:"text",children:"Delete table"})}),j("hr",{}),j("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:Ne("span",{className:"text",children:[(i.__headerState&pt.ROW)===pt.ROW?"Remove":"Add"," ","row header"]})}),j("button",{className:"item","data-test-id":"table-column-header",onClick:()=>v(),type:"button",children:Ne("span",{className:"text",children:[(i.__headerState&pt.COLUMN)===pt.COLUMN?"Remove":"Add"," ","column header"]})})]}),l.getRootElement()?.closest('dialog, [role="dialog"]')??document.body)}function jg({anchorElem:t,cellMerge:e}){let[o]=Ja(),n=So(null),r=So(null),[l,s]=ht(!1),[i,u]=ht(null),d=de(()=>{let a=n.current,m=No(),p=Dg(o._window),h=document.activeElement;function f(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),u(null)}if(m==null||a==null)return f();let g=o.getRootElement(),C=null,E=null;if(qn(m)&&g!==null&&p!==null&&g.contains(p.anchorNode)){let x=Ka(m.anchor.getNode());if(x==null||(E=o.getElementByKey(x.getKey()),E==null||!x.isAttached()))return f();let b=Me(x),k=Yn(b,o.getElementByKey(b.getKey()));if(k===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=Zn(k),u(x)}else if(zt(m)){let x=Ka(m.anchor.getNode());if(!Xa(x))throw new Error("TableSelection anchorNode must be a TableCellNode");let b=Me(x),k=Yn(b,o.getElementByKey(b.getKey()));if(k===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=Zn(k),E=o.getElementByKey(x.getKey())}else if(!h)return f();if(C===null||E===null)return f();let L=!C||!C.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",L),a.classList.toggle("table-cell-action-button-container--inactive",!L),L){let x=E.getBoundingClientRect(),b=t.getBoundingClientRect(),k=x.top-b.top,_=x.right-b.left;a.style.transform=`translate(${_}px, ${k}px)`}},[o,t]);ft(()=>{let a,m=()=>{a=void 0,o.getEditorState().read(d)},p=()=>(a===void 0&&(a=setTimeout(m,0)),!1);return yg(o.registerUpdateListener(p),o.registerCommand(Og,p,Ag),o.registerRootListener((h,f)=>{f&&f.removeEventListener("pointerup",p),h&&(h.addEventListener("pointerup",p),p())}),()=>clearTimeout(a))});let c=So(i);return ft(()=>{c.current!==i&&s(!1),c.current=i},[c,i]),j("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&Ne(Qn.Fragment,{children:[j("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:j(Ua,{})}),l&&j(Bg,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var Za=t=>{let e=fg(3),{anchorElem:o}=t,n=hg(),r;return e[0]!==o||e[1]!==n?(r=Ya(n?j(jg,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as Hg}from"react/compiler-runtime";import{jsx as yo,jsxs as zg}from"react/jsx-runtime";import{useLexicalComposerContext as Gg}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as Ug}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as Wg,$getTableNodeFromLexicalNodeOrThrow as er,$getTableRowIndexFromTableCellNode as Vg,$isTableCellNode as qa,$isTableRowNode as Kg,getDOMCellFromTarget as Jg,getTableElement as Xg,TableNode as Qa}from"@lexical/table";import{calculateZoomLevel as ec,mergeRegister as Yg}from"@lexical/utils";import{$getNearestNodeFromDOMNode as tr,isHTMLElement as Zg,SKIP_SCROLL_INTO_VIEW_TAG as tc}from"lexical";import*as nc from"react";import{useCallback as Gt,useEffect as Ro,useRef as Lo,useState as Ke}from"react";import{createPortal as qg}from"react-dom";var Qg=33,oc=92;function e2({editor:t}){let e=Lo(null),o=Lo(null),n=Lo(null),[r,l]=Ke(!1),s=W(),i=Lo(null),[u,d]=Ke(null),[c,a]=Ke(null),[m,p]=Ke(!1),[h,f]=Ke(null),g=Gt(()=>{a(null),e.current=null,f(null),i.current=null,n.current=null},[]),C=w=>(w.buttons&1)===1;Ro(()=>{let w=new Set;return Yg(t.registerMutationListener(Qa,y=>{for(let[S,R]of y)R==="destroyed"?w.delete(S):w.add(S);l(w.size>0)}),t.registerNodeTransform(Qa,y=>{if(y.getColWidths())return y;let S=y.getColumnCount(),R=oc;return y.setColWidths(Array(S).fill(R)),y}))},[t]),Ro(()=>{if(!r)return;let w=I=>{let D=I.target;if(Zg(D)){if(h){d({x:I.clientX,y:I.clientY});return}if(p(C(I)),!(o.current&&o.current.contains(D))&&e.current!==D){e.current=D;let F=Jg(D);F&&c!==F?t.getEditorState().read(()=>{let M=tr(F.elem);if(!M)throw new Error("TableCellResizer: Table cell node not found.");let B=er(M),$=Xg(B,t.getElementByKey(B.getKey()));if(!$)throw new Error("TableCellResizer: Table element not found.");e.current=D,n.current=$.getBoundingClientRect(),a(F)},{editor:t}):F==null&&g()}}},y=I=>{p(!0)},S=I=>{p(!1)},R=t.registerRootListener((I,D)=>{D?.removeEventListener("mousemove",w),D?.removeEventListener("mousedown",y),D?.removeEventListener("mouseup",S),I?.addEventListener("mousemove",w),I?.addEventListener("mousedown",y),I?.addEventListener("mouseup",S)});return()=>{R()}},[c,h,t,r,g]);let E=w=>w==="bottom",L=Gt(w=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let y=tr(c.elem);if(!qa(y))throw new Error("TableCellResizer: Table cell node not found.");let S=er(y),R=Vg(y),I=S.getChildren(),F=y.getColSpan()===S.getColumnCount()?R:R+y.getRowSpan()-1;if(F>=I.length||F<0)throw new Error("Expected table cell to be inside of table row.");let M=I[F];if(!Kg(M))throw new Error("Expected table row");let B=M.getHeight();if(B===void 0){let P=M.getChildren();B=Math.min(...P.map(V=>x(V,t)??1/0))}let $=Math.max(B+w,Qg);M.setHeight($)},{tag:tc})},[c,t]),x=(w,y)=>y.getElementByKey(w.getKey())?.clientHeight,b=(w,y)=>{let S;return y.forEach(R=>{R.forEach((I,D)=>{I.cell===w&&(S=D)})}),S},k=Gt(w=>{if(!c)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let y=tr(c.elem);if(!qa(y))throw new Error("TableCellResizer: Table cell node not found.");let S=er(y),[R]=Wg(S,null,null),I=b(y,R);if(I===void 0)throw new Error("TableCellResizer: Table column not found.");let D=S.getColWidths();if(!D)return;let F=D[I];if(F===void 0)return;let M=[...D],B=Math.max(F+w,oc);M[I]=B,S.setColWidths(M)},{tag:tc})},[c,t]),_=Gt(w=>{let y=S=>{if(S.preventDefault(),S.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:R,y:I}=i.current;if(c===null)return;let D=ec(S.target);if(E(w)){let F=(S.clientY-I)/D;L(F)}else{let F=(S.clientX-R)/D;k(F)}g(),document.removeEventListener("mouseup",y)}};return y},[c,g,k,L]),T=Gt(w=>y=>{if(y.preventDefault(),y.stopPropagation(),!c)throw new Error("TableCellResizer: Expected active cell.");i.current={x:y.clientX,y:y.clientY},d(i.current),f(w),document.addEventListener("mouseup",_(w))},[c,_]),[v,N]=Ke({bottom:null,left:null,right:null,top:null});return Ro(()=>{if(c){let{height:w,left:y,top:S,width:R}=c.elem.getBoundingClientRect(),I=ec(c.elem),D=!!t.getRootElement()?.closest('dialog, [role="dialog"]'),F=D?0:window.scrollX,M=D?0:window.scrollY,B=D?"fixed":"absolute",$=10,P={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${$}px`,left:`${F+y}px`,position:B,top:`${M+S+w-$/2}px`,width:`${R}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${w}px`,left:`${F+y+R-$/2}px`,position:B,top:`${M+S}px`,width:`${$}px`}},V=n.current;h&&u&&V&&(E(h)?(P[h].left=`${F+V.left}px`,P[h].top=`${M+u.y/I}px`,P[h].height="3px",P[h].width=`${V.width}px`):(P[h].top=`${M+V.top}px`,P[h].left=`${F+u.x/I}px`,P[h].width="3px",P[h].height=`${V.height}px`),P[h].backgroundColor="#adf"),N(P)}else N({bottom:null,left:null,right:null,top:null})},[c,h,t,u]),yo("div",{ref:o,children:c!=null&&!m&&zg(nc.Fragment,{children:[yo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("right"),style:v.right||void 0}),yo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:T("bottom"),style:v.bottom||void 0})]})})}var rc=()=>{let t=Hg(7),[e]=Gg(),o=Ug(),[n,r]=Ke(null),l,s;t[0]!==e?(l=()=>e.registerRootListener(u=>{r(u?.closest('dialog, [role="dialog"]')??document.body)}),s=[e],t[0]=e,t[1]=l,t[2]=s):(l=t[1],s=t[2]),Ro(l,s);let i;return t[3]!==e||t[4]!==o||t[5]!==n?(i=o&&n?qg(yo(e2,{editor:e}),n):null,t[3]=e,t[4]=o,t[5]=n,t[6]=i):i=t[6],i};import{c as a2}from"react/compiler-runtime";import{jsx as or,jsxs as c2,Fragment as u2}from"react/jsx-runtime";import{useLexicalComposerContext as d2}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as mc}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as m2,$getTableColumnIndexFromTableCellNode as p2,$getTableRowIndexFromTableCellNode as f2,$insertTableColumnAtSelection as h2,$insertTableRowAtSelection as g2,$isTableCellNode as x2,$isTableNode as sc,getTableElement as C2,TableNode as b2}from"@lexical/table";import{$findMatchingParent as k2,mergeRegister as _2}from"@lexical/utils";import{$getNearestNodeFromDOMNode as ac,isHTMLElement as T2}from"lexical";import{useEffect as cc,useMemo as E2,useRef as uc,useState as Io}from"react";import"react";import{createPortal as w2}from"react-dom";import{c as l2}from"react/compiler-runtime";import{useEffect as i2,useRef as s2}from"react";var t2="Expected a function",o2=Math.max,n2=Math.min;function r2(t,e,o){let n,r,l=0,s,i=!1,u=!1,d,c,a,m=!0;if(typeof t!="function")throw new TypeError(t2);e=e||0,typeof o=="object"&&(i=!!o.leading,u="maxWait"in o,d=u?o2(o.maxWait||0,e):d,m="trailing"in o?!!o.trailing:m);function p(k){let _=n,T=s;return n=s=void 0,l=k,c=t.apply(T,_),c}function h(k){return l=k,a=setTimeout(C,e),i?p(k):c}function f(k){let _=k-r,T=k-l,v=e-_;return u?n2(v,d-T):v}function g(k){let _=k-r,T=k-l;return r===void 0||_>=e||_<0||u&&T>=d}function C(){let k=Date.now();if(g(k))return E(k);a=setTimeout(C,f(k))}function E(k){return a=void 0,m&&n?p(k):(n=s=void 0,c)}function L(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function x(){return a===void 0?c:E(Date.now())}function b(){let k=Date.now(),_=g(k);if(n=arguments,s=this,r=k,_){if(a===void 0)return h(r);if(u)return clearTimeout(a),a=setTimeout(C,e),p(r)}return a===void 0&&(a=setTimeout(C,e)),c}return b.cancel=L,b.flush=x,b}var lc=r2;function ic(t,e,o){let n=l2(6),r=s2(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=lc(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),i2(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...d)=>{let c=d;r.current&&r.current(...c)},n[5]=i):i=n[5],i}var dc=16;function S2({anchorElem:t}){let[e]=d2(),o=mc(),n=W(),[r,l]=Io(!1),[s,i]=Io(!1),[u,d]=Io(!1),[c,a]=Io({}),m=uc(new Set),p=uc(null),h=ic(C=>{let{isOutside:E,tableDOMNode:L}=N2(C,n.editorConfig?.lexical);if(E){l(!1),i(!1);return}if(!L)return;p.current=L;let x=null,b=null,k=null;if(e.getEditorState().read(()=>{let F=ac(L);if(x2(F)){let M=k2(F,B=>sc(B));if(!sc(M))return;if(k=C2(M,e.getElementByKey(M.getKey())),k){let B=M.getChildrenSize(),$=M.getChildAtIndex(0)?.getChildrenSize(),P=f2(F),V=p2(F);P===B-1?x=F:V===$-1&&(b=F)}}},{editor:e}),!k)return;let _=k.parentElement;if(!_)return;let{bottom:T,height:v,left:N,right:w,width:y,y:S}=k.getBoundingClientRect(),R=!1;_&&_.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(R=_.scrollWidth>_.clientWidth);let{left:I,y:D}=t.getBoundingClientRect();x?(i(!1),l(!0),a({height:dc,left:R&&_?_.offsetLeft:N-I,top:T-D+5,width:R&&_?_.offsetWidth:y})):b&&(i(!0),l(!1),a({height:v,left:w-I+5,top:S-D,width:dc}))},50,250),f=E2(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);cc(()=>{if(u)return document.addEventListener("mousemove",h),()=>{l(!1),i(!1),document.removeEventListener("mousemove",h)}},[u,h]),cc(()=>_2(e.registerMutationListener(b2,C=>{e.getEditorState().read(()=>{let E=!1;for(let[L,x]of C)switch(x){case"created":{m.current.add(L),E=!0;break}case"destroyed":{m.current.delete(L),E=!0;break}default:break}if(E){f.disconnect();for(let L of m.current){let{tableElement:x}=m2(L);f.observe(x)}d(m.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let g=C=>{e.update(()=>{p.current&&(ac(p.current)?.selectEnd(),C?(g2(),l(!1)):(h2(),i(!1)))})};return o?c2(u2,{children:[r&&or("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...c},type:"button"}),s&&or("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...c},type:"button"})]}):null}function N2(t,e){let o=t.target;if(T2(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function pc(t){let e=a2(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!mc())return null;let l;return e[0]!==n?(l=w2(or(S2,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{jsx as lr,jsxs as I2}from"react/jsx-runtime";import{useLexicalComposerContext as v2}from"@lexical/react/LexicalComposerContext";import{TablePlugin as M2}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as A2,TableCellNode as D2,TableNode as $2,TableRowNode as O2}from"@lexical/table";import{mergeRegister as F2}from"@lexical/utils";import{$getSelection as P2,$isRangeSelection as B2,$setSelection as j2,COMMAND_PRIORITY_EDITOR as H2,createCommand as z2}from"lexical";import{createContext as G2,use as U2,useCallback as bc,useEffect as kc,useMemo as W2,useRef as V2,useState as vo}from"react";import*as _c from"react";import{jsx as te,jsxs as Le}from"react/jsx-runtime";import{useCallback as nr,useEffect as fc,useRef as rr,useState as Ut}from"react";import*as xc from"react";import{createPortal as L2}from"react-dom";var hc=10,gc=7;function y2(){return Le("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function R2(){return Le("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function Cc({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Ut(0),[u,d]=Ut(0),[c,a]=Ut(""),[m,p]=Ut(""),[h,f]=Ut(null),g=rr(null),C=rr(null),E=rr(null),L=s>0?s:c?parseInt(c,10)||0:5,x=u>0?u:m?parseInt(m,10)||0:5;fc(()=>{o||(i(0),d(0),a(""),p(""),f(null))},[o]),fc(()=>{if(!o)return;let N=w=>{if(w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),n()),w.key==="Enter"&&h){w.preventDefault();let y=parseInt(c,10),S=parseInt(m,10);y>0&&S>0&&r(y,S)}};return document.addEventListener("keydown",N,!0),()=>document.removeEventListener("keydown",N,!0)},[o,n,r,h,c,m]);let b=nr((N,w)=>{N>0&&w>0&&r(N,w)},[r]),k=nr((N,w)=>{i(N),d(w)},[]),_=nr(()=>{i(0),d(0)},[]);if(!o||!l||!t)return null;let T=[];for(let N=1;N<=gc;N++)for(let w=1;w<=hc;w++){let y=w<=L&&N<=x,S=w<=s&&N<=u,R="table-grid-popup__cell";y&&S?R+=" table-grid-popup__cell--hover":y&&(R+=" table-grid-popup__cell--selected"),T.push(te("div",{"aria-label":`${w} columns, ${N} rows`,className:R,onClick:()=>b(w,N),onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),b(w,N))},onMouseEnter:()=>k(w,N),role:"button",tabIndex:-1},`${N}-${w}`))}let v=s>0&&u>0;return L2(Le(xc.Fragment,{children:[te("div",{className:"table-grid-popup__backdrop",onClick:n}),te("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:Le("div",{className:"table-grid-popup__content",children:[Le("div",{className:"table-grid-popup__header",children:[Le("div",{className:`table-grid-popup__input-group${h==="cols"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(y2,{})}),te("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:N=>a(N.target.value),onFocus:()=>f("cols"),placeholder:s>0?String(s):"5",ref:C,type:"number",value:c})]}),te("span",{className:"table-grid-popup__separator",children:"\xD7"}),Le("div",{className:`table-grid-popup__input-group${h==="rows"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(R2,{})}),te("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:N=>p(N.target.value),onFocus:()=>f("rows"),placeholder:u>0?String(u):"5",ref:E,type:"number",value:m})]})]}),Le("div",{className:"table-grid-popup__grid",onMouseLeave:_,children:[T,v&&Le("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/hc*100}%)`,top:`calc(${(u-1)/gc*100}%)`},children:[L," \xD7 ",x]})]})]})})]}),t)}var Mo=z2("OPEN_EMBED_DRAWER_COMMAND"),Tc=G2({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Ec({children:t}){let[e,o]=vo({cellEditorConfig:null,cellEditorPlugins:null});return lr(Tc,{value:W2(()=>({cellEditorConfig:e.cellEditorConfig,cellEditorPlugins:e.cellEditorPlugins,set:(n,r)=>{o({cellEditorConfig:n,cellEditorPlugins:r})}}),[e.cellEditorConfig,e.cellEditorPlugins]),children:t})}var wc=()=>{let[t]=v2(),e=U2(Tc),[o,n]=vo(!1),[r,l]=vo(null),s=V2(null),[i,u]=vo(null);kc(()=>{let a=t.getRootElement();if(a){let m=a.closest(".editor")??null;u(m??a.parentElement)}},[t]),kc(()=>{if(!t.hasNodes([$2,O2,D2]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return F2(t.registerCommand(Mo,()=>{let a=i;if(!a)return!0;let m=a.getBoundingClientRect(),p=null;t.getEditorState().read(()=>{let f=P2();if(B2(f)){s.current=f.clone();let g=f.anchor.getNode(),C=t.getElementByKey(g.getKey());if(C){let E=C.getBoundingClientRect();E.height>0&&(p={left:E.left-m.left,top:E.bottom-m.top+8})}}});let h=window.getSelection();if(h&&h.rangeCount>0){let g=h.getRangeAt(0).getBoundingClientRect();g.height>0&&(p={left:g.left-m.left,top:g.bottom-m.top+8})}return p||(p={left:0,top:40}),l(p),n(!0),!0},H2))},[e,t,i]);let d=bc(()=>{n(!1)},[]),c=bc((a,m)=>{n(!1),t.focus(),t.update(()=>{s.current&&j2(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(A2,{columns:String(a),rows:String(m)})},1)},[t]);return I2(_c.Fragment,{children:[lr(Cc,{anchorElem:i,editor:t,isOpen:o,onClose:d,onInsert:c,position:r}),lr(M2,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var Y2=A({markdownTransformers:[Ha],nodes:[J2,K2,X2],plugins:[{Component:wc,position:"normal"},{Component:rc,position:"normal"},{Component:Za,position:"floatingAnchorElem"},{Component:pc,position:"floatingAnchorElem"}],providers:[Ec],slashMenu:{groups:[q([{Icon:Kn,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Mo,{})}}])]},toolbarFixed:{groups:[be([{ChildComponent:Kn,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Mo,{})}}])]}});import{$isNodeSelection as Sx}from"lexical";import{jsx as Sc}from"react/jsx-runtime";import"react";var Z2="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",ir=({className:t})=>Sc("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Sc("path",{clipRule:"evenodd",d:Z2,fill:"currentColor",fillRule:"evenodd"})});import{c as lx}from"react/compiler-runtime";import{jsx as ix}from"react/jsx-runtime";import{useLexicalComposerContext as sx}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as Oc,$insertNodeToNearestRoot as cr,mergeRegister as ax}from"@lexical/utils";import{useBulkUpload as cx,useEffectEvent as ux,useModal as dx}from"@payloadcms/ui";import ur from"bson-objectid";import{$createRangeSelection as mx,$getPreviousSelection as vc,$getSelection as Mc,$isParagraphNode as dr,$isRangeSelection as Ac,$setSelection as px,COMMAND_PRIORITY_EDITOR as fx,COMMAND_PRIORITY_LOW as Dc,createCommand as hx,DROP_COMMAND as gx,getDOMSelectionFromTarget as xx,isHTMLElement as $c,PASTE_COMMAND as Cx}from"lexical";import{useEffect as bx}from"react";import{c as Nc}from"react/compiler-runtime";import{jsx as sr}from"react/jsx-runtime";import{useLexicalComposerContext as Lc}from"@lexical/react/LexicalComposerContext.js";import{toast as q2}from"@payloadcms/ui";import{$getNodeByKey as Q2,COMMAND_PRIORITY_EDITOR as yc}from"lexical";import{useEffect as Rc,useState as ex}from"react";var tx=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=Q2(o);r&&r.replace(ye({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(ar,{fields:null,relationTo:e,value:n})},ox=t=>{let e=Nc(13),{enabledCollectionSlugs:o}=t,[n]=Lc(),[r,l]=ex(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:u,openListDrawer:d}=Pt(s),c,a;e[2]!==n||e[3]!==d?(c=()=>n.registerCommand(tt,f=>(l(f?.replace?f?.replace.nodeKey:null),d(),!0),yc),a=[n,d],e[2]=n,e[3]=d,e[4]=c,e[5]=a):(c=e[4],a=e[5]),Rc(c,a);let m;e[6]!==i||e[7]!==n||e[8]!==r?(m=f=>{let{collectionSlug:g,doc:C}=f;i(),tx({editor:n,relationTo:g,replaceNodeKey:r,value:C.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=m):m=e[9];let p=m,h;return e[10]!==u||e[11]!==p?(h=sr(u,{onSelect:p}),e[10]=u,e[11]=p,e[12]=h):h=e[12],h},nx=()=>{let t=Nc(3),[e]=Lc(),o,n;return t[0]!==e?(o=()=>e.registerCommand(tt,rx,yc),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),Rc(o,n),null},Ic=({enabledCollectionSlugs:t})=>t?.length?sr(ox,{enabledCollectionSlugs:t}):sr(nx,{});function rx(){return q2.error("No upload collections enabled"),!0}function kx(t){let e=t.target;return!!($c(e)&&!e.closest("code, span.editor-image")&&$c(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function _x(t){let e,o=xx(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var ar=hx("INSERT_UPLOAD_COMMAND"),Fc=t=>{let e=lx(20),{clientProps:o}=t,[n]=sx(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=Co(r),{modalSlug:s,setCollectionSlug:i,setInitialForms:u,setOnCancel:d,setOnSuccess:c,setSelectableCollections:a}=cx(),{isModalOpen:m,openModal:p}=dx(),h;e[2]!==s||e[3]!==n||e[4]!==l||e[5]!==m||e[6]!==p||e[7]!==i||e[8]!==u||e[9]!==d||e[10]!==c||e[11]!==a?(h=L=>{let{files:x}=L;if(x?.length!==0&&(u(b=>[...b??[],...x.map(Tx)]),!m(s))){if(!l.length||!l[0])return;i(l[0]),a(l),d(()=>{n.update(Ex)}),c(b=>{let k=new Map(b.map(wx));n.update(()=>{for(let _ of Oc()){let T=_.node;if(nt(T)){let v=T.getData();if(v?.pending){let N=k.get(v.pending?.formID);N&&T.replace(ye({data:{id:new ur.default().toHexString(),fields:{},relationTo:N.collectionSlug,value:N.doc.id}}))}}}})}),p(s)}},e[2]=s,e[3]=n,e[4]=l,e[5]=m,e[6]=p,e[7]=i,e[8]=u,e[9]=d,e[10]=c,e[11]=a,e[12]=h):h=e[12];let f=ux(h),g;e[13]!==n||e[14]!==f?(g=()=>{if(!n.hasNodes([ot]))throw new Error("UploadPlugin: UploadNode not registered on editor");let L=new WeakSet;return ax(n.registerNodeTransform(ot,x=>{let b=x.getData();if(!b?.pending||L.has(b.pending))return;L.add(b.pending),async function(){let T=null,v=b?.pending?.src,N=b?.pending?.formID;if(v?.startsWith("data:")){let w=v.match(/data:(image\/[a-zA-Z]+);base64,/),y=w?w[1]:"image/png",S=v.replace(/^data:image\/[a-zA-Z]+;base64,/,""),R=atob(S),I=new Array(R.length);for(let M=0;M<R.length;M++)I[M]=R.charCodeAt(M);let D=new Uint8Array(I);T={alt:void 0,file:new File([D],"pasted-image."+y?.split("/",2)[1],{type:y}),formID:N}}else if(v?.startsWith("http")||v?.startsWith("https")){let y=await(await fetch(v)).blob(),S=v.split("/").pop()||"pasted-image"+y.type.split("/",2)[1];T={alt:void 0,file:new File([y],S,{type:y.type}),formID:N}}T&&f({files:[T]})}()}),n.registerCommand(ar,x=>(n.update(()=>{let b=Mc()||vc();if(Ac(b)){let k=ye({data:{id:x.id,fields:x.fields,relationTo:x.relationTo,value:x.value}}),{focus:_}=b,T=_.getNode();cr(k),dr(T)&&!T.__first&&T.remove()}}),!0),fx),n.registerCommand(Cx,x=>{if(!(x instanceof ClipboardEvent))return!1;let b=x.clipboardData;if(!b?.types?.length||b?.types?.includes("text/html"))return!1;let k=[];return b?.files?.length&&Array.from(b.files).forEach(_=>{k.push({alt:"",file:_,formID:new ur.default().toHexString()})}),k.length?(n.update(()=>{let _=Mc()||vc();if(Ac(_))for(let T of k){let v=ye({data:{pending:{formID:T.formID,src:URL.createObjectURL(T.file)}}}),{focus:N}=_,w=N.getNode();cr(v),dr(w)&&!w.__first&&w.remove()}}),f({files:k}),!0):!1},Dc),n.registerCommand(gx,x=>{if(!(x instanceof DragEvent))return!1;let b=x.dataTransfer;if(!b?.types?.length)return!1;let k=[];return b?.files?.length&&Array.from(b.files).forEach(_=>{k.push({alt:"",file:_,formID:new ur.default().toHexString()})}),k.length?(x.preventDefault(),x.stopPropagation(),n.update(()=>{if(kx(x)){let _=_x(x),T=mx();_!=null&&T.applyDOMRange(_),px(T);for(let v of k){let N=ye({data:{pending:{formID:v.formID,src:URL.createObjectURL(v.file)}}}),{focus:w}=T,y=w.getNode();cr(N),dr(y)&&!y.__first&&y.remove()}}}),f({files:k}),!0):!1},Dc))},e[13]=n,e[14]=f,e[15]=g):g=e[15];let C;e[16]!==n?(C=[n],e[16]=n,e[17]=C):C=e[17],bx(g,C);let E;return e[18]!==l?(E=ix(Ic,{enabledCollectionSlugs:l}),e[18]=l,e[19]=E):E=e[19],E};function Tx(t){return{file:t.file,formID:t.formID}}function Ex(){for(let t of Oc()){let e=t.node;nt(e)&&e.getData()?.pending&&e.remove()}}function wx(t){return[t.formID,t]}var Nx=A({nodes:[ot],plugins:[{Component:Fc,position:"normal"}],slashMenu:{groups:[q([{Icon:ir,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(tt,{replace:!1})}}])]},toolbarFixed:{groups:[be([{ChildComponent:ir,isActive:({selection:t})=>{if(!Sx(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return nt(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(tt,{replace:!1})}}])]}});import{c as yx}from"react/compiler-runtime";import{jsx as Ao}from"react/jsx-runtime";import{createElement as Rx}from"react";import{ShimmerEffect as Ix,useConfig as vx}from"@payloadcms/ui";import{lazy as Mx,Suspense as Ax,useEffect as Dx,useState as $x}from"react";var Pc={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",root:"LexicalEditorTheme",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"};var mr={namespace:"lexical",theme:Pc};function Bc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let c of l.features){if(!c?.clientFeatureProps?.featureKey||c?.clientFeatureProps?.order===void 0||c?.clientFeatureProps?.order===null){console.warn("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.");continue}s.set(c.clientFeatureProps.featureKey,c),i.push(c)}l.features=i,l.features=l.features.sort((c,a)=>c.clientFeatureProps.order-a.clientFeatureProps.order);let u=new Map,d=0;for(let c of l.features){let a=typeof c.feature=="function"?c.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:u,schemaPath:r,unSanitizedEditorConfig:l}):c.feature;a.key=c.clientFeatureProps.featureKey,a.order=d,u.set(c.clientFeatureProps.featureKey,a),d++}return u}import{deepMerge as Lx}from"payload/shared";var jc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?Lx(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function pr(t,e,o,n){return{admin:o,features:jc(t),lexical:e,resolvedFeatureMap:t,view:n}}var Ox=Mx(()=>import("./Field-MT4FK3IP.js").then(t=>({default:t.RichText}))),Fx=t=>Ao(Vo,{inheritable:!0,views:t.views,children:Ao(Px,{...t})}),Px=t=>{let e=yx(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:u,views:d}=t,c;e[0]!==o?(c=o===void 0?{}:o,e[0]=o,e[1]=c):c=e[1];let a=c,m;e[2]!==r?(m=r===void 0?{}:r,e[2]=r,e[3]=m):m=e[3];let p=m,h=i===void 0?mr:i,{currentView:f}=Ko(),g=d?.[f]?.admin??a,C=d?.[f]?.lexical,E;e[4]!==h||e[5]!==C?(E=typeof C=="function"?C(h):C??h,e[4]=h,e[5]=C,e[6]=E):E=e[6];let L=E,{config:x}=vx(),[b,k]=$x(null),_,T;e[7]!==n||e[8]!==x||e[9]!==f||e[10]!==g||e[11]!==L||e[12]!==p||e[13]!==l||e[14]!==s||e[15]!==b||e[16]!==u||e[17]!==d?(_=()=>{if(b&&b.view===f)return;let N=d?.[f],w=N?.filterFeatures?N.filterFeatures(n):n,y=[];for(let R of Object.values(w))!R.clientFeatureProvider||!R.clientFeatureProps||y.push(R.clientFeatureProvider(R.clientFeatureProps));let S=Bc({config:x,featureClientImportMap:p,featureClientSchemaMap:l,field:s,schemaPath:u??s.name,unSanitizedEditorConfig:{features:y,lexical:L}});k(pr(S,L,g,f))},T=[g,n,x,p,l,s,b,L,u,f,d],e[7]=n,e[8]=x,e[9]=f,e[10]=g,e[11]=L,e[12]=p,e[13]=l,e[14]=s,e[15]=b,e[16]=u,e[17]=d,e[18]=_,e[19]=T):(_=e[18],T=e[19]),Dx(_,T);let v;return e[20]!==b||e[21]!==t?(v=Ao(Ax,{fallback:Ao(Ix,{height:"35vh"}),children:b&&Rx(Ox,{...t,editorConfig:b,key:b.view})}),e[20]=b,e[21]=t,e[22]=v):v=e[22],v};function Bx(...t){return t.filter(Boolean).join(" ")}var jx=t=>(e,o,n)=>{let r=t(n);r&&(r.append(...o),e.replace(r),r.select(0,0))};var Do=new WeakMap;function Hc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function $o(t,e){let o=Do.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Hc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let u=Hc(s);for(let d of n)u!==null&&d([u[0]-i[0],u[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},Do.set(t,o)}return o.listeners.add(e),()=>{Hx(t,e)}}function Hx(t,e){let o=Do.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(Do.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function zx(t,e){return $o(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function Gx(t,e){return $o(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function Ux(t,e){return $o(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function Wx(t,e){return $o(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as Vx}from"react/compiler-runtime";import{jsx as Kx}from"react/jsx-runtime";import"react";var Jx=()=>{let t=Vx(2),{EditButton:e}=xe(),o;return t[0]!==e?(o=e?Kx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Xx}from"react/compiler-runtime";import{jsx as Yx}from"react/jsx-runtime";import"react";var Zx=()=>{let t=Xx(2),{RemoveButton:e}=xe(),o;return t[0]!==e?(o=e?Yx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as qx}from"react/compiler-runtime";import{jsx as Qx}from"react/jsx-runtime";import"react";var eC=()=>{let t=qx(2),{Label:e}=xe(),o;return t[0]!==e?(o=e?Qx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as tC}from"react/compiler-runtime";import{jsx as oC}from"react/jsx-runtime";import"react";var nC=t=>{let e=tC(3),{children:o}=t,{InlineBlockContainer:n}=xe(),r;return e[0]!==n||e[1]!==o?(r=n?oC(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as rC}from"react/jsx-runtime";import"react";var lC=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?rC(n,{...o,children:e}):null};import{c as iC}from"react/compiler-runtime";import{jsx as sC}from"react/jsx-runtime";import"react";var aC=()=>{let t=iC(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?sC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as cC}from"react/compiler-runtime";import{jsx as uC}from"react/jsx-runtime";import"react";var dC=()=>{let t=cC(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?uC(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as mC}from"qs-esm";var pC=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let u=mC({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${u}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(c=>c.json())};var zc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
57
+ `,Xs="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Ys="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",K0=new RegExp("^[^"+Ys+"]*["+Xs+"]"),J0=new RegExp("^[^"+Xs+"]*["+Ys+"]"),X0={bold:$.IS_BOLD,code:$.IS_CODE,highlight:$.IS_HIGHLIGHT,italic:$.IS_ITALIC,strikethrough:$.IS_STRIKETHROUGH,subscript:$.IS_SUBSCRIPT,superscript:$.IS_SUPERSCRIPT,underline:$.IS_UNDERLINE},Y0={directionless:$.IS_DIRECTIONLESS,unmergeable:$.IS_UNMERGEABLE},Z0={center:$.IS_ALIGN_CENTER,end:$.IS_ALIGN_END,justify:$.IS_ALIGN_JUSTIFY,left:$.IS_ALIGN_LEFT,right:$.IS_ALIGN_RIGHT,start:$.IS_ALIGN_START},q0={[$.IS_ALIGN_CENTER]:"center",[$.IS_ALIGN_END]:"end",[$.IS_ALIGN_JUSTIFY]:"justify",[$.IS_ALIGN_LEFT]:"left",[$.IS_ALIGN_RIGHT]:"right",[$.IS_ALIGN_START]:"start"},Q0={normal:$.IS_NORMAL,segmented:$.IS_SEGMENTED,token:$.IS_TOKEN},eh={[$.IS_NORMAL]:"normal",[$.IS_SEGMENTED]:"segmented",[$.IS_TOKEN]:"token"};var Zs={text:({node:t})=>{let e=t.text;return t.format&$.IS_BOLD&&(e=We("strong",{children:e})),t.format&$.IS_ITALIC&&(e=We("em",{children:e})),t.format&$.IS_STRIKETHROUGH&&(e=We("span",{style:{textDecoration:"line-through"},children:e})),t.format&$.IS_UNDERLINE&&(e=We("span",{style:{textDecoration:"underline"},children:e})),t.format&$.IS_CODE&&(e=We("code",{children:e})),t.format&$.IS_SUBSCRIPT&&(e=We("sub",{children:e})),t.format&$.IS_SUPERSCRIPT&&(e=We("sup",{children:e})),e}};import{jsx as Ft}from"react/jsx-runtime";var qs={upload:({node:t})=>{let e=t;if(typeof e.value!="object")return null;let o=e.value,n=e.fields?.alt||o?.alt||"",r=o.url;if(!o.mimeType.startsWith("image"))return Ft("a",{href:r,rel:"noopener noreferrer",children:o.filename});if(!o.variants||!Object.keys(o.variants).length)return Ft("img",{alt:n,height:o.height,src:r,width:o.width});let l=[];for(let s in o.variants){let i=o.variants[s];if(!i||!i.width||!i.height||!i.mimeType||!i.filesize||!i.filename||!i.url)continue;let c=i?.url;l.push(Ft("source",{media:`(max-width: ${i.width}px)`,srcSet:c,type:i.mimeType},s))}return l.push(Ft("img",{alt:n,height:o?.height,src:r,width:o?.width},"image")),Ft("picture",{children:l})}};var mt={...Vs,...Zs,...Hs,...Fs,...Js,...Bs,...js,...Ws,...Gs({}),...qs,...Ks};import{jsx as go,Fragment as th}from"react/jsx-runtime";import ho from"react";function Qs(t){if(!!!t?.root?.children?.length)return!1;let o=!1;if(t?.root?.children?.length===1&&t?.root?.children[0]?.type==="paragraph"){let n=t?.root?.children[0];if(!n?.children||n?.children?.length===0)o=!0;else if(n?.children?.length===1){let r=n?.children[0];r?.type==="text"&&(r?.text?.length||(o=!0))}}return!o}function oh(t){return e=>{let o={...e,isEditor:!1,isJSXConverter:!0};if(t.Component)return t.Component(o);if(t.html){let n=typeof t.html=="function"?t.html(o):t.html;return go("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function ea(t){return e=>{if(t.Component){let o={...e,isEditor:!1,isJSXConverter:!0};return t.Component(o)}if(t.Block){let o=e.node,n={childIndex:e.childIndex,converters:e.converters,formData:o.fields??{},isEditor:!1,isJSXConverter:!0,node:o,nodesToJSX:e.nodesToJSX,parent:e.parent};return ho.createElement(t.Block,n)}if(t.html){let o={...e,isEditor:!1,isJSXConverter:!0},n=typeof t.html=="function"?t.html(o):t.html;return go("span",{dangerouslySetInnerHTML:{__html:n}})}return null}}function nh(t){let e={};for(let[o,n]of Object.entries(t)){if(!n||typeof n!="object")continue;if(o==="blocks"){e.blocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.blocks[l]=ea(i))}continue}if(o==="inlineBlocks"){e.inlineBlocks={};for(let[l,s]of Object.entries(n)){let i=s;(i.Component||i.Block||i.html)&&(e.inlineBlocks[l]=ea(i))}continue}let r=n;(r.Component||r.html)&&(e[o]=oh(r))}return e}function ta({converters:t,data:e,disableIndent:o,disableTextAlign:n,nodeMap:r}){if(Qs(e)){let l=r?nh(r):void 0,s=l?{...t,...l,blocks:{...t.blocks,...l.blocks},inlineBlocks:{...t.inlineBlocks,...l.inlineBlocks}}:t;return oa({converters:s,disableIndent:o,disableTextAlign:n,nodes:e.root.children,parent:e.root})}return go(th,{})}function oa({converters:t,disableIndent:e,disableTextAlign:o,nodes:n,parent:r}){let l=t.unknown;return n.map((i,c)=>{let u;i.type==="block"?(u=t?.blocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Blocks converter: found ${i?.fields?.blockType} block, but no converter is provided`)):i.type==="inlineBlock"?(u=t?.inlineBlocks?.[i?.fields?.blockType],!u&&!l&&console.error(`Lexical => JSX converter: Inline Blocks converter: found ${i?.fields?.blockType} inline block, but no converter is provided`)):u=t[i.type];try{!u&&l&&(u=l);let d;u?d=typeof u=="function"?u({childIndex:c,converters:t,node:i,nodesToJSX:m=>oa({converters:m.converters??t,disableIndent:m.disableIndent??e,disableTextAlign:m.disableTextAlign??o,nodes:m.nodes,parent:m.parent??{...i,parent:r}}),parent:r}):u:d=go("span",{children:"unknown node"},c);let a={};if(!o&&(!Array.isArray(o)||!o?.includes(i.type))&&"format"in i&&i.format)switch(i.format){case"center":a.textAlign="center";break;case"end":a.textAlign="right";break;case"justify":a.textAlign="justify";break;case"left":break;case"right":a.textAlign="right";break;case"start":a.textAlign="left";break}if(!e&&(!Array.isArray(e)||!e?.includes(i.type))&&"indent"in i&&i.indent&&i.type!=="listitem"&&(a.paddingInlineStart=`${Number(i.indent)*40}px`),ho.isValidElement(d)){if(a.textAlign||a.paddingInlineStart){let p={...a,...d?.props?.style??{}};return ho.cloneElement(d,{key:c,style:p})}return ho.cloneElement(d,{key:c})}return d}catch(d){return console.error("Error converting lexical node to JSX:",d,"node:",i),null}}).filter(Boolean)}function On({className:t,converters:e,data:o,disableContainer:n,disableIndent:r,disableTextAlign:l,nodeMap:s}){if(!o)return null;let i=e,c={};i?typeof i=="function"?c=i({defaultConverters:mt}):c=i:c=mt;let u=o&&!Array.isArray(o)&&typeof o=="object"&&"root"in o&&ta({converters:c,data:o,disableIndent:r,disableTextAlign:l,nodeMap:s});return n?na(rh,{children:u}):na("div",{className:t??"payload-richtext",children:u})}function la(){let t=lh(7),[e]=ih(),o;t[0]!==e?(o=()=>e.getEditorState().toJSON(),t[0]=e,t[1]=o):o=t[1];let[n,r]=ah(o),l,s;t[2]!==e?(l=()=>e.registerUpdateListener(c=>{let{editorState:u}=c;r(u.toJSON())}),s=[e],t[2]=e,t[3]=l,t[4]=s):(l=t[3],s=t[4]),sh(l,s);let i;return t[5]!==n?(i=ra("div",{className:"debug-jsx-converter",children:ra(On,{converters:mt,data:n})}),t[5]=n,t[6]=i):i=t[6],i}var ch=A({plugins:[{Component:la,position:"bottom"}]});var G={amber:{50:"oklch(0.987 0.022 95.277)",100:"oklch(0.962 0.059 95.617)",200:"oklch(0.924 0.12 95.746)",300:"oklch(0.879 0.169 91.605)",400:"oklch(0.828 0.189 84.429)",500:"oklch(0.769 0.188 70.08)",600:"oklch(0.666 0.179 58.318)",700:"oklch(0.555 0.163 48.998)",800:"oklch(0.473 0.137 46.201)",900:"oklch(0.414 0.112 45.904)",950:"oklch(0.279 0.077 45.635)"},black:"#000",blue:{50:"oklch(0.97 0.014 254.604)",100:"oklch(0.932 0.032 255.585)",200:"oklch(0.882 0.059 254.128)",300:"oklch(0.809 0.105 251.813)",400:"oklch(0.707 0.165 254.624)",500:"oklch(0.623 0.214 259.815)",600:"oklch(0.546 0.245 262.881)",700:"oklch(0.488 0.243 264.376)",800:"oklch(0.424 0.199 265.638)",900:"oklch(0.379 0.146 265.522)",950:"oklch(0.282 0.091 267.935)"},current:"currentColor",cyan:{50:"oklch(0.984 0.019 200.873)",100:"oklch(0.956 0.045 203.388)",200:"oklch(0.917 0.08 205.041)",300:"oklch(0.865 0.127 207.078)",400:"oklch(0.789 0.154 211.53)",500:"oklch(0.715 0.143 215.221)",600:"oklch(0.609 0.126 221.723)",700:"oklch(0.52 0.105 223.128)",800:"oklch(0.45 0.085 224.283)",900:"oklch(0.398 0.07 227.392)",950:"oklch(0.302 0.056 229.695)"},emerald:{50:"oklch(0.979 0.021 166.113)",100:"oklch(0.95 0.052 163.051)",200:"oklch(0.905 0.093 164.15)",300:"oklch(0.845 0.143 164.978)",400:"oklch(0.765 0.177 163.223)",500:"oklch(0.696 0.17 162.48)",600:"oklch(0.596 0.145 163.225)",700:"oklch(0.508 0.118 165.612)",800:"oklch(0.432 0.095 166.913)",900:"oklch(0.378 0.077 168.94)",950:"oklch(0.262 0.051 172.552)"},fuchsia:{50:"oklch(0.977 0.017 320.058)",100:"oklch(0.952 0.037 318.852)",200:"oklch(0.903 0.076 319.62)",300:"oklch(0.833 0.145 321.434)",400:"oklch(0.74 0.238 322.16)",500:"oklch(0.667 0.295 322.15)",600:"oklch(0.591 0.293 322.896)",700:"oklch(0.518 0.253 323.949)",800:"oklch(0.452 0.211 324.591)",900:"oklch(0.401 0.17 325.612)",950:"oklch(0.293 0.136 325.661)"},gray:{50:"oklch(0.985 0.002 247.839)",100:"oklch(0.967 0.003 264.542)",200:"oklch(0.928 0.006 264.531)",300:"oklch(0.872 0.01 258.338)",400:"oklch(0.707 0.022 261.325)",500:"oklch(0.551 0.027 264.364)",600:"oklch(0.446 0.03 256.802)",700:"oklch(0.373 0.034 259.733)",800:"oklch(0.278 0.033 256.848)",900:"oklch(0.21 0.034 264.665)",950:"oklch(0.13 0.028 261.692)"},green:{50:"oklch(0.982 0.018 155.826)",100:"oklch(0.962 0.044 156.743)",200:"oklch(0.925 0.084 155.995)",300:"oklch(0.871 0.15 154.449)",400:"oklch(0.792 0.209 151.711)",500:"oklch(0.723 0.219 149.579)",600:"oklch(0.627 0.194 149.214)",700:"oklch(0.527 0.154 150.069)",800:"oklch(0.448 0.119 151.328)",900:"oklch(0.393 0.095 152.535)",950:"oklch(0.266 0.065 152.934)"},indigo:{50:"oklch(0.962 0.018 272.314)",100:"oklch(0.93 0.034 272.788)",200:"oklch(0.87 0.065 274.039)",300:"oklch(0.785 0.115 274.713)",400:"oklch(0.673 0.182 276.935)",500:"oklch(0.585 0.233 277.117)",600:"oklch(0.511 0.262 276.966)",700:"oklch(0.457 0.24 277.023)",800:"oklch(0.398 0.195 277.366)",900:"oklch(0.359 0.144 278.697)",950:"oklch(0.257 0.09 281.288)"},inherit:"inherit",lime:{50:"oklch(0.986 0.031 120.757)",100:"oklch(0.967 0.067 122.328)",200:"oklch(0.938 0.127 124.321)",300:"oklch(0.897 0.196 126.665)",400:"oklch(0.841 0.238 128.85)",500:"oklch(0.768 0.233 130.85)",600:"oklch(0.648 0.2 131.684)",700:"oklch(0.532 0.157 131.589)",800:"oklch(0.453 0.124 130.933)",900:"oklch(0.405 0.101 131.063)",950:"oklch(0.274 0.072 132.109)"},neutral:{50:"oklch(0.985 0 0)",100:"oklch(0.97 0 0)",200:"oklch(0.922 0 0)",300:"oklch(0.87 0 0)",400:"oklch(0.708 0 0)",500:"oklch(0.556 0 0)",600:"oklch(0.439 0 0)",700:"oklch(0.371 0 0)",800:"oklch(0.269 0 0)",900:"oklch(0.205 0 0)",950:"oklch(0.145 0 0)"},orange:{50:"oklch(0.98 0.016 73.684)",100:"oklch(0.954 0.038 75.164)",200:"oklch(0.901 0.076 70.697)",300:"oklch(0.837 0.128 66.29)",400:"oklch(0.75 0.183 55.934)",500:"oklch(0.705 0.213 47.604)",600:"oklch(0.646 0.222 41.116)",700:"oklch(0.553 0.195 38.402)",800:"oklch(0.47 0.157 37.304)",900:"oklch(0.408 0.123 38.172)",950:"oklch(0.266 0.079 36.259)"},pink:{50:"oklch(0.971 0.014 343.198)",100:"oklch(0.948 0.028 342.258)",200:"oklch(0.899 0.061 343.231)",300:"oklch(0.823 0.12 346.018)",400:"oklch(0.718 0.202 349.761)",500:"oklch(0.656 0.241 354.308)",600:"oklch(0.592 0.249 0.584)",700:"oklch(0.525 0.223 3.958)",800:"oklch(0.459 0.187 3.815)",900:"oklch(0.408 0.153 2.432)",950:"oklch(0.284 0.109 3.907)"},purple:{50:"oklch(0.977 0.014 308.299)",100:"oklch(0.946 0.033 307.174)",200:"oklch(0.902 0.063 306.703)",300:"oklch(0.827 0.119 306.383)",400:"oklch(0.714 0.203 305.504)",500:"oklch(0.627 0.265 303.9)",600:"oklch(0.558 0.288 302.321)",700:"oklch(0.496 0.265 301.924)",800:"oklch(0.438 0.218 303.724)",900:"oklch(0.381 0.176 304.987)",950:"oklch(0.291 0.149 302.717)"},red:{50:"oklch(0.971 0.013 17.38)",100:"oklch(0.936 0.032 17.717)",200:"oklch(0.885 0.062 18.334)",300:"oklch(0.808 0.114 19.571)",400:"oklch(0.704 0.191 22.216)",500:"oklch(0.637 0.237 25.331)",600:"oklch(0.577 0.245 27.325)",700:"oklch(0.505 0.213 27.518)",800:"oklch(0.444 0.177 26.899)",900:"oklch(0.396 0.141 25.723)",950:"oklch(0.258 0.092 26.042)"},rose:{50:"oklch(0.969 0.015 12.422)",100:"oklch(0.941 0.03 12.58)",200:"oklch(0.892 0.058 10.001)",300:"oklch(0.81 0.117 11.638)",400:"oklch(0.712 0.194 13.428)",500:"oklch(0.645 0.246 16.439)",600:"oklch(0.586 0.253 17.585)",700:"oklch(0.514 0.222 16.935)",800:"oklch(0.455 0.188 13.697)",900:"oklch(0.41 0.159 10.272)",950:"oklch(0.271 0.105 12.094)"},sky:{50:"oklch(0.977 0.013 236.62)",100:"oklch(0.951 0.026 236.824)",200:"oklch(0.901 0.058 230.902)",300:"oklch(0.828 0.111 230.318)",400:"oklch(0.746 0.16 232.661)",500:"oklch(0.685 0.169 237.323)",600:"oklch(0.588 0.158 241.966)",700:"oklch(0.5 0.134 242.749)",800:"oklch(0.443 0.11 240.79)",900:"oklch(0.391 0.09 240.876)",950:"oklch(0.293 0.066 243.157)"},slate:{50:"oklch(0.984 0.003 247.858)",100:"oklch(0.968 0.007 247.896)",200:"oklch(0.929 0.013 255.508)",300:"oklch(0.869 0.022 252.894)",400:"oklch(0.704 0.04 256.788)",500:"oklch(0.554 0.046 257.417)",600:"oklch(0.446 0.043 257.281)",700:"oklch(0.372 0.044 257.287)",800:"oklch(0.279 0.041 260.031)",900:"oklch(0.208 0.042 265.755)",950:"oklch(0.129 0.042 264.695)"},stone:{50:"oklch(0.985 0.001 106.423)",100:"oklch(0.97 0.001 106.424)",200:"oklch(0.923 0.003 48.717)",300:"oklch(0.869 0.005 56.366)",400:"oklch(0.709 0.01 56.259)",500:"oklch(0.553 0.013 58.071)",600:"oklch(0.444 0.011 73.639)",700:"oklch(0.374 0.01 67.558)",800:"oklch(0.268 0.007 34.298)",900:"oklch(0.216 0.006 56.043)",950:"oklch(0.147 0.004 49.25)"},teal:{50:"oklch(0.984 0.014 180.72)",100:"oklch(0.953 0.051 180.801)",200:"oklch(0.91 0.096 180.426)",300:"oklch(0.855 0.138 181.071)",400:"oklch(0.777 0.152 181.912)",500:"oklch(0.704 0.14 182.503)",600:"oklch(0.6 0.118 184.704)",700:"oklch(0.511 0.096 186.391)",800:"oklch(0.437 0.078 188.216)",900:"oklch(0.386 0.063 188.416)",950:"oklch(0.277 0.046 192.524)"},transparent:"transparent",violet:{50:"oklch(0.969 0.016 293.756)",100:"oklch(0.943 0.029 294.588)",200:"oklch(0.894 0.057 293.283)",300:"oklch(0.811 0.111 293.571)",400:"oklch(0.702 0.183 293.541)",500:"oklch(0.606 0.25 292.717)",600:"oklch(0.541 0.281 293.009)",700:"oklch(0.491 0.27 292.581)",800:"oklch(0.432 0.232 292.759)",900:"oklch(0.38 0.189 293.745)",950:"oklch(0.283 0.141 291.089)"},white:"#fff",yellow:{50:"oklch(0.987 0.026 102.212)",100:"oklch(0.973 0.071 103.193)",200:"oklch(0.945 0.129 101.54)",300:"oklch(0.905 0.182 98.111)",400:"oklch(0.852 0.199 91.936)",500:"oklch(0.795 0.184 86.047)",600:"oklch(0.681 0.162 75.834)",700:"oklch(0.554 0.135 66.442)",800:"oklch(0.476 0.114 61.907)",900:"oklch(0.421 0.095 57.708)",950:"oklch(0.286 0.066 53.813)"},zinc:{50:"oklch(0.985 0 0)",100:"oklch(0.967 0.001 286.375)",200:"oklch(0.92 0.004 286.32)",300:"oklch(0.871 0.006 286.286)",400:"oklch(0.705 0.015 286.067)",500:"oklch(0.552 0.016 285.938)",600:"oklch(0.442 0.017 285.786)",700:"oklch(0.37 0.013 285.805)",800:"oklch(0.274 0.006 286.033)",900:"oklch(0.21 0.006 285.885)",950:"oklch(0.141 0.005 285.823)"}},uh={text:{"text-red":{css:{color:`light-dark(${G.red[600]}, ${G.red[400]})`},label:"Red"},"text-orange":{css:{color:`light-dark(${G.orange[600]}, ${G.orange[400]})`},label:"Orange"},"text-yellow":{css:{color:`light-dark(${G.yellow[700]}, ${G.yellow[300]})`},label:"Yellow"},"text-green":{css:{color:`light-dark(${G.green[700]}, ${G.green[400]})`},label:"Green"},"text-blue":{css:{color:`light-dark(${G.blue[600]}, ${G.blue[400]})`},label:"Blue"},"text-purple":{css:{color:`light-dark(${G.purple[600]}, ${G.purple[400]})`},label:"Purple"},"text-pink":{css:{color:`light-dark(${G.pink[600]}, ${G.pink[400]})`},label:"Pink"}},background:{"bg-red":{css:{"background-color":`light-dark(${G.red[400]}, ${G.red[600]})`},label:"Red"},"bg-orange":{css:{"background-color":`light-dark(${G.orange[400]}, ${G.orange[600]})`},label:"Orange"},"bg-yellow":{css:{"background-color":`light-dark(${G.yellow[300]}, ${G.yellow[700]})`},label:"Yellow"},"bg-green":{css:{"background-color":`light-dark(${G.green[400]}, ${G.green[700]})`},label:"Green"},"bg-blue":{css:{"background-color":`light-dark(${G.blue[400]}, ${G.blue[600]})`},label:"Blue"},"bg-purple":{css:{"background-color":`light-dark(${G.purple[400]}, ${G.purple[600]})`},label:"Purple"},"bg-pink":{css:{"background-color":`light-dark(${G.pink[400]}, ${G.pink[600]})`},label:"Pink"}}};import{$isNodeSelection as e5}from"lexical";import{jsx as ia}from"react/jsx-runtime";import"react";var dh="M9.5 6C9.77614 6 10 6.22386 10 6.5C10 6.77614 9.77614 7 9.5 7H7.5C7.22386 7 7 7.22386 7 7.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V14.5C17 14.2239 17.2239 14 17.5 14C17.7761 14 18 14.2239 18 14.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V7.5C6 6.67157 6.67157 6 7.5 6H9.5ZM17.5 6C17.7761 6 18 6.22386 18 6.5V11.5C18 11.7761 17.7761 12 17.5 12C17.2239 12 17 11.7761 17 11.5V7.70703L12.8535 11.8535C12.6583 12.0488 12.3417 12.0488 12.1465 11.8535C11.9512 11.6583 11.9512 11.3417 12.1465 11.1465L16.293 7H12.5C12.2239 7 12 6.77614 12 6.5C12 6.22386 12.2239 6 12.5 6H17.5Z",Fn=({className:t})=>ia("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:ia("path",{d:dh,fill:"currentColor"})});import{jsx as gh}from"react/jsx-runtime";import{$applyNodeReplacement as bh}from"lexical";import*as aa from"react";import{DecoratorBlockNode as mh}from"@lexical/react/LexicalDecoratorBlockNode.js";import{addClassNamesToElement as ph}from"@lexical/utils";import{$applyNodeReplacement as fh}from"lexical";function hh(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:sa({relationTo:o,value:e})}:null}var Pt=class extends mh{__data;constructor({data:e,format:o,key:n}){super(o,n),this.__data=e}static clone(e){return new this({data:e.__data,format:e.__format,key:e.__key})}static getType(){return"relationship"}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:hh,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=sa(o);return n.setFormat(e.format),n}static isInline(){return!1}createDOM(e){let o=document.createElement("div");return ph(o,e?.theme?.relationship),o}decorate(e,o){return null}exportDOM(){let e=document.createElement("div");e.setAttribute("data-lexical-relationship-id",String(typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value)),e.setAttribute("data-lexical-relationship-relationTo",this.__data?.relationTo);let o=document.createTextNode(this.getTextContent());return e.append(o),{element:e}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"relationship"}}getData(){return this.getLatest().__data}getTextContent(){return`${this.__data?.relationTo} relation to ${typeof this.__data?.value=="object"?this.__data?.value?.id:this.__data?.value}`}setData(e){let o=this.getWritable();o.__data=e}};function sa(t){return fh(new Pt({data:t}))}var xh=aa.lazy(()=>import("./RelationshipComponent-TVK6I4W4.js").then(t=>({default:t.RelationshipComponent})));function Ch(t){let e=t.getAttribute("data-lexical-relationship-id"),o=t.getAttribute("data-lexical-relationship-relationTo");return e!=null&&o!=null?{node:Ve({relationTo:o,value:e})}:null}var Ee=class extends Pt{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importDOM(){return{div:e=>!e.hasAttribute("data-lexical-relationship-relationTo")||!e.hasAttribute("data-lexical-relationship-id")?null:{conversion:Ch,priority:2}}}static importJSON(e){let o={relationTo:e.relationTo,value:e.value},n=Ve(o);return n.setFormat(e.format),n}decorate(e,o){return gh(xh,{className:o.theme.relationship??"LexicalEditorTheme__relationship",data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function Ve(t){return bh(new Ee({data:t}))}function Pn(t){return t instanceof Ee}import{c as zh}from"react/compiler-runtime";import{jsx as Gh}from"react/jsx-runtime";import{useLexicalComposerContext as Uh}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Wh}from"@lexical/utils";import{$getPreviousSelection as Vh,$getSelection as Kh,$isParagraphNode as Jh,$isRangeSelection as Xh,COMMAND_PRIORITY_EDITOR as Yh,createCommand as Zh}from"lexical";import{useEffect as qh}from"react";import{c as da}from"react/compiler-runtime";import{jsx as Bn}from"react/jsx-runtime";import{useLexicalComposerContext as ma}from"@lexical/react/LexicalComposerContext.js";import{toast as vh}from"@payloadcms/ui";import{$getNodeByKey as Mh,COMMAND_PRIORITY_EDITOR as pa}from"lexical";import{useEffect as fa,useState as Ah}from"react";import{c as kh}from"react/compiler-runtime";import{jsx as _h}from"react/jsx-runtime";import{useLexicalComposerContext as Th}from"@lexical/react/LexicalComposerContext";import{useListDrawer as Eh,useModal as wh}from"@payloadcms/ui";import{$getNodeByKey as ca,$getPreviousSelection as Sh,$getRoot as Nh,$getSelection as Lh,$isRangeSelection as yh,$setSelection as Rh}from"lexical";import{useEffect as Ih,useState as ua}from"react";var Bt=t=>{let e=kh(23),[o]=Th(),[n,r]=ua(null),[l,s]=ua(!1),[i,c,u]=Eh(t),{closeDrawer:d,drawerSlug:a,isDrawerOpen:p,openDrawer:m}=u,{modalState:h}=wh(),f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{let E=Lh()??Sh();r(E)},e[0]=f):f=e[0];let g=f,C;e[1]!==o||e[2]!==n?(C=()=>{n&&o.update(()=>{if(yh(n)){let{anchor:E,focus:w}=n;ca(E.key)&&ca(w.key)&&Rh(n.clone())}else Nh().selectEnd()},{discrete:!0,skipTransforms:!0})},e[1]=o,e[2]=n,e[3]=C):C=e[3];let S=C,N;e[4]!==d?(N=()=>{d()},e[4]=d,e[5]=N):N=e[5];let b=N,x,_;e[6]!==a||e[7]!==h||e[8]!==S||e[9]!==l?(x=()=>{if(!l)return;let E=h[a];E&&!E?.isOpen&&(s(!1),setTimeout(()=>{S()},1))},_=[h,a,S,l],e[6]=a,e[7]=h,e[8]=S,e[9]=l,e[10]=x,e[11]=_):(x=e[10],_=e[11]),Ih(x,_);let k;e[12]!==c?(k=E=>_h(c,{...E,onClick:()=>{g()}}),e[12]=c,e[13]=k):k=e[13];let T;e[14]!==m?(T=()=>{g(),m(),s(!0)},e[14]=m,e[15]=T):T=e[15];let y;return e[16]!==i||e[17]!==b||e[18]!==p||e[19]!==a||e[20]!==k||e[21]!==T?(y={closeListDrawer:b,isListDrawerOpen:p,ListDrawer:i,listDrawerSlug:a,ListDrawerToggler:k,openListDrawer:T},e[16]=i,e[17]=b,e[18]=p,e[19]=a,e[20]=k,e[21]=T,e[22]=y):y=e[22],y};var Dh=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=Mh(o);r&&r.replace(Ve({relationTo:e,value:n}))}):t.dispatchCommand(jn,{relationTo:e,value:n})},$h=t=>{let e=da(14),{enabledCollectionSlugs:o}=t,[n]=ma(),[r,l]=Ah(null),s=o?.[0],i;e[0]!==o||e[1]!==s?(i={collectionSlugs:o,selectedCollection:s},e[0]=o,e[1]=s,e[2]=i):i=e[2];let{closeListDrawer:c,ListDrawer:u,openListDrawer:d}=Bt(i),a,p;e[3]!==n||e[4]!==d?(a=()=>n.registerCommand(ot,g=>(l(g?.replace?g?.replace.nodeKey:null),d(),!0),pa),p=[n,d],e[3]=n,e[4]=d,e[5]=a,e[6]=p):(a=e[5],p=e[6]),fa(a,p);let m;e[7]!==c||e[8]!==n||e[9]!==r?(m=g=>{let{collectionSlug:C,doc:S}=g;Dh({editor:n,relationTo:C,replaceNodeKey:r,value:S.id}),c()},e[7]=c,e[8]=n,e[9]=r,e[10]=m):m=e[10];let h=m,f;return e[11]!==u||e[12]!==h?(f=Bn(u,{onSelect:h}),e[11]=u,e[12]=h,e[13]=f):f=e[13],f},Oh=()=>{let t=da(3),[e]=ma(),o,n;return t[0]!==e?(o=()=>e.registerCommand(ot,Fh,pa),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),fa(o,n),null},ha=({enabledCollectionSlugs:t})=>t?.length?Bn($h,{enabledCollectionSlugs:t}):Bn(Oh,{});function Fh(){return vh.error("No relationship collections enabled"),!0}import{c as Ph}from"react/compiler-runtime";import{useConfig as Bh,useEntityVisibility as jh}from"@payloadcms/ui";import"react";var bo=t=>{let e=Ph(11),{enabledCollectionSlugs:o}=t,{config:n}=Bh(),{collections:r}=n,{visibleEntities:l}=jh(),s,i;if(e[0]!==r||e[1]!==o||e[2]!==l){let u;e[5]!==o||e[6]!==l?(u=a=>{let{slug:p}=a;return o.includes(p)&&(!l?.collections||l.collections.includes(p))},e[5]=o,e[6]=l,e[7]=u):u=e[7];let d=r.filter(u);s=d,i=d.map(Hh),e[0]=r,e[1]=o,e[2]=l,e[3]=s,e[4]=i}else s=e[3],i=e[4];let c;return e[8]!==s||e[9]!==i?(c={enabledCollections:s,enabledCollectionSlugs:i},e[8]=s,e[9]=i,e[10]=c):c=e[10],c};function Hh(t){return t.slug}var jn=Zh("INSERT_RELATIONSHIP_COMMAND"),ga=t=>{let e=zh(7),{clientProps:o}=t,[n]=Uh(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=bo(r),s,i;e[2]!==n?(s=()=>{if(!n.hasNodes([Ee]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return n.registerCommand(jn,Qh,Yh)},i=[n],e[2]=n,e[3]=s,e[4]=i):(s=e[3],i=e[4]),qh(s,i);let c;return e[5]!==l?(c=Gh(ha,{enabledCollectionSlugs:l}),e[5]=l,e[6]=c):c=e[6],c};function Qh(t){let e=Kh()||Vh();if(Xh(e)){let o=Ve(t),{focus:n}=e,r=n.getNode();Wh(o),Jh(r)&&!r.__first&&r.remove()}return!0}var t5=A({nodes:[Ee],plugins:[{Component:ga,position:"normal"}],slashMenu:{groups:[q([{Icon:Fn,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(ot,{replace:!1})}}])]},toolbarFixed:{groups:[xe([{ChildComponent:Fn,isActive:({selection:t})=>{if(!e5(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return Pn(e)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(ot,{replace:!1})}}])]}});import{c as Ra}from"react/compiler-runtime";import{jsx as fe,jsxs as U5}from"react/jsx-runtime";import{useLexicalComposerContext as W5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as Ia}from"@lexical/react/useLexicalEditable";import{getTranslation as V5}from"@payloadcms/translations";import{useScrollInfo as K5,useThrottledEffect as J5,useTranslation as va}from"@payloadcms/ui";import*as Ma from"react";import{useMemo as ya}from"react";import{jsx as o5,jsxs as n5}from"react/jsx-runtime";import{Tooltip as r5,useTranslation as l5}from"@payloadcms/ui";import{$addUpdateTag as Hn,$getRoot as i5,$getSelection as s5,SKIP_SELECTION_FOCUS_TAG as a5}from"lexical";import{useCallback as ba,useEffect as c5,useMemo as xa,useRef as u5,useState as d5}from"react";var zn="toolbar-popup__button",jt=({active:t=!1,children:e,editor:o,enabled:n=!0,item:r})=>{let{i18n:l}=l5(),{fieldProps:{featureClientSchemaMap:s,schemaPath:i}}=W(),[c,u]=d5(!1),d=u5(null);c5(()=>{d.current?.removeAttribute("data-pressing")},[t]);let a=xa(()=>r.label?typeof r.label=="function"?r.label({featureClientSchemaMap:s,i18n:l,schemaPath:i}):r.label:r.key.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,f=>f.toUpperCase()),[s,l,i,r]),p=xa(()=>[zn,n?"":"disabled",t?"active":"",r.key?`${zn}-${r.key}`:""].filter(Boolean).join(" "),[t,n,r.key]),m=ba(f=>{if(n){if(f.detail===0&&r.isActive){let g=f.currentTarget;o.update(()=>{Hn("toolbar"),Hn(a5),s5()||i5().selectEnd(),r.onSelect?.({editor:o,isActive:t})},{onUpdate:()=>{g.isConnected&&g.ownerDocument.activeElement===o.getRootElement()&&g.focus({preventScroll:!0})}});return}o.focus(()=>{o.update(()=>{Hn("toolbar")}),r.onSelect?.({editor:o,isActive:t})})}},[o,r,t,n]),h=ba(f=>{f.preventDefault(),f.currentTarget.setAttribute("data-pressing","")},[]);return n5("button",{"aria-label":a,"aria-pressed":r.isActive?t:void 0,className:p,"data-button-key":r.key,disabled:!n,onClick:m,onMouseDown:h,onPointerEnter:()=>u(!0),onPointerLeave:()=>{u(!1),d.current?.removeAttribute("data-pressing")},ref:d,type:"button",children:[o5(r5,{className:`${zn}__tooltip`,show:c,children:a}),e]})};import{c as _5}from"react/compiler-runtime";import{jsx as pt}from"react/jsx-runtime";import T5,{useMemo as E5}from"react";import{useTranslation as wa}from"@payloadcms/ui";import{c as m5}from"react/compiler-runtime";import{jsx as Ke,jsxs as Ca}from"react/jsx-runtime";import{Button as p5}from"@payloadcms/ui";import{$addUpdateTag as f5,isDOMNode as h5}from"lexical";import Un,{useEffect as Co,useId as g5,useMemo as b5,useRef as xo,useState as Gn}from"react";var ka="toolbar-popup__dropdown-item",_a=Un.createContext(null);function Ta({active:t,children:e,editor:o,enabled:n,Icon:r,item:l,itemKey:s,tooltip:i}){let c=b5(()=>[ka,n===!1?"disabled":"",t?"active":"",l?.key?`${ka}-${l.key}`:""].filter(Boolean).join(" "),[n,t,l.key]),u=xo(null),d=Un.use(_a);if(d===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:a}=d;return Co(()=>{u?.current!=null&&a(u)},[u,a]),Ke(p5,{"aria-label":i,buttonStyle:"ghost",className:c,disabled:n===!1,extraButtonProps:{"aria-checked":l.isActive?!!t:void 0,"data-item-key":s,role:l.isActive?"menuitemcheckbox":"menuitem",tabIndex:-1},icon:r,iconPosition:"left",onClick:()=>{n!==!1&&o.focus(()=>{o.update(()=>{f5("toolbar")}),l.onSelect?.({editor:o,isActive:t})})},onMouseDown:p=>{p.preventDefault()},ref:u,tooltip:i,type:"button",children:e})}function x5(t){let e=m5(17),{id:o,children:n,dropdownKey:r,dropDownRef:l,itemsContainerClassNames:s,onClose:i,shouldAutoFocus:c}=t,[u,d]=Gn(),[a,p]=Gn(),m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=_=>{d(k=>k!=null?[...k,_]:[_])},e[0]=m):m=e[0];let h=m,f;e[1]!==u||e[2]!==i?(f=_=>{if(u==null)return;let{key:k}=_,T=u.filter(k5);["ArrowDown","ArrowUp","Escape"].includes(k)&&_.preventDefault(),k==="Escape"?i():k==="Tab"?setTimeout(()=>i({restoreFocus:!1})):k==="ArrowUp"?p(y=>{if(y==null)return T[0];let E=T.indexOf(y)-1;return T[E===-1?T.length-1:E]}):k==="ArrowDown"&&p(y=>{if(y==null)return T[0];let E=T.indexOf(y);return T[E===T.length-1?0:E+1]})},e[1]=u,e[2]=i,e[3]=f):f=e[3];let g=f,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(C={registerItem:h},e[4]=C):C=e[4];let S=C,N,b;e[5]!==a||e[6]!==u||e[7]!==c?(N=()=>{c&&u!=null&&a==null&&p(u.find(C5)),a!=null&&a?.current!=null&&a.current.focus()},b=[u,a,c],e[5]=a,e[6]=u,e[7]=c,e[8]=N,e[9]=b):(N=e[8],b=e[9]),Co(N,b);let x;return e[10]!==n||e[11]!==l||e[12]!==r||e[13]!==g||e[14]!==o||e[15]!==s?(x=Ke(_a,{value:S,children:Ke("div",{className:(s??["toolbar-popup__dropdown-items"]).join(" "),"data-dropdown-key":r,"data-theme":"dark",id:o,onKeyDown:g,popover:"manual",ref:l,role:"menu",tabIndex:-1,children:n})}),e[10]=n,e[11]=l,e[12]=r,e[13]=g,e[14]=o,e[15]=s,e[16]=x):x=e[16],x}function C5(t){return!t.current?.disabled}function k5(t){return!t.current?.disabled}function Ea({buttonAriaLabel:t,buttonClassName:e,children:o,disabled:n=!1,dropdownKey:r,Icon:l,itemsContainerClassNames:s,label:i,stopCloseOnClickSelf:c}){let u=xo(null),d=xo(null),a=xo(!1),p=g5(),m=`toolbar-dropdown-${r}-${p}`,[h,f]=Gn(!1),g=({restoreFocus:C=!0}={})=>{f(!1),C&&d?.current!=null&&d.current.focus()};return Co(()=>{let C=d.current,S=u.current;if(h&&C!==null&&S!==null){S.matches(":popover-open")||S.showPopover();let N=()=>{let{bottom:b,left:x,top:_}=C.getBoundingClientRect(),k=8,T=5,y=b+T,E=_-S.offsetHeight-T,w=Math.max(k,window.innerHeight-S.offsetHeight-k),R=y+S.offsetHeight+k<=window.innerHeight?y:E>=k?E:y;S.style.position="fixed",S.style.top=`${Math.max(k,Math.min(R,w))}px`,S.style.left=`${Math.max(8,Math.min(x-5,window.innerWidth-S.offsetWidth-20))}px`};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,{capture:!0,passive:!0}),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,{capture:!0})}}},[u,d,h]),Co(()=>{let C=d.current;if(C!==null&&h){let S=N=>{let b=N.target;h5(b)&&(c&&u.current&&u.current.contains(b)||C.contains(b)||f(!1))};return document.addEventListener("click",S),()=>{document.removeEventListener("click",S)}}},[u,d,h,c]),Ca(Un.Fragment,{children:[Ca("button",{"aria-controls":m,"aria-expanded":h,"aria-haspopup":"menu","aria-label":t,className:e+(h?" active":""),"data-dropdown-key":r,disabled:n,onClick:C=>{C.preventDefault(),a.current=!1,f(!h)},onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),a.current=!0,f(!h))},onMouseDown:C=>{C.preventDefault()},ref:d,type:"button",children:[l&&Ke(l,{}),i&&Ke("span",{className:"toolbar-popup__dropdown-label",children:i}),Ke("i",{className:"toolbar-popup__dropdown-caret"})]}),h&&Ke(x5,{dropdownKey:r,dropDownRef:u,id:m,itemsContainerClassNames:s,onClose:g,shouldAutoFocus:a.current,children:o})]})}var Wn="toolbar-popup__dropdown",w5=t=>{let e=_5(15),{active:o,anchorElem:n,editor:r,enabled:l,iconOnly:s,item:i}=t,{i18n:c}=wa(),{fieldProps:u}=W(),{featureClientSchemaMap:d,schemaPath:a}=u;if(i.Component){let m;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==l||e[4]!==i?(m=i?.Component&&pt(i.Component,{active:o,anchorElem:n,editor:r,enabled:l,item:i},i.key),e[0]=o,e[1]=n,e[2]=r,e[3]=l,e[4]=i,e[5]=m):m=e[5],m}let p;if(e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==d||e[10]!==c||e[11]!==s||e[12]!==i||e[13]!==a){let m=i.key,h;i.label&&(m=typeof i.label=="function"?i.label({featureClientSchemaMap:d,i18n:c,schemaPath:a}):i.label),m.length>25?h=m.substring(0,25)+"...":h=m,p=pt(Ta,{active:o,editor:r,enabled:l,Icon:i?.ChildComponent?pt(i.ChildComponent,{}):void 0,item:i,itemKey:i.key,tooltip:s?m:void 0,children:pt("span",{className:"text",children:h})},i.key),e[6]=o,e[7]=r,e[8]=l,e[9]=d,e[10]=c,e[11]=s,e[12]=i,e[13]=a,e[14]=p}else p=e[14];return p},S5=T5.memo(w5),Ht=({anchorElem:t,classNames:e,editor:o,group:n,groupState:r,Icon:l,itemsContainerClassNames:s,label:i})=>{let{items:c,key:u}=n,{i18n:d}=wa(),{fieldProps:{featureClientSchemaMap:a,schemaPath:p}}=W(),m=r.activeItems.map(C=>typeof C.label=="function"?C.label({featureClientSchemaMap:a,i18n:d,schemaPath:p}):C.label||C.key),h=u==="text"?d.t("lexical:general:textStyle"):void 0,f=[...new Set([i,...m,h].filter(Boolean))].join(", ")||u,g=E5(()=>c?.length?c.map(C=>pt(S5,{active:r.activeItemKeys.includes(C.key),anchorElem:t,editor:o,enabled:r.enabledItemKeys.includes(C.key),iconOnly:n.iconOnly,item:C},C.key)):null,[c,r.activeItemKeys,r.enabledItemKeys,t,o]);return pt(Ea,{buttonAriaLabel:f,buttonClassName:[Wn,`${Wn}-${u}`,...e||[]].filter(Boolean).join(" "),disabled:!r.enabledGroup,dropdownKey:u,Icon:l,itemsContainerClassNames:[`${Wn}-items`,...s||[]],label:i,children:g},u)};import{c as N5}from"react/compiler-runtime";import{useEffect as L5}from"react";function ko(t){let e=N5(3),{toolbarRef:o}=t,n,r;e[0]!==o?(n=()=>{let l=o.current;if(!l)return;let s,i=()=>Array.from(l.querySelectorAll("button")).filter(p=>!p.closest('[role="menu"]')&&p.closest('[role="toolbar"]')===l),c=()=>{let p=i(),m=p.filter(R5);(!s||!m.includes(s))&&(s=m[0]);for(let h of p)h.tabIndex=h===s?0:-1},u=p=>{let m=i().find(h=>h===p.target);m&&(s=m,c())},d=p=>{if(p.altKey||p.ctrlKey||p.metaKey||p.shiftKey)return;let m=i().filter(y5),h=m.findIndex(C=>C===p.target);if(h===-1)return;let f=getComputedStyle(l).direction==="rtl",g;e:switch(p.key){case"ArrowLeft":{g=h+(f?1:-1);break e}case"ArrowRight":{g=h+(f?-1:1);break e}case"End":{g=m.length-1;break e}case"Home":{g=0;break e}default:return}p.preventDefault(),p.stopPropagation(),m[(g+m.length)%m.length]?.focus()};c();let a=new MutationObserver(c);return a.observe(l,{attributeFilter:["disabled"],childList:!0,subtree:!0}),l.addEventListener("focusin",u),l.addEventListener("keydown",d),()=>{a.disconnect(),l.removeEventListener("focusin",u),l.removeEventListener("keydown",d)}},r=[o],e[0]=o,e[1]=n,e[2]=r):(n=e[1],r=e[2]),L5(n,r)}function y5(t){return!t.disabled}function R5(t){return!t.disabled}import{mergeRegister as I5}from"@lexical/utils";import{$getSelection as v5}from"lexical";import{useCallback as M5,useDeferredValue as A5,useEffect as D5,useRef as Sa,useState as $5}from"react";function O5(t){let e=new Map,o=new Map;if(!t?.length)return{groupStates:o,itemStates:e};for(let n of t){let r=[];for(let l of n.items)e.set(l.key,{active:!1,enabled:!0}),r.push(l.key);o.set(n.key,{activeItemKeys:[],activeItems:[],enabledGroup:!0,enabledItemKeys:r})}return{groupStates:o,itemStates:e}}function _o(t,e){let[o,n]=$5(()=>O5(e)),r=A5(o),l=W(),s=Sa(l);s.current=l;let i=Sa(e);i.current=e;let c=Mr(),u=M5(()=>{t.getEditorState().read(()=>{let d=v5();if(!d)return;let a=i.current;if(!a?.length)return;let p=s.current,m=new Map,h=new Map;for(let f of a){let g=[],C=[],S=[],N=f.type==="dropdown"?f.maxActiveItems??1:void 0;for(let x of f.items){let _=x.isActive?(!N||g.length<N)&&x.isActive({editor:t,editorConfigContext:p,selection:d}):!1,k=x.isEnabled?x.isEnabled({editor:t,editorConfigContext:p,selection:d}):!0;_&&(g.push(x.key),C.push(x)),k&&S.push(x.key),m.set(x.key,{active:_,enabled:k})}let b=f.type==="dropdown"&&f.isEnabled?f.isEnabled({editor:t,editorConfigContext:p,selection:d}):!0;h.set(f.key,{activeItemKeys:g,activeItems:C,enabledGroup:b,enabledItemKeys:S})}n({groupStates:h,itemStates:m})})},[t]);return D5(()=>{c(u);let d=()=>{c(u)},a=I5(t.registerUpdateListener(d));return document.addEventListener("mouseup",d),()=>{a(),document.removeEventListener("mouseup",d)}},[t,c,u]),r}import{c as F5}from"react/compiler-runtime";import{useEffect as P5}from"react";var B5=".fixed-toolbar__scroll",j5=40;function H5({clientWidth:t,deltaMode:e,deltaY:o,isRightToLeft:n}){let r=e===1?o*j5:e===2?o*t:o;return n?-r:r}function Na(t){if(!(Math.abs(t.deltaY)>Math.abs(t.deltaX)))return;let o=t.target;if(!(o instanceof Element))return;let n=o.closest(B5);!n||!(n.scrollWidth>n.clientWidth)||(t.preventDefault(),n.scrollLeft+=H5({clientWidth:n.clientWidth,deltaMode:t.deltaMode,deltaY:t.deltaY,isRightToLeft:getComputedStyle(n).direction==="rtl"}))}var ft=0;function La(){let t=F5(1),e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],t[0]=e):e=t[0],P5(z5,e)}function z5(){return ft===0&&document.addEventListener("wheel",Na,{passive:!1}),ft=ft+1,G5}function G5(){ft=ft-1,ft===0&&document.removeEventListener("wheel",Na)}function X5({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&fe(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?fe(jt,{active:t,editor:o,enabled:n,item:r,children:fe(r.ChildComponent,{})},r.key):null}function Y5(t){let e=Ra(22),{anchorElem:o,editor:n,editorConfig:r,group:l,index:s,toolbarStates:i}=t,{i18n:c}=va(),{fieldProps:u}=W(),{featureClientSchemaMap:d,schemaPath:a}=u,p;e[0]!==l.key||e[1]!==i.groupStates?(p=i.groupStates.get(l.key),e[0]=l.key,e[1]=i.groupStates,e[2]=p):p=e[2];let m=p;m?.activeItems;let h;e:{if(l.type!=="dropdown"){h=void 0;break e}let x=m?.activeItems?.[0];if(x){h=x.ChildComponent;break e}h=l.ChildComponent}let f=h,g;e[3]!==d||e[4]!==l.type||e[5]!==m?.activeItems||e[6]!==c||e[7]!==a?(g=()=>{if(l.type!=="dropdown")return;let x=m?.activeItems;if(!x?.length)return;if(x.length>1)return c.t("lexical:general:toolbarItemsActive",{count:x.length});let _=x[0],k=_.key;return _.label&&(k=typeof _.label=="function"?_.label({featureClientSchemaMap:d,i18n:c,schemaPath:a}):_.label),k.length>25&&(k=k.substring(0,25)+"..."),k},e[3]=d,e[4]=l.type,e[5]=m?.activeItems,e[6]=c,e[7]=a,e[8]=g):g=e[8],m?.activeItems;let C;e[9]!==g?(C=g(),e[9]=g,e[10]=C):C=e[10];let S=C,N=`fixed-toolbar__group fixed-toolbar__group-${l.key}`,b;return e[11]!==f||e[12]!==o||e[13]!==S||e[14]!==n||e[15]!==r.features.toolbarFixed?.groups.length||e[16]!==l||e[17]!==m||e[18]!==s||e[19]!==N||e[20]!==i.itemStates?(b=U5("div",{className:N,"data-toolbar-group-key":l.key,children:[l.type==="dropdown"&&l.items.length&&m?fe(Ht,{anchorElem:o,editor:n,group:l,groupState:m,Icon:f,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:S}):null,l.type==="buttons"&&l.items.length?l.items.map(x=>{let _=i.itemStates.get(x.key);return fe(X5,{active:_?.active??!1,anchorElem:o,editor:n,enabled:_?.enabled??!0,item:x},x.key)}):null,s<r.features.toolbarFixed?.groups.length-1&&fe("div",{className:"divider"})]},l.key),e[11]=f,e[12]=o,e[13]=S,e[14]=n,e[15]=r.features.toolbarFixed?.groups.length,e[16]=l,e[17]=m,e[18]=s,e[19]=N,e[20]=i.itemStates,e[21]=b):b=e[21],b}function Z5({anchorElem:t,clientProps:e,editor:o,editorConfig:n,parentWithFixedToolbar:r}){let l=Ma.useRef(null),s=ya(()=>({toolbarRef:l}),[]),{fieldProps:i}=W(),{i18n:c}=va();ko(s);let u=Ia(),{y:d}=K5();La();let a=_o(o,n?.features?.toolbarFixed?.groups),p=ya(()=>{if(!r||e?.disableIfParentHasFixedToolbar)return null;let h=r.editorContainerRef.current.previousElementSibling;for(;h;){if(h.classList.contains("fixed-toolbar"))return h;h=h.previousElementSibling}return null},[e?.disableIfParentHasFixedToolbar,r]);return J5(()=>{if(!p)return;let m=l.current;if(!m)return;let h=m.getBoundingClientRect(),f=p.getBoundingClientRect();if(!(h.bottom<f.top||h.top>f.bottom))m.classList.remove("fixed-toolbar"),m.classList.add("fixed-toolbar","fixed-toolbar--overlapping"),p.classList.remove("fixed-toolbar"),p.classList.add("fixed-toolbar","fixed-toolbar--hide");else{if(!m.classList.contains("fixed-toolbar--overlapping"))return;m.classList.remove("fixed-toolbar--overlapping"),m.classList.add("fixed-toolbar"),p.classList.remove("fixed-toolbar--hide"),p.classList.add("fixed-toolbar")}},50,[l,p,d]),fe("div",{"aria-label":V5(i.field.label||i.path,c)||i.path,className:"fixed-toolbar",onFocus:m=>{m.stopPropagation()},ref:l,role:"toolbar",children:u&&fe("div",{className:"fixed-toolbar__scroll",tabIndex:-1,children:n?.features&&n.features?.toolbarFixed?.groups.map((m,h)=>fe(Y5,{anchorElem:t,editor:o,editorConfig:n,group:m,index:h,toolbarStates:a},m.key))})})}var Aa=t=>{if(t.parentEditor?.editorConfig){if(t.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return t.parentEditor;if(t.parentEditor)return Aa(t.parentEditor)}return!1},Da=t=>{let e=Ra(6),{clientProps:o}=t,[n]=W5(),r=W();if(!Ia())return null;let{editorConfig:s}=r,i=o.applyToFocusedEditor&&r.focusedEditor?.editor||n,c=o.applyToFocusedEditor&&r.focusedEditor?.editorConfig||s,u,d;if(e[0]!==o||e[1]!==i||e[2]!==c||e[3]!==r){d=Symbol.for("react.early_return_sentinel");e:{let a=Aa(r);if(o?.disableIfParentHasFixedToolbar&&a){d=null;break e}if(!c?.features?.toolbarFixed?.groups?.length){d=null;break e}u=fe(Z5,{anchorElem:document.body,clientProps:o,editor:i,editorConfig:c,parentWithFixedToolbar:a})}e[0]=o,e[1]=i,e[2]=c,e[3]=r,e[4]=u,e[5]=d}else u=e[4],d=e[5];return d!==Symbol.for("react.early_return_sentinel")?d:u};var q5=A({plugins:[{Component:Da,position:"aboveContainer"}]});import{c as Fa}from"react/compiler-runtime";import{jsx as we,jsxs as Pa}from"react/jsx-runtime";import{useLexicalComposerContext as Q5}from"@lexical/react/LexicalComposerContext.js";import{useLexicalEditable as eg}from"@lexical/react/useLexicalEditable";import{mergeRegister as Ba}from"@lexical/utils";import{getTranslation as tg}from"@payloadcms/translations";import{useTranslation as og}from"@payloadcms/ui";import{$getSelection as ja,$isRangeSelection as $a,$isTextNode as ng,$onUpdate as rg,COMMAND_PRIORITY_LOW as lg,getDOMSelection as Ha,SELECTION_CHANGE_COMMAND as ig}from"lexical";import{useCallback as Eo,useEffect as zt,useMemo as sg,useRef as Oa,useState as ag}from"react";import"react";import{createPortal as cg}from"react-dom";function Vn(t,e){let o=t.getRangeAt(0),n;if(t.anchorNode===e){let r=e;for(;r.firstElementChild!=null;)r=r.firstElementChild;n=r.getBoundingClientRect()}else n=o.getBoundingClientRect();return n}function To(t){let{alwaysDisplayOnTop:e=!1,anchorElem:o,anchorFlippedOffset:n=0,floatingElem:r,horizontalOffset:l=32,horizontalPosition:s="left",specialHandlingForCaret:i=!1,targetRect:c,verticalGap:u=10}=t,d=o.parentElement;if(c===null||d==null){r.style.opacity="0",r.style.transform="translate(-10000px, -10000px)";return}let a=r.getBoundingClientRect(),p=o.getBoundingClientRect(),m=d.getBoundingClientRect(),h=c.top-a.height-u,f=c.left-l;s==="center"&&(f=c.left+c.width/2-a.width/2);let g=0;return!e&&h<m.top&&!i&&(g=a.height+c.height+u*2,h+=g),s==="center"?f+a.width>m.right?f=m.right-a.width-l:f<m.left&&(f=m.left+l):f+a.width>m.right&&(f=m.right-a.width-l),f-=p.left,r.style.opacity="1",i&&n!==0?(h-=p.bottom-n+a.height-3,r.style.transform=`translate(${f}px, ${h}px) rotate(180deg)`):(h-=p.top,r.style.transform=`translate(${f}px, ${h}px)`),g}function ug({active:t,anchorElem:e,editor:o,enabled:n,item:r}){return r.Component?r?.Component&&we(r.Component,{anchorElem:e,editor:o,item:r},r.key):r.ChildComponent?we(jt,{active:t,editor:o,enabled:n,item:r,children:we(r.ChildComponent,{})},r.key):null}function dg(t){let e=Fa(13),{anchorElem:o,editor:n,group:r,index:l,toolbarStates:s}=t,{editorConfig:i}=W(),c;e[0]!==r.key||e[1]!==s.groupStates?(c=s.groupStates.get(r.key),e[0]=r.key,e[1]=s.groupStates,e[2]=c):c=e[2];let u=c;u?.activeItems;let d;e:{if(r.type!=="dropdown"){d=void 0;break e}d=u?.activeItems?.[0]?.ChildComponent??r.ChildComponent}let a=d,p=`inline-toolbar-popup__group inline-toolbar-popup__group-${r.key}`,m;return e[3]!==a||e[4]!==o||e[5]!==n||e[6]!==i.features.toolbarInline?.groups.length||e[7]!==r||e[8]!==u||e[9]!==l||e[10]!==p||e[11]!==s.itemStates?(m=Pa("div",{className:p,"data-toolbar-group-key":r.key,children:[r.type==="dropdown"&&r.items.length&&u?we(Ht,{anchorElem:o,editor:n,group:r,groupState:u,Icon:a}):null,r.type==="buttons"&&r.items.length?r.items.map(h=>{let f=s.itemStates.get(h.key);return we(ug,{active:f?.active??!1,anchorElem:o,editor:n,enabled:f?.enabled??!0,item:h},h.key)}):null,l<i.features.toolbarInline?.groups.length-1&&we("div",{className:"divider"})]},r.key),e[3]=a,e[4]=o,e[5]=n,e[6]=i.features.toolbarInline?.groups.length,e[7]=r,e[8]=u,e[9]=l,e[10]=p,e[11]=s.itemStates,e[12]=m):m=e[12],m}function mg({anchorElem:t,editor:e}){let o=Oa(null),n=sg(()=>({toolbarRef:o}),[]),{fieldProps:r}=W(),{i18n:l}=og();ko(n);let s=Oa(null),{editorConfig:i}=W(),c=_o(e,i?.features?.toolbarInline?.groups),u=Eo(()=>{if(o?.current){let m=o.current.style.opacity==="0",h=o.current.style.pointerEvents==="none";m||(o.current.style.opacity="0"),h||(o.current.style.pointerEvents="none")}},[o]),d=Eo(m=>{if(o?.current&&(m.buttons===1||m.buttons===3)){let h=o.current.style.opacity==="0",f=o.current.style.pointerEvents==="none";if(!h||!f){let g=m.clientX,C=m.clientY,S=document.elementFromPoint(g,C);o.current.contains(S)||u()}}},[u]),a=Eo(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);zt(()=>(document.addEventListener("mousemove",d),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a)}),[o,d,a]);let p=Eo(()=>{let m=ja(),h=Ha(e._window);if(o.current===null)return;let f=t.querySelector(":scope > .link-editor"),g=f!==null&&"style"in f&&f?.style?.opacity==="1",C=e.getRootElement();if(m!==null&&h!==null&&!h.isCollapsed&&C!==null&&C.contains(h.anchorNode)){let S=Vn(h,C),N=To({alwaysDisplayOnTop:g,anchorElem:t,floatingElem:o.current,horizontalPosition:"center",targetRect:S});s.current&&To({anchorElem:o.current,anchorFlippedOffset:N,floatingElem:s.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:S,verticalGap:8})}else u()},[e,u,t]);return zt(()=>{let m=t.parentElement,h=()=>{e.getEditorState().read(()=>{p()})};return window.addEventListener("resize",h),m&&m.addEventListener("scroll",h),()=>{window.removeEventListener("resize",h),m&&m.removeEventListener("scroll",h)}},[e,p,t]),zt(()=>(e.getEditorState().read(()=>{p()}),Ba(e.registerUpdateListener(({editorState:m})=>{m.read(()=>{p()})}),e.registerCommand(ig,()=>(rg(()=>e.read("latest",p)),!1),lg))),[e,p]),Pa("div",{"aria-label":tg(r.field.label||r.path,l)||r.path,className:"inline-toolbar-popup",ref:o,role:"toolbar",children:[we("div",{className:"caret",ref:s}),i?.features&&i.features?.toolbarInline?.groups.map((m,h)=>we(dg,{anchorElem:t,editor:e,group:m,index:h,toolbarStates:c},m.key))]})}function pg(t,e){let o=Fa(12),[n,r]=ag(!1),l=eg(),s;o[0]!==t?(s=()=>{t.getEditorState().read(()=>{if(t.isComposing())return;let m=ja(),h=Ha(t._window),f=t.getRootElement();if(h!==null&&(!$a(m)||f===null||!f.contains(h.anchorNode))){r(!1);return}if(!$a(m))return;if(m.getTextContent()!==""){let C=m.getNodes(),S=!1;for(let N of C)if(ng(N)){r(!0),S=!0;break}S||r(!1)}else r(!1);let g=m.getTextContent().replace(/\n/g,"");if(!m.isCollapsed()&&g===""){r(!1);return}})},o[0]=t,o[1]=s):s=o[1];let i=s,c,u;o[2]!==i?(c=()=>(document.addEventListener("selectionchange",i),document.addEventListener("mouseup",i),()=>{document.removeEventListener("selectionchange",i),document.removeEventListener("mouseup",i)}),u=[i],o[2]=i,o[3]=c,o[4]=u):(c=o[3],u=o[4]),zt(c,u);let d,a;if(o[5]!==t||o[6]!==i?(d=()=>Ba(t.registerUpdateListener(()=>{i()}),t.registerRootListener(()=>{t.getRootElement()===null&&r(!1)})),a=[t,i],o[5]=t,o[6]=i,o[7]=d,o[8]=a):(d=o[7],a=o[8]),zt(d,a),!n||!l)return null;let p;return o[9]!==e||o[10]!==t?(p=cg(we(mg,{anchorElem:e,editor:t}),e),o[9]=e,o[10]=t,o[11]=p):p=o[11],p}var za=t=>{let{anchorElem:e}=t,[o]=Q5();return pg(o,e)};var fg=A({plugins:[{Component:za,position:"floatingAnchorElem"}]});import{TableCellNode as ub,TableNode as db,TableRowNode as mb}from"@lexical/table";import{jsx as Ga}from"react/jsx-runtime";import"react";var hg={16:"M7 4h4.5a.5.5 0 0 1 .5.5V6H7zM6 4H4.5a.5.5 0 0 0-.5.5V6h2zm0 3H4v2h2zm0 3H4v1.5a.5.5 0 0 0 .5.5H6zm1 2h4.5a.5.5 0 0 0 .5-.5V10H7zm0-3V7h5v2zM3 4.5A1.5 1.5 0 0 1 4.5 3h7A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5z",24:"M17.204 6.51A2 2 0 0 1 19 8.5V16l-.011.204a2 2 0 0 1-1.785 1.785L17 18H7l-.204-.01a2 2 0 0 1-1.786-1.786L5 16V8.5a2 2 0 0 1 1.796-1.99L7 6.5h10zM6 16a1 1 0 0 0 1 1h2v-2.5H6zm4-1.5V17h7a1 1 0 0 0 .995-.898L18 16v-1.5zm-4-1h3V11H6zm4-2.5v2.5h8V11zM7 7.5a1 1 0 0 0-.995.897L6 8.5V10h3V7.5zm3 2.5h8V8.5a1 1 0 0 0-1-1h-7z"},Kn=({className:t,size:e=24})=>Ga("svg",{className:["icon",t].filter(Boolean).join(" "),fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Ga("path",{clipRule:"evenodd",d:hg[e],fill:"currentColor",fillRule:"evenodd"})});import{$convertToMarkdownString as gg}from"@lexical/markdown";import{$createTableCellNode as bg,$createTableNode as xg,$createTableRowNode as Cg,$isTableCellNode as Ua,$isTableNode as Jn,$isTableRowNode as Xn,TableCellHeaderStates as wo,TableCellNode as kg,TableNode as _g,TableRowNode as Tg}from"@lexical/table";import{$isParagraphNode as Eg,$isTextNode as wg}from"lexical";var Va=/^\|(.+)\|\s?$/,Sg=/^(\| ?:?-*:? ?)+\|\s?$/,Ka=({allTransformers:t})=>({type:"element",dependencies:[_g,Tg,kg],export:e=>{if(!Jn(e))return null;let o=[];for(let n of e.getChildren()){let r=[];if(!Xn(n))continue;let l=!1;for(let s of n.getChildren())Ua(s)&&(r.push(gg(t,s).replace(/\n/g,"\\n").trim()),s.__headerState===wo.ROW&&(l=!0));o.push(`| ${r.join(" | ")} |`),l&&o.push(`| ${r.map(s=>"---").join(" | ")} |`)}return o.join(`
58
+ `)},regExp:Va,replace:(e,o,n)=>{let r=n[0];if(!r)return;if(Sg.test(r)){let a=e.getPreviousSibling();if(!a||!Jn(a))return;let p=a.getChildren(),m=p[p.length-1];if(!m||!Xn(m))return;m.getChildren().forEach(h=>{Ua(h)&&h.setHeaderStyles(wo.ROW,wo.ROW)}),e.remove();return}let l=Wa(r,t);if(l==null)return;let s=[l],i=e.getPreviousSibling(),c=l.length;for(;i&&!(!Eg(i)||i.getChildrenSize()!==1);){let a=i.getFirstChild();if(!wg(a))break;let p=Wa(a.getTextContent(),t);if(p==null)break;c=Math.max(c,p.length),s.unshift(p);let m=i.getPreviousSibling();i.remove(),i=m}let u=xg();for(let a of s){let p=Cg();u.append(p);for(let m=0;m<c;m++)p.append(m<a.length?a[m]:Ja("",t))}let d=e.getPreviousSibling();Jn(d)&&Ng(d)===c?(d.append(...u.getChildren()),e.remove()):e.replace(u),u.selectEnd()}});function Ng(t){let e=t.getFirstChild();return Xn(e)?e.getChildrenSize():0}var Ja=(t,e)=>{t=t.replace(/\\n/g,`
59
+ `);let o=bg(wo.NO_STATUS);return to(t,e,o,!1,!0),o},Wa=(t,e)=>{let o=t.match(Va);return!o||!o[1]?null:o[1].split("|").map(n=>Ja(n,e))};import{c as Ig}from"react/compiler-runtime";import{jsx as H,jsxs as Se}from"react/jsx-runtime";import{useLexicalComposerContext as ec}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as vg}from"@lexical/react/useLexicalEditable";import{$computeTableMap as Mg,$deleteTableColumnAtSelection as Ag,$deleteTableRowAtSelection as Dg,$getNodeTriplet as $g,$getTableCellNodeFromLexicalNode as Qa,$getTableNodeFromLexicalNodeOrThrow as Ae,$getTableRowIndexFromTableCellNode as Og,$insertTableColumnAtSelection as Fg,$insertTableRowAtSelection as Pg,$isTableCellNode as tc,$isTableSelection as Gt,$mergeCells as Bg,$setTableColumnIsHeader as jg,$setTableRowIsHeader as Hg,$unmergeCell as zg,getTableElement as Yn,getTableObserverFromTableElement as Zn,TableCellHeaderStates as ht,TableCellNode as Gg}from"@lexical/table";import{mergeRegister as Ug}from"@lexical/utils";import{useScrollInfo as Wg}from"@payloadcms/ui";import{$getSelection as No,$isElementNode as Vg,$isRangeSelection as qn,$isTextNode as Kg,$setSelection as Jg,COMMAND_PRIORITY_CRITICAL as Xg,getDOMSelection as Yg,isDOMNode as Zg,SELECTION_CHANGE_COMMAND as qg}from"lexical";import*as Qn from"react";import{useCallback as ue,useEffect as gt,useRef as So,useState as bt}from"react";import{createPortal as oc}from"react-dom";import{jsx as Xa}from"react/jsx-runtime";import"react";var Lg={16:"M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2",24:"M7.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m6 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4.5 1.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"},Ya=({className:t,size:e=24})=>Xa("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Xa("path",{clipRule:"evenodd",d:Lg[e],fill:"currentColor",fillRule:"evenodd"})});import{$computeTableCellRectBoundary as yg,$computeTableMap as Rg,$getNodeTriplet as Za}from"@lexical/table";function qa({selection:t}){let[e,,o]=Za(t.anchor),[n]=Za(t.focus),[r,l,s]=Rg(o,e,n),{maxColumn:i,maxRow:c,minColumn:u,minRow:d}=yg(r,l,s);return{columns:i-u+1,rows:c-d+1}}function Qg(){let t=No();if(qn(t)&&!t.isCollapsed()||Gt(t)&&!t.anchor.is(t.focus)||!qn(t)&&!Gt(t))return!1;let[e]=$g(t.anchor);return e.__colSpan>1||e.__rowSpan>1}function e2(t){let e=t.getLastDescendant();Kg(e)?e.select():Vg(e)?e.selectEnd():e!==null&&e.selectNext()}function t2({cellMerge:t,contextRef:e,onClose:o,setIsMenuOpen:n,tableCellNode:r}){let[l]=ec(),s=So(null),[i,c]=bt(r),[u,d]=bt({columns:1,rows:1}),[a,p]=bt(!1),[m,h]=bt(!1),{y:f}=Wg();gt(()=>l.registerMutationListener(Gg,L=>{L.get(i.getKey())==="updated"&&l.getEditorState().read(()=>{c(i.getLatest())})},{skipInitialization:!0}),[l,i]),gt(()=>{l.getEditorState().read(()=>{let L=No();if(Gt(L)){let I=qa({selection:L});d(I);let v=L.anchor.is(L.focus);p(!v&&(I.columns>1||I.rows>1))}h(Qg())})},[l]),gt(()=>{let L=e.current,I=s.current,v=l.getRootElement();if(L!=null&&I!=null&&v!=null){let O=v.getBoundingClientRect(),D=L.getBoundingClientRect();I.style.opacity="1";let M=I.getBoundingClientRect(),B=5,F=D.right+B;if(F+M.width>window.innerWidth||F+M.width>O.right){let P=D.left-M.width-B;F=(P<0?B:P)+window.pageXOffset}I.style.left=`${F+window.pageXOffset}px`;let j=D.top;if(j+M.height>window.innerHeight){let P=D.bottom-M.height;j=P<0?B:P}I.style.top=`${j}px`}},[e,s,l,f]),gt(()=>{function L(I){s.current!=null&&e.current!=null&&Zg(I.target)&&!s.current.contains(I.target)&&!e.current.contains(I.target)&&n(!1)}return window.addEventListener("click",L),()=>window.removeEventListener("click",L)},[n,e]);let g=ue(()=>{l.update(()=>{if(i.isAttached()){let L=Ae(i),I=Yn(L,l.getElementByKey(L.getKey()));if(I===null)throw new Error("Expected to find tableElement in DOM");let v=Zn(I);v!==null&&v.$clearHighlight(),L.markDirty(),c(i.getLatest())}Jg(null)})},[l,i]),C=()=>{l.update(()=>{let L=No();if(!Gt(L))return;let v=L.getNodes().filter(tc),O=Bg(v);O&&(e2(O),o())})},S=()=>{l.update(()=>{zg()}),g()},N=ue(L=>{l.update(()=>{for(let I=0;I<u.rows;I++)Pg(L);o()})},[l,o,u.rows]),b=ue(L=>{l.update(()=>{for(let I=0;I<u.columns;I++)Fg(L);o()})},[l,o,u.columns]),x=ue(()=>{l.update(()=>{Dg(),o()})},[l,o]),_=ue(()=>{l.update(()=>{Ae(i).remove(),g(),o()})},[l,i,g,o]),k=ue(()=>{l.update(()=>{Ag(),o()})},[l,o]),T=ue(()=>{l.update(()=>{let L=Ae(i),I=Og(i),v=!i.hasHeaderState(ht.ROW);Hg(L,I,v),g(),o()})},[l,i,g,o]),y=ue(()=>{l.update(()=>{let L=Ae(i),[,I]=Mg(L,i,i),v=!i.hasHeaderState(ht.COLUMN);jg(L,I.startColumn,v),g(),o()})},[l,i,g,o]),E=ue(()=>{l.update(()=>{if(i.isAttached()){let L=Ae(i);L&&L.setRowStriping(!L.getRowStriping())}g(),o()})},[l,i,g,o]),w=ue(()=>{l.update(()=>{if(i.isAttached()){let L=Ae(i);L&&L.setFrozenColumns(L.getFrozenColumns()===0?1:0)}g(),o()})},[l,i,g,o]),R=null;return t&&(a?R=H("button",{className:"item","data-test-id":"table-merge-cells",onClick:()=>C(),type:"button",children:H("span",{className:"text",children:"Merge cells"})}):m&&(R=H("button",{className:"item","data-test-id":"table-unmerge-cells",onClick:()=>S(),type:"button",children:H("span",{className:"text",children:"Unmerge cells"})}))),oc(Se("div",{className:"table-action-menu-dropdown",onClick:L=>{L.stopPropagation()},ref:s,children:[R?Se(Qn.Fragment,{children:[R,H("hr",{})]}):null,H("button",{className:"item","data-test-id":"table-row-striping",onClick:()=>E(),type:"button",children:H("span",{className:"text",children:"Toggle row striping"})}),H("button",{className:"item","data-test-id":"table-freeze-first-column",onClick:()=>w(),type:"button",children:H("span",{className:"text",children:"Toggle first column freeze"})}),H("button",{className:"item","data-test-id":"table-insert-row-above",onClick:()=>N(!1),type:"button",children:Se("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," above"]})}),H("button",{className:"item","data-test-id":"table-insert-row-below",onClick:()=>N(!0),type:"button",children:Se("span",{className:"text",children:["Insert ",u.rows===1?"row":`${u.rows} rows`," below"]})}),H("hr",{}),H("button",{className:"item","data-test-id":"table-insert-column-before",onClick:()=>b(!1),type:"button",children:Se("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","left"]})}),H("button",{className:"item","data-test-id":"table-insert-column-after",onClick:()=>b(!0),type:"button",children:Se("span",{className:"text",children:["Insert ",u.columns===1?"column":`${u.columns} columns`," ","right"]})}),H("hr",{}),H("button",{className:"item","data-test-id":"table-delete-columns",onClick:()=>k(),type:"button",children:H("span",{className:"text",children:"Delete column"})}),H("button",{className:"item","data-test-id":"table-delete-rows",onClick:()=>x(),type:"button",children:H("span",{className:"text",children:"Delete row"})}),H("button",{className:"item","data-test-id":"table-delete",onClick:()=>_(),type:"button",children:H("span",{className:"text",children:"Delete table"})}),H("hr",{}),H("button",{className:"item","data-test-id":"table-row-header",onClick:()=>T(),type:"button",children:Se("span",{className:"text",children:[(i.__headerState&ht.ROW)===ht.ROW?"Remove":"Add"," ","row header"]})}),H("button",{className:"item","data-test-id":"table-column-header",onClick:()=>y(),type:"button",children:Se("span",{className:"text",children:[(i.__headerState&ht.COLUMN)===ht.COLUMN?"Remove":"Add"," ","column header"]})})]}),l.getRootElement()?.closest('dialog, [role="dialog"]')??document.body)}function o2({anchorElem:t,cellMerge:e}){let[o]=ec(),n=So(null),r=So(null),[l,s]=bt(!1),[i,c]=bt(null),u=ue(()=>{let a=n.current,p=No(),m=Yg(o._window),h=document.activeElement;function f(){a&&(a.classList.remove("table-cell-action-button-container--active"),a.classList.add("table-cell-action-button-container--inactive")),c(null)}if(p==null||a==null)return f();let g=o.getRootElement(),C=null,S=null;if(qn(p)&&g!==null&&m!==null&&g.contains(m.anchorNode)){let b=Qa(p.anchor.getNode());if(b==null||(S=o.getElementByKey(b.getKey()),S==null||!b.isAttached()))return f();let x=Ae(b),_=Yn(x,o.getElementByKey(x.getKey()));if(_===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=Zn(_),c(b)}else if(Gt(p)){let b=Qa(p.anchor.getNode());if(!tc(b))throw new Error("TableSelection anchorNode must be a TableCellNode");let x=Ae(b),_=Yn(x,o.getElementByKey(x.getKey()));if(_===null)throw new Error("TableActionMenu: Expected to find tableElement in DOM");C=Zn(_),S=o.getElementByKey(b.getKey())}else if(!h)return f();if(C===null||S===null)return f();let N=!C||!C.isSelecting;if(a.classList.toggle("table-cell-action-button-container--active",N),a.classList.toggle("table-cell-action-button-container--inactive",!N),N){let b=S.getBoundingClientRect(),x=t.getBoundingClientRect(),_=b.top-x.top,k=b.right-x.left;a.style.transform=`translate(${k}px, ${_}px)`}},[o,t]);gt(()=>{let a,p=()=>{a=void 0,o.getEditorState().read(u)},m=()=>(a===void 0&&(a=setTimeout(p,0)),!1);return Ug(o.registerUpdateListener(m),o.registerCommand(qg,m,Xg),o.registerRootListener((h,f)=>{f&&f.removeEventListener("pointerup",m),h&&(h.addEventListener("pointerup",m),m())}),()=>clearTimeout(a))});let d=So(i);return gt(()=>{d.current!==i&&s(!1),d.current=i},[d,i]),H("div",{className:"table-cell-action-button-container",ref:n,children:i!=null&&Se(Qn.Fragment,{children:[H("button",{className:"table-cell-action-button",onClick:a=>{a.stopPropagation(),s(!l)},ref:r,type:"button",children:H(Ya,{})}),l&&H(t2,{cellMerge:e,contextRef:r,onClose:()=>s(!1),setIsMenuOpen:s,tableCellNode:i})]})})}var nc=t=>{let e=Ig(3),{anchorElem:o}=t,n=vg(),r;return e[0]!==o||e[1]!==n?(r=oc(n?H(o2,{anchorElem:o??document.body,cellMerge:!0}):null,o??document.body),e[0]=o,e[1]=n,e[2]=r):r=e[2],r};import{c as n2}from"react/compiler-runtime";import{jsx as yo,jsxs as r2}from"react/jsx-runtime";import{useLexicalComposerContext as l2}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as i2}from"@lexical/react/useLexicalEditable";import{$computeTableMapSkipCellCheck as s2,$getTableNodeFromLexicalNodeOrThrow as er,$getTableRowIndexFromTableCellNode as a2,$isTableCellNode as rc,$isTableRowNode as c2,getDOMCellFromTarget as u2,getTableElement as d2,TableNode as lc}from"@lexical/table";import{calculateZoomLevel as ic,mergeRegister as m2}from"@lexical/utils";import{$getNearestNodeFromDOMNode as tr,isHTMLElement as p2,SKIP_SCROLL_INTO_VIEW_TAG as sc}from"lexical";import*as cc from"react";import{useCallback as Ut,useEffect as Ro,useRef as Lo,useState as Je}from"react";import{createPortal as f2}from"react-dom";var h2=33,ac=92,g2=(t,e)=>e.getElementByKey(t.getKey())?.clientHeight;function b2({editor:t}){let e=Lo(null),o=Lo(null),n=Lo(null),[r,l]=Je(!1),s=W(),i=Lo(null),[c,u]=Je(null),[d,a]=Je(null),[p,m]=Je(!1),[h,f]=Je(null),g=Ut(()=>{a(null),e.current=null,f(null),i.current=null,n.current=null},[]),C=E=>(E.buttons&1)===1;Ro(()=>{let E=new Set;return m2(t.registerMutationListener(lc,w=>{for(let[R,L]of w)L==="destroyed"?E.delete(R):E.add(R);l(E.size>0)}),t.registerNodeTransform(lc,w=>{if(w.getColWidths())return w;let R=w.getColumnCount(),L=ac;return w.setColWidths(Array(R).fill(L)),w}))},[t]),Ro(()=>{if(!r)return;let E=I=>{let v=I.target;if(p2(v)){if(h){u({x:I.clientX,y:I.clientY});return}if(m(C(I)),!(o.current&&o.current.contains(v))&&e.current!==v){e.current=v;let O=u2(v);O&&d!==O?t.getEditorState().read(()=>{let D=tr(O.elem);if(!D)throw new Error("TableCellResizer: Table cell node not found.");let M=er(D),B=d2(M,t.getElementByKey(M.getKey()));if(!B)throw new Error("TableCellResizer: Table element not found.");e.current=v,n.current=B.getBoundingClientRect(),a(O)},{editor:t}):O==null&&g()}}},w=I=>{m(!0)},R=I=>{m(!1)},L=t.registerRootListener((I,v)=>{v?.removeEventListener("mousemove",E),v?.removeEventListener("mousedown",w),v?.removeEventListener("mouseup",R),I?.addEventListener("mousemove",E),I?.addEventListener("mousedown",w),I?.addEventListener("mouseup",R)});return()=>{L()}},[d,h,t,r,g]);let S=E=>E==="bottom",N=Ut(E=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=tr(d.elem);if(!rc(w))throw new Error("TableCellResizer: Table cell node not found.");let R=er(w),L=a2(w),I=R.getChildren(),O=w.getColSpan()===R.getColumnCount()?L:L+w.getRowSpan()-1;if(O>=I.length||O<0)throw new Error("Expected table cell to be inside of table row.");let D=I[O];if(!c2(D))throw new Error("Expected table row");let M=D.getHeight();if(M===void 0){let F=D.getChildren();M=Math.min(...F.map(j=>g2(j,t)??1/0))}let B=Math.max(M+E,h2);D.setHeight(B)},{tag:sc})},[d,t]),b=(E,w)=>{let R;return w.forEach(L=>{L.forEach((I,v)=>{I.cell===E&&(R=v)})}),R},x=Ut(E=>{if(!d)throw new Error("TableCellResizer: Expected active cell.");t.update(()=>{let w=tr(d.elem);if(!rc(w))throw new Error("TableCellResizer: Table cell node not found.");let R=er(w),[L]=s2(R,null,null),I=b(w,L);if(I===void 0)throw new Error("TableCellResizer: Table column not found.");let v=R.getColWidths();if(!v)return;let O=v[I];if(O===void 0)return;let D=[...v],M=Math.max(O+E,ac);D[I]=M,R.setColWidths(D)},{tag:sc})},[d,t]),_=Ut(E=>{let w=R=>{if(R.preventDefault(),R.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");if(i.current){let{x:L,y:I}=i.current;if(d===null)return;let v=ic(R.target);if(S(E)){let O=(R.clientY-I)/v;N(O)}else{let O=(R.clientX-L)/v;x(O)}g(),document.removeEventListener("mouseup",w)}};return w},[d,g,x,N]),k=Ut(E=>w=>{if(w.preventDefault(),w.stopPropagation(),!d)throw new Error("TableCellResizer: Expected active cell.");i.current={x:w.clientX,y:w.clientY},u(i.current),f(E),document.addEventListener("mouseup",_(E))},[d,_]),[T,y]=Je({bottom:null,left:null,right:null,top:null});return Ro(()=>{if(d){let{height:E,left:w,top:R,width:L}=d.elem.getBoundingClientRect(),I=ic(d.elem),v=!!t.getRootElement()?.closest('dialog, [role="dialog"]'),O=v?0:window.scrollX,D=v?0:window.scrollY,M=v?"fixed":"absolute",B=10,F={bottom:{backgroundColor:"none",cursor:"row-resize",height:`${B}px`,left:`${O+w}px`,position:M,top:`${D+R+E-B/2}px`,width:`${L}px`},right:{backgroundColor:"none",cursor:"col-resize",height:`${E}px`,left:`${O+w+L-B/2}px`,position:M,top:`${D+R}px`,width:`${B}px`}},j=n.current;h&&c&&j&&(S(h)?(F[h].left=`${O+j.left}px`,F[h].top=`${D+c.y/I}px`,F[h].height="3px",F[h].width=`${j.width}px`):(F[h].top=`${D+j.top}px`,F[h].left=`${O+c.x/I}px`,F[h].width="3px",F[h].height=`${j.height}px`),F[h].backgroundColor="#adf"),y(F)}else y({bottom:null,left:null,right:null,top:null})},[d,h,t,c]),yo("div",{ref:o,children:d!=null&&!p&&r2(cc.Fragment,{children:[yo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:k("right"),style:T.right||void 0}),yo("div",{className:`${s.editorConfig.lexical.theme.tableCellResizer} TableCellResizer__ui`,onMouseDown:k("bottom"),style:T.bottom||void 0})]})})}var uc=()=>{let t=n2(7),[e]=l2(),o=i2(),[n,r]=Je(null),l,s;t[0]!==e?(l=()=>e.registerRootListener(c=>{r(c?.closest('dialog, [role="dialog"]')??document.body)}),s=[e],t[0]=e,t[1]=l,t[2]=s):(l=t[1],s=t[2]),Ro(l,s);let i;return t[3]!==e||t[4]!==o||t[5]!==n?(i=o&&n?f2(yo(b2,{editor:e}),n):null,t[3]=e,t[4]=o,t[5]=n,t[6]=i):i=t[6],i};import{c as S2}from"react/compiler-runtime";import{jsx as or,jsxs as N2,Fragment as L2}from"react/jsx-runtime";import{useLexicalComposerContext as y2}from"@lexical/react/LexicalComposerContext";import{useLexicalEditable as xc}from"@lexical/react/useLexicalEditable";import{$getTableAndElementByKey as R2,$getTableColumnIndexFromTableCellNode as I2,$getTableRowIndexFromTableCellNode as v2,$insertTableColumnAtSelection as M2,$insertTableRowAtSelection as A2,$isTableCellNode as D2,$isTableNode as pc,getTableElement as $2,TableNode as O2}from"@lexical/table";import{$findMatchingParent as F2,mergeRegister as P2}from"@lexical/utils";import{$getNearestNodeFromDOMNode as fc,isHTMLElement as B2}from"lexical";import{useEffect as hc,useMemo as j2,useRef as gc,useState as Io}from"react";import"react";import{createPortal as H2}from"react-dom";import{c as T2}from"react/compiler-runtime";import{useEffect as E2,useRef as w2}from"react";var x2="Expected a function",C2=Math.max,k2=Math.min;function _2(t,e,o){let n,r,l=0,s,i=!1,c=!1,u,d,a,p=!0;if(typeof t!="function")throw new TypeError(x2);e=e||0,typeof o=="object"&&(i=!!o.leading,c="maxWait"in o,u=c?C2(o.maxWait||0,e):u,p="trailing"in o?!!o.trailing:p);function m(_){let k=n,T=s;return n=s=void 0,l=_,d=t.apply(T,k),d}function h(_){return l=_,a=setTimeout(C,e),i?m(_):d}function f(_){let k=_-r,T=_-l,y=e-k;return c?k2(y,u-T):y}function g(_){let k=_-r,T=_-l;return r===void 0||k>=e||k<0||c&&T>=u}function C(){let _=Date.now();if(g(_))return S(_);a=setTimeout(C,f(_))}function S(_){return a=void 0,p&&n?m(_):(n=s=void 0,d)}function N(){a!==void 0&&clearTimeout(a),l=0,n=r=s=a=void 0}function b(){return a===void 0?d:S(Date.now())}function x(){let _=Date.now(),k=g(_);if(n=arguments,s=this,r=_,k){if(a===void 0)return h(r);if(c)return clearTimeout(a),a=setTimeout(C,e),m(r)}return a===void 0&&(a=setTimeout(C,e)),d}return x.cancel=N,x.flush=b,x}var dc=_2;function mc(t,e,o){let n=T2(6),r=w2(null),l,s;n[0]!==t||n[1]!==o||n[2]!==e?(l=()=>(r.current=dc(t,e,{maxWait:o}),()=>{r.current?.cancel()}),s=[t,e,o],n[0]=t,n[1]=o,n[2]=e,n[3]=l,n[4]=s):(l=n[3],s=n[4]),E2(l,s);let i;return n[5]===Symbol.for("react.memo_cache_sentinel")?(i=(...u)=>{let d=u;r.current&&r.current(...d)},n[5]=i):i=n[5],i}var bc=16;function z2({anchorElem:t}){let[e]=y2(),o=xc(),n=W(),[r,l]=Io(!1),[s,i]=Io(!1),[c,u]=Io(!1),[d,a]=Io({}),p=gc(new Set),m=gc(null),h=mc(C=>{let{isOutside:S,tableDOMNode:N}=G2(C,n.editorConfig?.lexical);if(S){l(!1),i(!1);return}if(!N)return;m.current=N;let b=null,x=null,_=null;if(e.getEditorState().read(()=>{let D=fc(N);if(D2(D)){let M=F2(D,B=>pc(B));if(!pc(M))return;if(_=$2(M,e.getElementByKey(M.getKey())),_){let B=M.getChildrenSize(),F=M.getChildAtIndex(0)?.getChildrenSize(),j=v2(D),P=I2(D);j===B-1?b=D:P===F-1&&(x=D)}}},{editor:e}),!_)return;let k=_.parentElement;if(!k)return;let{bottom:T,height:y,left:E,right:w,width:R,y:L}=_.getBoundingClientRect(),I=!1;k&&k.classList.contains("LexicalEditorTheme__tableScrollableWrapper")&&(I=k.scrollWidth>k.clientWidth);let{left:v,y:O}=t.getBoundingClientRect();b?(i(!1),l(!0),a({height:bc,left:I&&k?k.offsetLeft:E-v,top:T-O+5,width:I&&k?k.offsetWidth:R})):x&&(i(!0),l(!1),a({height:y,left:w-v+5,top:L-O,width:bc}))},50,250),f=j2(()=>new ResizeObserver(()=>{l(!1),i(!1)}),[]);hc(()=>{if(c)return document.addEventListener("mousemove",h),()=>{l(!1),i(!1),document.removeEventListener("mousemove",h)}},[c,h]),hc(()=>P2(e.registerMutationListener(O2,C=>{e.getEditorState().read(()=>{let S=!1;for(let[N,b]of C)switch(b){case"created":{p.current.add(N),S=!0;break}case"destroyed":{p.current.delete(N),S=!0;break}default:break}if(S){f.disconnect();for(let N of p.current){let{tableElement:b}=R2(N);f.observe(b)}u(p.current.size>0)}},{editor:e})},{skipInitialization:!1})),[e,f]);let g=C=>{e.update(()=>{m.current&&(fc(m.current)?.selectEnd(),C?(A2(),l(!1)):(M2(),i(!1)))})};return o?N2(L2,{children:[r&&or("button",{"aria-label":"Add Row",className:n.editorConfig.lexical.theme.tableAddRows,onClick:()=>g(!0),style:{...d},type:"button"}),s&&or("button",{"aria-label":"Add Column",className:n.editorConfig.lexical.theme.tableAddColumns,onClick:()=>g(!1),style:{...d},type:"button"})]}):null}function G2(t,e){let o=t.target;if(B2(o)){let n=o.closest(`td.${e.theme.tableCell}, th.${e.theme.tableCell}`);return{isOutside:!(n||o.closest(`button.${e.theme.tableAddRows}`)||o.closest(`button.${e.theme.tableAddColumns}`)||o.closest(`div.${e.theme.tableCellResizer}`)),tableDOMNode:n}}else return{isOutside:!0,tableDOMNode:null}}function Cc(t){let e=S2(2),{anchorElem:o}=t,n=o===void 0?document.body:o;if(!xc())return null;let l;return e[0]!==n?(l=H2(or(z2,{anchorElem:n}),n),e[0]=n,e[1]=l):l=e[1],l}import{c as K2}from"react/compiler-runtime";import{jsx as lr,jsxs as J2}from"react/jsx-runtime";import{useLexicalComposerContext as X2}from"@lexical/react/LexicalComposerContext";import{TablePlugin as Y2}from"@lexical/react/LexicalTablePlugin";import{INSERT_TABLE_COMMAND as Z2,TableCellNode as q2,TableNode as Q2,TableRowNode as eb}from"@lexical/table";import{mergeRegister as tb}from"@lexical/utils";import{$getSelection as ob,$isRangeSelection as nb,$setSelection as rb,COMMAND_PRIORITY_EDITOR as lb,createCommand as ib}from"lexical";import{createContext as sb,use as ab,useCallback as Sc,useEffect as Nc,useRef as cb,useState as vo}from"react";import*as Lc from"react";import{jsx as te,jsxs as Ne}from"react/jsx-runtime";import{useCallback as nr,useEffect as kc,useRef as rr,useState as Wt}from"react";import*as Ec from"react";import{createPortal as U2}from"react-dom";var _c=10,Tc=7;function W2(){return Ne("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"1.5",y:"1.5"}),te("rect",{height:"9",rx:"1",stroke:"currentColor",width:"3",x:"7.5",y:"1.5"})]})}function V2(){return Ne("svg",{fill:"none",height:"12",viewBox:"0 0 12 12",width:"12",xmlns:"http://www.w3.org/2000/svg",children:[te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"1.5"}),te("rect",{height:"3",rx:"1",stroke:"currentColor",width:"9",x:"1.5",y:"7.5"})]})}function wc({anchorElem:t,editor:e,isOpen:o,onClose:n,onInsert:r,position:l}){let[s,i]=Wt(0),[c,u]=Wt(0),[d,a]=Wt(""),[p,m]=Wt(""),[h,f]=Wt(null),g=rr(null),C=rr(null),S=rr(null),N=s>0?s:d?parseInt(d,10)||0:5,b=c>0?c:p?parseInt(p,10)||0:5;kc(()=>{o||(i(0),u(0),a(""),m(""),f(null))},[o]),kc(()=>{if(!o)return;let E=w=>{if(w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),n()),w.key==="Enter"&&h){w.preventDefault();let R=parseInt(d,10),L=parseInt(p,10);R>0&&L>0&&r(R,L)}};return document.addEventListener("keydown",E,!0),()=>document.removeEventListener("keydown",E,!0)},[o,n,r,h,d,p]);let x=nr((E,w)=>{E>0&&w>0&&r(E,w)},[r]),_=nr((E,w)=>{i(E),u(w)},[]),k=nr(()=>{i(0),u(0)},[]);if(!o||!l||!t)return null;let T=[];for(let E=1;E<=Tc;E++)for(let w=1;w<=_c;w++){let R=w<=N&&E<=b,L=w<=s&&E<=c,I="table-grid-popup__cell";R&&L?I+=" table-grid-popup__cell--hover":R&&(I+=" table-grid-popup__cell--selected"),T.push(te("div",{"aria-label":`${w} columns, ${E} rows`,className:I,onClick:()=>x(w,E),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),x(w,E))},onMouseEnter:()=>_(w,E),role:"button",tabIndex:-1},`${E}-${w}`))}let y=s>0&&c>0;return U2(Ne(Ec.Fragment,{children:[te("div",{className:"table-grid-popup__backdrop",onClick:n}),te("div",{className:"table-grid-popup",ref:g,style:{transform:`translate(${l.left}px, ${l.top}px)`},children:Ne("div",{className:"table-grid-popup__content",children:[Ne("div",{className:"table-grid-popup__header",children:[Ne("div",{className:`table-grid-popup__input-group${h==="cols"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(W2,{})}),te("input",{"aria-label":"Columns",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:E=>a(E.target.value),onFocus:()=>f("cols"),placeholder:s>0?String(s):"5",ref:C,type:"number",value:d})]}),te("span",{className:"table-grid-popup__separator",children:"\xD7"}),Ne("div",{className:`table-grid-popup__input-group${h==="rows"?" table-grid-popup__input-group--focused":""}`,children:[te("div",{className:"table-grid-popup__input-icon",children:te(V2,{})}),te("input",{"aria-label":"Rows",className:"table-grid-popup__input",min:1,onBlur:()=>f(null),onChange:E=>m(E.target.value),onFocus:()=>f("rows"),placeholder:c>0?String(c):"5",ref:S,type:"number",value:p})]})]}),Ne("div",{className:"table-grid-popup__grid",onMouseLeave:k,children:[T,y&&Ne("div",{className:"table-grid-popup__tooltip",style:{left:`calc(${(s-.5)/_c*100}%)`,top:`calc(${(c-1)/Tc*100}%)`},children:[N," \xD7 ",b]})]})]})})]}),t)}var Mo=ib("OPEN_EMBED_DRAWER_COMMAND"),yc=sb({cellEditorConfig:null,cellEditorPlugins:null,set:()=>{}});function Rc(t){let e=K2(8),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={cellEditorConfig:null,cellEditorPlugins:null},e[0]=n):n=e[0];let[r,l]=vo(n),s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=(d,a)=>{l({cellEditorConfig:d,cellEditorPlugins:a})},e[1]=s):s=e[1];let i;e[2]!==r.cellEditorConfig||e[3]!==r.cellEditorPlugins?(i={cellEditorConfig:r.cellEditorConfig,cellEditorPlugins:r.cellEditorPlugins,set:s},e[2]=r.cellEditorConfig,e[3]=r.cellEditorPlugins,e[4]=i):i=e[4];let c=i,u;return e[5]!==o||e[6]!==c?(u=lr(yc,{value:c,children:o}),e[5]=o,e[6]=c,e[7]=u):u=e[7],u}var Ic=()=>{let[t]=X2(),e=ab(yc),[o,n]=vo(!1),[r,l]=vo(null),s=cb(null),[i,c]=vo(null);Nc(()=>{let a=t.getRootElement();if(a){let p=a.closest(".editor")??null;c(p??a.parentElement)}},[t]),Nc(()=>{if(!t.hasNodes([Q2,eb,q2]))throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");return tb(t.registerCommand(Mo,()=>{let a=i;if(!a)return!0;let p=a.getBoundingClientRect(),m=null;t.getEditorState().read(()=>{let f=ob();if(nb(f)){s.current=f.clone();let g=f.anchor.getNode(),C=t.getElementByKey(g.getKey());if(C){let S=C.getBoundingClientRect();S.height>0&&(m={left:S.left-p.left,top:S.bottom-p.top+8})}}});let h=window.getSelection();if(h&&h.rangeCount>0){let g=h.getRangeAt(0).getBoundingClientRect();g.height>0&&(m={left:g.left-p.left,top:g.bottom-p.top+8})}return m||(m={left:0,top:40}),l(m),n(!0),!0},lb))},[e,t,i]);let u=Sc(()=>{n(!1)},[]),d=Sc((a,p)=>{n(!1),t.focus(),t.update(()=>{s.current&&rb(s.current.clone())},{discrete:!0,skipTransforms:!0}),setTimeout(()=>{t.dispatchCommand(Z2,{columns:String(a),rows:String(p)})},1)},[t]);return J2(Lc.Fragment,{children:[lr(wc,{anchorElem:i,editor:t,isOpen:o,onClose:u,onInsert:d,position:r}),lr(Y2,{hasCellBackgroundColor:!1,hasCellMerge:!0,hasHorizontalScroll:!0})]})};var pb=A({markdownTransformers:[Ka],nodes:[db,ub,mb],plugins:[{Component:Ic,position:"normal"},{Component:uc,position:"normal"},{Component:nc,position:"floatingAnchorElem"},{Component:Cc,position:"floatingAnchorElem"}],providers:[Rc],slashMenu:{groups:[q([{Icon:Kn,key:"table",keywords:["table"],label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Mo,{})}}])]},toolbarFixed:{groups:[xe([{ChildComponent:Kn,key:"table",label:"Table",onSelect:({editor:t})=>{t.dispatchCommand(Mo,{})}}])]}});import{$isNodeSelection as zb}from"lexical";import{jsx as vc}from"react/jsx-runtime";import"react";var fb="M16.2041 6.01074C17.2128 6.113 18 6.96435 18 8V16L17.9893 16.2041C17.8938 17.1457 17.1457 17.8938 16.2041 17.9893L16 18H8C6.96435 18 6.113 17.2128 6.01074 16.2041L6 16V8C6 6.89543 6.89543 6 8 6H16L16.2041 6.01074ZM8 7C7.44772 7 7 7.44772 7 8V16C7 16.5523 7.44772 17 8 17H16C16.5523 17 17 16.5523 17 16V8C17 7.44772 16.5523 7 16 7H8ZM9.72461 11.582C9.91869 11.4539 10.1827 11.4756 10.3535 11.6465L13.8535 15.1465C14.0488 15.3417 14.0488 15.6583 13.8535 15.8535C13.6583 16.0488 13.3417 16.0488 13.1465 15.8535L10 12.707L8.85352 13.8535C8.65825 14.0488 8.34175 14.0488 8.14648 13.8535C7.95122 13.6583 7.95122 13.3417 8.14648 13.1465L9.64648 11.6465L9.72461 11.582ZM14 8C15.1046 8 16 8.89543 16 10C16 11.1046 15.1046 12 14 12C12.8954 12 12 11.1046 12 10C12 8.89543 12.8954 8 14 8ZM14 9C13.4477 9 13 9.44772 13 10C13 10.5523 13.4477 11 14 11C14.5523 11 15 10.5523 15 10C15 9.44772 14.5523 9 14 9Z",ir=({className:t})=>vc("svg",{"aria-hidden":"true",className:["icon",t].filter(Boolean).join(" "),fill:"none",focusable:"false",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:vc("path",{clipRule:"evenodd",d:fb,fill:"currentColor",fillRule:"evenodd"})});import{c as Tb}from"react/compiler-runtime";import{jsx as Eb}from"react/jsx-runtime";import{useLexicalComposerContext as wb}from"@lexical/react/LexicalComposerContext.js";import{$dfsIterator as zc,$insertNodeToNearestRoot as cr,mergeRegister as Sb}from"@lexical/utils";import{useBulkUpload as Nb,useEffectEvent as Lb,useModal as yb}from"@payloadcms/ui";import ur from"bson-objectid";import{$createRangeSelection as Rb,$getPreviousSelection as Fc,$getSelection as Pc,$isParagraphNode as dr,$isRangeSelection as Bc,$setSelection as Ib,COMMAND_PRIORITY_EDITOR as vb,COMMAND_PRIORITY_LOW as jc,createCommand as Mb,DROP_COMMAND as Ab,getDOMSelectionFromTarget as Db,isHTMLElement as Hc,PASTE_COMMAND as $b}from"lexical";import{useEffect as Ob}from"react";import{c as Mc}from"react/compiler-runtime";import{jsx as sr}from"react/jsx-runtime";import{useLexicalComposerContext as Ac}from"@lexical/react/LexicalComposerContext.js";import{toast as hb}from"@payloadcms/ui";import{$getNodeByKey as gb,COMMAND_PRIORITY_EDITOR as Dc}from"lexical";import{useEffect as $c,useState as bb}from"react";var xb=({editor:t,relationTo:e,replaceNodeKey:o,value:n})=>{o?t.update(()=>{let r=gb(o);r&&r.replace(Re({data:{fields:null,relationTo:e,value:n}}))}):t.dispatchCommand(ar,{fields:null,relationTo:e,value:n})},Cb=t=>{let e=Mc(13),{enabledCollectionSlugs:o}=t,[n]=Ac(),[r,l]=bb(null),s;e[0]!==o?(s={collectionSlugs:o,uploads:!0},e[0]=o,e[1]=s):s=e[1];let{closeListDrawer:i,ListDrawer:c,openListDrawer:u}=Bt(s),d,a;e[2]!==n||e[3]!==u?(d=()=>n.registerCommand(nt,f=>(l(f?.replace?f?.replace.nodeKey:null),u(),!0),Dc),a=[n,u],e[2]=n,e[3]=u,e[4]=d,e[5]=a):(d=e[4],a=e[5]),$c(d,a);let p;e[6]!==i||e[7]!==n||e[8]!==r?(p=f=>{let{collectionSlug:g,doc:C}=f;i(),xb({editor:n,relationTo:g,replaceNodeKey:r,value:C.id})},e[6]=i,e[7]=n,e[8]=r,e[9]=p):p=e[9];let m=p,h;return e[10]!==c||e[11]!==m?(h=sr(c,{onSelect:m}),e[10]=c,e[11]=m,e[12]=h):h=e[12],h},kb=()=>{let t=Mc(3),[e]=Ac(),o,n;return t[0]!==e?(o=()=>e.registerCommand(nt,_b,Dc),n=[e],t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),$c(o,n),null},Oc=({enabledCollectionSlugs:t})=>t?.length?sr(Cb,{enabledCollectionSlugs:t}):sr(kb,{});function _b(){return hb.error("No upload collections enabled"),!0}function Fb(t){let e=t.target;return!!(Hc(e)&&!e.closest("code, span.editor-image")&&Hc(e.parentElement)&&e.parentElement.closest("div.ContentEditable__root"))}function Pb(t){let e,o=Db(t.target);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&o!==null)o.collapse(t.rangeParent,t.rangeOffset||0),e=o.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var ar=Mb("INSERT_UPLOAD_COMMAND"),Gc=t=>{let e=Tb(20),{clientProps:o}=t,[n]=wb(),r;e[0]!==o.enabledCollectionSlugs?(r={enabledCollectionSlugs:o.enabledCollectionSlugs},e[0]=o.enabledCollectionSlugs,e[1]=r):r=e[1];let{enabledCollectionSlugs:l}=bo(r),{modalSlug:s,setCollectionSlug:i,setInitialForms:c,setOnCancel:u,setOnSuccess:d,setSelectableCollections:a}=Nb(),{isModalOpen:p,openModal:m}=yb(),h;e[2]!==s||e[3]!==n||e[4]!==l||e[5]!==p||e[6]!==m||e[7]!==i||e[8]!==c||e[9]!==u||e[10]!==d||e[11]!==a?(h=N=>{let{files:b}=N;if(b?.length!==0&&(c(x=>[...x??[],...b.map(Bb)]),!p(s))){if(!l.length||!l[0])return;i(l[0]),a(l),u(()=>{n.update(jb)}),d(x=>{let _=new Map(x.map(Hb));n.update(()=>{for(let k of zc()){let T=k.node;if(lt(T)){let y=T.getData();if(y?.pending){let E=_.get(y.pending?.formID);E&&T.replace(Re({data:{id:new ur.default().toHexString(),fields:{},relationTo:E.collectionSlug,value:E.doc.id}}))}}}})}),m(s)}},e[2]=s,e[3]=n,e[4]=l,e[5]=p,e[6]=m,e[7]=i,e[8]=c,e[9]=u,e[10]=d,e[11]=a,e[12]=h):h=e[12];let f=Lb(h),g;e[13]!==n||e[14]!==f?(g=()=>{if(!n.hasNodes([rt]))throw new Error("UploadPlugin: UploadNode not registered on editor");let N=new WeakSet;return Sb(n.registerNodeTransform(rt,b=>{let x=b.getData();if(!x?.pending||N.has(x.pending))return;N.add(x.pending),async function(){let T=null,y=x?.pending?.src,E=x?.pending?.formID;if(y?.startsWith("data:")){let w=y.match(/data:(image\/[a-zA-Z]+);base64,/),R=w?w[1]:"image/png",L=y.replace(/^data:image\/[a-zA-Z]+;base64,/,""),I=atob(L),v=new Array(I.length);for(let M=0;M<I.length;M++)v[M]=I.charCodeAt(M);let O=new Uint8Array(v);T={alt:void 0,file:new File([O],"pasted-image."+R?.split("/",2)[1],{type:R}),formID:E}}else if(y?.startsWith("http")||y?.startsWith("https")){let R=await(await fetch(y)).blob(),L=y.split("/").pop()||"pasted-image"+R.type.split("/",2)[1];T={alt:void 0,file:new File([R],L,{type:R.type}),formID:E}}T&&f({files:[T]})}()}),n.registerCommand(ar,b=>(n.update(()=>{let x=Pc()||Fc();if(Bc(x)){let _=Re({data:{id:b.id,fields:b.fields,relationTo:b.relationTo,value:b.value}}),{focus:k}=x,T=k.getNode();cr(_),dr(T)&&!T.__first&&T.remove()}}),!0),vb),n.registerCommand($b,b=>{if(!(b instanceof ClipboardEvent))return!1;let x=b.clipboardData;if(!x?.types?.length||x?.types?.includes("text/html"))return!1;let _=[];return x?.files?.length&&Array.from(x.files).forEach(k=>{_.push({alt:"",file:k,formID:new ur.default().toHexString()})}),_.length?(n.update(()=>{let k=Pc()||Fc();if(Bc(k))for(let T of _){let y=Re({data:{pending:{formID:T.formID,src:URL.createObjectURL(T.file)}}}),{focus:E}=k,w=E.getNode();cr(y),dr(w)&&!w.__first&&w.remove()}}),f({files:_}),!0):!1},jc),n.registerCommand(Ab,b=>{if(!(b instanceof DragEvent))return!1;let x=b.dataTransfer;if(!x?.types?.length)return!1;let _=[];return x?.files?.length&&Array.from(x.files).forEach(k=>{_.push({alt:"",file:k,formID:new ur.default().toHexString()})}),_.length?(b.preventDefault(),b.stopPropagation(),n.update(()=>{if(Fb(b)){let k=Pb(b),T=Rb();k!=null&&T.applyDOMRange(k),Ib(T);for(let y of _){let E=Re({data:{pending:{formID:y.formID,src:URL.createObjectURL(y.file)}}}),{focus:w}=T,R=w.getNode();cr(E),dr(R)&&!R.__first&&R.remove()}}}),f({files:_}),!0):!1},jc))},e[13]=n,e[14]=f,e[15]=g):g=e[15];let C;e[16]!==n?(C=[n],e[16]=n,e[17]=C):C=e[17],Ob(g,C);let S;return e[18]!==l?(S=Eb(Oc,{enabledCollectionSlugs:l}),e[18]=l,e[19]=S):S=e[19],S};function Bb(t){return{file:t.file,formID:t.formID}}function jb(){for(let t of zc()){let e=t.node;lt(e)&&e.getData()?.pending&&e.remove()}}function Hb(t){return[t.formID,t]}var Gb=A({nodes:[rt],plugins:[{Component:Gc,position:"normal"}],slashMenu:{groups:[q([{Icon:ir,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(nt,{replace:!1})}}])]},toolbarFixed:{groups:[xe([{ChildComponent:ir,isActive:({selection:t})=>{if(!zb(t)||!t.getNodes().length)return!1;let e=t.getNodes()[0];return lt(e)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(nt,{replace:!1})}}])]}});import{c as Wb}from"react/compiler-runtime";import{jsx as Ao}from"react/jsx-runtime";import{createElement as Vb}from"react";import{ShimmerEffect as Kb,useConfig as Jb}from"@payloadcms/ui";import{lazy as Xb,Suspense as Yb,useEffect as Zb,useState as qb}from"react";var Uc={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",inlineBlock:"LexicalEditorTheme__inlineBlock",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",hrSelected:"LexicalEditorTheme__hrSelected",indent:"LexicalEditorTheme__indent",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",placeholder:"LexicalEditorTheme__placeholder",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",root:"LexicalEditorTheme",rtl:"LexicalEditorTheme__rtl",tab:"LexicalEditorTheme__tabNode",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableAlignment:{center:"LexicalEditorTheme__tableAlignmentCenter",right:"LexicalEditorTheme__tableAlignmentRight"},tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableFrozenColumn:"LexicalEditorTheme__tableFrozenColumn",tableRowStriping:"LexicalEditorTheme__tableRowStriping",tableScrollableWrapper:"LexicalEditorTheme__tableScrollableWrapper",tableSelected:"LexicalEditorTheme__tableSelected",tableSelection:"LexicalEditorTheme__tableSelection",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"LexicalEditorTheme__upload"};var mr={namespace:"lexical",theme:Uc};function Wc({config:t,featureClientImportMap:e,featureClientSchemaMap:o,field:n,schemaPath:r,unSanitizedEditorConfig:l}){let s=new Map,i=[];for(let d of l.features){if(!d?.clientFeatureProps?.featureKey||d?.clientFeatureProps?.order===void 0||d?.clientFeatureProps?.order===null){console.warn("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.");continue}s.set(d.clientFeatureProps.featureKey,d),i.push(d)}l.features=i,l.features=l.features.sort((d,a)=>d.clientFeatureProps.order-a.clientFeatureProps.order);let c=new Map,u=0;for(let d of l.features){let a=typeof d.feature=="function"?d.feature({config:t,featureClientImportMap:e,featureClientSchemaMap:o,featureProviderMap:s,field:n,resolvedFeatures:c,schemaPath:r,unSanitizedEditorConfig:l}):d.feature;a.key=d.clientFeatureProps.featureKey,a.order=u,c.set(d.clientFeatureProps.featureKey,a),u++}return c}import{deepMerge as Ub}from"payload/shared";var Vc=t=>{let e={enabledFeatures:[],enabledFormats:[],markdownTransformers:[],nodes:[],plugins:[],providers:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}},o={};if(t.forEach(n=>{n.key==="toolbarFixed"&&n.sanitizedClientFeatureProps?.customGroups&&(o={...o,...n.sanitizedClientFeatureProps.customGroups})}),!t?.size)return e;t.forEach(n=>{if(n.providers?.length&&(e.providers=e.providers.concat(n.providers)),n.enableFormats?.length&&e.enabledFormats.push(...n.enableFormats),n.nodes?.length)for(let r of n.nodes)e.nodes.push(r);if(n.plugins?.length&&n.plugins.forEach((r,l)=>{e.plugins?.push({clientProps:n.sanitizedClientFeatureProps,Component:r.Component,key:n.key+l,position:r.position})}),n.toolbarInline?.groups?.length)for(let r of n.toolbarInline.groups){let l=e.toolbarInline.groups.find(s=>s.key===r.key);l?e.toolbarInline.groups=e.toolbarInline.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarInline?.groups.push(l)}if(n.toolbarFixed?.groups?.length)for(let r of n.toolbarFixed.groups){let l=e.toolbarFixed.groups.find(s=>s.key===r.key);l?e.toolbarFixed.groups=e.toolbarFixed.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.toolbarFixed?.groups.push(l)}if(n.slashMenu?.groups){n.slashMenu.dynamicGroups?.length&&(e.slashMenu.dynamicGroups=e.slashMenu.dynamicGroups.concat(n.slashMenu.dynamicGroups));for(let r of n.slashMenu.groups){let l=e.slashMenu.groups.find(s=>s.key===r.key);l?e.slashMenu.groups=e.slashMenu.groups.filter(s=>s.key!==r.key):l={...r,items:[]},r?.items?.length&&(l.items=l.items.concat(r.items)),e.slashMenu.groups.push(l)}}if(n.markdownTransformers?.length)for(let r of n.markdownTransformers)typeof r=="function"?e.markdownTransformers.push(r({allNodes:e.nodes,allTransformers:e.markdownTransformers})):e.markdownTransformers.push(r);e.enabledFeatures.push(n.key)}),Object.keys(o).length>0&&(e.toolbarFixed.groups=e.toolbarFixed.groups.map(n=>{let r=o[n.key];return r?Ub(n,r):n})),e.toolbarInline.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0),e.toolbarFixed.groups.sort((n,r)=>n.order&&r.order?n.order-r.order:n.order?-1:r.order?1:0);for(let n of e.toolbarInline.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);for(let n of e.toolbarFixed.groups)n.items.sort((r,l)=>r.order&&l.order?r.order-l.order:r.order?-1:l.order?1:0);return e};function pr(t,e,o,n){return{admin:o,features:Vc(t),lexical:e,resolvedFeatureMap:t,view:n}}var Qb=Xb(()=>import("./Field-334JNLRF.js").then(t=>({default:t.RichText}))),ex=t=>Ao(Vo,{inheritable:!0,views:t.views,children:Ao(tx,{...t})}),tx=t=>{let e=Wb(23),{admin:o,clientFeatures:n,featureClientImportMap:r,featureClientSchemaMap:l,field:s,lexicalEditorConfig:i,schemaPath:c,views:u}=t,d;e[0]!==o?(d=o===void 0?{}:o,e[0]=o,e[1]=d):d=e[1];let a=d,p;e[2]!==r?(p=r===void 0?{}:r,e[2]=r,e[3]=p):p=e[3];let m=p,h=i===void 0?mr:i,{currentView:f}=Ko(),g=u?.[f]?.admin??a,C=u?.[f]?.lexical,S;e[4]!==h||e[5]!==C?(S=typeof C=="function"?C(h):C??h,e[4]=h,e[5]=C,e[6]=S):S=e[6];let N=S,{config:b}=Jb(),[x,_]=qb(null),k,T;e[7]!==n||e[8]!==b||e[9]!==f||e[10]!==g||e[11]!==N||e[12]!==m||e[13]!==l||e[14]!==s||e[15]!==x||e[16]!==c||e[17]!==u?(k=()=>{if(x&&x.view===f)return;let E=u?.[f],w=E?.filterFeatures?E.filterFeatures(n):n,R=[];for(let I of Object.values(w))!I.clientFeatureProvider||!I.clientFeatureProps||R.push(I.clientFeatureProvider(I.clientFeatureProps));let L=Wc({config:b,featureClientImportMap:m,featureClientSchemaMap:l,field:s,schemaPath:c??s.name,unSanitizedEditorConfig:{features:R,lexical:N}});_(pr(L,N,g,f))},T=[g,n,b,m,l,s,x,N,c,f,u],e[7]=n,e[8]=b,e[9]=f,e[10]=g,e[11]=N,e[12]=m,e[13]=l,e[14]=s,e[15]=x,e[16]=c,e[17]=u,e[18]=k,e[19]=T):(k=e[18],T=e[19]),Zb(k,T);let y;return e[20]!==x||e[21]!==t?(y=Ao(Yb,{fallback:Ao(Kb,{height:"35vh"}),children:x&&Vb(Qb,{...t,editorConfig:x,key:x.view})}),e[20]=x,e[21]=t,e[22]=y):y=e[22],y};function ox(...t){return t.filter(Boolean).join(" ")}var nx=t=>(e,o,n)=>{let r=t(n);r&&(r.append(...o),e.replace(r),r.select(0,0))};var Do=new WeakMap;function Kc(t){let e=t.changedTouches[0];return e===void 0?null:[e.clientX,e.clientY]}function $o(t,e){let o=Do.get(t);if(o===void 0){let n=new Set,r=s=>{o!==void 0&&(o.start=Kc(s))},l=s=>{if(o===void 0)return;let{start:i}=o;if(i===null)return;let c=Kc(s);for(let u of n)c!==null&&u([c[0]-i[0],c[1]-i[1]],s)};t.addEventListener("touchstart",r),t.addEventListener("touchend",l),o={handleTouchend:l,handleTouchstart:r,listeners:n,start:null},Do.set(t,o)}return o.listeners.add(e),()=>{rx(t,e)}}function rx(t,e){let o=Do.get(t);if(o===void 0)return;let{listeners:n}=o;n.delete(e),n.size===0&&(Do.delete(t),t.removeEventListener("touchstart",o.handleTouchstart),t.removeEventListener("touchend",o.handleTouchend))}function lx(t,e){return $o(t,(o,n)=>{let[r,l]=o;r<0&&-r>Math.abs(l)&&e(r,n)})}function ix(t,e){return $o(t,(o,n)=>{let[r,l]=o;r>0&&r>Math.abs(l)&&e(r,n)})}function sx(t,e){return $o(t,(o,n)=>{let[r,l]=o;l<0&&-l>Math.abs(r)&&e(r,n)})}function ax(t,e){return $o(t,(o,n)=>{let[r,l]=o;l>0&&l>Math.abs(r)&&e(r,n)})}import{c as cx}from"react/compiler-runtime";import{jsx as ux}from"react/jsx-runtime";import"react";var dx=()=>{let t=cx(2),{EditButton:e}=ge(),o;return t[0]!==e?(o=e?ux(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as mx}from"react/compiler-runtime";import{jsx as px}from"react/jsx-runtime";import"react";var fx=()=>{let t=mx(2),{RemoveButton:e}=ge(),o;return t[0]!==e?(o=e?px(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as hx}from"react/compiler-runtime";import{jsx as gx}from"react/jsx-runtime";import"react";var bx=()=>{let t=hx(2),{Label:e}=ge(),o;return t[0]!==e?(o=e?gx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as xx}from"react/compiler-runtime";import{jsx as Cx}from"react/jsx-runtime";import"react";var kx=t=>{let e=xx(3),{children:o}=t,{InlineBlockContainer:n}=ge(),r;return e[0]!==n||e[1]!==o?(r=n?Cx(n,{children:o}):null,e[0]=n,e[1]=o,e[2]=r):r=e[2],r};import{jsx as _x}from"react/jsx-runtime";import"react";var Tx=t=>{let{children:e,...o}=t,{BlockCollapsible:n}=ae();return n?_x(n,{...o,children:e}):null};import{c as Ex}from"react/compiler-runtime";import{jsx as wx}from"react/jsx-runtime";import"react";var Sx=()=>{let t=Ex(2),{EditButton:e}=ae(),o;return t[0]!==e?(o=e?wx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{c as Nx}from"react/compiler-runtime";import{jsx as Lx}from"react/jsx-runtime";import"react";var yx=()=>{let t=Nx(2),{RemoveButton:e}=ae(),o;return t[0]!==e?(o=e?Lx(e,{}):null,t[0]=e,t[1]=o):o=t[1],o};import{stringify as Rx}from"qs-esm";var Ix=({apiURL:t,depth:e,draft:o,locale:n})=>async({id:l,collectionSlug:s,select:i})=>{let c=Rx({depth:e??0,draft:o??!1,locale:n,select:i},{addQueryPrefix:!0});return await fetch(`${t}/${s}/${l}${c}`,{credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},method:"GET"}).then(d=>d.json())};var Jc={customEndRegex:{optional:!0,regExp:/[ \t]*```$/},customStartRegex:/^[ \t]*```(\w+)?/,doNotTrimChildren:!0,export:({fields:t})=>!t.code.includes(`
60
60
  `)&&!t.language?.length?"```"+t.code+"```":"```"+(t.language||"")+(t.code?`
61
61
  `+t.code:"")+"\n```",import:({children:t,closeMatch:e,openMatch:o})=>{let n=o?.[1];return t.startsWith(`
62
62
  `)&&(t=t.slice(1)),t.endsWith(`
63
63
  `)&&(t=t.slice(0,-1)),!!e&&!t.includes(`
64
- `)&&o?.input?.trim()!=="```"+n?{code:n+(t?.length?t:""),language:""}:{code:t,language:n}}};import{jsx as fC}from"react/jsx-runtime";import{CodeField as hC,useFormFields as gC}from"@payloadcms/ui";import{useId as xC,useMemo as CC}from"react";var Oo={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"};var bC=({autoComplete:t,field:e,forceRender:o,languages:n=Oo,path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:u,typescript:d,validate:c})=>{let a=gC(([C])=>C.language),m=a?.value||a?.initialValue||"typescript",p=xC(),h=n[m],f=CC(()=>({...e,type:"code",admin:{...e.admin,editorOptions:{},editorProps:{defaultPath:m==="ts"?`file-${e.name}-${p}.tsx`:void 0},language:m}}),[e,m,p]),g=`${e.name}-${m}-${h}`;return f&&fC(hC,{autoComplete:t,field:f,forceRender:o,onMount:(C,E)=>{E.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),E.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),E.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:E.languages.typescript.JsxEmit.React,moduleResolution:E.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:d?.paths,reactNamespace:"React",target:E.languages.typescript.ScriptTarget[d?.target??"ESNext"],typeRoots:d?.typeRoots??["node_modules/@types"]}),E.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!d?.enableSemanticValidation,noSyntaxValidation:!1}),(async()=>d?.fetchTypes&&Array.isArray(d.fetchTypes)&&d.fetchTypes.length>0&&await Promise.all(d.fetchTypes.map(async x=>{let k=await(await fetch(x.url)).text();E.languages.typescript.typescriptDefaults.addExtraLib(k,x.filePath)})))()},path:r,permissions:l,readOnly:s,renderedBlocks:i,schemaPath:u,validate:c},g)};import{jsx as le,jsxs as Xc}from"react/jsx-runtime";import{useLexicalEditable as RC}from"@lexical/react/useLexicalEditable";import{ChevronIcon as IC,Combobox as vC,CopyToClipboard as MC,PopupList as AC,RenderFields as DC,useForm as $C,useFormFields as Yc,useTranslation as OC}from"@payloadcms/ui";import FC from"react";import{jsx as Gc}from"react/jsx-runtime";import"react";var kC={16:"M6.646 6.146a.5.5 0 1 0 .708.708l1.5-1.5a.5.5 0 0 0 0-.708l-1.5-1.5a.5.5 0 1 0-.708.708L7.793 5zm-1.292-3a.5.5 0 0 1 0 .708L4.207 5l1.147 1.146a.5.5 0 1 1-.708.708l-1.5-1.5a.5.5 0 0 1 0-.708l1.5-1.5a.5.5 0 0 1 .708 0M10.5 3h1A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5v-3a.5.5 0 0 1 1 0v3a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 1 0-1",24:"M16.5 6C17.3284 6 18 6.67157 18 7.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V12.5C6 12.2239 6.22386 12 6.5 12C6.77614 12 7 12.2239 7 12.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V7.5C17 7.22386 16.7761 7 16.5 7H15.5C15.2239 7 15 6.77614 15 6.5C15 6.22386 15.2239 6 15.5 6H16.5ZM8.14648 6.14648C8.34175 5.95122 8.65825 5.95122 8.85352 6.14648C9.04878 6.34175 9.04878 6.65825 8.85352 6.85352L7.20703 8.5L8.85352 10.1465C9.04878 10.3417 9.04878 10.6583 8.85352 10.8535C8.65825 11.0488 8.34175 11.0488 8.14648 10.8535L6.14648 8.85352C5.95122 8.65825 5.95122 8.34175 6.14648 8.14648L8.14648 6.14648ZM11.1465 6.14648C11.3417 5.95122 11.6583 5.95122 11.8535 6.14648L13.8535 8.14648C14.0488 8.34175 14.0488 8.65825 13.8535 8.85352L11.8535 10.8535C11.6583 11.0488 11.3417 11.0488 11.1465 10.8535C10.9512 10.6583 10.9512 10.3417 11.1465 10.1465L12.793 8.5L11.1465 6.85352C10.9512 6.65825 10.9512 6.34175 11.1465 6.14648Z"},Uc=({className:t,size:e=24})=>Gc("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Gc("path",{clipRule:"evenodd",d:kC[e],fill:"currentColor",fillRule:"evenodd"})});import{jsx as fr}from"react/jsx-runtime";import"react";import{useCollapsible as wC}from"@payloadcms/ui";import{jsx as Wc}from"react/jsx-runtime";import"react";var _C="M11.4999 13C11.6325 13 11.7597 13.0527 11.8535 13.1464L14.8535 16.1464C15.0487 16.3417 15.0487 16.6582 14.8535 16.8535C14.6582 17.0487 14.3417 17.0487 14.1464 16.8535L11.4999 14.207L8.85346 16.8535C8.6582 17.0487 8.34169 17.0487 8.14643 16.8535C7.95119 16.6582 7.95119 16.3417 8.14643 16.1464L11.1464 13.1464C11.2402 13.0527 11.3674 13 11.4999 13ZM14.1464 7.14644C14.3417 6.95119 14.6582 6.95118 14.8535 7.14644C15.0487 7.3417 15.0487 7.65821 14.8535 7.85347L11.8535 10.8535C11.7597 10.9472 11.6325 10.9999 11.4999 11C11.3674 10.9999 11.2402 10.9472 11.1464 10.8535L8.14643 7.85347C7.95119 7.65821 7.95119 7.3417 8.14643 7.14644C8.34169 6.9512 8.6582 6.9512 8.85346 7.14644L11.4999 9.79292L14.1464 7.14644Z",Fo=({className:t})=>Wc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Wc("path",{d:_C,fill:"currentColor"})});import{jsx as Vc}from"react/jsx-runtime";import"react";var TC="M11.5 6C11.6326 6 11.7597 6.05272 11.8535 6.14648L14.8535 9.14648C15.0487 9.34175 15.0487 9.65825 14.8535 9.85352C14.6582 10.0488 14.3417 10.0488 14.1464 9.85352L12 7.70703V16.293L14.1464 14.1465C14.3417 13.9512 14.6582 13.9512 14.8535 14.1465C15.0487 14.3417 15.0487 14.6583 14.8535 14.8535L11.8535 17.8535C11.6582 18.0488 11.3417 18.0488 11.1464 17.8535L8.14645 14.8535C7.95119 14.6583 7.95119 14.3417 8.14645 14.1465C8.34171 13.9512 8.65822 13.9512 8.85348 14.1465L11 16.293V7.70703L8.85348 9.85352C8.65822 10.0488 8.34171 10.0488 8.14645 9.85352C7.95118 9.65825 7.95118 9.34175 8.14645 9.14648L11.1464 6.14648C11.2402 6.05272 11.3674 6 11.5 6Z",Po=({className:t})=>Vc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Vc("path",{clipRule:"evenodd",d:TC,fill:"currentColor",fillRule:"evenodd"})});var EC="code-block-collapse-button",Kc=()=>{let{isCollapsed:t,toggle:e}=wC();return fr("button",{className:EC,onClick:e,type:"button",children:t?fr(Po,{}):fr(Fo,{})})};import{jsx as hr,jsxs as SC}from"react/jsx-runtime";import{useCollapsible as NC,useTranslation as LC}from"@payloadcms/ui";import"react";var yC="code-block-floating-collapse-button",Jc=()=>{let{isCollapsed:t,toggle:e}=NC(),{t:o}=LC();return SC("button",{className:yC,onClick:e,type:"button",children:[t?hr(Po,{}):hr(Fo,{}),hr("span",{children:o(t?"general:expand":"general:collapse")})]})};var Je="payload-richtext-code-block",PC=t=>{let{languages:e}=t,o=e||Oo,{BlockCollapsible:n,formSchema:r,RemoveButton:l}=ae(),{setModified:s}=$C(),{t:i}=OC(),{codeField:u}=Yc(([h])=>({codeField:h?.code})),{selectedLanguageField:d,setSelectedLanguage:c}=Yc(([h,f])=>({selectedLanguageField:h?.language,setSelectedLanguage:g=>{f({type:"UPDATE",path:"language",value:g}),s(!0)}})),a=o[d?.value],m=RC(),p=FC.useMemo(()=>Object.entries(o).map(([h,f])=>({name:`${h} ${f}`,Component:le(AC.Button,{active:!1,disabled:!1,onClick:()=>{c(h)},children:le("span",{className:`${Je}__language-code`,"data-language":h,children:f})})})),[o,c]);return le(n,{Actions:Xc("div",{className:`${Je}__actions`,children:[le(vC,{"aria-label":i("general:language"),button:Xc("div",{className:`${Je}__language-selector-button`,"data-selected-language":d?.value,children:[le("span",{children:a}),le(IC,{className:`${Je}__chevron`})]}),buttonType:"custom",className:`${Je}__language-selector`,disabled:!m,entries:p,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:i("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),le(MC,{value:u?.value??""}),le(Kc,{}),m&&le(l,{})]}),className:Je,collapsibleProps:{AfterCollapsible:le(Jc,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:le("div",{className:`${Je}__pill`,children:le(Uc,{})}),showDragHandle:!1,showRowNumber:!1,children:le(DC,{fields:r,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!m})})};import{c as BC}from"react/compiler-runtime";import{jsx as gt}from"react/jsx-runtime";import{FieldContext as jC,FieldPathContext as Zc,ServerFunctionsContext as qc,ShimmerEffect as HC,useServerFunctions as zC}from"@payloadcms/ui";import GC,{useEffect as UC,useRef as WC}from"react";var VC=t=>{let e=BC(10),{name:o,field:n,initialValue:r,label:l,Loading:s,path:i,schemaPath:u,setValue:d,value:c}=t,[a,m]=GC.useState(null),p=zC(),{_internal_renderField:h}=p,[f,g]=u.split(".",2),C=o!==void 0?o:n?.name,E=l!==void 0?l:n?.label,L=i??C??"",x;e[0]!==h||e[1]!==E||e[2]!==C||e[3]!==r||e[4]!==i||e[5]!==u?(x=()=>{(async function(){let{Field:S}=await h({name:C,hidden:!1,initialValue:r??void 0,label:typeof E=="function"?void 0:E,path:i,schemaPath:u});m(S)})()},e[0]=h,e[1]=E,e[2]=C,e[3]=r,e[4]=i,e[5]=u,e[6]=x):x=e[6];let b=x,k=WC(!1),_,T;if(e[7]!==b?(_=()=>{k.current||(k.current=!0,b())},T=[b],e[7]=b,e[8]=_,e[9]=T):(_=e[8],T=e[9]),UC(_,T),!a)return typeof s<"u"?s:gt(HC,{});let v={...p,getFormState:async w=>p.getFormState({...w,collectionSlug:f==="collection"?g:void 0,globalSlug:f==="global"?g:void 0})};if(typeof c>"u"&&!d)return gt(qc,{value:{...v},children:gt(Zc,{value:L,children:a},L)});let N={disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:c,path:L,setValue:d??KC,showError:!1,value:c};return gt(qc,{value:{...v},children:gt(Zc,{value:L,children:gt(jC,{value:N,children:a})},L)})};function KC(){}function Qc({nodes:t,text:e}){let o={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return e&&o.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:e,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),t?.length&&o.root.children.push(...t),o.root.children.length===0&&o.root.children.push({type:"paragraph",children:[],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),o}var JC=Qc;export{At as $createAutoLinkNode,Fe as $createBlockNode,je as $createHorizontalRuleNode,Tt as $createInlineBlockNode,_e as $createLinkNode,We as $createRelationshipNode,ye as $createUploadNode,Ee as $isAutoLinkNode,ve as $isBlockNode,He as $isHorizontalRuleNode,Et as $isInlineBlockNode,X as $isLinkNode,Pn as $isRelationshipNode,nt as $isUploadNode,Lu as AlignFeatureClient,Te as AutoLinkNode,lC as BlockCollapsible,aC as BlockEditButton,ue as BlockNode,dC as BlockRemoveButton,$u as BlockquoteFeatureClient,mm as BlocksFeatureClient,jm as BoldFeatureClient,se as CAN_USE_DOM,f0 as ChecklistFeatureClient,PC as CodeBlockBlockComponent,bC as CodeComponent,z0 as DETAIL_TYPE_TO_DETAIL,P0 as DOUBLE_LINE_BREAK,th as DebugJsxConverterFeatureClient,U0 as ELEMENT_FORMAT_TO_TYPE,G0 as ELEMENT_TYPE_TO_FORMAT,mu as ENABLE_SLASH_MENU_COMMAND,au as EditorConfigProvider,Wo as FieldsDrawer,F5 as FixedToolbarFeatureClient,ef as HeadingFeatureClient,_f as HorizontalRuleFeatureClient,ke as HorizontalRuleNode,rt as INSERT_BLOCK_COMMAND,lt as INSERT_INLINE_BLOCK_COMMAND,O0 as IS_ALL_FORMATTING,Bf as IndentFeatureClient,nC as InlineBlockContainer,Jx as InlineBlockEditButton,eC as InlineBlockLabel,_t as InlineBlockNode,Zx as InlineBlockRemoveButton,Vm as InlineCodeFeatureClient,q5 as InlineToolbarFeatureClient,Qm as ItalicFeatureClient,j0 as LTR_REGEX,r0 as LinkFeatureClient,ne as LinkNode,F0 as NON_BREAKING_SPACE,O as NodeFormat,k0 as OrderedListFeatureClient,y0 as ParagraphFeatureClient,uu as Point,B0 as RTL_REGEX,pu as Rect,Kh as RelationshipFeatureClient,we as RelationshipNode,VC as RenderLexical,Fx as RichTextField,Vo as RichTextViewProvider,lp as StrikethroughFeatureClient,up as SubscriptFeatureClient,hp as SuperscriptFeatureClient,W0 as TEXT_MODE_TO_TYPE,H0 as TEXT_TYPE_TO_FORMAT,V0 as TEXT_TYPE_TO_MODE,fe as TOGGLE_LINK_COMMAND,Y2 as TableFeatureClient,Nm as TestRecorderFeatureClient,vp as TextStateFeatureClient,Bt as ToolbarButton,jt as ToolbarDropdown,vm as TreeViewFeatureClient,kp as UnderlineFeatureClient,N0 as UnorderedListFeatureClient,Nx as UploadFeatureClient,ot as UploadNode,Wx as addSwipeDownListener,zx as addSwipeLeftListener,Gx as addSwipeRightListener,Ux as addSwipeUpListener,JC as buildDefaultEditorState,Qc as buildEditorState,zc as codeConverterClient,jx as createBlockNode,A as createClientFeature,oh as defaultColors,mr as defaultEditorLexicalConfig,Vn as getDOMRangeRect,fu as getEnabledNodes,pC as getRestPopulateFn,it as getSelectedNode,du as isPoint,Bx as joinClasses,pr as sanitizeClientEditorConfig,jc as sanitizeClientFeatures,To as setFloatingElemPosition,mo as setFloatingElemPositionForLinkEditor,q as slashMenuBasicGroupWithItems,be as toolbarAddDropdownGroupWithItems,bn as toolbarFeatureButtonsGroupWithItems,Q as toolbarFormatGroupWithItems,oe as toolbarTextDropdownGroupWithItems,ae as useBlockComponentContext,W as useEditorConfigContext,xe as useInlineBlockComponentContext,cu as useLexicalDocumentDrawer,De as useLexicalDrawer,Pt as useLexicalListDrawer,Ko as useRichTextView};
64
+ `)&&o?.input?.trim()!=="```"+n?{code:n+(t?.length?t:""),language:""}:{code:t,language:n}}};import{c as vx}from"react/compiler-runtime";import{jsx as Mx}from"react/jsx-runtime";import{CodeField as Ax,useFormFields as Dx}from"@payloadcms/ui";import{useId as $x}from"react";var Oo={abap:"ABAP",apex:"Apex",azcli:"Azure CLI",bat:"Batch",bicep:"Bicep",cameligo:"CameLIGO",clojure:"Clojure",coffee:"CoffeeScript",cpp:"C++",csharp:"C#",csp:"CSP",css:"CSS",cypher:"Cypher",dart:"Dart",dockerfile:"Dockerfile",ecl:"ECL",elixir:"Elixir",flow9:"Flow9",freemarker2:"FreeMarker 2",fsharp:"F#",go:"Go",graphql:"GraphQL",handlebars:"Handlebars",hcl:"HCL",html:"HTML",ini:"INI",java:"Java",javascript:"JavaScript",julia:"Julia",kotlin:"Kotlin",less:"Less",lexon:"Lexon",liquid:"Liquid",lua:"Lua",m3:"M3",markdown:"Markdown",mdx:"MDX",mips:"MIPS",msdax:"DAX",mysql:"MySQL","objective-c":"Objective-C",pascal:"Pascal",pascaligo:"PascaLIGO",perl:"Perl",pgsql:"PostgreSQL",php:"PHP",pla:"PLA",plaintext:"Plain Text",postiats:"Postiats",powerquery:"Power Query",powershell:"PowerShell",protobuf:"Protobuf",pug:"Pug",python:"Python",qsharp:"Q#",r:"R",razor:"Razor",redis:"Redis",redshift:"Amazon Redshift",restructuredtext:"reStructuredText",ruby:"Ruby",rust:"Rust",sb:"Small Basic",scala:"Scala",scheme:"Scheme",scss:"SCSS",shell:"Shell",solidity:"Solidity",sophia:"Sophia",sparql:"SPARQL",sql:"SQL",st:"Structured Text",swift:"Swift",systemverilog:"SystemVerilog",tcl:"Tcl",twig:"Twig",typescript:"TypeScript",typespec:"TypeSpec",vb:"Visual Basic",wgsl:"WGSL",xml:"XML",yaml:"YAML"};var Ox=t=>{let e=vx(22),{autoComplete:o,field:n,forceRender:r,languages:l,path:s,permissions:i,readOnly:c,renderedBlocks:u,schemaPath:d,typescript:a,validate:p}=t,m=l===void 0?Oo:l,h=Dx(Fx),f=h?.value||h?.initialValue||"typescript",g=$x(),C=m[f],S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S={},e[0]=S):S=e[0];let N=f==="ts"?`file-${n.name}-${g}.tsx`:void 0,b;e[1]!==N?(b={defaultPath:N},e[1]=N,e[2]=b):b=e[2];let x;e[3]!==n.admin||e[4]!==f||e[5]!==b?(x={...n.admin,editorOptions:S,editorProps:b,language:f},e[3]=n.admin,e[4]=f,e[5]=b,e[6]=x):x=e[6];let _;e[7]!==n||e[8]!==x?(_={...n,type:"code",admin:x},e[7]=n,e[8]=x,e[9]=_):_=e[9];let k=_,T=`${n.name}-${f}-${C}`,y;return e[10]!==o||e[11]!==r||e[12]!==T||e[13]!==s||e[14]!==i||e[15]!==k||e[16]!==c||e[17]!==u||e[18]!==d||e[19]!==a||e[20]!==p?(y=k&&Mx(Ax,{autoComplete:o,field:k,forceRender:r,onMount:(E,w)=>{w.editor.defineTheme("vs-dark",{base:"vs-dark",colors:{"editor.background":"#222222"},inherit:!0,rules:[]}),w.editor.defineTheme("vs",{base:"vs",colors:{"editor.background":"#f5f5f5"},inherit:!0,rules:[]}),w.languages.typescript.typescriptDefaults.setCompilerOptions({allowNonTsExtensions:!0,allowJs:!0,allowSyntheticDefaultImports:!0,esModuleInterop:!0,jsx:w.languages.typescript.JsxEmit.React,moduleResolution:w.languages.typescript.ModuleResolutionKind.NodeJs,noEmit:!0,paths:a?.paths,reactNamespace:"React",target:w.languages.typescript.ScriptTarget[a?.target??"ESNext"],typeRoots:a?.typeRoots??["node_modules/@types"]}),w.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!a?.enableSemanticValidation,noSyntaxValidation:!1}),(async()=>a?.fetchTypes&&Array.isArray(a.fetchTypes)&&a.fetchTypes.length>0&&await Promise.all(a.fetchTypes.map(async L=>{let v=await(await fetch(L.url)).text();w.languages.typescript.typescriptDefaults.addExtraLib(v,L.filePath)})))()},path:s,permissions:i,readOnly:c,renderedBlocks:u,schemaPath:d,validate:p},T),e[10]=o,e[11]=r,e[12]=T,e[13]=s,e[14]=i,e[15]=k,e[16]=c,e[17]=u,e[18]=d,e[19]=a,e[20]=p,e[21]=y):y=e[21],y};function Fx(t){let[e]=t;return e.language}import{c as Kx}from"react/compiler-runtime";import{jsx as le,jsxs as tu}from"react/jsx-runtime";import{useLexicalEditable as Jx}from"@lexical/react/useLexicalEditable";import{ChevronIcon as Xx,Combobox as Yx,CopyToClipboard as Zx,PopupList as qx,RenderFields as Qx,useForm as eC,useFormFields as ou,useTranslation as tC}from"@payloadcms/ui";import"react";import{jsx as Xc}from"react/jsx-runtime";import"react";var Px={16:"M6.646 6.146a.5.5 0 1 0 .708.708l1.5-1.5a.5.5 0 0 0 0-.708l-1.5-1.5a.5.5 0 1 0-.708.708L7.793 5zm-1.292-3a.5.5 0 0 1 0 .708L4.207 5l1.147 1.146a.5.5 0 1 1-.708.708l-1.5-1.5a.5.5 0 0 1 0-.708l1.5-1.5a.5.5 0 0 1 .708 0M10.5 3h1A1.5 1.5 0 0 1 13 4.5v7a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 11.5v-3a.5.5 0 0 1 1 0v3a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 1 0-1",24:"M16.5 6C17.3284 6 18 6.67157 18 7.5V16.5C18 17.3284 17.3284 18 16.5 18H7.5C6.67157 18 6 17.3284 6 16.5V12.5C6 12.2239 6.22386 12 6.5 12C6.77614 12 7 12.2239 7 12.5V16.5C7 16.7761 7.22386 17 7.5 17H16.5C16.7761 17 17 16.7761 17 16.5V7.5C17 7.22386 16.7761 7 16.5 7H15.5C15.2239 7 15 6.77614 15 6.5C15 6.22386 15.2239 6 15.5 6H16.5ZM8.14648 6.14648C8.34175 5.95122 8.65825 5.95122 8.85352 6.14648C9.04878 6.34175 9.04878 6.65825 8.85352 6.85352L7.20703 8.5L8.85352 10.1465C9.04878 10.3417 9.04878 10.6583 8.85352 10.8535C8.65825 11.0488 8.34175 11.0488 8.14648 10.8535L6.14648 8.85352C5.95122 8.65825 5.95122 8.34175 6.14648 8.14648L8.14648 6.14648ZM11.1465 6.14648C11.3417 5.95122 11.6583 5.95122 11.8535 6.14648L13.8535 8.14648C14.0488 8.34175 14.0488 8.65825 13.8535 8.85352L11.8535 10.8535C11.6583 11.0488 11.3417 11.0488 11.1465 10.8535C10.9512 10.6583 10.9512 10.3417 11.1465 10.1465L12.793 8.5L11.1465 6.85352C10.9512 6.65825 10.9512 6.34175 11.1465 6.14648Z"},Yc=({className:t,size:e=24})=>Xc("svg",{className:t,fill:"none",height:e,viewBox:`0 0 ${e} ${e}`,width:e,xmlns:"http://www.w3.org/2000/svg",children:Xc("path",{clipRule:"evenodd",d:Px[e],fill:"currentColor",fillRule:"evenodd"})});import{jsx as fr}from"react/jsx-runtime";import"react";import{useCollapsible as zx}from"@payloadcms/ui";import{jsx as Zc}from"react/jsx-runtime";import"react";var Bx="M11.4999 13C11.6325 13 11.7597 13.0527 11.8535 13.1464L14.8535 16.1464C15.0487 16.3417 15.0487 16.6582 14.8535 16.8535C14.6582 17.0487 14.3417 17.0487 14.1464 16.8535L11.4999 14.207L8.85346 16.8535C8.6582 17.0487 8.34169 17.0487 8.14643 16.8535C7.95119 16.6582 7.95119 16.3417 8.14643 16.1464L11.1464 13.1464C11.2402 13.0527 11.3674 13 11.4999 13ZM14.1464 7.14644C14.3417 6.95119 14.6582 6.95118 14.8535 7.14644C15.0487 7.3417 15.0487 7.65821 14.8535 7.85347L11.8535 10.8535C11.7597 10.9472 11.6325 10.9999 11.4999 11C11.3674 10.9999 11.2402 10.9472 11.1464 10.8535L8.14643 7.85347C7.95119 7.65821 7.95119 7.3417 8.14643 7.14644C8.34169 6.9512 8.6582 6.9512 8.85346 7.14644L11.4999 9.79292L14.1464 7.14644Z",Fo=({className:t})=>Zc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:Zc("path",{d:Bx,fill:"currentColor"})});import{jsx as qc}from"react/jsx-runtime";import"react";var jx="M11.5 6C11.6326 6 11.7597 6.05272 11.8535 6.14648L14.8535 9.14648C15.0487 9.34175 15.0487 9.65825 14.8535 9.85352C14.6582 10.0488 14.3417 10.0488 14.1464 9.85352L12 7.70703V16.293L14.1464 14.1465C14.3417 13.9512 14.6582 13.9512 14.8535 14.1465C15.0487 14.3417 15.0487 14.6583 14.8535 14.8535L11.8535 17.8535C11.6582 18.0488 11.3417 18.0488 11.1464 17.8535L8.14645 14.8535C7.95119 14.6583 7.95119 14.3417 8.14645 14.1465C8.34171 13.9512 8.65822 13.9512 8.85348 14.1465L11 16.293V7.70703L8.85348 9.85352C8.65822 10.0488 8.34171 10.0488 8.14645 9.85352C7.95118 9.65825 7.95118 9.34175 8.14645 9.14648L11.1464 6.14648C11.2402 6.05272 11.3674 6 11.5 6Z",Po=({className:t})=>qc("svg",{className:t,fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",children:qc("path",{clipRule:"evenodd",d:jx,fill:"currentColor",fillRule:"evenodd"})});var Hx="code-block-collapse-button",Qc=()=>{let{isCollapsed:t,toggle:e}=zx();return fr("button",{className:Hx,onClick:e,type:"button",children:t?fr(Po,{}):fr(Fo,{})})};import{jsx as hr,jsxs as Gx}from"react/jsx-runtime";import{useCollapsible as Ux,useTranslation as Wx}from"@payloadcms/ui";import"react";var Vx="code-block-floating-collapse-button",eu=()=>{let{isCollapsed:t,toggle:e}=Ux(),{t:o}=Wx();return Gx("button",{className:Vx,onClick:e,type:"button",children:[t?hr(Po,{}):hr(Fo,{}),hr("span",{children:o(t?"general:expand":"general:collapse")})]})};var Xe="payload-richtext-code-block",oC=t=>{let e=Kx(15),{languages:o}=t,n=o||Oo,{BlockCollapsible:r,formSchema:l,RemoveButton:s}=ae(),{setModified:i}=eC(),{t:c}=tC(),{codeField:u}=ou(nC),d;e[0]!==i?(d=S=>{let[N,b]=S;return{selectedLanguageField:N?.language,setSelectedLanguage:x=>{b({type:"UPDATE",path:"language",value:x}),i(!0)}}},e[0]=i,e[1]=d):d=e[1];let{selectedLanguageField:a,setSelectedLanguage:p}=ou(d),m=n[a?.value],h=Jx(),f;e[2]!==n||e[3]!==p?(f=Object.entries(n).map(S=>{let[N,b]=S;return{name:`${N} ${b}`,Component:le(qx.Button,{active:!1,disabled:!1,onClick:()=>{p(N)},children:le("span",{className:`${Xe}__language-code`,"data-language":N,children:b})})}}),e[2]=n,e[3]=p,e[4]=f):f=e[4];let g=f,C;return e[5]!==r||e[6]!==s||e[7]!==u?.value||e[8]!==l||e[9]!==h||e[10]!==g||e[11]!==a?.value||e[12]!==m||e[13]!==c?(C=le(r,{Actions:tu("div",{className:`${Xe}__actions`,children:[le(Yx,{"aria-label":c("general:language"),button:tu("div",{className:`${Xe}__language-selector-button`,"data-selected-language":a?.value,children:[le("span",{children:m}),le(Xx,{className:`${Xe}__chevron`})]}),buttonType:"custom",className:`${Xe}__language-selector`,disabled:!h,entries:g,horizontalAlign:"right",minEntriesForSearch:8,searchPlaceholder:c("fields:searchForLanguage"),showScrollbar:!0,size:"large"}),le(Zx,{value:u?.value??""}),le(Qc,{}),h&&le(s,{})]}),className:Xe,collapsibleProps:{AfterCollapsible:le(eu,{}),disableHeaderToggle:!0,disableToggleIndicator:!0},Pill:le("div",{className:`${Xe}__pill`,children:le(Yc,{})}),showDragHandle:!1,showRowNumber:!1,children:le(Qx,{fields:l,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:"",permissions:!0,readOnly:!h})}),e[5]=r,e[6]=s,e[7]=u?.value,e[8]=l,e[9]=h,e[10]=g,e[11]=a?.value,e[12]=m,e[13]=c,e[14]=C):C=e[14],C};function nC(t){let[e]=t;return{codeField:e?.code}}import{c as rC}from"react/compiler-runtime";import{jsx as xt}from"react/jsx-runtime";import{FieldContext as lC,FieldPathContext as nu,ServerFunctionsContext as ru,ShimmerEffect as iC,useServerFunctions as sC}from"@payloadcms/ui";import aC,{useEffect as cC,useRef as uC}from"react";var dC=t=>{let e=rC(10),{name:o,field:n,initialValue:r,label:l,Loading:s,path:i,schemaPath:c,setValue:u,value:d}=t,[a,p]=aC.useState(null),m=sC(),{_internal_renderField:h}=m,[f,g]=c.split(".",2),C=o!==void 0?o:n?.name,S=l!==void 0?l:n?.label,N=i??C??"",b;e[0]!==h||e[1]!==S||e[2]!==C||e[3]!==r||e[4]!==i||e[5]!==c?(b=()=>{(async function(){let{Field:L}=await h({name:C,hidden:!1,initialValue:r??void 0,label:typeof S=="function"?void 0:S,path:i,schemaPath:c});p(L)})()},e[0]=h,e[1]=S,e[2]=C,e[3]=r,e[4]=i,e[5]=c,e[6]=b):b=e[6];let x=b,_=uC(!1),k,T;if(e[7]!==x?(k=()=>{_.current||(_.current=!0,x())},T=[x],e[7]=x,e[8]=k,e[9]=T):(k=e[8],T=e[9]),cC(k,T),!a)return typeof s<"u"?s:xt(iC,{});let y={...m,getFormState:async w=>m.getFormState({...w,collectionSlug:f==="collection"?g:void 0,globalSlug:f==="global"?g:void 0})};if(typeof d>"u"&&!u)return xt(ru,{value:{...y},children:xt(nu,{value:N,children:a},N)});let E={disabled:!1,formInitializing:!1,formProcessing:!1,formSubmitted:!1,initialValue:d,path:N,setValue:u??mC,showError:!1,value:d};return xt(ru,{value:{...y},children:xt(nu,{value:N,children:xt(lC,{value:E,children:a})},N)})};function mC(){}function lu({nodes:t,text:e}){let o={root:{type:"root",children:[],direction:"ltr",format:"",indent:0,version:1}};return e&&o.root.children.push({type:"paragraph",children:[{type:"text",detail:0,format:0,mode:"normal",style:"",text:e,version:1}],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),t?.length&&o.root.children.push(...t),o.root.children.length===0&&o.root.children.push({type:"paragraph",children:[],direction:"ltr",format:"",indent:0,textFormat:0,textStyle:"",version:1}),o}var pC=lu;export{Dt as $createAutoLinkNode,Pe as $createBlockNode,He as $createHorizontalRuleNode,wt as $createInlineBlockNode,ke as $createLinkNode,Ve as $createRelationshipNode,Re as $createUploadNode,Te as $isAutoLinkNode,Me as $isBlockNode,ze as $isHorizontalRuleNode,St as $isInlineBlockNode,Y as $isLinkNode,Pn as $isRelationshipNode,lt as $isUploadNode,Au as AlignFeatureClient,_e as AutoLinkNode,Tx as BlockCollapsible,Sx as BlockEditButton,ce as BlockNode,yx as BlockRemoveButton,Hu as BlockquoteFeatureClient,Cm as BlocksFeatureClient,Km as BoldFeatureClient,se as CAN_USE_DOM,T0 as ChecklistFeatureClient,oC as CodeBlockBlockComponent,Ox as CodeComponent,Y0 as DETAIL_TYPE_TO_DETAIL,V0 as DOUBLE_LINE_BREAK,ch as DebugJsxConverterFeatureClient,q0 as ELEMENT_FORMAT_TO_TYPE,Z0 as ELEMENT_TYPE_TO_FORMAT,xu as ENABLE_SLASH_MENU_COMMAND,fu as EditorConfigProvider,Wo as FieldsDrawer,q5 as FixedToolbarFeatureClient,af as HeadingFeatureClient,yf as HorizontalRuleFeatureClient,Ce as HorizontalRuleNode,it as INSERT_BLOCK_COMMAND,st as INSERT_INLINE_BLOCK_COMMAND,U0 as IS_ALL_FORMATTING,Vf as IndentFeatureClient,kx as InlineBlockContainer,dx as InlineBlockEditButton,bx as InlineBlockLabel,Et as InlineBlockNode,fx as InlineBlockRemoveButton,Qm as InlineCodeFeatureClient,fg as InlineToolbarFeatureClient,ip as ItalicFeatureClient,J0 as LTR_REGEX,m0 as LinkFeatureClient,ne as LinkNode,W0 as NON_BREAKING_SPACE,$ as NodeFormat,y0 as OrderedListFeatureClient,O0 as ParagraphFeatureClient,gu as Point,K0 as RTL_REGEX,Cu as Rect,t5 as RelationshipFeatureClient,Ee as RelationshipNode,dC as RenderLexical,ex as RichTextField,Vo as RichTextViewProvider,mp as StrikethroughFeatureClient,bp as SubscriptFeatureClient,Tp as SuperscriptFeatureClient,Q0 as TEXT_MODE_TO_TYPE,X0 as TEXT_TYPE_TO_FORMAT,eh as TEXT_TYPE_TO_MODE,pe as TOGGLE_LINK_COMMAND,pb as TableFeatureClient,Am as TestRecorderFeatureClient,Pp as TextStateFeatureClient,jt as ToolbarButton,Ht as ToolbarDropdown,Pm as TreeViewFeatureClient,Lp as UnderlineFeatureClient,D0 as UnorderedListFeatureClient,Gb as UploadFeatureClient,rt as UploadNode,ax as addSwipeDownListener,lx as addSwipeLeftListener,ix as addSwipeRightListener,sx as addSwipeUpListener,pC as buildDefaultEditorState,lu as buildEditorState,Jc as codeConverterClient,nx as createBlockNode,A as createClientFeature,uh as defaultColors,mr as defaultEditorLexicalConfig,Vn as getDOMRangeRect,ku as getEnabledNodes,Ix as getRestPopulateFn,at as getSelectedNode,bu as isPoint,ox as joinClasses,pr as sanitizeClientEditorConfig,Vc as sanitizeClientFeatures,To as setFloatingElemPosition,uo as setFloatingElemPositionForLinkEditor,q as slashMenuBasicGroupWithItems,xe as toolbarAddDropdownGroupWithItems,Cn as toolbarFeatureButtonsGroupWithItems,Q as toolbarFormatGroupWithItems,oe as toolbarTextDropdownGroupWithItems,ae as useBlockComponentContext,W as useEditorConfigContext,ge as useInlineBlockComponentContext,hu as useLexicalDocumentDrawer,$e as useLexicalDrawer,Bt as useLexicalListDrawer,Ko as useRichTextView};
65
65
  //# sourceMappingURL=index.js.map