@layers-app/editor 0.5.3 → 0.5.5-optimization

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 (255) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.js +12 -10
  3. package/dist/layers.B10sB-Vy.js +1 -0
  4. package/dist/layers.BDsvvINb.js +6774 -0
  5. package/dist/layers.BFJ7oQiY.js +7723 -0
  6. package/dist/layers.BwyONivc.js +864 -0
  7. package/dist/layers.C2lacXcg.js +2511 -0
  8. package/dist/layers.C69TrYD7.js +7 -0
  9. package/dist/layers.CEMW9z_P.js +4 -0
  10. package/dist/layers.Cwao1pOZ.js +6 -0
  11. package/dist/layers.CzNz0Zya.js +1 -0
  12. package/dist/layers.D0Z-zLAV.js +530 -0
  13. package/dist/layers.DNCgFYS7.js +27 -0
  14. package/dist/layers.EKDSoJm1.js +2227 -0
  15. package/dist/layers.QjAkD17S.js +3677 -0
  16. package/dist/layers.ahDFHQXD.js +341 -0
  17. package/dist/layers.eLiGm-eZ.js +3 -0
  18. package/dist/layers.hgliNTDV.js +2 -0
  19. package/package.json +75 -17
  20. package/dist/layers.-R5PibOa.js +0 -10
  21. package/dist/layers.-mkaUFzn.js +0 -65
  22. package/dist/layers.1XpBjqYP.js +0 -1
  23. package/dist/layers.2Ibk-yAi.js +0 -10
  24. package/dist/layers.3DsBPqy5.js +0 -10
  25. package/dist/layers.4OVSS-76.js +0 -320
  26. package/dist/layers.52famHy6.js +0 -1
  27. package/dist/layers.7JqFgE4-.js +0 -15
  28. package/dist/layers.9Su9jHuK.js +0 -9
  29. package/dist/layers.9pNaFvaX.js +0 -1
  30. package/dist/layers.9rNftyw-.js +0 -40
  31. package/dist/layers.B-6jN1Zn.js +0 -41
  32. package/dist/layers.B0JnuQf0.js +0 -11
  33. package/dist/layers.B0dbAkLw.js +0 -11
  34. package/dist/layers.B19MhDZN.js +0 -1265
  35. package/dist/layers.B19hGmey.js +0 -1
  36. package/dist/layers.B1IDMpWZ.js +0 -32
  37. package/dist/layers.B1VK1Umd.js +0 -41
  38. package/dist/layers.B2IHCuq4.js +0 -202
  39. package/dist/layers.B2OBW6d_.js +0 -1
  40. package/dist/layers.B2RJoL8j.js +0 -8
  41. package/dist/layers.B3D4g2HH.js +0 -1
  42. package/dist/layers.B66ctuSP.js +0 -1
  43. package/dist/layers.B9uP5ibo.js +0 -1619
  44. package/dist/layers.BAtv1CM7.js +0 -1
  45. package/dist/layers.BDlQMLta.js +0 -1034
  46. package/dist/layers.BFlW1eUA.js +0 -1088
  47. package/dist/layers.BIRU7ZCl.js +0 -35
  48. package/dist/layers.BIeVwYKL.js +0 -1
  49. package/dist/layers.BJDrjORS.js +0 -244
  50. package/dist/layers.BJOHTiQN.js +0 -1
  51. package/dist/layers.BKLAyg9f.js +0 -34
  52. package/dist/layers.BKktUt3V.js +0 -425
  53. package/dist/layers.BLZg3-j8.js +0 -44
  54. package/dist/layers.BLd2spTm.js +0 -1
  55. package/dist/layers.BPHDdk7q.js +0 -6
  56. package/dist/layers.BQYTL9KT.js +0 -4
  57. package/dist/layers.BSTBZrFn.js +0 -1
  58. package/dist/layers.BUbQisBD.js +0 -40
  59. package/dist/layers.BY5MS01o.js +0 -304
  60. package/dist/layers.BY5x-OCj.js +0 -1359
  61. package/dist/layers.BZYqdVEt.js +0 -5
  62. package/dist/layers.B_blLMys.js +0 -7
  63. package/dist/layers.Bau1Nn-R.js +0 -1
  64. package/dist/layers.BbCfEXyj.js +0 -55
  65. package/dist/layers.BdC79PeD.js +0 -8
  66. package/dist/layers.BeQxuBmo.js +0 -373
  67. package/dist/layers.BgOa2ZQq.js +0 -7
  68. package/dist/layers.BhoEY-tV.js +0 -1
  69. package/dist/layers.BiJ8hfRt.js +0 -1510
  70. package/dist/layers.BipydXP9.js +0 -437
  71. package/dist/layers.BjNcxnlF.js +0 -40
  72. package/dist/layers.BjkZnui0.js +0 -6
  73. package/dist/layers.BjlXrUqq.js +0 -1
  74. package/dist/layers.BmEnHWGn.js +0 -1126
  75. package/dist/layers.Bm_lyqCL.js +0 -6
  76. package/dist/layers.Bo0o9BXc.js +0 -61
  77. package/dist/layers.Bowu41KP.js +0 -791
  78. package/dist/layers.BpVuHPkZ.js +0 -33
  79. package/dist/layers.BpilXLfW.js +0 -6
  80. package/dist/layers.BptubpVI.js +0 -37
  81. package/dist/layers.Bq8EFsFh.js +0 -3
  82. package/dist/layers.Brr7ESXx.js +0 -2
  83. package/dist/layers.BsTKIt_N.js +0 -19
  84. package/dist/layers.BshQq6Az.js +0 -189
  85. package/dist/layers.BsuVfEWr.js +0 -1
  86. package/dist/layers.Bwphu0_-.js +0 -41
  87. package/dist/layers.BxBoiyiz.js +0 -2
  88. package/dist/layers.BxqlTEGI.js +0 -39
  89. package/dist/layers.BznUuBVb.js +0 -1
  90. package/dist/layers.C0Lgw_Sx.js +0 -11688
  91. package/dist/layers.C24uY6Fe.js +0 -931
  92. package/dist/layers.C2fRZH80.js +0 -1
  93. package/dist/layers.C3KcBscd.js +0 -1
  94. package/dist/layers.C4CXznF_.js +0 -37
  95. package/dist/layers.C7M6CfP5.js +0 -42
  96. package/dist/layers.C7eXel2I.js +0 -7
  97. package/dist/layers.C8_lu5UH.js +0 -23
  98. package/dist/layers.CAm5BKM7.js +0 -1
  99. package/dist/layers.CBUXk-09.js +0 -11
  100. package/dist/layers.CDEWhNHi.js +0 -10
  101. package/dist/layers.CDL3opya.js +0 -8
  102. package/dist/layers.CE4FK9O5.js +0 -40
  103. package/dist/layers.CF-302Fh.js +0 -9
  104. package/dist/layers.CHZsXQcr.js +0 -1
  105. package/dist/layers.CHmvLyW1.js +0 -8
  106. package/dist/layers.CJUngdl8.js +0 -37
  107. package/dist/layers.CLAvgOJP.js +0 -4
  108. package/dist/layers.CLgsvcu7.js +0 -10
  109. package/dist/layers.CM9lYwoQ.js +0 -36
  110. package/dist/layers.CMMTUOh6.js +0 -39
  111. package/dist/layers.COYYECPe.js +0 -48146
  112. package/dist/layers.CQ6g1bgB.js +0 -11
  113. package/dist/layers.CR1i6QWh.js +0 -803
  114. package/dist/layers.CRKrzT-Y.js +0 -11
  115. package/dist/layers.CSNKiqFe.js +0 -8
  116. package/dist/layers.CSYpl3YM.js +0 -960
  117. package/dist/layers.CTK5IBtb.js +0 -793
  118. package/dist/layers.CVUgbWcY.js +0 -21763
  119. package/dist/layers.CXg7Sg55.js +0 -802
  120. package/dist/layers.C_RheIIS.js +0 -904
  121. package/dist/layers.C_eoPPmk.js +0 -13
  122. package/dist/layers.Ccvu-Dlo.js +0 -1
  123. package/dist/layers.CdGfvF7V.js +0 -1
  124. package/dist/layers.Cf9fVqKx.js +0 -21938
  125. package/dist/layers.Cisk2RXM.js +0 -1
  126. package/dist/layers.CkXqIRYC.js +0 -38
  127. package/dist/layers.ClJd7I1M.js +0 -9
  128. package/dist/layers.ClxhzI7j.js +0 -8
  129. package/dist/layers.CmqoZAnC.js +0 -2479
  130. package/dist/layers.CnrBP_N5.js +0 -769
  131. package/dist/layers.Cob5vYhh.js +0 -5
  132. package/dist/layers.Coygwekn.js +0 -9
  133. package/dist/layers.Cp5JhAmO.js +0 -7
  134. package/dist/layers.CqVTtuYm.js +0 -6
  135. package/dist/layers.CtHBfow6.js +0 -282
  136. package/dist/layers.CuoaVZrW.js +0 -41
  137. package/dist/layers.Cyzu9PKQ.js +0 -1
  138. package/dist/layers.D-7S1Qn6.js +0 -7
  139. package/dist/layers.D-cAGd4i.js +0 -41
  140. package/dist/layers.D-v-3mtK.js +0 -9
  141. package/dist/layers.D0MGpeyX.js +0 -39
  142. package/dist/layers.D0lTyC6R.js +0 -35
  143. package/dist/layers.D0zn4_Mx.js +0 -1
  144. package/dist/layers.D33cj9e8.js +0 -1
  145. package/dist/layers.D3A8IuMw.js +0 -42
  146. package/dist/layers.D40oNXih.js +0 -1580
  147. package/dist/layers.D4T8fTcj.js +0 -1223
  148. package/dist/layers.D4ydcUW5.js +0 -7
  149. package/dist/layers.D7jGxypv.js +0 -8
  150. package/dist/layers.DByfn15F.js +0 -7
  151. package/dist/layers.DCrkhQnl.js +0 -9
  152. package/dist/layers.DDVf9_XJ.js +0 -501
  153. package/dist/layers.DFF0tKf2.js +0 -9
  154. package/dist/layers.DGB6f2fp.js +0 -186
  155. package/dist/layers.DGF-imcj.js +0 -6
  156. package/dist/layers.DGlLGCMd.js +0 -41
  157. package/dist/layers.DH7bTclZ.js +0 -1
  158. package/dist/layers.DHrdv4EX.js +0 -32
  159. package/dist/layers.DIs-8Ynj.js +0 -35
  160. package/dist/layers.DIuulfCg.js +0 -32
  161. package/dist/layers.DJS98Zvr.js +0 -42
  162. package/dist/layers.DLwuMfdd.js +0 -84
  163. package/dist/layers.DMh-zb88.js +0 -10
  164. package/dist/layers.DMkBISW1.js +0 -1
  165. package/dist/layers.DN9HoVxI.js +0 -18
  166. package/dist/layers.DNray0Kg.js +0 -51
  167. package/dist/layers.DO8Lq71I.js +0 -4
  168. package/dist/layers.DOrgOHBr.js +0 -1
  169. package/dist/layers.DPg8YVWZ.js +0 -118
  170. package/dist/layers.DRRAWjJ-.js +0 -84
  171. package/dist/layers.DSnpK9v9.js +0 -40
  172. package/dist/layers.DT-qahkC.js +0 -41
  173. package/dist/layers.DT4gw4t8.js +0 -8
  174. package/dist/layers.DVjOEkHq.js +0 -295
  175. package/dist/layers.DW9Z4dLd.js +0 -37
  176. package/dist/layers.DWIf8ql6.js +0 -8
  177. package/dist/layers.DWynlv5x.js +0 -1
  178. package/dist/layers.DXKXZPx3.js +0 -10
  179. package/dist/layers.DXnKtB68.js +0 -2966
  180. package/dist/layers.DXr2kWj5.js +0 -36
  181. package/dist/layers.D_MRmmCY.js +0 -40
  182. package/dist/layers.D_Q80AXV.js +0 -7
  183. package/dist/layers.D_i2rLsg.js +0 -46859
  184. package/dist/layers.D_nCsZyv.js +0 -6
  185. package/dist/layers.Da1VjmYH.js +0 -122
  186. package/dist/layers.DaLcxrnP.js +0 -4
  187. package/dist/layers.DbaKVP5e.js +0 -1
  188. package/dist/layers.DeIaMdiM.js +0 -2
  189. package/dist/layers.Df5Qb1Ul.js +0 -220
  190. package/dist/layers.DfXjhAWm.js +0 -207
  191. package/dist/layers.Dfev0R1t.js +0 -36
  192. package/dist/layers.Dfw_b3vF.js +0 -2235
  193. package/dist/layers.Dh45zDPj.js +0 -7
  194. package/dist/layers.Di7HIxcn.js +0 -268
  195. package/dist/layers.DilKJOqa.js +0 -139
  196. package/dist/layers.DjUOC4st.js +0 -16
  197. package/dist/layers.DlWfA7qx.js +0 -423
  198. package/dist/layers.Dlp5s5ci.js +0 -41
  199. package/dist/layers.Dne14exG.js +0 -14
  200. package/dist/layers.DqpBjyTk.js +0 -10
  201. package/dist/layers.DrD0W7B3.js +0 -5
  202. package/dist/layers.DvdRZk6P.js +0 -39
  203. package/dist/layers.DxA6ocdw.js +0 -70
  204. package/dist/layers.DxIjFIXA.js +0 -39
  205. package/dist/layers.DxzveV49.js +0 -96
  206. package/dist/layers.Dy1naDTQ.js +0 -14
  207. package/dist/layers.ETa5WiKT.js +0 -160
  208. package/dist/layers.G9Ka5gtG.js +0 -39
  209. package/dist/layers.H0NAWny8.js +0 -33
  210. package/dist/layers.J8OYHqDO.js +0 -32
  211. package/dist/layers.JWCLFILJ.js +0 -1
  212. package/dist/layers.MNsWD8fy.js +0 -139
  213. package/dist/layers.MbNt5pO7.js +0 -39
  214. package/dist/layers.MsLi1AaR.js +0 -10
  215. package/dist/layers.NzblQjNP.js +0 -36
  216. package/dist/layers.PaRWxJTx.js +0 -1
  217. package/dist/layers.Pfqcm_x1.js +0 -40
  218. package/dist/layers.QUgQojU2.js +0 -39
  219. package/dist/layers.QeRtN6Gq.js +0 -1
  220. package/dist/layers.Rhe5fmYG.js +0 -38
  221. package/dist/layers.SuFOjX9h.js +0 -9
  222. package/dist/layers.UA4MYWds.js +0 -1089
  223. package/dist/layers.X8WQJwc7.js +0 -70
  224. package/dist/layers.XOnoorb1.js +0 -116
  225. package/dist/layers.YS67QCmr.js +0 -40
  226. package/dist/layers.YfvGPzEu.js +0 -1
  227. package/dist/layers.ZAlzzwQR.js +0 -59
  228. package/dist/layers.Zh3IN_BW.js +0 -1283
  229. package/dist/layers.akd0joBp.js +0 -84
  230. package/dist/layers.b0h5ZBmD.js +0 -61
  231. package/dist/layers.bfGibH2F.js +0 -38
  232. package/dist/layers.chFbbZh9.js +0 -9166
  233. package/dist/layers.e7K9sNTy.js +0 -32
  234. package/dist/layers.eOMmuyRq.js +0 -52
  235. package/dist/layers.f5SObLpT.js +0 -6
  236. package/dist/layers.ftDLkcXk.js +0 -32
  237. package/dist/layers.gdeLIrFt.js +0 -10
  238. package/dist/layers.hGSxVR0w.js +0 -8
  239. package/dist/layers.hMduvmS1.js +0 -42
  240. package/dist/layers.hYSHj9J1.js +0 -230
  241. package/dist/layers.hweLqW3I.js +0 -261
  242. package/dist/layers.i3cprua-.js +0 -1
  243. package/dist/layers.lCpg7dOn.js +0 -21
  244. package/dist/layers.pN-YTLfe.js +0 -1
  245. package/dist/layers.puGhbMne.js +0 -257
  246. package/dist/layers.rPpIRTrs.js +0 -39
  247. package/dist/layers.rfeShEsx.js +0 -40
  248. package/dist/layers.sf1uvSch.js +0 -1
  249. package/dist/layers.t3fpEPMO.js +0 -8
  250. package/dist/layers.v4_WldHC.js +0 -9
  251. package/dist/layers.vHrsDWns.js +0 -40
  252. package/dist/layers.yIm62nh0.js +0 -5
  253. package/dist/layers.z72AWJJl.js +0 -42
  254. package/dist/layers.zj3cbd1g.js +0 -5
  255. package/dist/layers.zysZLChz.js +0 -9
@@ -0,0 +1,6 @@
1
+ "use strict";const n=require("react/jsx-runtime"),I=require("react"),V=require("react-i18next"),je=require("@lexical/react/LexicalComposerContext"),f=require("@mantine/core"),b=require("lexical"),ae=require("./layers.eLiGm-eZ.js"),e=require("@tabler/icons-react"),we=require("@layers-app/shared"),H=require("./layers.CEMW9z_P.js"),k=require("./layers.CzNz0Zya.js"),Se=require("react-dom"),ke=require("@lexical/react/LexicalContentEditable"),Ne=require("@lexical/rich-text"),De=require("@lexical/utils"),B=require("./layers.C69TrYD7.js"),Ie={bullet:e.IconList,check:e.IconListCheck,"check-mark":e.IconCheck,code:e.IconCode,h1:e.IconH1,h2:e.IconH2,h3:e.IconH3,number:e.IconListNumbers,paragraph:e.IconIndentIncrease,quote:e.IconQuote,fontFamily:e.IconLetterT,undo:e.IconArrowBackUp,redo:e.IconArrowForwardUp,bold:e.IconBold,italic:e.IconItalic,underline:e.IconUnderline,link:e.IconLink,"color-picker":e.IconColorPicker,background:e.IconBucketDroplet,photo:e.IconPhoto,"photo-check":e.IconPhotoCheck,"align-left":e.IconAlignLeft,"align-end":e.IconAlignLeft,"align-start":e.IconAlignLeft,"align-right":e.IconAlignRight,"align-center":e.IconAlignCenter,"align-justify":e.IconAlignJustified,"horizontal-rule":e.IconFlipHorizontal,strikethrough:e.IconStrikethrough,subscript:e.IconSubscript,superscript:e.IconSuperscript,minus:e.IconMinus,plus:e.IconPlus,"chevron-down":e.IconChevronDown,"chevron-right":e.IconChevronRight,grip:e.IconGripVertical,"circle-check":e.IconCircleCheck,"circle-x":e.IconCircleX,pencil:e.IconPencil,trash:e.IconTrash,table:e.IconTable,"caret-right":e.IconCaretRight,grid:e.IconColumns3,"dots-vertical":e.IconDotsVertical,copy:e.IconCopy,clipboard:e.IconClipboard,cut:e.IconCut,"arrow-bar-to-up":e.IconArrowBarToUp,"arrow-bar-to-down":e.IconArrowBarToDown,"arrow-bar-to-left":e.IconArrowBarToLeft,"arrow-bar-to-right":e.IconArrowBarToRight,"column-insert-left":e.IconColumnInsertLeft,"column-insert-right":e.IconColumnInsertRight,"row-insert-top":e.IconRowInsertTop,"row-insert-bottom":e.IconRowInsertBottom,"container-off":e.IconContainerOff,"table-off":e.IconTableOff,"layers-union":e.IconLayersUnion,"layers-substract":e.IconLayersSubtract,"сlear-format":e.IconDropletOff,form:e.IconCheckupList,youtube:e.IconBrandYoutube,emoji:e.IconMoodSmile,file:e.IconFile,success:e.IconCheck,warning:e.IconAlertTriangle,alert:e.IconExclamationCircle,defaultOff:e.IconBaseline,embed:e.IconCodeCircle,at:e.IconAt,paperclip:e.IconPaperclip,close:e.IconX,api:e.IconApi,music:e.IconMusic,message:e.IconMessage,reply:e.IconArrowBackUp,filter:e.IconFilter,messages:e.IconMessages,"shield-check":e.IconShieldCheckFilled,reOpen:e.IconReload,send:e.IconSend,expandSidebar:e.IconLayoutSidebarLeftExpand,palette:e.IconPalette},P=({name:t,iconStyle:o,...a})=>{const i=Ie[t]||Ie.bullet;return n.jsx(f.Flex,{gap:0,justify:"center",align:"center",...a,children:n.jsx(i,{size:18,stroke:2,style:o,...a})})},Le=({icon:t,title:o,pointerEvents:a="auto",isLoading:i,progress:E,nodeKey:y,onAfterCancel:m,...x})=>{const[C]=je.useLexicalComposerContext(),{t:M}=V.useTranslation(),{fetchUploadMedia:l}=I.useContext(ae.Context),_=((l==null?void 0:l.length)??0)>=5,T=()=>{C.update(()=>{const z=b.$getNodeByKey(y);z&&z.remove()})},N=z=>{z.stopPropagation(),m==null||m()};return n.jsxs(f.UnstyledButton,{className:"image-node-picker-button",styles:{root:{width:"100%",display:"flex",alignItems:"center",gap:"var(--mantine-spacing-sm)",flexDirection:"column",padding:"var(--mantine-spacing-md)",background:"var(--mantine-primary-color-light)",color:"var(--mantine-color-text)",borderRadius:"var(--mantine-radius-default)",opacity:.75,pointerEvents:i?"none":a,boxSizing:"border-box"}},...x,children:[n.jsxs("div",{className:"empty-node-button__content",children:[i&&!_&&n.jsx(f.Loader,{size:"xs",mb:2,mr:4,color:"gray"}),!i&&n.jsx(P,{name:t}),o,i&&m&&n.jsx(f.Text,{component:"span",onClick:N,variant:"link",style:{marginLeft:"auto",cursor:"pointer",pointerEvents:"auto"},children:M("editor.cancel")}),y&&!i&&n.jsx(P,{style:{pointerEvents:"auto"},className:"delete-icon",name:"close",size:22,onClick:T})]}),i&&typeof E=="number"&&_&&n.jsx(f.Progress,{w:"100%",value:E,animated:!0,transitionDuration:200})]})},Oe="_title_81iwv_1",ve="_icon_81iwv_11",Ae="_link_81iwv_20",se={title:Oe,icon:ve,link:Ae},Be=({page:t})=>{const{t:o}=V.useTranslation();return n.jsxs("div",{className:se.link,onClick:t.onClick,children:[n.jsx("div",{className:se.icon,children:t.icon?n.jsx(we.ProjectIcon,{size:16,fz:16,icon:t.icon,fallback:n.jsx(e.IconFile,{size:"1em"})}):n.jsx(e.IconFile,{size:16})}),n.jsx(f.Tooltip,{label:t.title,disabled:!t.title,openDelay:400,children:n.jsx(f.Text,{truncate:!0,className:se.title,"data-empty":!t.title,children:t.title||o("editor.noTitle")})})]})},He=I.memo,Fe=He(Be),We={center:-8,right:2,left:-18},$e=(t,o,a,i)=>{const y=t.width/2,m=t.height/2,x=i==null?void 0:i.classList[1],C=We[x];switch(o){case"nw-resize":return{x:0,y:0};case"ne-resize":return{x:t.width-16,y:0};case"sw-resize":return{x:0,y:t.height-16};case"se-resize":return{x:t.width-16,y:t.height-16};case"n-resize":return{x:y+C,y:0};case"s-resize":return{x:y+C,y:t.height-16};case"w-resize":return{x:0,y:m-8};case"e-resize":return{x:t.width-16,y:m-(a?17:8)}}},qe=(t,o,a,i=["nw-resize","ne-resize","sw-resize","se-resize","n-resize","s-resize","w-resize","e-resize"])=>{const y=a<=32,m=a>=t.height-32,x=o<=32,C=o>=t.width-32;return y&&x?i.includes("nw-resize")?"nw-resize":"default":y&&C?i.includes("ne-resize")?"ne-resize":"default":m&&x?i.includes("sw-resize")?"sw-resize":"default":m&&C?i.includes("se-resize")?"se-resize":"default":y?i.includes("n-resize")?"n-resize":"default":m?i.includes("s-resize")?"s-resize":"default":x?i.includes("w-resize")?"w-resize":"default":C&&i.includes("e-resize")?"e-resize":"default"},X=32,U=(t,o)=>t&&typeof t=="number"?Math.min(t/o*100,95.5):95.5;function Ge(t){const a=100-4e3/t;return{minResizePercent:Math.max(5,9792/t),maxWidthPercent:a}}const Ye=({editor:t,width:o,height:a,initialHeight:i,initialWidth:E,children:y,onResizeStart:m,isIcon:x,onResizeEnd:C,alignment:M,isEmbed:l,type:_})=>{const[T,N]=I.useState({x:-1e3,y:-1e3}),[z,J]=I.useState(30),[q,K]=I.useState("default"),[G,le]=I.useState(!1),{imperativeHandleRef:Y}=I.useContext(ae.Context),[Q,Z]=I.useState(null),D=I.useMemo(()=>H.getAllowedControls(M)||["e-resize"],[M]),ye=D.length===1&&D[0]==="e-resize",u=I.useRef(null),ue=I.useRef(null),R=I.useRef({rootHeight:0,rootWidth:0,ratio:1,currentWidth:0,currentWidthPercent:0,currentHeight:0,currentHeightPercent:0,startWidth:0,startWidthPercent:0,startHeight:0,startHeightPercent:0,startX:0,startY:0,direction:"x",isResizing:!1,isTop:!1,isBottom:!1,isLeft:!1,isRight:!1}),L=(r,s=95.5)=>{var d;const p=(d=t._window)==null?void 0:d.innerWidth;if(p){let g=100;l&&(g=250);const h=g/p*100;return r<h?h:r>s?s:r}else return r<20?20:r>100?100:r},de=(r,s)=>{const p=Math.min(r,s);return 15+(Math.max(200,Math.min(800,p))-100)/500*15},he=(r,s,p)=>{if(K("default"),!G)return;let d=q;d=qe(r,s,p,D),R.current.isResizing&&(d=q),K(d),J(z),N(g=>$e(r,d,l||!1,u.current)||g)},Ce=r=>{var g;if(k.isMobile)return;r.preventDefault();const s=(g=u.current)==null?void 0:g.getBoundingClientRect();if(!s)return;const p=r.clientX-s.left,d=r.clientY-s.top;R.current.isResizing||he(s,p,d)},me=(r,s=12,p=95.5,d=R.current.rootWidth)=>{const g=u.current,h=R.current;if(!g||r.button===2||!(h!=null&&h.isResizing))return;const w=g.getBoundingClientRect(),O=r.clientX-w.left,ee=r.clientY-w.top;he(w,O,ee);const te=.17,F=M==="right",W=M==="center",v=h.isLeft,A=h.isTop,$=h.isBottom,ne=h.direction==="y",c=h.isRight,S=Math.floor(F?w.right-r.clientX-(w.right-h.startX):r.clientX-h.startX),re=Math.floor(r.clientY-h.startY);let j=0;v||c?j=S/d*100:(A||$||W)&&(j=re*te),(v||A)&&(!F||ne&&!v)&&(!$||W)&&(j=-j),(A&&c||$&&c)&&(j=S/d*100),j=Math.max(-100,Math.min(100,j));const ie=h.startWidthPercent+j,oe=h.startHeightPercent+j;h.currentWidthPercent=L(Math.max(s,ie),p),h.currentHeightPercent=L(Math.max(s,oe),p),g.style.width=`${h.currentWidthPercent}%`,g.style.height=`${h.currentHeightPercent}%`},Ee=r=>{var g,h;const s=R.current;if(s.isResizing=!1,(g=u.current)==null||g.classList.remove("is-resizing"),(h=u.current)==null||h.releasePointerCapture(r.pointerId),C(s.currentWidthPercent+"%",s.currentHeightPercent+"%"),document.removeEventListener("pointermove",me),!u.current)return;const p=u.current.getBoundingClientRect(),d=de(p.width,p.height);J(d)},Me=r=>{var pe,ge;if(r.button===2||!G){r.preventDefault(),r.stopPropagation();return}if(!u.current)return;u.current.classList.add("is-resizing");const s=t.getRootElement();if(!s)return;const p=s.getBoundingClientRect();if(!t.isEditable()||q==="default")return;const d=ue.current;if(d===null)return;const g=(pe=u.current)==null?void 0:pe.getBoundingClientRect();if(!d.getBoundingClientRect()||!g)return;const{width:w,height:O,top:ee,left:te}=g,F=r.clientX-te,W=r.clientY-ee,v=W<=X,A=W>=O-X,$=F<=X,ne=F>=w-X,c=R.current,S=window.getComputedStyle(s),re=parseFloat(S.paddingTop),j=parseFloat(S.paddingBottom),ie=parseFloat(S.paddingLeft),oe=parseFloat(S.paddingRight);c.rootHeight=p.height-re-j||0,c.rootWidth=p.width-ie-oe||0,c.ratio=w/O,c.currentWidth=c.currentWidth||w,c.currentWidthPercent=+u.current.style.width.replace("%",""),c.currentHeight=c.currentHeight||O,c.currentHeightPercent=+u.current.style.height.replace("%",""),c.startX=r.clientX,c.startY=r.clientY,c.startWidth=c.currentWidth||w,c.startWidthPercent=c.currentWidthPercent,c.startHeight=c.currentHeight||O,c.startHeightPercent=c.currentHeightPercent,c.isResizing=!0,c.isTop=v,c.isBottom=A,c.isLeft=$,c.isRight=ne,c.direction=A||v?"y":"x",m&&m(),u.current.setPointerCapture(r.pointerId);const Re=((ge=u.current.parentElement)==null?void 0:ge.offsetWidth)??c.rootWidth,{maxWidthPercent:Pe,minResizePercent:_e}=Ge(Re);document.addEventListener("pointermove",be=>{var fe,xe;return me(be,_==="video"?40:_e,Pe,(xe=(fe=u.current)==null?void 0:fe.parentElement)==null?void 0:xe.offsetWidth)}),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})};I.useEffect(()=>{var g;const r=u.current;if(!r)return;if(typeof o=="number"&&typeof a=="number"){r.style.width=`${L(o)}%`,r.style.height=`${L(a)}%`;return}const s=(g=r.parentElement)==null?void 0:g.getBoundingClientRect();if(!s)return;const p=U(i,s.height),d=U(E,s.width);r.style.width=`${d}%`,r.style.height=`${p}%`},[o,a,E,i]),I.useEffect(()=>{var d;if(!u.current)return;const r=u.current.getBoundingClientRect(),s=(d=u.current.parentElement)==null?void 0:d.getBoundingClientRect(),p=de(r.width,r.height);if(J(p),typeof o=="number"&&typeof a=="number")u.current.style.width=`${L(o)}%`,u.current.style.height=`${L(a)}%`,R.current.currentWidthPercent=o,R.current.currentHeightPercent=a;else if(s){const g=U(i,s.height),h=U(E,s.width);requestAnimationFrame(()=>{u.current&&(u.current.style.height=`${g}%`,u.current.style.width=`${h}%`)}),R.current.currentWidthPercent=h,R.current.currentHeightPercent=g}else u.current.style.height="100%",u.current.style.width="100%",R.current.currentWidthPercent=100,R.current.currentHeightPercent=100},[u.current,x,i,E]);const Te=r=>{const p=r.target.closest("[data-lexical-decorator]");return p?t.update(()=>{const d=b.$getNearestNodeFromDOMNode(p);d&&d instanceof b.DecoratorNode&&Z(d)}):Z(null),!1},ze=()=>(Q&&setTimeout(()=>{t.update(()=>(Q.insertAfter(b.$createParagraphNode()).selectStart(),Z(null),!0))}),!1);return Y!=null&&Y.current&&(Y.current.decoratorEnterAction=ze),I.useEffect(()=>{const r=t.registerCommand(b.CLICK_COMMAND,Te,b.COMMAND_PRIORITY_NORMAL);return()=>{r()}},[Q]),k.isMobile?y:n.jsxs("div",{ref:u,className:`resizable-container ${M||""} ${ye?"hide-padding":""}`,style:{cursor:q},onMouseMove:Ce,onMouseEnter:()=>le(!0),onMouseLeave:()=>{le(!1),K("default")},onMouseUp:()=>{t.dispatchCommand(k.ON_CHANGE_COMMAND,"show_menu")},onPointerDown:Me,children:[n.jsx("svg",{className:`resizable-container__handle ${G?"hovered":""}`,style:{"--clip-x1":`${T.x-z}px`,"--clip-y1":`${T.y-z}px`,"--clip-x2":`${T.x+z}px`,"--clip-y2":`${T.y-z}px`,"--clip-x3":`${T.x+z}px`,"--clip-y3":`${T.y+z}px`,"--clip-x4":`${T.x-z}px`,"--clip-y4":`${T.y+z}px`,clipPath:`polygon(
2
+ var(--clip-x1) var(--clip-y1),
3
+ var(--clip-x2) var(--clip-y2),
4
+ var(--clip-x3) var(--clip-y3),
5
+ var(--clip-x4) var(--clip-y4)
6
+ )`,opacity:G?1:0,transition:`${R.current.isResizing?"none":` opacity 0.3s ease-in-out, clip-path ${(D==null?void 0:D.length)<4?"0.2s":"0.3s"} cubic-bezier(0.825, 0.225, 0.280, 0.770)`}`},children:n.jsx("rect",{x:0,y:0,width:"100%",height:"100%",stroke:"#D9D9D9",strokeWidth:8,rx:15,ry:15,fill:"none"})}),n.jsx("div",{ref:ue,className:"resizable-container__inner",style:{height:"100%",width:"100%",pointerEvents:R.current.isResizing?"none":"auto"},children:y})]})};function Xe({children:t}){return Se.createPortal(n.jsx("div",{className:"FlashMessage__overlay",role:"dialog",children:n.jsx("p",{className:"FlashMessage__alert",role:"alert",children:t})}),document.body)}function Ue({onClose:t,children:o,title:a,size:i}){return n.jsx(f.Modal,{className:"doc-space-editor-wrapper",size:i,centered:!0,opened:!0,onClose:t,title:a,zIndex:999,children:o})}function Ve({"data-test-id":t,children:o,className:a,onClick:i,disabled:E,small:y,title:m}){return n.jsx(f.Button,{onClick:i,disabled:E,variant:"filled",children:o})}const Je=({label:t,icon:o})=>n.jsxs("div",{className:"custom-menu-item",children:[n.jsxs("div",{children:[o,n.jsx("span",{children:t})]}),n.jsx(P,{name:"chevron-right"})]}),Ke=t=>({center:{icon:"align-center",iconRTL:"center-align",name:t("editor.toolbar.center")},end:{icon:"align-end",iconRTL:"left-align",name:"End Align"},justify:{icon:"align-justify",iconRTL:"justify-align",name:t("editor.toolbar.justify")},left:{icon:"align-left",iconRTL:"left-align",name:t("editor.toolbar.left")},right:{icon:"align-right",iconRTL:"left-align",name:t("editor.toolbar.right")},start:{icon:"align-start",iconRTL:"right-align",name:"Start Align"}});function Qe({editor:t,value:o,disabled:a=!1,setElementFormat:i}){const{t:E,i18n:y}=V.useTranslation(),m=I.useMemo(()=>Ke(E),[y.language]),x=I.useMemo(()=>o==="start"||o==="end"?m.left:m[o||"left"],[o,y.language]),C=M=>{i(M),t.dispatchCommand(b.FORMAT_ELEMENT_COMMAND,M)};return n.jsxs(f.Menu,{transitionProps:H.animationMenu,shadow:"md",styles:{dropdown:{zIndex:1e3}},children:[n.jsx(f.Menu.Target,{children:n.jsx(f.Tooltip,{label:E("editor.toolbar.align"),children:n.jsxs("button",{disabled:a,className:"toolbar-item spaced alignment","aria-label":"Formatting options for text alignment",type:"button",children:[n.jsx(P,{size:18,name:x.icon}),n.jsxs(f.Text,{mx:5,size:"sm",children:[" ",x.name]}),n.jsx(P,{name:"chevron-down"})]})})}),n.jsxs(f.Menu.Dropdown,{onMouseDown:M=>{M.preventDefault()},children:[n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-left"}),rightSection:o==="left"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("left"),children:m.left.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-center"}),rightSection:o==="center"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("center"),children:m.center.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-right"}),rightSection:o==="right"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("right"),children:m.right.name}),n.jsx(f.Menu.Item,{leftSection:n.jsx(P,{size:18,name:"align-justify"}),rightSection:o==="justify"&&n.jsx(P,{name:"check-mark"}),onClick:()=>C("justify"),children:m.justify.name})]})]})}function Ze({className:t}){return n.jsx(ke.ContentEditable,{contentEditable:!1,className:t||"ContentEditable__root"})}const et="_listContainer_1d88b_1",tt="_list_1d88b_1",nt="_text_1d88b_28",ce={listContainer:et,list:tt,text:nt},rt=({editor:t})=>{var M;const[o,a]=I.useState(!1),{t:i,i18n:E}=V.useTranslation(),{excludeNodes:y}=I.useContext(ae.Context),m=l=>{const _=document.querySelector(".editor-container");if(l){_.classList.add("empty-editor");return}_.classList.remove("empty-editor")};I.useEffect(()=>{t.update(()=>{k.checkIsEmpty()&&(a(!0),m(!0))}),De.mergeRegister(t.registerCommand(b.BLUR_COMMAND,()=>{const l=!!k.checkIsEmpty();return a(l),m(l),!1},b.COMMAND_PRIORITY_LOW),t.registerCommand(b.FOCUS_COMMAND,()=>(a(!1),m(!1),!1),b.COMMAND_PRIORITY_LOW))},[]);const x=(l,_)=>{l==null||l.update(()=>{l.focus();const N=b.$getRoot().getFirstChild();N&&_&&(_(N),a(!1))})},C=I.useMemo(()=>[{title:i("editor.emptyPageOptions.heading"),icon:n.jsx(e.IconH1,{stroke:2,size:18}),onSelect:()=>x(t,l=>{l.replace(Ne.$createHeadingNode("h1"))})},{title:i("editor.emptyPageOptions.grid"),icon:n.jsx(e.IconColumns2,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(B.INSERT_LAYOUT_COMMAND,B.GRID_TWO_COL_WITH_GAP)})}},{title:i("editor.emptyPageOptions.list"),icon:n.jsx(e.IconListNumbers,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(H.INSERT_ORDERED_LIST_COMMAND,void 0)})}},{title:i("editor.emptyPageOptions.code"),icon:n.jsx(e.IconCode,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(B.INSERT_CODE_COMMAND,void 0)})}},{title:i("editor.menu.media.excalidraw.hint.description"),icon:n.jsx(e.IconPalette,{stroke:2,size:18}),onSelect:()=>{Promise.resolve().then(()=>require("./layers.C69TrYD7.js")).then(l=>l.index).then(({INSERT_EXCALIDRAW_COMMAND:l})=>{x(t,()=>{t.dispatchCommand(l,void 0)})})}},y.template?{title:i("editor.emptyPageOptions.template"),icon:n.jsx(e.IconTemplate,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{t==null||t.dispatchCommand(k.CREATE_TEMPLATE,void 0)})}}:null,{title:i("editor.emptyPageOptions.callout"),icon:n.jsx(e.IconBaseline,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(k.INSERT_CALLOUT_COMMAND,"success")})})}},{title:i("editor.emptyPageOptions.table"),icon:n.jsx(e.IconTable,{stroke:2,size:18}),onSelect:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(H.INSERT_TABLE_COMMAND,{columns:"4",includeHeaders:!1,rows:"3"})})})}},{title:i("editor.emptyPageOptions.integrations"),icon:n.jsx(e.IconApps,{stroke:2,size:18}),onSelect:()=>{}}],[E.language]);return o?n.jsx(f.Portal,{target:((M=t==null?void 0:t._rootElement)==null?void 0:M.parentElement)||document.body,children:n.jsx("ul",{className:`${ce.listContainer} empty-page-options`,children:C.map((l,_)=>l?n.jsxs(f.Menu,{disabled:_!==C.length-1,position:"bottom-start",shadow:"md",styles:{dropdown:{overflow:"auto",zIndex:1e3}},middlewares:B.middlewaresPopup,width:200,transitionProps:H.animationMenu,children:[n.jsx(f.Menu.Target,{children:n.jsxs("li",{className:ce.list,onClick:l.onSelect,children:[l.icon," ",n.jsx("span",{className:ce.text,children:l.title})]})}),n.jsx(f.Menu.Dropdown,{children:H.embedDescriptors.map(T=>n.jsx(f.Menu.Item,{className:"item "+B.dropDownActiveClass(T.key==="1"),leftSection:T.icon,style:{borderRadius:"var(--mantine-radius-sm)"},onClick:()=>{x(t,()=>{setTimeout(()=>{t==null||t.dispatchCommand(B.INSERT_EMBED_INTEGRATION_COMMAND,""),a(!1)})})},children:T.name},T.name))})]},l.title):null)})}):null};exports.AlignMenu=Qe;exports.Button=Ve;exports.CustomMenuItem=Je;exports.EmptyNodeButton=Le;exports.EmptyPage=rt;exports.FlashMessage=Xe;exports.Icon=P;exports.LexicalContentEditable=Ze;exports.ModalComponent=Ue;exports.PageLink=Fe;exports.ResizableContainer=Ye;
@@ -0,0 +1 @@
1
+ "use strict";const r=require("lexical"),g=require("./layers.CEMW9z_P.js"),x=require("./layers.hgliNTDV.js"),k=require("@lexical/utils"),O=require("@lexical/selection");require("@lexical/code");require("@lexical/hashtag");require("@lexical/link");require("@lexical/mark");require("@lexical/overflow");require("@lexical/react/LexicalHorizontalRuleNode");require("@lexical/rich-text");const f=require("./layers.C69TrYD7.js");function T(e,t){if(t.add(e.getKey()),r.$isElementNode(e))for(const n of e.getChildren())T(n,t)}function I(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}const R=r.createCommand(),F=r.createCommand(),K=r.createCommand(),B=r.createCommand(),U=r.createCommand(),q=r.createCommand(),z=r.createCommand(),W=r.createCommand(),G=(()=>{var t;const e=(t=window.navigator)==null?void 0:t.userAgentData;return e!==void 0?e.mobile:window.innerWidth<=800&&window.innerHeight<=600})(),V=e=>typeof e=="string"&&e.includes("%")?parseFloat(e):e;function H(e,t){if(!t||!(t instanceof HTMLElement)){console.error("Invalid DOM element provided.");return}e?t.classList.add("disable-scroll"):t.classList.remove("disable-scroll")}function m(e){const t=r.$getSelection();if(r.$isRangeSelection(t)){const o=t.anchor.getNode();if(o!==null){const s=o.getParent();return e?s:o}}return null}function Y(e){e.update(()=>{const t=r.$getSelection();if(r.$isRangeSelection(t)){const n=t.getNodes();let o=null,s=null;if(n.forEach((l,c)=>{c===0&&(o=l.getParent()),c===n.length-1&&(s=l.getParent())}),o&&s){const l=r.$getSelection();r.$isRangeSelection(l)&&(o.isAttached()&&s.isAttached()?g.$isExtendedTextNode(o)&&g.$isExtendedTextNode(s)?l.setTextNodeRange(o,0,s,s.getTextContentSize()):(l.anchor.set(o.getKey(),0,"element"),l.focus.set(s.getKey(),s.getChildrenSize(),"element")):console.error("Error: One of the nodes is not attached."))}}})}const $=(e,t)=>{e.update(()=>{if(typeof t=="string"){const n=r.$getNodeByKey(t);n&&n.remove();return}t&&t.remove()})};function J(e,t){t.update(()=>{let n=r.$createRangeSelection();e.getParent()&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(e.getKey(),0,"element"),r.$setSelection(n))})}function j(){const e=r.$getSelection();if(r.$isRangeSelection(e)){const t=e.anchor,n=e.focus,o=n.getNode(),s=g.$isExtendedCodeNode(o)?o.__size:o.getTextContentSize(),l=t.offset===0,c=n.offset===s;if(l&&c)return!0}return!1}function Z(e,t){const n=r.$copyNode(e),o=[[e,n]];let s;for(;(s=o.length)>0;)for(let l=0;l<s;l++){const c=o.shift();if(c!==void 0){const[a,i]=c;if(r.$isElementNode(a)&&r.$isElementNode(i)){const d=a.getChildren();for(const u of d){if(t&&u.is(t))continue;const h=r.$copyNode(u);g.$isExtendedTextNode(u)&&g.$isExtendedTextNode(h)&&(h.setFormat(u.__format),h.setStyle(u.__style)),i.append(h),o.push([u,h])}}}}return n}function v(e,t,n=3){if(!e)return null;let o=e,s=0;for(;o&&s<n;){if(t(o))return o;if(o.__type==="root")break;o=o.getParent(),s++}return null}function E(e,t,n){var s;const o=n||{root:!0};if(e){let l=e.getParent();if(o[l==null?void 0:l.__type]){const c=t.getElementByKey(e.__key),a=v(l,g.$isCalloutNode);if(a&&(a.getFirstChild()===e.getTopLevelElement()||a.getFirstChild()===((s=e.getTopLevelElement())==null?void 0:s.getParent()))){const d=a.getParent(),u=d?t.getElementByKey(d.__key):null;if(u)return{htmlElement:u,lexicalNode:r.$getNearestNodeFromDOMNode(u)}}return{htmlElement:c,lexicalNode:e}}return E(l,t,o)}return{htmlElement:null,lexicalNode:null}}function Q(e,t,n,o){var s;if(e)if((e==null?void 0:e.__type)==="root"||(e==null?void 0:e.__type)==="layout-item"||(e==null?void 0:e.__type)==="callout-wrapper"||(e==null?void 0:e.__type)==="collapsible-content"){const l=(o==null?void 0:o.clientY)||0,{left:c}=((s=t.getElementByKey(e.__key))==null?void 0:s.getBoundingClientRect())||{left:0},{paddingLeft:a}=window.getComputedStyle(o==null?void 0:o.target),i=document.elementFromPoint(c+parseFloat(a)+10,l),d=r.$getNearestNodeFromDOMNode(i||document.body);return d?E(d,t,n):{htmlElement:null,lexicalNode:null}}else return E(e,t,n);return{htmlElement:null,lexicalNode:null}}const X=e=>{e.update(()=>{r.$getSelection()!==null&&r.$setSelection(null)})},ee=()=>{const e=r.$getRoot(),t=e==null?void 0:e.getFirstChild();return e.getChildren().length>1?!1:t&&r.$isElementNode(t)&&t.isEmpty()&&!g.$isExtendedCodeNode(t)},te=e=>{e.update(()=>{const t=r.$getRoot(),n=r.$createParagraphNode(),o=r.$getSelection();r.$isRangeSelection(o)&&(o.format=0,o.setStyle("")),t.append(n).selectEnd()})},ne=(e,t,n)=>{const o=e.target;if(o&&(o instanceof HTMLElement||o instanceof SVGElement)){let s=null;const l=o.closest(t);for(const a of n)if(s=o.closest(a),s)break;return{lexicalDOMNode:l,isOutside:!(l||s)}}else return{lexicalDOMNode:null,isOutside:!0}};async function*L(e){let t=!1;for(;!t;){const n=await e.read(),{value:o}=n;o!==void 0&&(yield o),t=n.done}}async function oe(e){const t=[];for await(const o of L(e))for(let s=0;s<o.length;s+=32768)t.push(String.fromCharCode(...o.subarray(s,s+32768)));return t.join("")}async function se(e){const t=new CompressionStream("gzip"),n=t.writable.getWriter(),[,o]=await Promise.all([n.write(new TextEncoder().encode(JSON.stringify(e))).then(()=>n.close()),oe(t.readable.getReader())]);return`#doc=${btoa(o).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}`}async function le(e){const t=/^#doc=(.*)$/.exec(e);if(!t)return null;const n=new DecompressionStream("gzip"),o=n.writable.getWriter(),s=atob(t[1].replace(/_/g,"/").replace(/-/g,"+")),l=new Uint8Array(s.length);for(let i=0;i<s.length;i++)l[i]=s.charCodeAt(i);const c=o.write(l).then(()=>o.close()),a=[];for await(const i of L(n.readable.pipeThrough(new TextDecoderStream).getReader()))a.push(i);return await c,JSON.parse(a.join(""))}const P=()=>!!document.querySelector(".selected-all-document"),re=(e,t,n)=>{var s,l,c,a,i;const o=r.$getSelection();if(r.$isRangeSelection(o)&&o.isCollapsed()){const d=o.anchor.getNode(),u=d.getKey(),h=d.getParent()===n,C=n instanceof r.ElementNode&&(n.__type==="layout-item"?(l=(s=n.getLastChild())==null?void 0:s.getPreviousSibling())==null?void 0:l.getKey():(c=n.getLastChild())==null?void 0:c.getKey())===u,b=n instanceof r.ElementNode&&((a=n.getFirstChild())==null?void 0:a.getKey())===u;if(n&&d instanceof r.ParagraphNode&&!d.getTextContent()&&h&&!((i=d.getPreviousSibling())!=null&&i.getTextContent())&&C&&!b){const D=e.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>(D(),!0),r.COMMAND_PRIORITY_NORMAL);return e.update(()=>{var _;if(n){let p=n.getChildren();const w=n.getLastChild();g.$isLayoutDividerNode(w)&&(p=p.slice(0,-1)),p.length===2?p.slice(-1).forEach(y=>y.remove()):p.slice(-2).forEach(y=>y.remove())}const S=t==null?void 0:t.getNextSibling();if(r.$isParagraphNode(S)&&S.getTextContent()==="")(_=t==null?void 0:t.getNextSibling())==null||_.selectEnd();else{const p=t==null?void 0:t.insertAfter(r.$createParagraphNode());p==null||p.selectStart()}}),!0}}return!1},ie=(e,t,n)=>{var l,c,a;const o=(n==null?void 0:n.getChildren())||[];if((o==null?void 0:o.length)===2){for(const i of o)i.__key!==(t==null?void 0:t.__key)&&(n==null||n.insertBefore(i),(l=i.getFirstChild())==null||l.selectEnd());n.remove()}else for(const i of o)if(i.__key===(t==null?void 0:t.__key)){x.setTemplateColumnsAfterDelete(e,i),$(e,i);const d=i.getPreviousSibling()??i.getNextSibling();(a=(c=d==null?void 0:d.getFirstChild)==null?void 0:c.call(d))==null||a.selectEnd()}const s=e.registerCommand(r.DELETE_CHARACTER_COMMAND,()=>(s(),!0),r.COMMAND_PRIORITY_NORMAL);return!0},ce=(e,t,n)=>{if(!e)return null;let o=null;return n.read(()=>{const s=r.$getNearestNodeFromDOMNode(e);o=s&&k.$getNearestNodeOfType(s,t)}),o};function ae(e){return e instanceof HTMLElement}function N(e){let t=0;e instanceof WheelEvent?t=e.deltaY:e instanceof TouchEvent&&(t=1);let n=e.target;for(;n&&n!==document.body&&n!==document.documentElement;){if(n.scrollHeight>n.clientHeight&&(t<0&&n.scrollTop>0||t>0&&n.scrollTop+n.clientHeight<n.scrollHeight))return;n=n.parentElement}e.preventDefault()}function A(){document.addEventListener("wheel",N,{passive:!1}),document.addEventListener("touchmove",N,{passive:!1})}function M(){document.removeEventListener("wheel",N),document.removeEventListener("touchmove",N)}function de(e){const t=e.anchor,n=e.focus,o=e.anchor.getNode(),s=e.focus.getNode();return o===s?o:e.isBackward()?O.$isAtNodeEnd(n)?o:s:O.$isAtNodeEnd(t)?o:s}const ue=new Set(["http:","https:","mailto:","sms:","tel:"]);function fe(e){try{const t=new URL(e);if(!ue.has(t.protocol))return"about:blank"}catch{return e}return e}function ge(e,t){const n=e.getRangeAt(0);let o;if(e.anchorNode===t){let s=t;for(;s.firstElementChild!=null;)s=s.firstElementChild;o=s.getBoundingClientRect()}else o=n.getBoundingClientRect();return o}const he=()=>{var n;const e=(n=window.getSelection())==null?void 0:n.toString().trim();return e==null?void 0:e.replace(/\s+/g,"")},pe=10,me=5;function Ce(e,t,n,o=!1,s=pe,l=me){const c=n.parentElement,a=document.querySelector(".ai-editor-menu");if(e===null||!c||a){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)",M();return}const i=t.getBoundingClientRect(),d=c.getBoundingClientRect();let u=e.top-i.height-s;u<0&&(u=10);let h=e.left-l;if(u<d.top&&(u+=i.height+e.height+s*2),h+i.width>d.right&&(h=d.right-i.width-l),e.bottom-e.height>d.bottom){t.style.transform="translate(-1000px, -1000px)";return}if(e.bottom+e.height<d.top){t.style.transform="translate(-1000px, -1000px)";return}let C=u;i.top>=d.bottom&&(C=d.bottom),t.style.transform=`translate(${h}px, ${C}px)`,t.style.opacity="1",A()}const Ee=e=>{const t=r.$getSelection(),n=m(),o=n==null?void 0:n.getParent(),s=o==null?void 0:o.getParent();if(n){if(P())return r.$getRoot().clear(),t.insertParagraph(),!0;if(s instanceof f.CollapsibleContentNode||s instanceof f.CollapsibleTitleNode)return f.handleDeleteCollapsibleCharacter();if(o instanceof g.ExtendCodeNode)return f.handleDeleteCodeCharacter()}return!1},Ne=(e,t)=>{var n,o,s,l,c,a;if(e.dataTransfer){const i=Object.values(e.dataTransfer.files);if(i&&i.length)return e.preventDefault(),e.target instanceof HTMLElement&&((n=t.current)!=null&&n.insertImages)&&((o=r.$getNearestNodeFromDOMNode(e.target))==null||o.selectEnd(),i[0].type.includes("video")&&((s=t.current)!=null&&s.insertVideos)?t.current.insertVideos(i):i[0].type.includes("image")&&((l=t.current)!=null&&l.insertImages)?t.current.insertImages(i):i[0].type.includes("audio")&&((c=t.current)!=null&&c.insertMusics)?t.current.insertMusics(i):(a=t.current)!=null&&a.insertFiles&&(t==null||t.current.insertFiles(i))),!0}return!1},ye=()=>{const e=m(),t=e==null?void 0:e.getParent();return e&&f.$isCollapsibleContentNode(t)?f.$onEscapeDownRightCollapsible():!1},Se=()=>{const e=m(),t=e==null?void 0:e.getParent();return e&&f.$isCollapsibleTitleNode(t)?f.$onEscapeUpLeftCollapsible():!1},_e=e=>{const t=r.$getSelection();if(!r.$isRangeSelection(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();if(n.getPreviousSibling()===null&&t.anchor.offset===0){const o=n.getParent();if(o){const s=r.$createParagraphNode();return s.append(...o.getChildren()),o.replace(s),e.preventDefault(),!0}}return!1};function Oe(e){if(!e)return null;const n=new DOMParser().parseFromString(e,"text/html").body,o=Array.from(n.children);if(o.length!==1)return null;const s=o[0];return s.tagName!=="IMG"||n.textContent&&n.textContent.trim().length>0?null:s.getAttribute("src")||""||null}const Te=(e,t,n)=>{var l,c;const o=m(),s=o==null?void 0:o.getParent();if(o){if(f.$isCollapsibleTitleNode(s))return f.deleteCollapsibleContainer(e);if(g.$isCalloutNode(s))(c=(l=n.current)==null?void 0:l.onDeleteCallout)==null||c.call(l,t);else{if(g.$isLayoutItemNode(s))return f.deleteLayoutItem(e);if(g.$isListItemNode(s))return _e(t)}}return!1},$e=(e,t)=>{const n=t.ctrlKey||t.metaKey,o=t.shiftKey,s=t.code==="KeyZ";return n&&o&&s?(t.preventDefault(),e.dispatchCommand(r.REDO_COMMAND,void 0),!0):!1},Le=(e,t,n,o,s)=>{var a,i;if(s)return o.preventDefault(),o.key==="Enter"&&o.shiftKey&&t.insertParagraph(),!0;const l=m(),c=l==null?void 0:l.getParent();if(l){if(c instanceof g.LayoutItemNode)return f.handleExitLayout(e);if(c instanceof f.CollapsibleContentNode)return f.handleExitCollapsible(e);if(c instanceof g.CalloutNode)return f.handleExitCallout(e);if(c instanceof g.TableCellNode)return f.handleExitTable(e);if(c instanceof g.ListNode||g.LayoutItemNode)return f.handleEnterCheckList()}return(i=(a=n.current)==null?void 0:a.decoratorEnterAction)==null||i.call(a),!1};function Pe(e,t){var n,o,s,l,c,a,i,d;if("dataTransfer"in e&&((o=(n=e.dataTransfer)==null?void 0:n.files)!=null&&o.length)){const u=Array.from(e.dataTransfer.files),h=u[0];return h.type.includes("video")&&((s=t.current)!=null&&s.insertVideos)?t.current.insertVideos(u):h.type.includes("image")&&((l=t.current)!=null&&l.insertImages)?t.current.insertImages(u):h.type.includes("audio")&&((c=t.current)!=null&&c.insertMusics)?t.current.insertMusics(u):(a=t.current)!=null&&a.insertFiles&&t.current.insertFiles(u),!0}if("clipboardData"in e){const u=(d=(i=e.clipboardData)==null?void 0:i.getData("text/html"))==null?void 0:d.trim();if(Oe(u))return!0}return!1}function Ae(e){if(!e||e.classList.contains("video-container")||e.classList.contains("resizable-container")||e.classList.contains("editor-image"))return null;if(e.closest("ol, ul"))return e;let t=e;for(;t&&!t.classList.contains("ContentEditable__root");)t=t.parentElement;if(t!=null&&t.classList.contains("ContentEditable__root")){let n=e;for(;n&&n.parentElement!==t;)n=n.parentElement;return n}return null}function Me(e,t=!1){e.focus(),e.update(()=>{var o,s;const n=r.$getRoot();t?(n.selectStart(),(o=n.getFirstChild())==null||o.selectEnd()):(n.selectEnd(),(s=n.getLastChild())==null||s.selectEnd())})}exports.$copyNodeDeep=Z;exports.$createNewParagraph=te;exports.$getBlockNode=Q;exports.$getClosestParentNode=E;exports.CREATE_TEMPLATE=q;exports.INSERT_CALLOUT_COMMAND=K;exports.KeyBackSpace=Te;exports.ON_CHANGE_COMMAND=R;exports.ON_OPEN_KEBAB_MENU=F;exports.ON_SCROLL_EDITOR=B;exports.ON_SHOW_LINK_POPUP=U;exports.OPEN_EMOJI_PICKER_COMMAND=W;exports.RIGHT_CLICK_COMMAND=z;exports.addNodeAndChildrenToSelection=T;exports.allEditorSelected=P;exports.blockScroll=A;exports.checkIsEmpty=ee;exports.deleteCharacterCommand=Ee;exports.deleteNode=$;exports.docFromHash=le;exports.docToHash=se;exports.dropCommand=Ne;exports.findTopParentElement=Ae;exports.focusEditor=Me;exports.focusOnNode=J;exports.getCurrentElement=m;exports.getDOMRangeRect=ge;exports.getMouseInfo=ne;exports.getNativeSelectedText=he;exports.getNearestBlockNodeOfType=ce;exports.getSelectedNode=de;exports.handleEnterExitContainer=re;exports.isHTMLElement=ae;exports.isMobile=G;exports.isWholeNodeSelected=j;exports.keyArrowRightDown=ye;exports.keyArrowUpLeft=Se;exports.keyDownCommand=$e;exports.keyEnterListener=Le;exports.parseContainerSize=V;exports.pasteCommand=Pe;exports.removeNodeKeepContent=ie;exports.resetSelection=X;exports.sanitizeUrl=fe;exports.selectCurrentNode=Y;exports.setFloatingElemPosition=Ce;exports.stopEvent=I;exports.toggleLockScroll=H;exports.unblockScroll=M;
@@ -0,0 +1,530 @@
1
+ import { $isElementNode as y, createCommand as h, $getRoot as S, $createParagraphNode as b, $getSelection as g, $isRangeSelection as p, $getNearestNodeFromDOMNode as N, $setSelection as M, $getNodeByKey as G, $createRangeSelection as V, $copyNode as O, ElementNode as x, ParagraphNode as W, INSERT_PARAGRAPH_COMMAND as j, COMMAND_PRIORITY_NORMAL as $, $isParagraphNode as J, DELETE_CHARACTER_COMMAND as Y, REDO_COMMAND as q } from "lexical";
2
+ import { p as k, D as I, f as E, aF as Z, a6 as Q, U as H, u as v, Q as A, C as X, aj as tt, n as et } from "./layers.BFJ7oQiY.js";
3
+ import { s as st } from "./layers.C2lacXcg.js";
4
+ import { $getNearestNodeOfType as nt } from "@lexical/utils";
5
+ import { $isAtNodeEnd as D } from "@lexical/selection";
6
+ import "@lexical/code";
7
+ import "@lexical/hashtag";
8
+ import "@lexical/link";
9
+ import "@lexical/mark";
10
+ import "@lexical/overflow";
11
+ import "@lexical/react/LexicalHorizontalRuleNode";
12
+ import "@lexical/rich-text";
13
+ import { G as F, H as ot, _ as lt, a0 as rt, a1 as it, a2 as at, a3 as K, a4 as ct, a5 as ft, a6 as ut, a7 as dt, a8 as gt, a9 as ht, aa as pt, ab as mt } from "./layers.BDsvvINb.js";
14
+ function Ct(t, e) {
15
+ if (e.add(t.getKey()), y(t))
16
+ for (const s of t.getChildren())
17
+ Ct(s, e);
18
+ }
19
+ function Vt(t) {
20
+ t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
21
+ }
22
+ const Wt = h(), jt = h(), Jt = h(), Yt = h(), qt = h(), Zt = h(), Qt = h(), Ht = h(), vt = (() => {
23
+ var e;
24
+ const t = (e = window.navigator) == null ? void 0 : e.userAgentData;
25
+ return t !== void 0 ? t.mobile : window.innerWidth <= 800 && window.innerHeight <= 600;
26
+ })(), Xt = (t) => typeof t == "string" && t.includes("%") ? parseFloat(t) : t;
27
+ function te(t, e) {
28
+ if (!e || !(e instanceof HTMLElement)) {
29
+ console.error("Invalid DOM element provided.");
30
+ return;
31
+ }
32
+ t ? e.classList.add("disable-scroll") : e.classList.remove("disable-scroll");
33
+ }
34
+ function m(t) {
35
+ const e = g();
36
+ if (p(e)) {
37
+ const n = e.anchor.getNode();
38
+ if (n !== null) {
39
+ const o = n.getParent();
40
+ return t ? o : n;
41
+ }
42
+ }
43
+ return null;
44
+ }
45
+ function ee(t) {
46
+ t.update(() => {
47
+ const e = g();
48
+ if (p(e)) {
49
+ const s = e.getNodes();
50
+ let n = null, o = null;
51
+ if (s.forEach((l, i) => {
52
+ i === 0 && (n = l.getParent()), i === s.length - 1 && (o = l.getParent());
53
+ }), n && o) {
54
+ const l = g();
55
+ p(l) && (n.isAttached() && o.isAttached() ? E(n) && E(o) ? l.setTextNodeRange(
56
+ n,
57
+ 0,
58
+ o,
59
+ o.getTextContentSize()
60
+ ) : (l.anchor.set(n.getKey(), 0, "element"), l.focus.set(
61
+ o.getKey(),
62
+ o.getChildrenSize(),
63
+ "element"
64
+ )) : console.error("Error: One of the nodes is not attached."));
65
+ }
66
+ }
67
+ });
68
+ }
69
+ const yt = (t, e) => {
70
+ t.update(() => {
71
+ if (typeof e == "string") {
72
+ const s = G(e);
73
+ s && s.remove();
74
+ return;
75
+ }
76
+ e && e.remove();
77
+ });
78
+ };
79
+ function se(t, e) {
80
+ e.update(() => {
81
+ let s = V();
82
+ t.getParent() && (s.anchor.set(t.getKey(), 0, "element"), s.focus.set(t.getKey(), 0, "element"), M(s));
83
+ });
84
+ }
85
+ function ne() {
86
+ const t = g();
87
+ if (p(t)) {
88
+ const e = t.anchor, s = t.focus, n = s.getNode(), o = k(n) ? n.__size : n.getTextContentSize(), l = e.offset === 0, i = s.offset === o;
89
+ if (l && i)
90
+ return !0;
91
+ }
92
+ return !1;
93
+ }
94
+ function oe(t, e) {
95
+ const s = O(t), n = [[t, s]];
96
+ let o;
97
+ for (; (o = n.length) > 0; )
98
+ for (let l = 0; l < o; l++) {
99
+ const i = n.shift();
100
+ if (i !== void 0) {
101
+ const [a, r] = i;
102
+ if (y(a) && y(r)) {
103
+ const c = a.getChildren();
104
+ for (const f of c) {
105
+ if (e && f.is(e))
106
+ continue;
107
+ const u = O(f);
108
+ E(f) && E(u) && (u.setFormat(f.__format), u.setStyle(f.__style)), r.append(u), n.push([f, u]);
109
+ }
110
+ }
111
+ }
112
+ }
113
+ return s;
114
+ }
115
+ function Et(t, e, s = 3) {
116
+ if (!t) return null;
117
+ let n = t, o = 0;
118
+ for (; n && o < s; ) {
119
+ if (e(n))
120
+ return n;
121
+ if (n.__type === "root")
122
+ break;
123
+ n = n.getParent(), o++;
124
+ }
125
+ return null;
126
+ }
127
+ function L(t, e, s) {
128
+ var o;
129
+ const n = s || { root: !0 };
130
+ if (t) {
131
+ let l = t.getParent();
132
+ if (n[l == null ? void 0 : l.__type]) {
133
+ const i = e.getElementByKey(t.__key), a = Et(l, I);
134
+ if (a && (a.getFirstChild() === t.getTopLevelElement() || a.getFirstChild() === ((o = t.getTopLevelElement()) == null ? void 0 : o.getParent()))) {
135
+ const c = a.getParent(), f = c ? e.getElementByKey(c.__key) : null;
136
+ if (f)
137
+ return {
138
+ htmlElement: f,
139
+ lexicalNode: N(f)
140
+ };
141
+ }
142
+ return { htmlElement: i, lexicalNode: t };
143
+ }
144
+ return L(l, e, n);
145
+ }
146
+ return { htmlElement: null, lexicalNode: null };
147
+ }
148
+ function le(t, e, s, n) {
149
+ var o;
150
+ if (t)
151
+ if ((t == null ? void 0 : t.__type) === "root" || (t == null ? void 0 : t.__type) === "layout-item" || (t == null ? void 0 : t.__type) === "callout-wrapper" || (t == null ? void 0 : t.__type) === "collapsible-content") {
152
+ const l = (n == null ? void 0 : n.clientY) || 0, { left: i } = ((o = e.getElementByKey(t.__key)) == null ? void 0 : o.getBoundingClientRect()) || {
153
+ left: 0
154
+ }, { paddingLeft: a } = window.getComputedStyle(
155
+ n == null ? void 0 : n.target
156
+ ), r = document.elementFromPoint(
157
+ i + parseFloat(a) + 10,
158
+ l
159
+ ), c = N(r || document.body);
160
+ return c ? L(c, e, s) : { htmlElement: null, lexicalNode: null };
161
+ } else
162
+ return L(t, e, s);
163
+ return { htmlElement: null, lexicalNode: null };
164
+ }
165
+ const re = (t) => {
166
+ t.update(() => {
167
+ g() !== null && M(null);
168
+ });
169
+ }, ie = () => {
170
+ const t = S(), e = t == null ? void 0 : t.getFirstChild();
171
+ return t.getChildren().length > 1 ? !1 : e && y(e) && e.isEmpty() && !k(e);
172
+ }, ae = (t) => {
173
+ t.update(() => {
174
+ const e = S(), s = b(), n = g();
175
+ p(n) && (n.format = 0, n.setStyle("")), e.append(s).selectEnd();
176
+ });
177
+ }, ce = (t, e, s) => {
178
+ const n = t.target;
179
+ if (n && (n instanceof HTMLElement || n instanceof SVGElement)) {
180
+ let o = null;
181
+ const l = n.closest(e);
182
+ for (const a of s)
183
+ if (o = n.closest(a), o)
184
+ break;
185
+ return { lexicalDOMNode: l, isOutside: !(l || o) };
186
+ } else
187
+ return { lexicalDOMNode: null, isOutside: !0 };
188
+ };
189
+ async function* B(t) {
190
+ let e = !1;
191
+ for (; !e; ) {
192
+ const s = await t.read(), { value: n } = s;
193
+ n !== void 0 && (yield n), e = s.done;
194
+ }
195
+ }
196
+ async function _t(t) {
197
+ const e = [];
198
+ for await (const n of B(t))
199
+ for (let o = 0; o < n.length; o += 32768)
200
+ e.push(String.fromCharCode(...n.subarray(o, o + 32768)));
201
+ return e.join("");
202
+ }
203
+ async function fe(t) {
204
+ const e = new CompressionStream("gzip"), s = e.writable.getWriter(), [, n] = await Promise.all([
205
+ s.write(new TextEncoder().encode(JSON.stringify(t))).then(() => s.close()),
206
+ _t(e.readable.getReader())
207
+ ]);
208
+ return `#doc=${btoa(n).replace(/\//g, "_").replace(/\+/g, "-").replace(/=+$/, "")}`;
209
+ }
210
+ async function ue(t) {
211
+ const e = /^#doc=(.*)$/.exec(t);
212
+ if (!e)
213
+ return null;
214
+ const s = new DecompressionStream("gzip"), n = s.writable.getWriter(), o = atob(e[1].replace(/_/g, "/").replace(/-/g, "+")), l = new Uint8Array(o.length);
215
+ for (let r = 0; r < o.length; r++)
216
+ l[r] = o.charCodeAt(r);
217
+ const i = n.write(l).then(() => n.close()), a = [];
218
+ for await (const r of B(
219
+ s.readable.pipeThrough(new TextDecoderStream()).getReader()
220
+ ))
221
+ a.push(r);
222
+ return await i, JSON.parse(a.join(""));
223
+ }
224
+ const St = () => !!document.querySelector(".selected-all-document"), de = (t, e, s) => {
225
+ var o, l, i, a, r;
226
+ const n = g();
227
+ if (p(n) && n.isCollapsed()) {
228
+ const c = n.anchor.getNode(), f = c.getKey(), u = c.getParent() === s, C = s instanceof x && (s.__type === "layout-item" ? (l = (o = s.getLastChild()) == null ? void 0 : o.getPreviousSibling()) == null ? void 0 : l.getKey() : (i = s.getLastChild()) == null ? void 0 : i.getKey()) === f, R = s instanceof x && ((a = s.getFirstChild()) == null ? void 0 : a.getKey()) === f;
229
+ if (s && c instanceof W && !c.getTextContent() && u && !((r = c.getPreviousSibling()) != null && r.getTextContent()) && C && !R) {
230
+ const U = t.registerCommand(
231
+ j,
232
+ () => (U(), !0),
233
+ $
234
+ );
235
+ return t.update(() => {
236
+ var P;
237
+ if (s) {
238
+ let d = s.getChildren();
239
+ const z = s.getLastChild();
240
+ Z(z) && (d = d.slice(0, -1)), d.length === 2 ? d.slice(-1).forEach((T) => T.remove()) : d.slice(-2).forEach((T) => T.remove());
241
+ }
242
+ const w = e == null ? void 0 : e.getNextSibling();
243
+ if (J(w) && w.getTextContent() === "")
244
+ (P = e == null ? void 0 : e.getNextSibling()) == null || P.selectEnd();
245
+ else {
246
+ const d = e == null ? void 0 : e.insertAfter(b());
247
+ d == null || d.selectStart();
248
+ }
249
+ }), !0;
250
+ }
251
+ }
252
+ return !1;
253
+ }, ge = (t, e, s) => {
254
+ var l, i, a;
255
+ const n = (s == null ? void 0 : s.getChildren()) || [];
256
+ if ((n == null ? void 0 : n.length) === 2) {
257
+ for (const r of n)
258
+ r.__key !== (e == null ? void 0 : e.__key) && (s == null || s.insertBefore(r), (l = r.getFirstChild()) == null || l.selectEnd());
259
+ s.remove();
260
+ } else
261
+ for (const r of n)
262
+ if (r.__key === (e == null ? void 0 : e.__key)) {
263
+ st(t, r), yt(t, r);
264
+ const c = r.getPreviousSibling() ?? r.getNextSibling();
265
+ (a = (i = c == null ? void 0 : c.getFirstChild) == null ? void 0 : i.call(c)) == null || a.selectEnd();
266
+ }
267
+ const o = t.registerCommand(
268
+ Y,
269
+ () => (o(), !0),
270
+ $
271
+ );
272
+ return !0;
273
+ }, he = (t, e, s) => {
274
+ if (!t) return null;
275
+ let n = null;
276
+ return s.read(() => {
277
+ const o = N(t);
278
+ n = o && nt(o, e);
279
+ }), n;
280
+ };
281
+ function pe(t) {
282
+ return t instanceof HTMLElement;
283
+ }
284
+ function _(t) {
285
+ let e = 0;
286
+ t instanceof WheelEvent ? e = t.deltaY : t instanceof TouchEvent && (e = 1);
287
+ let s = t.target;
288
+ for (; s && s !== document.body && s !== document.documentElement; ) {
289
+ if (s.scrollHeight > s.clientHeight && (e < 0 && s.scrollTop > 0 || e > 0 && s.scrollTop + s.clientHeight < s.scrollHeight))
290
+ return;
291
+ s = s.parentElement;
292
+ }
293
+ t.preventDefault();
294
+ }
295
+ function Nt() {
296
+ document.addEventListener("wheel", _, { passive: !1 }), document.addEventListener("touchmove", _, { passive: !1 });
297
+ }
298
+ function Tt() {
299
+ document.removeEventListener("wheel", _), document.removeEventListener("touchmove", _);
300
+ }
301
+ function me(t) {
302
+ const e = t.anchor, s = t.focus, n = t.anchor.getNode(), o = t.focus.getNode();
303
+ return n === o ? n : t.isBackward() ? D(s) ? n : o : D(e) ? n : o;
304
+ }
305
+ const Lt = /* @__PURE__ */ new Set([
306
+ "http:",
307
+ "https:",
308
+ "mailto:",
309
+ "sms:",
310
+ "tel:"
311
+ ]);
312
+ function Ce(t) {
313
+ try {
314
+ const e = new URL(t);
315
+ if (!Lt.has(e.protocol))
316
+ return "about:blank";
317
+ } catch {
318
+ return t;
319
+ }
320
+ return t;
321
+ }
322
+ function ye(t, e) {
323
+ const s = t.getRangeAt(0);
324
+ let n;
325
+ if (t.anchorNode === e) {
326
+ let o = e;
327
+ for (; o.firstElementChild != null; )
328
+ o = o.firstElementChild;
329
+ n = o.getBoundingClientRect();
330
+ } else
331
+ n = s.getBoundingClientRect();
332
+ return n;
333
+ }
334
+ const Ee = () => {
335
+ var s;
336
+ const t = (s = window.getSelection()) == null ? void 0 : s.toString().trim();
337
+ return t == null ? void 0 : t.replace(/\s+/g, "");
338
+ }, bt = 10, wt = 5;
339
+ function _e(t, e, s, n = !1, o = bt, l = wt) {
340
+ const i = s.parentElement, a = document.querySelector(".ai-editor-menu");
341
+ if (t === null || !i || a) {
342
+ e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)", Tt();
343
+ return;
344
+ }
345
+ const r = e.getBoundingClientRect(), c = i.getBoundingClientRect();
346
+ let f = t.top - r.height - o;
347
+ f < 0 && (f = 10);
348
+ let u = t.left - l;
349
+ if (f < c.top && (f += r.height + t.height + o * 2), u + r.width > c.right && (u = c.right - r.width - l), t.bottom - t.height > c.bottom) {
350
+ e.style.transform = "translate(-1000px, -1000px)";
351
+ return;
352
+ }
353
+ if (t.bottom + t.height < c.top) {
354
+ e.style.transform = "translate(-1000px, -1000px)";
355
+ return;
356
+ }
357
+ let C = f;
358
+ r.top >= c.bottom && (C = c.bottom), e.style.transform = `translate(${u}px, ${C}px)`, e.style.opacity = "1", Nt();
359
+ }
360
+ const Se = (t) => {
361
+ const e = g(), s = m(), n = s == null ? void 0 : s.getParent(), o = n == null ? void 0 : n.getParent();
362
+ if (s) {
363
+ if (St())
364
+ return S().clear(), e.insertParagraph(), !0;
365
+ if (o instanceof F || o instanceof ot)
366
+ return lt();
367
+ if (n instanceof Q)
368
+ return rt();
369
+ }
370
+ return !1;
371
+ }, Ne = (t, e) => {
372
+ var s, n, o, l, i, a;
373
+ if (t.dataTransfer) {
374
+ const r = Object.values(t.dataTransfer.files);
375
+ if (r && r.length)
376
+ return t.preventDefault(), t.target instanceof HTMLElement && ((s = e.current) != null && s.insertImages) && ((n = N(t.target)) == null || n.selectEnd(), r[0].type.includes("video") && ((o = e.current) != null && o.insertVideos) ? e.current.insertVideos(r) : r[0].type.includes("image") && ((l = e.current) != null && l.insertImages) ? e.current.insertImages(r) : r[0].type.includes("audio") && ((i = e.current) != null && i.insertMusics) ? e.current.insertMusics(r) : (a = e.current) != null && a.insertFiles && (e == null || e.current.insertFiles(r))), !0;
377
+ }
378
+ return !1;
379
+ }, Te = () => {
380
+ const t = m(), e = t == null ? void 0 : t.getParent();
381
+ return t && it(e) ? at() : !1;
382
+ }, Le = () => {
383
+ const t = m(), e = t == null ? void 0 : t.getParent();
384
+ return t && K(e) ? ct() : !1;
385
+ }, Pt = (t) => {
386
+ const e = g();
387
+ if (!p(e) || !e.isCollapsed())
388
+ return !1;
389
+ const s = e.anchor.getNode();
390
+ if (s.getPreviousSibling() === null && e.anchor.offset === 0) {
391
+ const n = s.getParent();
392
+ if (n) {
393
+ const o = b();
394
+ return o.append(...n.getChildren()), n.replace(o), t.preventDefault(), !0;
395
+ }
396
+ }
397
+ return !1;
398
+ };
399
+ function Ot(t) {
400
+ if (!t) return null;
401
+ const s = new DOMParser().parseFromString(t, "text/html").body, n = Array.from(s.children);
402
+ if (n.length !== 1) return null;
403
+ const o = n[0];
404
+ return o.tagName !== "IMG" || s.textContent && s.textContent.trim().length > 0 ? null : o.getAttribute("src") || "" || null;
405
+ }
406
+ const be = (t, e, s) => {
407
+ var l, i;
408
+ const n = m(), o = n == null ? void 0 : n.getParent();
409
+ if (n) {
410
+ if (K(o))
411
+ return ft(t);
412
+ if (I(o))
413
+ (i = (l = s.current) == null ? void 0 : l.onDeleteCallout) == null || i.call(l, e);
414
+ else {
415
+ if (H(o))
416
+ return ut(t);
417
+ if (v(o))
418
+ return Pt(e);
419
+ }
420
+ }
421
+ return !1;
422
+ }, we = (t, e) => {
423
+ const s = e.ctrlKey || e.metaKey, n = e.shiftKey, o = e.code === "KeyZ";
424
+ return s && n && o ? (e.preventDefault(), t.dispatchCommand(q, void 0), !0) : !1;
425
+ }, Pe = (t, e, s, n, o) => {
426
+ var a, r;
427
+ if (o)
428
+ return n.preventDefault(), n.key === "Enter" && n.shiftKey && e.insertParagraph(), !0;
429
+ const l = m(), i = l == null ? void 0 : l.getParent();
430
+ if (l) {
431
+ if (i instanceof A)
432
+ return dt(t);
433
+ if (i instanceof F)
434
+ return gt(t);
435
+ if (i instanceof X)
436
+ return ht(t);
437
+ if (i instanceof tt)
438
+ return pt(t);
439
+ if (i instanceof et || A)
440
+ return mt();
441
+ }
442
+ return (r = (a = s.current) == null ? void 0 : a.decoratorEnterAction) == null || r.call(a), !1;
443
+ };
444
+ function Oe(t, e) {
445
+ var s, n, o, l, i, a, r, c;
446
+ if ("dataTransfer" in t && ((n = (s = t.dataTransfer) == null ? void 0 : s.files) != null && n.length)) {
447
+ const f = Array.from(t.dataTransfer.files), u = f[0];
448
+ return u.type.includes("video") && ((o = e.current) != null && o.insertVideos) ? e.current.insertVideos(f) : u.type.includes("image") && ((l = e.current) != null && l.insertImages) ? e.current.insertImages(f) : u.type.includes("audio") && ((i = e.current) != null && i.insertMusics) ? e.current.insertMusics(f) : (a = e.current) != null && a.insertFiles && e.current.insertFiles(f), !0;
449
+ }
450
+ if ("clipboardData" in t) {
451
+ const f = (c = (r = t.clipboardData) == null ? void 0 : r.getData("text/html")) == null ? void 0 : c.trim();
452
+ if (Ot(f))
453
+ return !0;
454
+ }
455
+ return !1;
456
+ }
457
+ function xe(t) {
458
+ if (!t || t.classList.contains("video-container") || t.classList.contains("resizable-container") || t.classList.contains("editor-image"))
459
+ return null;
460
+ if (t.closest("ol, ul"))
461
+ return t;
462
+ let e = t;
463
+ for (; e && !e.classList.contains("ContentEditable__root"); )
464
+ e = e.parentElement;
465
+ if (e != null && e.classList.contains("ContentEditable__root")) {
466
+ let s = t;
467
+ for (; s && s.parentElement !== e; )
468
+ s = s.parentElement;
469
+ return s;
470
+ }
471
+ return null;
472
+ }
473
+ function Ae(t, e = !1) {
474
+ t.focus(), t.update(() => {
475
+ var n, o;
476
+ const s = S();
477
+ e ? (s.selectStart(), (n = s.getFirstChild()) == null || n.selectEnd()) : (s.selectEnd(), (o = s.getLastChild()) == null || o.selectEnd());
478
+ });
479
+ }
480
+ export {
481
+ L as $,
482
+ me as A,
483
+ qt as B,
484
+ ae as C,
485
+ re as D,
486
+ se as E,
487
+ oe as F,
488
+ Nt as G,
489
+ jt as H,
490
+ Jt as I,
491
+ pe as J,
492
+ be as K,
493
+ le as L,
494
+ Tt as M,
495
+ Ee as N,
496
+ Wt as O,
497
+ _e as P,
498
+ ee as Q,
499
+ Qt as R,
500
+ ne as S,
501
+ ye as T,
502
+ Zt as U,
503
+ Ae as V,
504
+ we as a,
505
+ Le as b,
506
+ ie as c,
507
+ Se as d,
508
+ Te as e,
509
+ Ne as f,
510
+ Yt as g,
511
+ xe as h,
512
+ m as i,
513
+ Xt as j,
514
+ Pe as k,
515
+ vt as l,
516
+ ce as m,
517
+ yt as n,
518
+ Ct as o,
519
+ Oe as p,
520
+ ue as q,
521
+ fe as r,
522
+ Vt as s,
523
+ te as t,
524
+ St as u,
525
+ de as v,
526
+ ge as w,
527
+ Ht as x,
528
+ he as y,
529
+ Ce as z
530
+ };