@tickernelz/paperclip-pro-ui 2026.1011.2 → 2026.1012.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/assets/AgentAvatar-B47RVwPt.js +1 -0
  2. package/dist/assets/Agents.production-CaL_roCY.js +2 -0
  3. package/dist/assets/BreadcrumbContext-BRKP7-bF.js +15 -0
  4. package/dist/assets/CompanyActivity.production-B5ko3U6C.js +1 -0
  5. package/dist/assets/{CompanyExport-C2LARvhE.js → CompanyExport-D_8Cdnps.js} +4 -4
  6. package/dist/assets/{CompanySkills.production-o0Fyauh-.js → CompanySkills.production-DKpb4vb9.js} +3 -3
  7. package/dist/assets/EmptyState-iwTwakaR.js +1 -0
  8. package/dist/assets/MarkdownBody-CbLdPc8E.js +16 -0
  9. package/dist/assets/MarkdownEditor-98mZdmRX.js +85 -0
  10. package/dist/assets/OrgChart.production-CpVPwEak.js +1 -0
  11. package/dist/assets/{PageSkeleton-DjZAlHdx.js → PageSkeleton-Dl_gWB8z.js} +1 -1
  12. package/dist/assets/RoutineDetail.production-CmUbfGto.js +1 -0
  13. package/dist/assets/RoutineRunVariablesDialog-DrqOVV5i.js +5 -0
  14. package/dist/assets/Routines.production-C3-E_ij7.js +1 -0
  15. package/dist/assets/StatusIcon-Co-elrfc.js +1 -0
  16. package/dist/assets/ToastContext-CYUmn7f8.js +1 -0
  17. package/dist/assets/agent-avatar-url-B91C7fqh.js +134 -0
  18. package/dist/assets/alert-dialog-CfwPsmAH.js +1 -0
  19. package/dist/assets/arrow-right-DW0tfmbi.js +1 -0
  20. package/dist/assets/badge-B4XIQ7B_.js +1 -0
  21. package/dist/assets/bot-zBrbL-yH.js +1 -0
  22. package/dist/assets/card-79GDCTP3.js +1 -0
  23. package/dist/assets/{check-QbJMKH4B.js → check-x_elx0uL.js} +1 -1
  24. package/dist/assets/checkbox-3gl2Un2H.js +1 -0
  25. package/dist/assets/clipboard-_seTAJiP.js +1 -0
  26. package/dist/assets/{company-members-DQZcrryX.js → company-members-BXmr5rWO.js} +1 -1
  27. package/dist/assets/{definition-6w9rBPo4.js → definition-I91EV37G.js} +1 -1
  28. package/dist/assets/{dist-DZgNtG8a.js → dist-B6TpBrd3.js} +1 -1
  29. package/dist/assets/{dist-xQwUswee.js → dist-BAtkULn4.js} +1 -1
  30. package/dist/assets/{dist-C2jegCUe.js → dist-BEo-uoE2.js} +1 -1
  31. package/dist/assets/{dist-BuzarGBs.js → dist-BPuuaNc6.js} +1 -1
  32. package/dist/assets/{dist-BXoB5t8y.js → dist-BX4PSqp4.js} +1 -1
  33. package/dist/assets/{dist-BRrJTSwu.js → dist-BY93_d3Z.js} +1 -1
  34. package/dist/assets/{dist-DyyIM2uF.js → dist-Bc6S4vv3.js} +1 -1
  35. package/dist/assets/dist-Bgy8AcEI.js +1 -0
  36. package/dist/assets/{dist-DCJXgQu0.js → dist-BhxPxuMy.js} +12 -12
  37. package/dist/assets/{dist-BeN6V24C.js → dist-Bp5Y-deP.js} +1 -1
  38. package/dist/assets/{dist-DpmnjHX9.js → dist-CD47N__7.js} +1 -1
  39. package/dist/assets/{dist-C8CoeHVO.js → dist-CN5Rg9XU.js} +1 -1
  40. package/dist/assets/{dist-oQmcCiSD.js → dist-CcBZFMdg.js} +1 -1
  41. package/dist/assets/{dist-DoBOMP6Y.js → dist-CdFTLNcc.js} +1 -1
  42. package/dist/assets/{dist-CXeuJs-w.js → dist-Cv1Aw0YM.js} +1 -1
  43. package/dist/assets/{dist-CWrRKmYk.js → dist-D4qkWMdz.js} +1 -1
  44. package/dist/assets/dist-D4yyXwCK.js +1 -0
  45. package/dist/assets/{dist-CSbL7rtN.js → dist-D61jI6QA.js} +1 -1
  46. package/dist/assets/{dist-DsLYqWnM.js → dist-DTj_cM7l.js} +1 -1
  47. package/dist/assets/{dist-BX-OCtve.js → dist-DTwCbVsv.js} +1 -1
  48. package/dist/assets/{dist-CBo4NvFW.js → dist-DY5RRJBY.js} +1 -1
  49. package/dist/assets/{dist-DKJ0FdKS.js → dist-DrXWoUSy.js} +1 -1
  50. package/dist/assets/dist-G74v2gk6.js +1 -0
  51. package/dist/assets/{dist-YH7EZ8d1.js → dist-Uvf9OORN.js} +1 -1
  52. package/dist/assets/{dist-Bs8B1orN.js → dist-Wi1mdRva.js} +1 -1
  53. package/dist/assets/{dist-sLIQSVjm.js → dist-ds5P5TFe.js} +1 -1
  54. package/dist/assets/{dist-B0TRtKS8.js → dist-yKrp-Qew.js} +1 -1
  55. package/dist/assets/environments-x0bu3agB.js +1 -0
  56. package/dist/assets/external-link-DZQH1MR8.js +1 -0
  57. package/dist/assets/{file-text-enWNyTOr.js → file-text-DnkFEoqC.js} +1 -1
  58. package/dist/assets/{health-DBBZn_mP.js → health-DIsZUg4d.js} +1 -1
  59. package/dist/assets/{heartbeats-C7hzaXUK.js → heartbeats-hynzhqu3.js} +1 -1
  60. package/dist/assets/index-B2A-dAWv.css +1 -0
  61. package/dist/assets/{index-DRvRAzwu.js → index-SsNrNOjw.js} +204 -312
  62. package/dist/assets/{input-CaBijGbz.js → input-DW5WzZI0.js} +1 -1
  63. package/dist/assets/label-BnuPQCxV.js +5 -0
  64. package/dist/assets/{mention-chips-DymVknlf.js → mention-chips-DtMro9HO.js} +2 -2
  65. package/dist/assets/{rotate-ccw-Bm2GI2Za.js → rotate-ccw-wat5PoA5.js} +1 -1
  66. package/dist/assets/select-CtJdi3BB.js +1 -0
  67. package/dist/assets/sheet-5L45GZhN.js +1 -0
  68. package/dist/assets/skeleton-Cea_xEjg.js +1 -0
  69. package/dist/assets/tabs-CVzr4EnB.js +1 -0
  70. package/dist/assets/use-adapter-capabilities-BzuoLi4n.js +1 -0
  71. package/dist/assets/use-copy-action-D1yLO8Yp.js +1 -0
  72. package/dist/assets/useHiddenSettings-DuLvvhZD.js +1 -0
  73. package/dist/brands/adapters/openai-dot.README.md +7 -0
  74. package/dist/brands/adapters/openai-dot.svg +3 -0
  75. package/dist/brands/apps/bedrock.svg +1 -0
  76. package/dist/brands/apps/calendly.png +0 -0
  77. package/dist/brands/apps/clickup.png +0 -0
  78. package/dist/brands/apps/enterpret.png +0 -0
  79. package/dist/brands/apps/exa.svg +5 -0
  80. package/dist/brands/apps/firecrawl.svg +12 -0
  81. package/dist/brands/apps/gauge.png +0 -0
  82. package/dist/brands/apps/google.svg +1 -0
  83. package/dist/brands/apps/gsc-wizard.png +0 -0
  84. package/dist/brands/apps/klaviyo.png +0 -0
  85. package/dist/brands/apps/manifest.json +126 -3
  86. package/dist/brands/apps/monday-dark.png +0 -0
  87. package/dist/brands/apps/monday.png +0 -0
  88. package/dist/brands/apps/parallel-dark.svg +11 -0
  89. package/dist/brands/apps/parallel.svg +11 -0
  90. package/dist/brands/apps/superagent.png +0 -0
  91. package/dist/brands/apps/tavily.png +0 -0
  92. package/dist/brands/apps/telem-dark.svg +9 -0
  93. package/dist/brands/apps/telem.svg +9 -0
  94. package/dist/brands/apps/windsor-ai.png +0 -0
  95. package/dist/index.html +41 -47
  96. package/dist/sw.js +1 -1
  97. package/package.json +1 -1
  98. package/dist/assets/AgentAvatar-BlBIRCn-.js +0 -1
  99. package/dist/assets/AgentIdentity-DGZ1IWcm.js +0 -1
  100. package/dist/assets/Agents.production-BLkE-0NE.js +0 -2
  101. package/dist/assets/CompanyActivity.production-CTian23Q.js +0 -1
  102. package/dist/assets/Costs.production-BC1KZiFm.js +0 -1
  103. package/dist/assets/EmptyState-B3GzFGA2.js +0 -1
  104. package/dist/assets/MarkdownBody-Czv0XlBT.js +0 -16
  105. package/dist/assets/MarkdownEditor-Cli5vQ9A.js +0 -85
  106. package/dist/assets/OrgChart.production-32WvU7ZC.js +0 -1
  107. package/dist/assets/RoutineDetail.production-DixgPerZ.js +0 -1
  108. package/dist/assets/RoutineRunVariablesDialog-CX_crJ2M.js +0 -5
  109. package/dist/assets/Routines.production-DqVaTpH6.js +0 -1
  110. package/dist/assets/SidebarContext-BafyN2te.js +0 -1
  111. package/dist/assets/StatusIcon-DAfZZt5s.js +0 -1
  112. package/dist/assets/agent-avatar-url-CrFre_o0.js +0 -92
  113. package/dist/assets/agents-CXRgDTPe.js +0 -1
  114. package/dist/assets/badge-DgXn7-fn.js +0 -1
  115. package/dist/assets/bot-XZ1yN3-I.js +0 -1
  116. package/dist/assets/boxes-D23QBcG5.js +0 -41
  117. package/dist/assets/button-qNr9PNnV.js +0 -1
  118. package/dist/assets/card-C7YSXtUE.js +0 -1
  119. package/dist/assets/checkbox-DgUtspFU.js +0 -1
  120. package/dist/assets/chevron-down-WiCDFzOc.js +0 -1
  121. package/dist/assets/chevron-right-CrTYgpoD.js +0 -1
  122. package/dist/assets/clipboard-CCSd74n9.js +0 -1
  123. package/dist/assets/dist-CxnAC5ut.js +0 -1
  124. package/dist/assets/dist-DwdZYoi9.js +0 -1
  125. package/dist/assets/environments-BMUrSRs5.js +0 -1
  126. package/dist/assets/external-link-CXBsDJFH.js +0 -1
  127. package/dist/assets/index-Bf6jMBkl.css +0 -1
  128. package/dist/assets/label-BOZRq-vu.js +0 -5
  129. package/dist/assets/loader-circle-BvNlkozx.js +0 -1
  130. package/dist/assets/octagon-alert-BDrG2ej6.js +0 -1
  131. package/dist/assets/router-DsEp3y3a.js +0 -15
  132. package/dist/assets/save-hiSIvhFZ.js +0 -1
  133. package/dist/assets/select-BGs-t22m.js +0 -1
  134. package/dist/assets/sheet-o78ZsqWt.js +0 -1
  135. package/dist/assets/skeleton-wNNcfiP_.js +0 -1
  136. package/dist/assets/tabs-CcJa_lIi.js +0 -1
  137. package/dist/assets/triangle-alert-CvrMHubr.js +0 -1
  138. package/dist/assets/use-adapter-capabilities-Dgs0vc7z.js +0 -1
  139. package/dist/assets/useHiddenSettings-BjfNzv3C.js +0 -1
@@ -0,0 +1,85 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BEo-uoE2.js","assets/dist-BhxPxuMy.js","assets/dist-BX4PSqp4.js","assets/dist-Wi1mdRva.js","assets/dist-DTj_cM7l.js","assets/dist-D4qkWMdz.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/dist-DTwCbVsv.js","assets/dist-Bp5Y-deP.js","assets/dist-ds5P5TFe.js","assets/dist-BAtkULn4.js","assets/dist-DrXWoUSy.js","assets/dist-Uvf9OORN.js","assets/dist-CcBZFMdg.js","assets/dist-D61jI6QA.js","assets/dist-CN5Rg9XU.js","assets/dist-DY5RRJBY.js","assets/dist-Bc6S4vv3.js","assets/dist-CD47N__7.js","assets/dist-yKrp-Qew.js","assets/dist-CdFTLNcc.js","assets/dist-Cv1Aw0YM.js","assets/dist-B6TpBrd3.js","assets/dockerfile-BttNdtK0.js","assets/simple-mode-B79cVo-x.js","assets/factor-CM3-9V3b.js","assets/nsis-KFC6hioG.js","assets/pug-C20tNwmy.js","assets/javascript-Cblpdx44.js","assets/dist-BPuuaNc6.js","assets/dist-BY93_d3Z.js"])))=>i.map(i=>d[i]);
2
+ var hk=Object.defineProperty;var s=(e,t)=>hk(e,"name",{value:t,configurable:!0});import{i as da,n as xx,t as ws}from"./rolldown-runtime-ZpX3ckPj.js";import{A as gk,G as Yi,Hi as Ce,Ia as pk,La as mk,M as hs,O as Wg,Ra as _k,St as Z1,a as vk,c as zg,ht as yk,i as jg,j as Cx,l as Jg,n as Gu,na as Y1,o as bx,r as xk,s as Ex,t as Ck,y as X1}from"./agent-avatar-url-B91C7fqh.js";import{t as V}from"./preload-helper-CceJXRIF.js";import{A as rr,B as bk,D as Gg,E as Ek,G as Tr,I as Q1,K as Xi,L as Sk,M as Ka,N as e0,O as js,P as Ye,Q as Tk,R as wk,T as t0,V as n0,X as jd,Y as yi,Z as kk,b as Mk,c as Ak,d as Ik,et as Nk,f as Ok,i as qg,it as Dk,j as an,l as Rk,m as Lk,n as $k,nt as Sx,p as Pk,q as Pc,rt as Fk,t as Ua,tt as Vk,u as Bk,v as Hk,w as Jf,y as Kk,z as Uk}from"./mention-chips-DtMro9HO.js";import{i as Tx,n as wx,r as qu,t as kx}from"./dist-Bgy8AcEI.js";import{a as Mx,c as Wk,d as zk,f as jk,i as Ax,l as Jk,n as Ix,o as Nx,p as Gk,r as Ox,s as qk,t as Zk}from"./dist-G74v2gk6.js";import{t as Yk}from"./AgentAvatar-B47RVwPt.js";import{a as Xk,f as Qk,h as e9,i as t9,l as n9,m as r9,n as i9,p as o9,s as s9,t as l9}from"./dist-D4yyXwCK.js";import{$ as a9,A as Dx,B as c9,Ct as Zu,E as Rx,F as Dt,G as u9,H as d9,I as Lx,J as f9,K as h9,L as ct,O as Zo,Ot as Gf,P as _e,Q as g9,R as Zg,S as $x,St as fa,T as Il,Tt as Yg,U as Xg,V as p9,W as Px,X as Fx,Y as Qg,Z as qf,_t as ha,a as P,at as Vx,bt as Fn,c as m9,ct as Te,dt as _9,et as v9,f as y9,ft as ep,g as x9,gt as nn,ht as C9,it as Yu,j as ks,l as b9,lt as Fc,mt as Bx,n as Hx,nt as E9,o as S9,ot as Kx,pt as T9,q as w9,rt as Ct,st as cn,t as k9,tt as Ux,ut as Io,v as M9,vt as Wx,w as A9,wt as vo,x as Vc,xt as Jr,yt as Jd,z as I9}from"./dist-BhxPxuMy.js";var Bc=da(mk(),1),m=da(_k(),1),ee=da(pk(),1),N9=Object.defineProperty,zx=s((e,t)=>N9(e,"name",{value:t,configurable:!0}),"__name$3"),r0="horizontal",O9=["horizontal","vertical"],D9=m.forwardRef(zx(s(function(t,n){const{decorative:r,orientation:i=r0,...o}=t,l=jx(i)?i:r0,a=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return(0,ee.jsx)(hs.div,{"data-orientation":l,...a,...o,ref:n})},"Separator2"),"Separator"));function jx(e){return O9.includes(e)}s(jx,"isValidOrientation");zx(jx,"isValidOrientation");var R9=D9,L9=Object.defineProperty,$9=s((e,t)=>L9(e,"name",{value:t,configurable:!0}),"__name$2"),P9="Toggle",F9=m.forwardRef($9(s(function(t,n){const{pressed:r,defaultPressed:i,onPressedChange:o,...l}=t,[a,c]=Wg({prop:r,onChange:o,defaultProp:i??!1,caller:P9});return(0,ee.jsx)(hs.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...l,ref:n,onClick:gk(t.onClick,()=>{t.disabled||c(!a)})})},"Toggle2"),"Toggle")),V9=Object.defineProperty,Li=s((e,t)=>V9(e,"name",{value:t,configurable:!0}),"__name$1"),Ms="ToggleGroup",[Jx,Gx]=Cx(Ms,[qu]),qx=qu(),B9=m.forwardRef(Li(s(function(t,n){const{type:r,...i}=t;if(r==="single")return(0,ee.jsx)(H9,{role:"radiogroup",...i,ref:n});if(r==="multiple")return(0,ee.jsx)(K9,{role:"toolbar",...i,ref:n});throw new Error(`Missing prop \`type\` expected on \`${Ms}\``)},"ToggleGroup2"),"ToggleGroup")),[Zx,Yx]=Jx(Ms),H9=m.forwardRef(Li(s(function(t,n){const{value:r,defaultValue:i,onValueChange:o=Li(()=>{},"onValueChange"),...l}=t,[a,c]=Wg({prop:r,defaultProp:i??"",onChange:o,caller:Ms});return(0,ee.jsx)(Zx,{scope:t.__scopeToggleGroup,type:"single",value:m.useMemo(()=>a?[a]:[],[a]),onItemActivate:c,onItemDeactivate:m.useCallback(()=>c(""),[c]),children:(0,ee.jsx)(Xx,{...l,ref:n})})},"ToggleGroupImplSingle2"),"ToggleGroupImplSingle")),K9=m.forwardRef(Li(s(function(t,n){const{value:r,defaultValue:i,onValueChange:o=Li(()=>{},"onValueChange"),...l}=t,[a,c]=Wg({prop:r,defaultProp:i??[],onChange:o,caller:Ms}),u=m.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=m.useCallback(f=>c((h=[])=>h.filter(g=>g!==f)),[c]);return(0,ee.jsx)(Zx,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:u,onItemDeactivate:d,children:(0,ee.jsx)(Xx,{...l,ref:n})})},"ToggleGroupImplMultiple2"),"ToggleGroupImplMultiple")),[U9,W9]=Jx(Ms),Xx=m.forwardRef(Li(s(function(t,n){const{__scopeToggleGroup:r,disabled:i=!1,rovingFocus:o=!0,orientation:l,dir:a,loop:c=!0,...u}=t,d=qx(r),f=Tx(a),h={dir:f,...u};return(0,ee.jsx)(U9,{scope:r,rovingFocus:o,disabled:i,children:o?(0,ee.jsx)(wx,{asChild:!0,...d,orientation:l,dir:f,loop:c,children:(0,ee.jsx)(hs.div,{...h,ref:n})}):(0,ee.jsx)(hs.div,{...h,ref:n})})},"ToggleGroupImpl2"),"ToggleGroupImpl")),Zf="ToggleGroupItem",z9=m.forwardRef(Li(s(function(t,n){const r=Yx(Zf,t.__scopeToggleGroup),i=W9(Zf,t.__scopeToggleGroup),o=qx(t.__scopeToggleGroup),l=r.value.includes(t.value),a=i.disabled||t.disabled,c={...t,pressed:l,disabled:a},u=m.useRef(null);return i.rovingFocus?(0,ee.jsx)(kx,{asChild:!0,...o,focusable:!a,active:l,ref:u,children:(0,ee.jsx)(i0,{...c,ref:n})}):(0,ee.jsx)(i0,{...c,ref:n})},"ToggleGroupItem2"),"ToggleGroupItem")),i0=m.forwardRef(Li(s(function(t,n){const{__scopeToggleGroup:r,value:i,...o}=t,l=Yx(Zf,r),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=l.type==="single"?a:void 0;return(0,ee.jsx)(F9,{...c,...o,ref:n,onPressedChange:s(u=>{u?l.onItemActivate(i):l.onItemDeactivate(i)},"onPressedChange")})},"ToggleGroupItemImpl2"),"ToggleGroupItemImpl")),j9=Object.defineProperty,ga=s((e,t)=>j9(e,"name",{value:t,configurable:!0}),"__name"),Qx="Toolbar",[J9,SU]=Cx(Qx,[qu,Gx]),eC=qu(),tC=Gx(),[G9,nC]=J9(Qx),q9=m.forwardRef(ga(s(function(t,n){const{__scopeToolbar:r,orientation:i="horizontal",dir:o,loop:l=!0,...a}=t,c=eC(r),u=Tx(o);return(0,ee.jsx)(G9,{scope:r,orientation:i,dir:u,children:(0,ee.jsx)(wx,{asChild:!0,...c,orientation:i,dir:u,loop:l,children:(0,ee.jsx)(hs.div,{role:"toolbar","aria-orientation":i,dir:u,...a,ref:n})})})},"Toolbar2"),"Toolbar")),Z9="ToolbarSeparator",Y9=m.forwardRef(ga(s(function(t,n){const{__scopeToolbar:r,...i}=t,o=nC(Z9,r);return(0,ee.jsx)(R9,{orientation:o.orientation==="horizontal"?"vertical":"horizontal",...i,ref:n})},"ToolbarSeparator2"),"ToolbarSeparator")),rC=m.forwardRef(ga(s(function(t,n){const{__scopeToolbar:r,...i}=t,o=eC(r);return(0,ee.jsx)(kx,{asChild:!0,...o,focusable:!t.disabled,children:(0,ee.jsx)(hs.button,{type:"button",...i,ref:n})})},"ToolbarButton2"),"ToolbarButton")),X9="ToolbarToggleGroup",Q9=m.forwardRef(ga(s(function(t,n){const{__scopeToolbar:r,...i}=t,o=nC(X9,r),l=tC(r);return(0,ee.jsx)(B9,{"data-orientation":o.orientation,dir:o.dir,...l,...i,ref:n,rovingFocus:!1})},"ToolbarToggleGroup2"),"ToolbarToggleGroup")),eM=m.forwardRef(ga(s(function(t,n){const{__scopeToolbar:r,...i}=t,o=tC(r),l={__scopeToolbar:t.__scopeToolbar};return(0,ee.jsx)(rC,{asChild:!0,...l,children:(0,ee.jsx)(z9,{...o,...i,ref:n})})},"ToolbarToggleItem2"),"ToolbarToggleItem")),iC=q9,tM=Y9,os=rC,nM=Q9,Gd=eM,oC={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};oC.node;var rM=Gu(oC),sC={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};sC.node;var iM=Gu(sC),lC={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};lC.node;var oM=Gu(lC),aC={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};aC.node;var sM=Gu(aC),qd={list:s((e,t,n)=>{const r=new URLSearchParams;t?.entityType&&r.set("entityType",t.entityType),t?.entityId&&r.set("entityId",t.entityId),t?.agentId&&r.set("agentId",t.agentId),t?.limit&&r.set("limit",String(t.limit));const i=r.toString();return Ce.get(`/companies/${e}/activity${i?`?${i}`:""}`,n)},"list"),forIssue:s(e=>Ce.get(`/issues/${e}/activity`),"forIssue"),runsForIssue:s(e=>Ce.get(`/issues/${e}/runs`),"runsForIssue"),issuesForRun:s(e=>Ce.get(`/heartbeat-runs/${e}/issues`),"issuesForRun")},lM={list:s((e,t)=>{const n=new URLSearchParams;t?.projectId&&n.set("projectId",t.projectId);const r=n.toString();return Ce.get(`/companies/${e}/routines${r?`?${r}`:""}`)},"list"),create:s((e,t)=>Ce.post(`/companies/${e}/routines`,t),"create"),get:s(e=>Ce.get(`/routines/${e}`),"get"),update:s((e,t)=>Ce.patch(`/routines/${e}`,t),"update"),listRevisions:s(e=>Ce.get(`/routines/${e}/revisions`),"listRevisions"),restoreRevision:s((e,t,n={})=>Ce.post(`/routines/${e}/revisions/${t}/restore`,n),"restoreRevision"),listRuns:s((e,t=50)=>Ce.get(`/routines/${e}/runs?limit=${t}`),"listRuns"),createTrigger:s((e,t)=>Ce.post(`/routines/${e}/triggers`,t),"createTrigger"),updateTrigger:s((e,t)=>Ce.patch(`/routine-triggers/${e}`,t),"updateTrigger"),deleteTrigger:s(e=>Ce.delete(`/routine-triggers/${e}`),"deleteTrigger"),rotateTriggerSecret:s(e=>Ce.post(`/routine-triggers/${e}/rotate-secret`,{}),"rotateTriggerSecret"),run:s((e,t)=>Ce.post(`/routines/${e}/run`,t??{}),"run"),activity:s(async(e,t,n)=>{const r=[qd.list(e,{entityType:"routine",entityId:t}),...(n?.triggerIds??[]).map(o=>qd.list(e,{entityType:"routine_trigger",entityId:o})),...(n?.runIds??[]).map(o=>qd.list(e,{entityType:"routine_run",entityId:o}))],i=(await Promise.all(r)).flat();return[...new Map(i.map(o=>[o.id,o])).values()].sort((o,l)=>new Date(l.createdAt).getTime()-new Date(o.createdAt).getTime())},"activity")},aM=Object.defineProperty,cM=s((e,t,n)=>t in e?aM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"P$1"),zr=s((e,t,n)=>cM(e,typeof t!="symbol"?t+"":t,n),"p$6"),uM=class cC{static{s(this,"S$1")}constructor(t=new Map){this.map=t}clone(){return new cC(new Map(this.map))}increment(t){const n=this.map.get(t)??0;this.map.set(t,n+1)}decrement(t,n){let r=this.map.get(t);r!==void 0&&(r-=1,this.map.set(t,r),r===0&&n())}},Wa=class{static{s(this,"k$1")}constructor(){zr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function ss(e,t){return t(e),e}s(ss,"d$4");function tp(){}s(tp,"x$6");var uC="cell";function o0(e,t){return e===t}s(o0,"O$3");var Xu=new Map,Zd,dM=class{static{s(this,"T$1")}constructor(e={}){zr(this,"subscriptions",new Wa),zr(this,"singletonSubscriptions",new Map),zr(this,"graph",new Wa),zr(this,"state",new Map),zr(this,"distinctNodes",new Map),zr(this,"executionMaps",new Map),zr(this,"definitionRegistry",new Set),zr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?o0:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?o0:e),t}sub(e,t){this.register(e);const n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const n=this.signalInstance();return this.connect({map:s(r=>(...i)=>{r(i)},"map"),sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;const n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),o=r.participatingNodes.slice(),l=new Map(this.state),a=s(c=>{this.graph.use(c,u=>{for(const{sources:d,sink:f}of u)d.has(c)&&i.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})},"l");for(;;){const c=o.shift();if(c===void 0)break;const u=c;let d=!1;const f=s(h=>{const g=this.distinctNodes.get(u);if(g!=null&&g(l.get(u),h)){d=!1;return}d=!0,l.set(u,h),this.state.has(u)&&this.state.set(u,h)},"y");if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):r.projections.use(u,h=>{for(const g of h){const p=[...Array.from(g.sources),...Array.from(g.pulls)].map(_=>l.get(_));g.map(f)(...p)}}),d){const h=l.get(u);this.inContext(()=>{this.subscriptions.use(u,g=>{for(const p of g)p(h)})}),(t=this.singletonSubscriptions.get(u))==null||t(h)}else a(u)}}connect({sources:e,pulls:t=[],map:n,sink:r}){const i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>ss(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:s(n=>r=>{n(r)},"map"),sink:t,sources:[e]})}combine(...e){return ss(this.signalInstance(),t=>{this.connect({map:s(n=>(...r)=>{n(r)},"map"),sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(r=>e.length===r.sources.length&&e.every((i,o)=>i===r.sources[o]));if(t)return t.cell;const n=this.cellInstance(e.map(r=>this.getValue(r)),!0);return this.connect({map:s(r=>(...i)=>{r(i)},"map"),sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Xu.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),ss(t.type===uC?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),n=>{this.inContext(()=>{t.init(this,n)})}))}inContext(e){const t=Zd;Zd=this;const n=e();return Zd=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:s(r=>(i,o)=>{r(n(o,i))},"map")})}calculateExecutionMap(e){const t=[],n=new Set,r=new Wa,i=new uM,o=new Wa,l=s((a,c=0)=>{i.increment(a),!n.has(a)&&(this.register(a),r.use(a,u=>{c=Math.max(...Array.from(u).map(d=>t.indexOf(d)))+1}),this.graph.use(a,u=>{for(const d of u)d.sources.has(a)?(o.getOrCreate(d.sink).add(d),l(d.sink,c)):r.getOrCreate(d.sink).add(a)}),n.add(a),t.splice(c,0,a))},"l");return e.forEach(l),{participatingNodes:t,pendingPulls:r,projections:o,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const r=this.executionMaps.get(t);if(r!==void 0)return r}else for(const[r,i]of this.executionMaps.entries())if(Array.isArray(r)&&r.length===e.length&&r.every(o=>e.includes(o)))return i;const n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(const n of e)t=n(t,this);return t}}};function he(e,t=tp,n=!0){return ss(Symbol(),r=>{Xu.set(r,{type:uC,distinct:n,initial:e,init:t})})}s(he,"$$2");function wt(e=tp,t=!1){return ss(Symbol(),n=>{Xu.set(n,{type:"signal",distinct:t,init:e})})}s(wt,"K$1");function Ji(e=tp){return ss(Symbol(),t=>{Xu.set(t,{type:"signal",distinct:!1,init:e})})}s(Ji,"q$3");var dC=m.createContext(null);function Qu(){const e=m.useContext(dC);if(e===null)throw new Error("useRealm must be used within a RealmContextProvider");return e}s(Qu,"R$2");function ni(e){const t=Qu();t.register(e);const n=m.useCallback(r=>t.sub(e,r),[t,e]);return m.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}s(ni,"E$3");function vr(...e){const t=Qu();return ni(m.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}s(vr,"X$4");function Mn(e){const t=Qu();return t.register(e),m.useCallback(n=>{t.pub(e,n)},[t,e])}s(Mn,"A$1");function $i(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:s(i=>o=>{i(e(o))},"map"),sink:r,sources:[t]}),r}}s($i,"_$2");function mt(...e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:s(i=>(...o)=>{i(o)},"map"),pulls:e,sink:r,sources:[t]}),r}}s(mt,"tt$2");function fC(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:s(i=>()=>{i(e)},"map"),sink:r,sources:[t]}),r}}s(fC,"et$3");function ed(e){return(t,n)=>{const r=n.signalInstance();return n.connect({map:s(i=>o=>{e(o)&&i(o)},"map"),sink:r,sources:[t]}),r}}s(ed,"nt$5");function hC(e,t){return(n,r)=>{const i=r.signalInstance();return r.connect({map:s(o=>l=>{o(t=e(t,l))},"map"),sink:i,sources:[n]}),i}}s(hC,"it$4");var Hc=new WeakMap;function s0(e,t){let n=Hc.get(e);return n||(n=new Set,Hc.set(e,n)),n.add(t),()=>{n.delete(t)}}s(s0,"registerRealmCleanup");function l0(e){const t=Hc.get(e);if(Hc.delete(e),!t)return;let n=!1,r;for(const i of[...t].reverse())try{i()}catch(o){n||(n=!0,r=o)}if(n)throw r instanceof Error?r:new Error("Realm cleanup failed with a non-Error value")}s(l0,"disposeRealmSession");function En(e){return function(t){return{init:s(n=>{var r;return(r=e.init)==null?void 0:r.call(e,n,t)},"init"),postInit:s(n=>{var r;return(r=e.postInit)==null?void 0:r.call(e,n,t)},"postInit"),update:s(n=>{var r;return(r=e.update)==null?void 0:r.call(e,n,t)},"update")}}}s(En,"realmPlugin");function fM({children:e,plugins:t}){const[n,r]=m.useState(null);return m.useEffect(()=>{var i,o;const l=new dM;try{for(const a of t)(i=a.init)==null||i.call(a,l);for(const a of t)(o=a.postInit)==null||o.call(a,l)}catch(a){try{l0(l)}catch(c){throw new AggregateError([a,c],"Realm plugin initialization and cleanup both failed")}throw a}return r(l),()=>{l0(l)}},[]),m.useEffect(()=>{var i;if(n)for(const o of t)(i=o.update)==null||i.call(o,n)}),n?m.createElement(dC.Provider,{value:n},e):null}s(fM,"RealmWithPlugins");var hM=xx({$addUpdateTag:s(()=>Eo,"$addUpdateTag"),$applyNodeReplacement:s(()=>ba,"$applyNodeReplacement"),$assumeActiveEditor:s(()=>O8,"$assumeActiveEditor"),$caretFromPoint:s(()=>ei,"$caretFromPoint"),$caretRangeFromSelection:s(()=>wh,"$caretRangeFromSelection"),$cloneWithProperties:s(()=>Kp,"$cloneWithProperties"),$cloneWithPropertiesEphemeral:s(()=>lA,"$cloneWithPropertiesEphemeral"),$comparePointCaretNext:s(()=>Gp,"$comparePointCaretNext"),$copyNode:s(()=>Fp,"$copyNode"),$create:s(()=>cA,"$create"),$createChildrenArray:s(()=>zl,"$createChildrenArray"),$createLineBreakNode:s(()=>ya,"$createLineBreakNode"),$createNodeSelection:s(()=>Yc,"$createNodeSelection"),$createParagraphNode:s(()=>mn,"$createParagraphNode"),$createPoint:s(()=>gr,"$createPoint"),$createRangeSelection:s(()=>O5,"$createRangeSelection"),$createRangeSelectionFromDom:s(()=>M8,"$createRangeSelectionFromDom"),$createTabNode:s(()=>bp,"$createTabNode"),$createTextNode:s(()=>Ft,"$createTextNode"),$extendCaretToRange:s(()=>jp,"$extendCaretToRange"),$findMatchingParent:s(()=>bi,"$findMatchingParent"),$formatText:s(()=>b5,"$formatText"),$fullReconcile:s(()=>$5,"$fullReconcile"),$generateNodesFromRawText:s(()=>Ep,"$generateNodesFromRawText"),$getAdjacentChildCaret:s(()=>_s,"$getAdjacentChildCaret"),$getAdjacentNode:s(()=>l2,"$getAdjacentNode"),$getAdjacentSiblingOrParentSiblingCaret:s(()=>CA,"$getAdjacentSiblingOrParentSiblingCaret"),$getCaretInDirection:s(()=>Nr,"$getCaretInDirection"),$getCaretRange:s(()=>Ki,"$getCaretRange"),$getCaretRangeInDirection:s(()=>Zp,"$getCaretRangeInDirection"),$getCharacterOffsets:s(()=>ph,"$getCharacterOffsets"),$getChildCaret:s(()=>oi,"$getChildCaret"),$getChildCaretAtIndex:s(()=>W2,"$getChildCaretAtIndex"),$getChildCaretOrSelf:s(()=>P2,"$getChildCaretOrSelf"),$getCollapsedCaretRange:s(()=>B2,"$getCollapsedCaretRange"),$getCommonAncestor:s(()=>au,"$getCommonAncestor"),$getCommonAncestorResultBranchOrder:s(()=>qp,"$getCommonAncestorResultBranchOrder"),$getDOMSlot:s(()=>Rn,"$getDOMSlot"),$getDOMTextNode:s(()=>Qr,"$getDOMTextNode"),$getDocument:s(()=>vn,"$getDocument"),$getEditor:s(()=>xr,"$getEditor"),$getEditorDOMRenderConfig:s(()=>Hp,"$getEditorDOMRenderConfig"),$getNearestNodeFromDOMNode:s(()=>Ip,"$getNearestNodeFromDOMNode"),$getNearestRootOrShadowRoot:s(()=>$p,"$getNearestRootOrShadowRoot"),$getNodeByKey:s(()=>nt,"$getNodeByKey"),$getNodeByKeyOrThrow:s(()=>d2,"$getNodeByKeyOrThrow"),$getNodeFromDOMNode:s(()=>Ap,"$getNodeFromDOMNode"),$getPreviousSelection:s(()=>No,"$getPreviousSelection"),$getRoot:s(()=>Dn,"$getRoot"),$getSelection:s(()=>Ve,"$getSelection"),$getSiblingCaret:s(()=>_t,"$getSiblingCaret"),$getSlot:s(()=>Vi,"$getSlot"),$getSlotFrame:s(()=>N2,"$getSlotFrame"),$getSlotHost:s(()=>Kn,"$getSlotHost"),$getSlotNameWithinHost:s(()=>I2,"$getSlotNameWithinHost"),$getSlotNames:s(()=>Jn,"$getSlotNames"),$getState:s(()=>Wc,"$getState"),$getStateChange:s(()=>FM,"$getStateChange"),$getTextContent:s(()=>I8,"$getTextContent"),$getTextNodeOffset:s(()=>hr,"$getTextNodeOffset"),$getTextPointCaret:s(()=>Hi,"$getTextPointCaret"),$getTextPointCaretSlice:s(()=>Th,"$getTextPointCaretSlice"),$getWritableNodeState:s(()=>sp,"$getWritableNodeState"),$hasAncestor:s(()=>Ul,"$hasAncestor"),$hasUpdateTag:s(()=>q8,"$hasUpdateTag"),$insertNodeToNearestRootAtCaret:s(()=>j2,"$insertNodeToNearestRootAtCaret"),$insertNodes:s(()=>A8,"$insertNodes"),$isBlockElementNode:s(()=>I5,"$isBlockElementNode"),$isChildCaret:s(()=>Gn,"$isChildCaret"),$isDecoratorNode:s(()=>We,"$isDecoratorNode"),$isEditorState:s(()=>L8,"$isEditorState"),$isElementDOMSlot:s(()=>b2,"$isElementDOMSlot"),$isElementNode:s(()=>F,"$isElementNode"),$isExtendableTextPointCaret:s(()=>U2,"$isExtendableTextPointCaret"),$isInlineElementOrDecoratorNode:s(()=>u2,"$isInlineElementOrDecoratorNode"),$isInlineFormattable:s(()=>Zc,"$isInlineFormattable"),$isLeafNode:s(()=>z8,"$isLeafNode"),$isLexicalNode:s(()=>yp,"$isLexicalNode"),$isLineBreakNode:s(()=>Ir,"$isLineBreakNode"),$isNodeCaret:s(()=>pA,"$isNodeCaret"),$isNodeSelection:s(()=>As,"$isNodeSelection"),$isParagraphNode:s(()=>q5,"$isParagraphNode"),$isRangeSelection:s(()=>ve,"$isRangeSelection"),$isRootNode:s(()=>Mt,"$isRootNode"),$isRootOrShadowRoot:s(()=>kt,"$isRootOrShadowRoot"),$isSelectionCapturedInDecoratorInput:s(()=>ud,"$isSelectionCapturedInDecoratorInput"),$isShadowRootNode:s(()=>Pp,"$isShadowRootNode"),$isSiblingCaret:s(()=>Bi,"$isSiblingCaret"),$isSlotChild:s(()=>Fi,"$isSlotChild"),$isSlotHost:s(()=>Mr,"$isSlotHost"),$isTabNode:s(()=>rd,"$isTabNode"),$isTextNode:s(()=>X,"$isTextNode"),$isTextPointCaret:s(()=>fr,"$isTextPointCaret"),$isTextPointCaretSlice:s(()=>xA,"$isTextPointCaretSlice"),$isTokenOrSegmented:s(()=>An,"$isTokenOrSegmented"),$isTokenOrTab:s(()=>Di,"$isTokenOrTab"),$markSlotEditable:s(()=>k2,"$markSlotEditable"),$needsBlockCursorBeside:s(()=>Ec,"$needsBlockCursorBeside"),$nodesOfType:s(()=>G8,"$nodesOfType"),$normalizeCaret:s(()=>dr,"$normalizeCaret"),$normalizeSelection__EXPERIMENTAL:s(()=>Yo,"$normalizeSelection__EXPERIMENTAL"),$onUpdate:s(()=>c2,"$onUpdate"),$parseSerializedNode:s(()=>D8,"$parseSerializedNode"),$removeFromParent:s(()=>ur,"$removeFromParent"),$removeSlot:s(()=>R2,"$removeSlot"),$removeTextFromCaretRange:s(()=>K2,"$removeTextFromCaretRange"),$rewindSiblingCaret:s(()=>Do,"$rewindSiblingCaret"),$selectAll:s(()=>J8,"$selectAll"),$setCompositionKey:s(()=>Rt,"$setCompositionKey"),$setDirectionFromDOM:s(()=>S2,"$setDirectionFromDOM"),$setFormatFromDOM:s(()=>T2,"$setFormatFromDOM"),$setPointFromCaret:s(()=>vs,"$setPointFromCaret"),$setSelection:s(()=>dn,"$setSelection"),$setSelectionFromCaretRange:s(()=>H2,"$setSelectionFromCaretRange"),$setSlot:s(()=>Wp,"$setSlot"),$setState:s(()=>VM,"$setState"),$setTextFormat:s(()=>w8,"$setTextFormat"),$splitAtPointCaretNext:s(()=>z2,"$splitAtPointCaretNext"),$splitNode:s(()=>X8,"$splitNode"),$updateDOMSelection:s(()=>D5,"$updateDOMSelection"),$updateRangeSelectionFromCaretRange:s(()=>yl,"$updateRangeSelectionFromCaretRange"),ArtificialNode__DO_NOT_USE:s(()=>W5,"ArtificialNode__DO_NOT_USE"),BEFORE_INPUT_COMMAND:s(()=>ap,"BEFORE_INPUT_COMMAND"),BLUR_COMMAND:s(()=>n5,"BLUR_COMMAND"),CAN_REDO_COMMAND:s(()=>e8,"CAN_REDO_COMMAND"),CAN_UNDO_COMMAND:s(()=>t8,"CAN_UNDO_COMMAND"),CAN_USE_BEFORE_INPUT:s(()=>Nl,"CAN_USE_BEFORE_INPUT"),CAN_USE_DOM:s(()=>er,"CAN_USE_DOM"),CLEAR_EDITOR_COMMAND:s(()=>XM,"CLEAR_EDITOR_COMMAND"),CLEAR_HISTORY_COMMAND:s(()=>QM,"CLEAR_HISTORY_COMMAND"),CLICK_COMMAND:s(()=>FC,"CLICK_COMMAND"),COLLABORATION_TAG:s(()=>h8,"COLLABORATION_TAG"),COMMAND_PRIORITY_BEFORE_CRITICAL:s(()=>-4,"COMMAND_PRIORITY_BEFORE_CRITICAL"),COMMAND_PRIORITY_BEFORE_EDITOR:s(()=>-8,"COMMAND_PRIORITY_BEFORE_EDITOR"),COMMAND_PRIORITY_BEFORE_HIGH:s(()=>-5,"COMMAND_PRIORITY_BEFORE_HIGH"),COMMAND_PRIORITY_BEFORE_LOW:s(()=>-7,"COMMAND_PRIORITY_BEFORE_LOW"),COMMAND_PRIORITY_BEFORE_NORMAL:s(()=>-6,"COMMAND_PRIORITY_BEFORE_NORMAL"),COMMAND_PRIORITY_CRITICAL:s(()=>4,"COMMAND_PRIORITY_CRITICAL"),COMMAND_PRIORITY_EDITOR:s(()=>0,"COMMAND_PRIORITY_EDITOR"),COMMAND_PRIORITY_HIGH:s(()=>3,"COMMAND_PRIORITY_HIGH"),COMMAND_PRIORITY_LOW:s(()=>1,"COMMAND_PRIORITY_LOW"),COMMAND_PRIORITY_NORMAL:s(()=>2,"COMMAND_PRIORITY_NORMAL"),COMPOSITION_END_COMMAND:s(()=>dp,"COMPOSITION_END_COMMAND"),COMPOSITION_END_TAG:s(()=>xp,"COMPOSITION_END_TAG"),COMPOSITION_START_COMMAND:s(()=>up,"COMPOSITION_START_COMMAND"),COMPOSITION_START_TAG:s(()=>_8,"COMPOSITION_START_TAG"),CONTROLLED_TEXT_INSERTION_COMMAND:s(()=>ls,"CONTROLLED_TEXT_INSERTION_COMMAND"),COPY_COMMAND:s(()=>mp,"COPY_COMMAND"),CUT_COMMAND:s(()=>_p,"CUT_COMMAND"),CUT_TAG:s(()=>"cut","CUT_TAG"),DEFAULT_EDITOR_DOM_CONFIG:s(()=>Kl,"DEFAULT_EDITOR_DOM_CONFIG"),DELETE_CHARACTER_COMMAND:s(()=>Fl,"DELETE_CHARACTER_COMMAND"),DELETE_LINE_COMMAND:s(()=>Bl,"DELETE_LINE_COMMAND"),DELETE_WORD_COMMAND:s(()=>Vl,"DELETE_WORD_COMMAND"),DRAGEND_COMMAND:s(()=>QC,"DRAGEND_COMMAND"),DRAGOVER_COMMAND:s(()=>XC,"DRAGOVER_COMMAND"),DRAGSTART_COMMAND:s(()=>YC,"DRAGSTART_COMMAND"),DROP_COMMAND:s(()=>ZC,"DROP_COMMAND"),DecoratorNode:s(()=>Sp,"DecoratorNode"),ElementNode:s(()=>Is,"ElementNode"),FOCUS_COMMAND:s(()=>t5,"FOCUS_COMMAND"),FORMAT_ELEMENT_COMMAND:s(()=>YM,"FORMAT_ELEMENT_COMMAND"),FORMAT_TEXT_COMMAND:s(()=>Ti,"FORMAT_TEXT_COMMAND"),HISTORIC_TAG:s(()=>u8,"HISTORIC_TAG"),HISTORY_MERGE_TAG:s(()=>xc,"HISTORY_MERGE_TAG"),HISTORY_PUSH_TAG:s(()=>d8,"HISTORY_PUSH_TAG"),INDENT_CONTENT_COMMAND:s(()=>qM,"INDENT_CONTENT_COMMAND"),INPUT_COMMAND:s(()=>cp,"INPUT_COMMAND"),INSERT_LINE_BREAK_COMMAND:s(()=>_l,"INSERT_LINE_BREAK_COMMAND"),INSERT_PARAGRAPH_COMMAND:s(()=>ah,"INSERT_PARAGRAPH_COMMAND"),INSERT_TAB_COMMAND:s(()=>GM,"INSERT_TAB_COMMAND"),INTERNAL_$isBlock:s(()=>hn,"INTERNAL_$isBlock"),IS_ALL_FORMATTING:s(()=>vM,"IS_ALL_FORMATTING"),IS_ANDROID:s(()=>np,"IS_ANDROID"),IS_ANDROID_CHROME:s(()=>Ol,"IS_ANDROID_CHROME"),IS_APPLE:s(()=>Vn,"IS_APPLE"),IS_APPLE_WEBKIT:s(()=>ma,"IS_APPLE_WEBKIT"),IS_BOLD:s(()=>1,"IS_BOLD"),IS_CHROME:s(()=>rp,"IS_CHROME"),IS_CODE:s(()=>16,"IS_CODE"),IS_FIREFOX:s(()=>ri,"IS_FIREFOX"),IS_HIGHLIGHT:s(()=>128,"IS_HIGHLIGHT"),IS_IOS:s(()=>yo,"IS_IOS"),IS_ITALIC:s(()=>2,"IS_ITALIC"),IS_SAFARI:s(()=>pa,"IS_SAFARI"),IS_STRIKETHROUGH:s(()=>4,"IS_STRIKETHROUGH"),IS_SUBSCRIPT:s(()=>32,"IS_SUBSCRIPT"),IS_SUPERSCRIPT:s(()=>64,"IS_SUPERSCRIPT"),IS_UNDERLINE:s(()=>8,"IS_UNDERLINE"),KEY_ARROW_DOWN_COMMAND:s(()=>WC,"KEY_ARROW_DOWN_COMMAND"),KEY_ARROW_LEFT_COMMAND:s(()=>HC,"KEY_ARROW_LEFT_COMMAND"),KEY_ARROW_RIGHT_COMMAND:s(()=>VC,"KEY_ARROW_RIGHT_COMMAND"),KEY_ARROW_UP_COMMAND:s(()=>UC,"KEY_ARROW_UP_COMMAND"),KEY_BACKSPACE_COMMAND:s(()=>jC,"KEY_BACKSPACE_COMMAND"),KEY_DELETE_COMMAND:s(()=>GC,"KEY_DELETE_COMMAND"),KEY_DOWN_COMMAND:s(()=>pp,"KEY_DOWN_COMMAND"),KEY_ENTER_COMMAND:s(()=>jc,"KEY_ENTER_COMMAND"),KEY_ESCAPE_COMMAND:s(()=>JC,"KEY_ESCAPE_COMMAND"),KEY_MODIFIER_COMMAND:s(()=>r5,"KEY_MODIFIER_COMMAND"),KEY_SPACE_COMMAND:s(()=>zC,"KEY_SPACE_COMMAND"),KEY_TAB_COMMAND:s(()=>qC,"KEY_TAB_COMMAND"),LineBreakNode:s(()=>ld,"LineBreakNode"),MOVE_TO_END:s(()=>BC,"MOVE_TO_END"),MOVE_TO_START:s(()=>KC,"MOVE_TO_START"),NODE_STATE_DIRECT:s(()=>Qf,"NODE_STATE_DIRECT"),NODE_STATE_KEY:s(()=>"$","NODE_STATE_KEY"),NODE_STATE_LATEST:s(()=>wC,"NODE_STATE_LATEST"),OUTDENT_CONTENT_COMMAND:s(()=>ZM,"OUTDENT_CONTENT_COMMAND"),PASTE_COMMAND:s(()=>fp,"PASTE_COMMAND"),PASTE_TAG:s(()=>f8,"PASTE_TAG"),ParagraphNode:s(()=>ad,"ParagraphNode"),REDO_COMMAND:s(()=>gp,"REDO_COMMAND"),REMOVE_TEXT_COMMAND:s(()=>_c,"REMOVE_TEXT_COMMAND"),RootNode:s(()=>sd,"RootNode"),SELECTION_CHANGE_COMMAND:s(()=>lp,"SELECTION_CHANGE_COMMAND"),SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:s(()=>jM,"SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),SELECT_ALL_COMMAND:s(()=>e5,"SELECT_ALL_COMMAND"),SET_TEXT_FORMAT_COMMAND:s(()=>JM,"SET_TEXT_FORMAT_COMMAND"),SKIP_COLLAB_TAG:s(()=>g8,"SKIP_COLLAB_TAG"),SKIP_DOM_SELECTION_TAG:s(()=>m8,"SKIP_DOM_SELECTION_TAG"),SKIP_SCROLL_INTO_VIEW_TAG:s(()=>p8,"SKIP_SCROLL_INTO_VIEW_TAG"),SKIP_SELECTION_FOCUS_TAG:s(()=>d5,"SKIP_SELECTION_FOCUS_TAG"),TEXT_TYPE_TO_FORMAT:s(()=>Gt,"TEXT_TYPE_TO_FORMAT"),TabNode:s(()=>nd,"TabNode"),TextNode:s(()=>_a,"TextNode"),UNDO_COMMAND:s(()=>hp,"UNDO_COMMAND"),addClassNamesToElement:s(()=>AA,"addClassNamesToElement"),buildImportMap:s(()=>c8,"buildImportMap"),configExtension:s(()=>TA,"configExtension"),createCommand:s(()=>ke,"createCommand"),createEditor:s(()=>V8,"createEditor"),createRefCountedRegistry:s(()=>i5,"createRefCountedRegistry"),createSharedNodeState:s(()=>kC,"createSharedNodeState"),createState:s(()=>PM,"createState"),declarePeerDependency:s(()=>wA,"declarePeerDependency"),defineExtension:s(()=>SA,"defineExtension"),findAllLexicalElementsDeep:s(()=>g2,"findAllLexicalElementsDeep"),flipDirection:s(()=>Gi,"flipDirection"),getActiveElement:s(()=>ou,"getActiveElement"),getActiveElementDeep:s(()=>ms,"getActiveElementDeep"),getComposedEventTarget:s(()=>Vp,"getComposedEventTarget"),getComposedStaticRange:s(()=>Ds,"getComposedStaticRange"),getDOMOwnerDocument:s(()=>fd,"getDOMOwnerDocument"),getDOMSelection:s(()=>tr,"getDOMSelection"),getDOMSelectionFromTarget:s(()=>f2,"getDOMSelectionFromTarget"),getDOMSelectionPoints:s(()=>Yn,"getDOMSelectionPoints"),getDOMSelectionRange:s(()=>m2,"getDOMSelectionRange"),getDOMSelectionRangeAndPoints:s(()=>Y8,"getDOMSelectionRangeAndPoints"),getDOMShadowRoots:s(()=>h2,"getDOMShadowRoots"),getDOMTextNode:s(()=>Q5,"getDOMTextNode"),getDeclaredSlots:s(()=>O2,"getDeclaredSlots"),getEditorPropertyFromDOMNode:s(()=>Ca,"getEditorPropertyFromDOMNode"),getNearestEditorFromDOMNode:s(()=>fo,"getNearestEditorFromDOMNode"),getParentElement:s(()=>Oo,"getParentElement"),getRegisteredNode:s(()=>cd,"getRegisteredNode"),getRegisteredNodeOrThrow:s(()=>Mp,"getRegisteredNodeOrThrow"),getRegisteredSubtypeMap:s(()=>aA,"getRegisteredSubtypeMap"),getRootOwnerDocument:s(()=>p2,"getRootOwnerDocument"),getStaticNodeConfig:s(()=>Ea,"getStaticNodeConfig"),getStyleObjectFromCSS:s(()=>hh,"getStyleObjectFromCSS"),getTextDirection:s(()=>W8,"getTextDirection"),getTransformSetFromKlass:s(()=>Y5,"getTransformSetFromKlass"),isBlockDomNode:s(()=>Bp,"isBlockDomNode"),isCurrentlyReadOnlyMode:s(()=>bo,"isCurrentlyReadOnlyMode"),isDOMCapturingSelection:s(()=>Wl,"isDOMCapturingSelection"),isDOMDocumentNode:s(()=>Ns,"isDOMDocumentNode"),isDOMNode:s(()=>Rs,"isDOMNode"),isDOMShadowRoot:s(()=>ii,"isDOMShadowRoot"),isDOMTextNode:s(()=>yr,"isDOMTextNode"),isDOMUnmanaged:s(()=>Up,"isDOMUnmanaged"),isDocumentFragment:s(()=>x2,"isDocumentFragment"),isExactShortcutMatch:s(()=>qe,"isExactShortcutMatch"),isHTMLAnchorElement:s(()=>Q8,"isHTMLAnchorElement"),isHTMLElement:s(()=>vt,"isHTMLElement"),isHTMLTableCellElement:s(()=>tA,"isHTMLTableCellElement"),isHTMLTableRowElement:s(()=>eA,"isHTMLTableRowElement"),isInlineDomNode:s(()=>C2,"isInlineDomNode"),isLastChildInBlockNode:s(()=>J5,"isLastChildInBlockNode"),isLexicalEditor:s(()=>dd,"isLexicalEditor"),isModifierMatch:s(()=>s2,"isModifierMatch"),isOnlyChildInBlockNode:s(()=>j5,"isOnlyChildInBlockNode"),isSelectionCapturedInDecoratorInput:s(()=>U8,"isSelectionCapturedInDecoratorInput"),isSelectionWithinEditor:s(()=>xa,"isSelectionWithinEditor"),iterStaticNodeConfigChain:s(()=>Sa,"iterStaticNodeConfigChain"),makeStepwiseIterator:s(()=>Jp,"makeStepwiseIterator"),mergeRegister:s(()=>Yp,"mergeRegister"),mountSlotContainer:s(()=>iA,"mountSlotContainer"),normalizeClassNames:s(()=>Ta,"normalizeClassNames"),registerEventListener:s(()=>vp,"registerEventListener"),registerEventListeners:s(()=>NA,"registerEventListeners"),removeClassNamesFromElement:s(()=>IA,"removeClassNamesFromElement"),removeFromParent:s(()=>j8,"removeFromParent"),resetRandomKey:s(()=>H8,"resetRandomKey"),safeCast:s(()=>kA,"safeCast"),setDOMStyleFromCSS:s(()=>gh,"setDOMStyleFromCSS"),setDOMStyleObject:s(()=>y8,"setDOMStyleObject"),setDOMUnmanaged:s(()=>w2,"setDOMUnmanaged"),setNodeIndentFromDOM:s(()=>E2,"setNodeIndentFromDOM"),shallowMergeConfig:s(()=>MA,"shallowMergeConfig"),stopLexicalPropagation:s(()=>dh,"stopLexicalPropagation"),toggleTextFormatType:s(()=>Pi,"toggleTextFormatType"),tokenizeRawText:s(()=>R5,"tokenizeRawText"),unmountSlotContainer:s(()=>oA,"unmountSlotContainer")});function B(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(B,"t$5");function gC(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);n.search=r.toString()}s(gC,"e$4");var er=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,gM=er&&"documentMode"in document?document.documentMode:null,Vn=er&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ri=er&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Nl=!(!er||!("InputEvent"in window)||gM)&&"getTargetRanges"in new window.InputEvent("input"),yo=er&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,np=er&&/Android/.test(navigator.userAgent),pa=er&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!np,rp=er&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ol=er&&np&&rp,ma=er&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Vn&&!rp,pM=0,mM=1,_M=2;var vM=2047,yM=1,xM=2,CM=3,bM=4,EM=5,SM=6,Dl=pa||yo||ma?" ":"​",lo=`
3
+
4
+ `,ip=ri?" ":Dl,pC="֑-߿יִ-﷽ﹰ-ﻼ",mC="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",TM=new RegExp("^[^"+mC+"]*["+pC+"]"),wM=new RegExp("^[^"+pC+"]*["+mC+"]"),Gt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},kM={directionless:1,unmergeable:2},Kc={center:2,end:6,justify:4,left:1,right:3,start:5},MM={[xM]:"center",[SM]:"end",[bM]:"justify",[yM]:"left",[CM]:"right",[EM]:"start"},AM={normal:0,segmented:2,token:1},IM={[pM]:"normal",[_M]:"segmented",[mM]:"token"};var a0="$config";function c0(){return xr()._blockCursorElement}s(c0,"j$1");function NM(e){return e!==null&&e.nodeType===1&&e.hasAttribute("data-lexical-slot")}s(NM,"V$2");var _C=class pc{static{s(this,"q$2")}element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new pc(this.element,t,this.after)}withAfter(t){return new pc(this.element,this.before,t)}withElement(t){return this.element===t?this:new pc(t,this.before,this.after)}insertChild(t){const n=this.getInsertionAnchor();return n!==null&&n.parentElement!==this.element&&B(357),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&B(358),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&B(359),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;return n===this.getInsertionAnchor()?null:n}getFirstChildAnchor(){return this.after}resolveLeafPosition(t,n,r){if(this.element===t)return n===t&&r===0?"before":"after";const i=u0(t,this.element);if(i===null)return"after";const o=Array.prototype.indexOf.call(t.childNodes,i);if(o<0)return"after";if(n===t)return r<=o?"before":"after";const l=u0(t,n);if(l===null)return"after";const a=Array.prototype.indexOf.call(t.childNodes,l);return a>=0&&a<=o?"before":"after"}getInsertionAnchor(){return this.before}};function u0(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}s(u0,"Y$1");var vC=class mc extends _C{static{s(this,"G$1")}withBefore(t){return new mc(this.element,t,this.after)}withAfter(t){return new mc(this.element,this.before,t)}withElement(t){return this.element===t?this:new mc(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let t=super.getFirstChildAnchor(),n=t?t.nextSibling:this.element.firstChild;for(;NM(n);)t=n,n=n.nextSibling;const r=t?t.nextSibling:this.element.firstChild;return r!==null&&r===c0()?r:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(this.element.__lexicalLastChildKind=t,t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(ma||yo||pa);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,i=this.before,o=vn().createElement("br");if(o.setAttribute("data-lexical-managed-linebreak","true"),r.insertBefore(o,i),t){const l=vn().createElement("img");l.setAttribute("data-lexical-managed-linebreak","true"),l.style.setProperty("display","inline","important"),l.style.setProperty("border","0px","important"),l.style.setProperty("margin","0px","important"),l.alt="",r.insertBefore(l,o),r.__lexicalLineBreak=l}else r.__lexicalLineBreak=o}getFirstChildOffset(){const t=this.getFirstChild(),n=this.getInsertionAnchor();let r=0;for(let i=this.element.firstChild;i!==null&&i!==t&&i!==n;i=i.nextSibling)r++;return r}resolveChildIndex(t,n,r,i){if(r===this.element){const c=this.getFirstChildOffset(),u=c0(),d=this.element.childNodes,f=Math.min(i,d.length);let h=0;for(let g=c;g<f;g++)d[g]!==u&&h++;return[t,Math.min(h,t.getChildrenSize())]}const o=d0(n,r);o.push(i);const l=d0(n,this.element);let a=t.getIndexWithinParent();for(let c=0;c<l.length;c++){const u=o[c],d=l[c];if(u===void 0||u<d)break;if(u>d){a+=1;break}}return[t.getParentOrThrow(),a]}};function d0(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let i=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)i++;n.push(i)}return r!==e&&B(225),n.reverse()}s(d0,"X$3");var yC;try{yC="0.48.0+prod.esm"}catch{}var xC=yC??'"<unknown>+source"',Js=class{static{s(this,"tt$1")}_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},Qi=null;function CC(e,t=1e3){return e instanceof Yf?e.clone():e.size<t?new Map(e):new Yf().init(new Map(e),void 0,e.size)}s(CC,"nt$4");var Yf=class bC{static{s(this,"ot$4")}_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new bC().init(this._old,this._nursery,this._size)}init(t,n,r){return this._old=t,this._nursery=n,this._size=r,this}get size(){return this._size}has(t){return this.get(t)!==void 0}getWithTombstone(t){const n=this._nursery&&this._nursery.get(t);return n!==void 0?n:this._old&&this._old.get(t)}get(t){const n=this.getWithTombstone(t);return n===Qi?void 0:n}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(t=!1){if(this._nursery&&this._nursery.size>0&&(t||this.shouldCompact())){const n=new Map(this._old);for(const[r,i]of this._nursery)i!==Qi?n.set(r,i):n.delete(r);this._old=n,this._nursery=void 0}return this._mutable=!1,this}set(t,n){const r=this.getWithTombstone(t);if(r===n)return this;const i=this.getNursery();return r!==Qi&&r!==void 0||(this._size++,r===Qi&&i.delete(t)),i.set(t,n),this}delete(t){const n=this.has(t);return n&&(this.getNursery().set(t,Qi),this._size--),n}getOrInsert(t,n){const r=this.get(t);return r!==void 0?r:(this.set(t,n),n)}getOrInsertComputed(t,n){const r=this.get(t);if(r!==void 0)return r;const i=n(t);return this.set(t,i),i}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(const t of this.entries())yield t[0]}*values(){for(const t of this.entries())yield t[1]}*entries(){const t=this._nursery,n=this._old;if(n)for(const r of n){const i=r[0],o=t?t.get(i):void 0;o!==Qi&&(o!==void 0&&(r[1]=o),yield r)}if(t)for(const r of t)r[1]===Qi||n&&n.has(r[0])||(yield r)}forEach(t,n){n!==void 0&&(t=t.bind(n));for(const[r,i]of this.entries())t(i,r,this)}get[Symbol.toStringTag](){return"GenMap"}[Symbol.iterator](){return this.entries()}};function Uc(e,t,n,r,i,o){if(F(e)){let l=e.getFirstChild();for(;l!==null;){const a=l.__key;l.__parent===t&&((F(l)||Mr(l)&&l.__slots!==null)&&Uc(l,a,n,r,i,o),n.has(a)||o.delete(a),i.push(a)),l=l.getNextSibling()}}for(const l of Mr(e)&&e.__slots!==null?e.__slots.values():[]){const a=r.get(l);a!==void 0&&Fi(a)&&a.__slotHost===t&&((F(a)||Mr(a)&&a.__slots!==null)&&Uc(a,l,n,r,i,o),n.has(l)||o.delete(l),i.push(l))}}s(Uc,"rt$4");var Xf=!1,op=0;function OM(e){op=e.timeStamp}s(OM,"lt$4");function Yd(e,t,n){const r=e.nodeName==="BR",i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Os(e,n)!==void 0}s(Yd,"ct$3");function DM(e,t,n){const r=tr(Sn(n)),i=r&&Yn(r,n._rootElement);let o=null,l=null;i!==null&&i.anchorNode===e&&(o=i.anchorOffset,l=i.focusOffset);const a=e.nodeValue;a!==null&&Dp(t,a,o,l,!1)}s(DM,"at$1");function RM(e,t,n){if(ve(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return yr(t)&&n.isAttached()}s(RM,"ut$3");function LM(e,t,n){for(let r=e;r&&!Up(r);r=Oo(r)){const i=Os(r,t);if(i!==void 0){const o=nt(i,n);if(o)return We(o)||!vt(r)?void 0:[r,o]}}}s(LM,"ft$3");function EC(e,t,n){Xf=!0;const r=performance.now()-op>100;try{jn(e,()=>{const i=Ve()||(function(f){return f.read("latest",()=>{const h=Ve();return h!==null?h.clone():null})})(e),o=new Map,l=e._editorState,a=e._blockCursorElement;let c=!1,u="";for(let f=0;f<t.length;f++){const h=t[f],g=h.type,p=h.target,_=LM(p,e,l);if(!_)continue;const[y,v]=_;if(g==="characterData")r&&X(v)&&yr(p)&&RM(i,p,v)&&DM(p,v,e);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let S=0;S<x.length;S++){const M=x[S],T=Ap(M),E=M.parentNode;if(!(E==null||M===a||T!==null||Yd(M,E,e)||e._slotsUsed&&vt(M)&&M.hasAttribute("data-lexical-slot")||Up(M))){if(ri){const A=(vt(M)?M.innerText:null)||M.nodeValue;A&&(u+=A)}E.removeChild(M)}}const C=h.removedNodes,b=C.length;if(b>0){let S=0;for(let M=0;M<b;M++){const T=C[M];(Yd(T,p,e)||a===T)&&(p.appendChild(T),S++)}b!==S&&o.set(y,v)}}}if(o.size>0)for(const[f,h]of o)h.reconcileObservedMutation(f,e);const d=n.takeRecords();if(d.length>0){for(let f=0;f<d.length;f++){const h=d[f],g=h.addedNodes,p=h.target;for(let _=0;_<g.length;_++){const y=g[_],v=y.parentNode;v==null||y.nodeName!=="BR"||Yd(y,p,e)||v.removeChild(y)}}n.takeRecords()}i!==null&&(c&&dn(i),ri&&a2(e)&&i.insertRawText(u))})}finally{Xf=!1}}s(EC,"dt$5");function SC(e){const t=e._observer;t!==null&&EC(e,t.takeRecords(),t)}s(SC,"ht$4");function TC(e){(function(t){op===0&&Sn(t).addEventListener("textInput",OM,!0)})(e),e._observer=new MutationObserver((t,n)=>{EC(e,t,n)})}s(TC,"gt$1");var Qf="direct",wC="latest",$M=class{static{s(this,"yt$4")}key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||HM).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function PM(e,t){return new $M(e,t)}s(PM,"mt$5");function Wc(e,t,n=wC){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}s(Wc,"xt$5");function FM(e,t,n){const r=Wc(e,n,Qf),i=Wc(t,n,Qf);return n.isEqual(r,i)?null:[r,i]}s(FM,"Ct$5");function VM(e,t,n){let r;if(Ht(),typeof n=="function"){const o=e.getLatest(),l=Wc(o,t);if(r=n(l),t.isEqual(l,r))return o}else r=n;const i=e.getWritable();return sp(i).updateFromKnown(t,r),i}s(VM,"St$6");function kC(e){const t=new Map,n=new Set;for(const{ownNodeConfig:r}of Sa(typeof e=="function"?e:e.replace))if(r&&r.stateConfigs)for(const i of r.stateConfigs){let o;"stateConfig"in i?(o=i.stateConfig,i.flat&&n.add(o.key)):o=i,t.set(o.key,o)}return{flatKeys:n,sharedConfigMap:t}}s(kC,"vt$5");var f0=new Set(["__proto__","constructor","prototype"]),BM=class MC{static{s(this,"kt$6")}node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,i=new Map,o=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=i;const{sharedConfigMap:l}=this.sharedNodeState,a=o!==void 0?o:(function(c,u,d){let f=d.size;if(u)for(const h in u){const g=c.get(h);g&&d.has(g)||f++}return f})(l,r,i);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const i=this.unknownState[t.key];i!==void 0&&(r=t.parse(i)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return h0(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new MC(t,n,(function(o,l,a){let c;if(a)for(const[u,d]of Object.entries(a)){if(f0.has(u))continue;const f=o.get(u);f?l.has(f)||l.set(f,f.parse(d)):(c=c||{},c[u]=d)}return c})(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const t of this.knownState.keys())t.resetOnCopyNode&&this.knownState.set(t,t.defaultValue);return this}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:i,unknownState:o}=this;i.has(t)||o&&r in o||(o&&(delete o[r],this.unknownState=h0(o)),this.size++),i.set(t,n)}updateFromUnknown(t,n){if(f0.has(t))return;const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,i]of Object.entries(t))this.updateFromUnknown(r,i)}};function sp(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new BM(t,AC(t));return t.__state=n,n}s(sp,"bt$4");function AC(e){return e.__state?e.__state.sharedNodeState:Mp(xr(),e.getType()).sharedNodeState}s(AC,"Nt$6");function h0(e){if(e)for(const t in e)return e}s(h0,"wt$4");function HM(e){return e}s(HM,"Et$5");function g0(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const o=n?n.getValue(r):r.defaultValue;if(o!==i&&!r.isEqual(o,i))return!0}return!1}s(g0,"Ot$6");function p0(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(const[o,l]of Object.entries(r))if(!e.has(o)&&(e.add(o),l!==(i?i[o]:void 0)))return!0}return!1}s(p0,"Mt$5");function m0(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}s(m0,"At$4");function _0(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,l=t.__format,a=t.__style,c=e.__state,u=t.__state;return(n===null||n===o)&&(r===null||r===l)&&(i===null||i===a)&&(e.__state===null||c===u||(function(d,f){if(d===f)return!0;const h=new Set;return!(d&&g0(h,d,f)||f&&g0(h,f,d)||d&&p0(h,d,f)||f&&p0(h,f,d))})(c,u))}s(_0,"Dt$5");function v0(e,t){const n=e.mergeWithSibling(t),r=Ue()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}s(v0,"Pt$5");function y0(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(_0(t,r)){r=v0(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(_0(r,n)){r=v0(r,n);break}break}n.remove()}}else r.remove()}s(y0,"Ft$5");function Yo(e){return x0(e.anchor),x0(e.focus),e}s(Yo,"It$4");function x0(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),X(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!F(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}s(x0,"Lt$4");var Rl=Symbol.for("@lexical/CachedTextSize");function C0(e,t){return th.read(()=>{let n=0,r=e;for(let i=0;i<t&&r!==null;i++){const o=cr.get(r);if(o===void 0&&B(345,r),F(o)){const l=ht.get(r);if(l!==void 0&&F(l)&&l.__parent!==o.__parent)n+=o.getTextContentSize();else{const a=xo.get(r),c=a&&a.__lexicalTextContent;typeof c!="string"&&B(346,o.getType()),n+=c.length}i<t-1&&!o.isInline()&&(n+=2)}else{const l=o[Rl];l===void 0&&B(347,o.getType(),r),n+=l}r=o.__next}return n},{editor:Be})}s(C0,"zt$4");function IC(e){F(e)||e[Rl]===void 0&&(e[Rl]=X(e)?e.__text.length:e.getTextContentSize())}s(IC,"Bt$4");var KM=4,Ll,Be,$l,Oe="",xt=null,Qt=null,qt=null;function wr(){return{firstTextKey:qt,format:xt,style:Qt}}s(wr,"qt$3");function Bn(e){e.firstTextKey!==null&&(xt=e.format,Qt=e.style,qt=e.firstTextKey)}s(Bn,"Yt$2");function eh(e){if(qt!==null)return;const t=e.__lexicalFirstTextKey;if(t===void 0&&B(348),t===null)return;const n=ht.get(t);X(n)&&(xt=n.getFormat(),Qt=n.getStyle(),qt=t)}s(eh,"Gt$2");var td,pl,ml,cr,th,ht,xo,nh,Pl,Co,Gr=!1,zc=!1;function Ni(e,t){const n=cr.get(e),r=ht.has(e);if(t!==null){const i=lh(e);i.parentNode===t&&t.removeChild(i)}if(!r){if(Be._keyToDOMMap.delete(e),F(n)){const i=zl(n,cr);rh(i,0,i.length-1,null)}if(n!==void 0){for(const i of kn(n).values()){const o=oh(i);Ni(i,null),o!==null&&o.remove()}Rp(Pl,$l,td,n,"destroyed")}}}s(Ni,"ae$2");function rh(e,t,n,r){for(let i=t;i<=n;++i){const o=e[i];o!==void 0&&Ni(o,r)}}s(rh,"ue$3");function eo(e,t){e.setProperty("text-align",t)}s(eo,"fe$1");var UM="40px";function NC(e,t){const n=Ll.theme.indent;if(typeof n=="string"){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * var(--lexical-indent-base-value, ${UM}))`)}s(NC,"he$2");function OC(e,t){const n=e.style;t===0?eo(n,""):t===1?eo(n,"left"):t===2?eo(n,"center"):t===3?eo(n,"right"):t===4?eo(n,"justify"):t===5?eo(n,"start"):t===6&&eo(n,"end")}s(OC,"ge$2");function ih(e,t){const n=(function(r){const i=r.__dir;if(i!==null)return i;if(Mt(r))return null;const o=r.getParent();return o===null||kt(o)&&o.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}s(ih,"_e$2");function DC(e){const t=vn().createElement("div");return t.setAttribute("data-lexical-slot",e),t.style.display="none",t}s(DC,"pe$2");function RC(e,t,n){t||e.contentEditable==="false"?k2(n,Be):n.removeAttribute("contenteditable")}s(RC,"ye$2");function b0(e,t,n){const r=Oe,i=wr();Oe="";let o="";const l=We(e);for(const[a,c]of n){const u=DC(a);RC(t,l,u),t.appendChild(u),Oe="";const d=wr();Oi(c,Rn(e,u,Be)),Bn(d),LC(e,a,t,u),o+=Oe}return Bn(i),Oe=r,o}s(b0,"me$2");function kn(e){return Mr(e)&&e.__slots!==null?e.__slots:A2}s(kn,"xe$3");function LC(e,t,n,r){const i=Co.$getSlotTargetElement(e,t,n,Be);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display="")}s(LC,"Ce$2");function oh(e){const t=xo.get(e);return t!==void 0?t.parentElement:null}s(oh,"Se$2");function E0(e,t,n){const r=kn(e),i=kn(t);for(const[d,f]of r)if(!i.has(d)){const h=oh(f);Ni(f,null),h!==null&&h.remove()}const o=Oe,l=wr();let a="",c=null;const u=We(t);for(const[d,f]of i){const h=r.get(d);let g=h!==void 0?oh(h):null;Oe="";const p=wr();if(g===null){g=DC(d);let _=null;for(const y of n.children)if(!y.hasAttribute("data-lexical-slot")){_=y;break}n.insertBefore(g,_),Oi(f,Rn(t,g,Be))}else h===f?jr(f,g):(h!==void 0&&Ni(h,g),Oi(f,Rn(t,g,Be)));if(Bn(p),RC(n,u,g),LC(t,d,n,g),a+=Oe,g.parentElement===n){const _=c===null?n.firstChild:c.nextSibling;_!==g&&n.insertBefore(g,_),c=g}}return Bn(l),Oe=o,a}s(E0,"ve$2");function Oi(e,t){const n=ht.get(e);if(n===void 0&&B(60),t!==null){const i=cr.get(e);if(i!==void 0){const o=xo.get(e);if(o!==void 0){const l=Fi(i)?i.__slotHost:null,a=Fi(n)?n.__slotHost:null,c=i.__parent!==n.__parent||l!==a,u=a!==null&&o.parentElement!==t.element;if(c||u)return t.insertChild(o),jr(e,t.element)}}}const r=Co.$createDOM(n,Be);if((function(i,o,l){const a=l._keyToDOMMap;t2(o,l,i),a.set(i,o)})(e,r,Be),X(n)?r.setAttribute("data-lexical-text","true"):We(n)&&(r.setAttribute("data-lexical-decorator","true"),w2(r,{captureSelection:!0})),F(n)){const i=n.__indent,o=n.__size;ih(r,n),i!==0&&NC(r,i);const l=kn(n),a=l.size>0?b0(n,r,l):"";if(o===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,Oe+=a,l.size>0&&(r.__lexicalSlotTextLength=a.length);else{const u=Oe,d=o-1;if(sh(zl(n,ht),n,0,d,Rn(n,r,Be)),a!==""){const f=r.__lexicalTextContent||"";r.__lexicalTextContent=a+f,Oe=u+a+f}l.size>0&&(r.__lexicalSlotTextLength=a.length)}const c=n.__format;c!==0&&OC(r,c),n.isInline()||$C(null,n,r)}else{const i=n.getTextContent();if(We(n)){const o=n.decorate(Be,Ll);o!==null&&PC(e,o),r.contentEditable="false";const l=kn(n);l.size>0&&b0(n,r,l)}Oe+=i}return t!==null&&t.insertChild(r),Co.$decorateDOM(n,null,r,Be),IC(n),Rp(Pl,$l,td,n,"created"),r}s(Oi,"Te$3");function sh(e,t,n,r,i){const o=Oe,l=wr();Oe="",xt=null,Qt=null,qt=null;let a=n;for(;a<=r;++a){const u=wr();Oi(e[a],i);const d=ht.get(e[a]);d!==null&&X(d)?xt===null&&(xt=d.getFormat(),Qt=d.getStyle(),qt=d.__key):F(d)&&a<r&&!d.isInline()&&(Oe+=lo),Bn(u)}const c=Be._keyToDOMMap.get(t.__key);c===void 0&&B(349,t.__key),c.__lexicalTextContent=Oe,c.__lexicalFirstTextKey=qt,Oe=o+Oe,Bn(l)}s(sh,"ke$3");function $C(e,t,n){const r=Rn(t,n,Be),i=r.element.__lexicalLastChildKind??null,o=(function(l,a){if(l){const c=l.__last;if(c){const u=a.get(c);if(u)return Ir(u)?"line-break":We(u)&&u.isInline()?"decorator":null}return kn(l).size>0?null:"empty"}return null})(t,ht);i!==o&&r.setManagedLineBreak(o)}s($C,"be$1");function WM(e,t,n){var r;xt=null,Qt=null,qt=null,(function(i,o,l){const a=Oe,c=i.__size,u=o.__size;Oe="";const d=l.element,f=Be._keyToDOMMap.get(o.__key);f===void 0&&B(351,o.__key);const h=u-c;if(!Gr&&Math.abs(h)<=1&&c>=KM&&i.__first===o.__first&&(h!==0||!Be._cloneNotNeeded.has(i.__key))){const g=f.__lexicalTextContent,p=nh.get(i.__key);if(!Gr&&typeof g=="string"&&p!==void 0){const _=(function(y,v){const x=v.size;if(x===0||x>=y.__size)return null;let C=y.__last,b=null,S=0;for(;C!==null&&S<x;){if(!v.has(C))return null;b=C;const M=ht.get(C);if(M===void 0)return null;C=M.__prev,S++}return S!==x||C!==null&&v.has(C)?null:b})(o,p);if(_!==null){const y=p.size;if(h===0){const v=C0(_,y);let x=_,C=0;for(;x!==null&&C<y;){const E=ht.get(x);if(E===void 0)break;const A=wr();jr(x,d),X(E)&&xt===null&&(xt=E.getFormat(),Qt=E.getStyle(),qt=E.__key),Bn(A),x=E.__next,C++}let b="";for(x=_,C=0;x!==null&&C<y;){const E=ht.get(x);if(E===void 0)break;let A;if(F(E)){const D=Be._keyToDOMMap.get(x),L=D&&D.__lexicalTextContent;typeof L!="string"&&B(352,E.getType()),A=L}else A=E.getTextContent();b+=A,C<y-1&&F(E)&&!E.isInline()&&(b+=lo),x=E.__next,C++}const S=f.__lexicalSlotTextLength||0,M=S>0?g.slice(S):g,T=M.slice(0,M.length-v)+b;f.__lexicalTextContent=T,Oe=a+T,S0(o,f,p);return}if((function(v,x,C,b,S,M,T,E){if(E!==1&&E!==-1||T!==(E===1?2:1))return!1;const A=T-E;let D=v.__last;for(let j=0;j<A-1;j++){if(D===null)return!1;const ne=cr.get(D);if(ne===void 0)return!1;D=ne.__prev}if(D===null)return!1;const L=ht.get(M),G=cr.get(D);if(L===void 0||G===void 0||L.__prev!==G.__prev)return!1;const $=[];let z=M;for(let j=0;j<T;j++){if(z===null)return!1;$.push(z);const ne=ht.get(z);z=ne?ne.__next:null}const W=[];z=D;for(let j=0;j<A;j++){if(z===null)return!1;W.push(z);const ne=cr.get(z);z=ne?ne.__next:null}const ye=new Set(W),q=new Set($),ge=[];let me=0,oe=0;for(;me<A&&oe<T;)if($[oe]===W[me])ge.push({key:$[oe],kind:"reconcile"}),me++,oe++;else if(q.has(W[me])){if(ye.has($[oe]))return!1;ge.push({key:$[oe],kind:"create",nextIndex:oe}),oe++}else ge.push({key:W[me],kind:"destroy"}),me++;for(;me<A;)ge.push({key:W[me++],kind:"destroy"});for(;oe<T;)ge.push({key:$[oe],kind:"create",nextIndex:oe}),oe++;const Z=C0(D,A);for(const j of ge){const ne=wr();if(j.kind==="reconcile")jr(j.key,C.element);else if(j.kind==="destroy")Ni(j.key,C.element);else{let ue=null;for(let Ne=j.nextIndex+1;Ne<T;Ne++){const $e=Be._keyToDOMMap.get($[Ne]);if($e!==void 0){ue=$e;break}}Oi(j.key,C.withBefore(ue??C.before))}if(j.kind!=="destroy"){const ue=ht.get(j.key);ue&&X(ue)&&xt===null&&(xt=ue.getFormat(),Qt=ue.getStyle(),qt=ue.__key)}Bn(ne)}let pe="";for(let j=0;j<T;j++){const ne=ht.get($[j]);if(ne===void 0)return!1;let ue;if(F(ne)){const Ne=Be._keyToDOMMap.get($[j]),$e=Ne&&Ne.__lexicalTextContent;typeof $e!="string"&&B(350,ne.getType()),ue=$e}else ue=ne.getTextContent();pe+=ue,j<T-1&&F(ne)&&!ne.isInline()&&(pe+=lo)}const de=b.__lexicalSlotTextLength||0,ce=de>0?S.slice(de):S;return b.__lexicalTextContent=ce.slice(0,ce.length-Z)+pe,!0})(i,0,l,f,g,_,y,h)){const v=f.__lexicalTextContent;typeof v!="string"&&B(353),Oe=a+v,S0(o,f,p);return}}}if(h===0){let _=i.__first,y=0;for(;_!==null;){const v=ht.get(_);if(v===void 0)break;const x=Gr||ml.has(_)||pl.has(_),C=wr();if(x)jr(_,d);else{let b,S;if(F(v)){S=xo.get(_);const M=S&&S.__lexicalTextContent;typeof M!="string"&&B(354,v.getType()),b=M}else b=v.getTextContent();Oe+=b,S!==void 0&&eh(S)}X(v)?xt===null&&(xt=v.getFormat(),Qt=v.getStyle(),qt=v.__key):F(v)&&y<u-1&&!v.isInline()&&(Oe+=lo),Bn(C),_=v.__next,y++}f.__lexicalTextContent=Oe,f.__lexicalFirstTextKey=qt,Oe=a+Oe;return}}if(c===1&&u===1){const g=i.__first,p=o.__first;if(g===p)jr(g,d);else{const y=lh(g),v=Oi(p,null);try{y.parentNode===d?d.replaceChild(v,y):l.insertChild(v)}catch(x){if(typeof x=="object"&&x!=null){const C=`${x.toString()} Parent: ${d.tagName}, new child: {tag: ${v.tagName} key: ${p}}, old child: {tag: ${y.tagName}, key: ${g}}.`;throw new Error(C)}throw x}Ni(g,null)}const _=ht.get(p);X(_)&&xt===null&&(xt=_.getFormat(),Qt=_.getStyle(),qt=_.__key)}else{const g=zl(i,cr),p=zl(o,ht);if(g.length!==c&&B(227),p.length!==u&&B(228),c===0)u!==0&&sh(p,o,0,u-1,l);else if(u===0){if(c!==0){const _=l.after==null&&l.before==null&&kn(o).size===0&&l.element.__lexicalLineBreak==null;rh(g,0,c-1,_?null:d),_&&(d.textContent="")}}else(function(_,y,v,x,C,b){const S=x-1,M=C-1;let T,E,A=b.getFirstChild(),D=0,L=0;for(;D<=S&&L<=M;){const z=y[D],W=v[L],ye=wr();if(z===W)A=Xd(jr(W,b.element)),D++,L++;else{if(E===void 0&&(E=T0(v,L)),T===void 0)T=T0(y,D);else if(!T.has(z)){D++,Bn(ye);continue}if(!E.has(z)){A=Xd(lh(z)),Ni(z,b.element),D++,T.delete(z),Bn(ye);continue}if(T.has(W)){const ge=ps(Be,W);ge!==A&&b.withBefore(A??b.before).insertChild(ge),A=Xd(jr(W,b.element)),D++,L++}else Oi(W,b.withBefore(A??b.before)),L++}const q=ht.get(W);q!==null&&X(q)?xt===null&&(xt=q.getFormat(),Qt=q.getStyle(),qt=q.__key):F(q)&&L<=M&&!q.isInline()&&(Oe+=lo),Bn(ye)}const G=D>S,$=L>M;if(G&&!$){const z=v[M+1],W=z===void 0?null:Be.getElementByKey(z);sh(v,_,L,M,b.withBefore(W??b.before))}else $&&!G&&rh(y,D,S,b.element)})(o,g,p,c,u,l)}f.__lexicalTextContent=Oe,f.__lexicalFirstTextKey=qt,Oe=a+Oe})(e,t,Rn(t,n,Be)),kt(t)||(r=t,xt==null||xt===r.__textFormat||zc||r.setTextFormat(xt),(function(i){Qt==null||Qt===i.__textStyle||zc||i.setTextStyle(Qt)})(t))}s(WM,"Ne$2");function S0(e,t,n){const r=t.__lexicalFirstTextKey;if(r!=null){const i=e.__key;let o=r;for(;o!==null;){const l=ht.get(o);if(l===void 0){o=null;break}if(l.__parent===i)break;o=l.__parent}if(o!==null&&!n.has(o)){const l=ht.get(r);if(X(l))return xt=l.getFormat(),void(Qt=l.getStyle())}}t.__lexicalFirstTextKey=qt}s(S0,"we$2");function jr(e,t){const n=cr.get(e);let r=ht.get(e);n!==void 0&&r!==void 0||B(61);const i=Gr||ml.has(e)||pl.has(e),o=ps(Be,e);if(n===r&&!i){let l;if(F(n)){const a=o.__lexicalTextContent;typeof a!="string"&&B(355,n.getType()),l=a,eh(o)}else l=n.getTextContent();return Oe+=l,o}if(n!==r&&i&&Rp(Pl,$l,td,r,"updated"),Co.$updateDOM(r,n,o,Be)){const l=Oi(e,null);return t===null&&B(62),t.replaceChild(l,o),Ni(e,null),l}if(F(n)){F(r)||B(334,e);const l=r.__indent;(Gr||l!==n.__indent)&&NC(o,l);const a=r.__format;(Gr||a!==n.__format)&&OC(o,a);const c=i&&(kn(r).size>0||kn(n).size>0)?E0(n,r,o):"";if(i){const u=Oe;if(WM(n,r,o),Mt(r)||r.isInline()||$C(0,r,o),c!==""){const d=o.__lexicalTextContent||"";o.__lexicalTextContent=c+d,Oe=u+c+d,o.__lexicalSlotTextLength=c.length}else(kn(r).size>0||kn(n).size>0)&&(o.__lexicalSlotTextLength=0)}else{const u=o.__lexicalTextContent;typeof u!="string"&&B(356,n.getType()),Oe+=u,eh(o)}if((Gr||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(ih(o,r),Mt(r)&&!Gr))for(const u of r.getChildren())F(u)&&ih(ps(Be,u.getKey()),u)}else{const l=r.getTextContent();if(We(r)){const a=r.decorate(Be,Ll);a!==null&&PC(e,a),i&&(kn(r).size>0||kn(n).size>0)&&E0(n,r,o)}Oe+=l}if(!zc&&Mt(r)){const l=r.getLatest();if(l.__cachedText!==Oe){const a=l.getWritable();a.__cachedText=Oe,r=a}}return Co.$decorateDOM(r,n,o,Be),IC(r),o}s(jr,"Ee$1");function PC(e,t){let n=Be._pendingDecorators;const r=Be._decorators;if(n===null){if(r[e]===t)return;n=n2(Be)}n[e]=t}s(PC,"Oe$2");function Xd(e){let t=e.nextSibling;return t!==null&&t===Be._blockCursorElement&&(t=t.nextSibling),t}s(Xd,"Me$2");function T0(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}s(T0,"Ae$2");function zM(e,t,n,r,i,o){Oe="",xt=null,Qt=null,qt=null,Gr=r===2,Be=n,Ll=n._config,Co=n._config.dom||Kl,$l=n._nodes,td=Be._listeners.mutation,pl=i,ml=o,cr=e._nodeMap,th=e,ht=t._nodeMap,zc=t._readOnly,xo=CC(n._keyToDOMMap),nh=(function(){const a=new Map,c=s(u=>{for(const d of u){const f=ht.get(d);if(f===void 0)continue;const h=f.__parent;if(h===null)continue;let g=a.get(h);g===void 0&&(g=new Set,a.set(h,g)),g.add(d)}},"e");return c(pl.keys()),c(ml),a})();const l=new Map;return Pl=l,jr("root",null),Be=void 0,$l=void 0,pl=void 0,ml=void 0,cr=void 0,th=void 0,ht=void 0,Ll=void 0,xo=void 0,nh=void 0,Pl=void 0,Co=Kl,l}s(zM,"De$2");function lh(e){const t=xo.get(e);return t===void 0&&B(75,e),t}s(lh,"Pe$3");function ke(e){return{type:e}}s(ke,"Fe$3");var lp=ke("SELECTION_CHANGE_COMMAND"),jM=ke("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),FC=ke("CLICK_COMMAND"),ap=ke("BEFORE_INPUT_COMMAND"),cp=ke("INPUT_COMMAND"),up=ke("COMPOSITION_START_COMMAND"),dp=ke("COMPOSITION_END_COMMAND"),Fl=ke("DELETE_CHARACTER_COMMAND"),_l=ke("INSERT_LINE_BREAK_COMMAND"),ah=ke("INSERT_PARAGRAPH_COMMAND"),ls=ke("CONTROLLED_TEXT_INSERTION_COMMAND"),fp=ke("PASTE_COMMAND"),_c=ke("REMOVE_TEXT_COMMAND"),Vl=ke("DELETE_WORD_COMMAND"),Bl=ke("DELETE_LINE_COMMAND"),Ti=ke("FORMAT_TEXT_COMMAND"),JM=ke("SET_TEXT_FORMAT_COMMAND"),hp=ke("UNDO_COMMAND"),gp=ke("REDO_COMMAND"),pp=ke("KEYDOWN_COMMAND"),VC=ke("KEY_ARROW_RIGHT_COMMAND"),BC=ke("MOVE_TO_END"),HC=ke("KEY_ARROW_LEFT_COMMAND"),KC=ke("MOVE_TO_START"),UC=ke("KEY_ARROW_UP_COMMAND"),WC=ke("KEY_ARROW_DOWN_COMMAND"),jc=ke("KEY_ENTER_COMMAND"),zC=ke("KEY_SPACE_COMMAND"),jC=ke("KEY_BACKSPACE_COMMAND"),JC=ke("KEY_ESCAPE_COMMAND"),GC=ke("KEY_DELETE_COMMAND"),qC=ke("KEY_TAB_COMMAND"),GM=ke("INSERT_TAB_COMMAND"),qM=ke("INDENT_CONTENT_COMMAND"),ZM=ke("OUTDENT_CONTENT_COMMAND"),ZC=ke("DROP_COMMAND"),YM=ke("FORMAT_ELEMENT_COMMAND"),YC=ke("DRAGSTART_COMMAND"),XC=ke("DRAGOVER_COMMAND"),QC=ke("DRAGEND_COMMAND"),mp=ke("COPY_COMMAND"),_p=ke("CUT_COMMAND"),e5=ke("SELECT_ALL_COMMAND"),XM=ke("CLEAR_EDITOR_COMMAND"),QM=ke("CLEAR_HISTORY_COMMAND"),e8=ke("CAN_REDO_COMMAND"),t8=ke("CAN_UNDO_COMMAND"),t5=ke("FOCUS_COMMAND"),n5=ke("BLUR_COMMAND"),r5=ke("KEY_MODIFIER_COMMAND");function i5(e){const t=new Map;return{dispose(){for(const n of t.values())n.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));const o=s(()=>{const l=t.get(n);l&&l.holders.delete(o)&&l.holders.size===0&&(t.delete(n),l.dispose())},"i");return i.holders.add(o),o}}}s(i5,"Dn$1");function vp(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}s(vp,"Pn");var Kr=Object.freeze({}),ch=[["keydown",function(e,t){const n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!=="Backspace"&&Hl(n),!t.isComposing()&&fe(t,pp,e)}],["pointerdown",function(e,t){const n=Vp(e),r=e.pointerType;Rs(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&jn(t,()=>{Wl(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],["compositionstart",function(e,t){fe(t,up,e)}],["compositionend",function(e,t){const n=t._inputState;ri?n.compositionPhase="ending-firefox":yo||!pa&&!ma?fe(t,dp,e):(n.compositionPhase="ending-safari",n.compositionEndData=e.data)}],["input",function(e,t){e.stopPropagation();const n=t._inputState;Hl(n),jn(t,()=>{a5(e,t)||t.dispatchCommand(cp,e)},{event:e}),n.unprocessedBeforeInputData=null}],["click",function(e,t){jn(t,()=>{const n=Ve(),r=tr(Sn(t)),i=No();if(r){if(ve(n)){const o=n.anchor,l=o.getNode();o.type==="element"&&o.offset===0&&n.isCollapsed()&&!Mt(l)&&Dn().getChildrenSize()===1&&l.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType==="touch"||e.pointerType==="pen"){const o=Yn(r,t._rootElement).anchorNode;(vt(o)||yr(o))&&dn(id(i,r,t,e))}}fe(t,FC,e)})}],["cut",Kr],["copy",Kr],["dragstart",Kr],["dragover",Kr],["dragend",Kr],["paste",Kr],["focus",Kr],["blur",Kr],["drop",Kr]];Nl&&ch.push(["beforeinput",(e,t)=>(function(n,r){const i=n.inputType;i==="deleteCompositionText"||ri&&a2(r)||i!=="insertCompositionText"&&jn(r,()=>{a5(n,r)||fe(r,ap,n)},{event:n})})(e,t)]);var uh=new WeakMap,Jc=new WeakMap,n8=i5(e=>(e.addEventListener("selectionchange",I0),()=>e.removeEventListener("selectionchange",I0)));function o5(e,t,n,r,i,o){const l=e.anchor,a=e.focus,c=l.getNode(),u=Ue();let d;if(o!==void 0)d=o;else{const _=tr(Sn(u));d=_!==null?Yn(_,u._rootElement):null}const f=d!==null?d.anchorNode:null,h=l.key,g=u.getElementByKey(h),p=n.length;return h!==a.key||!X(c)||(!i&&(!Nl||u._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&p<2||r2(n))&&l.offset!==a.offset&&!c.isComposing()||An(c)||c.isDirty()&&p>1||(i||!Nl)&&g!==null&&!c.isComposing()&&f!==Qr(c,g,u)||d!==null&&t!==null&&(!t.collapsed||t.startContainer!==d.anchorNode||t.startOffset!==d.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||(function(_,y){if(y.isSegmented())return!0;if(!_.isCollapsed())return!1;const v=_.anchor.offset,x=y.getParentOrThrow(),C=Di(y);return v===0?!y.canInsertTextBefore()||!x.canInsertTextBefore()&&!y.isComposing()||C||(function(b){const S=b.getPreviousSibling();return(X(S)||F(S)&&S.isInline())&&!S.canInsertTextAfter()})(y):v===y.getTextContentSize()&&(!y.canInsertTextAfter()||!x.canInsertTextAfter()&&!y.isComposing()||C)})(e,c)}s(o5,"Bn");function w0(e,t){return yr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}s(w0,"Rn");function k0(e,t,n){const{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:l}=Yn(e,t._rootElement),a=t._inputState;a.isSelectionChangeFromDOMUpdate&&(a.isSelectionChangeFromDOMUpdate=!1,w0(r,i)&&w0(o,l)&&!a.postDeleteSelectionToRestore)||jn(t,()=>{if(!n)return void dn(null);if(!xa(t,r,o))return;let c=Ve();if(a.postDeleteSelectionToRestore&&ve(c)&&c.isCollapsed()){const u=c.anchor,d=a.postDeleteSelectionToRestore.anchor;(u.key===d.key&&u.offset===d.offset+1||u.offset===1&&d.getNode().is(u.getNode().getPreviousSibling()))&&(c=a.postDeleteSelectionToRestore.clone(),dn(c))}if(a.postDeleteSelectionToRestore=null,ve(c)){const u=c.anchor,d=u.getNode();if(c.isCollapsed()){e.type==="Range"&&r===o&&(c.dirty=!0);const f=Sn(t).event,h=f?f.timeStamp:performance.now(),{format:g,style:p,offset:_,key:y,timeStamp:v}=a.collapsedSelectionFormat,x=Dn(),C=t.isComposing()===!1&&x.getTextContent()==="";if(h<v+200&&u.offset===_&&u.key===y)vc(c,g,p);else if(u.type==="text")X(d)||B(141),s5(c,d);else if(u.type==="element"&&!C){F(d)||B(259);const b=u.getNode();b.isEmpty()?(function(S,M){vc(S,M.getTextFormat(),M.getTextStyle())})(c,b):vc(c,c.format,"")}}else{const f=u.key,h=c.focus.key,g=c.getNodes(),p=g.length,_=c.isBackward(),y=_?l:i,v=_?i:l,x=_?h:f,C=_?f:h;let b=2047,S=!1;for(let M=0;M<p;M++){const T=g[M],E=T.getTextContentSize();if(X(T)&&E!==0&&!(M===0&&T.__key===x&&y===E||M===p-1&&T.__key===C&&v===0)&&(S=!0,b&=T.getFormat(),b===0))break}c.format=S?b:0}}fe(t,lp,void 0)})}s(k0,"Wn");function vc(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}s(vc,"Un");function s5(e,t){vc(e,t.getFormat(),t.getStyle())}s(s5,"$n");function l5(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}s(l5,"Hn");function M0(e){const{lastKeyCode:t}=Ue()._inputState;if(e==null||e.length<=1||t==null)return;const n=t.length===1?t:t==="Enter"?`
5
+ `:t==="Tab"?" ":null;if(!n)return;const r=Ve();if(!ve(r)||!r.isCollapsed())return;const i=r.anchor.getNode();if(!X(i))return;const{offset:o}=r.anchor;if(i.getTextContentSize()===o){const l=i.getNextSibling();if(n===`
6
+ `){if(Ir(l))l.selectEnd();else if(!l){const a=bi(i,I5),c=a&&a.getNextSibling();F(c)&&c.selectStart()}}else n===" "?rd(l)&&l.selectEnd():X(l)&&l.getTextContent()[0]===n&&l.select(1,1)}else i.getTextContent()[o]===n&&i.select(o+1,o+1)}s(M0,"Jn");function Hl(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}s(Hl,"jn");function A0(e){Hl(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Hl(e),0)}s(A0,"Vn");function a5(e,t){const n=Vp(e);if(vt(n)&&Wl(n,t))return!0;const r=t.getRootElement();if(r===null)return!1;const i=ms(r.ownerDocument);return i!==null&&r.contains(i)&&Wl(i,t)}s(a5,"qn");function r8(e){const t=e.inputType,n=l5(e),r=Ue(),i=r._inputState,o=Ve();if(t==="insertText"&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Hl(i),e.preventDefault(),ve(o)&&!o.isCollapsed()){const f=o.isBackward()?o.anchor:o.focus;o.anchor.set(f.key,f.offset,f.type),o.focus.set(f.key,f.offset,f.type)}return!0}if(t==="deleteContentBackward"){if(o===null){const f=No();if(!ve(f))return!0;dn(f.clone())}if(ve(o)){const f=o.anchor.key===o.focus.key;if((function(h,g){return h.lastKeyCode==="MediaLast"&&g<h.lastKeyDownTimeStamp+30})(i,e.timeStamp)&&r.isComposing()&&f){if(Rt(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{jn(r,()=>{Rt(null)})},30),ve(o)){const h=o.anchor.getNode();h.markDirty(),X(h)||B(142),s5(o,h)}}else{if(Rt(null),yo&&n!==null&&!n.collapsed&&(o.applyDOMRange(n),!o.isCollapsed()))return e.preventDefault(),o.removeText(),!0;e.preventDefault();const h=o.anchor.getNode(),g=h.getTextContent(),p=h.canInsertTextAfter(),_=o.anchor.offset===0&&o.focus.offset===g.length;let y=Ol&&f&&!_&&p;if(y&&o.isCollapsed()&&(y=!We(l2(o.anchor,!0))),!y){fe(r,Fl,!0);const v=Ve();Ol&&ve(v)&&v.isCollapsed()&&(i.postDeleteSelectionToRestore=v,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!ve(o))return!0;const l=e.data;i.unprocessedBeforeInputData!==null&&Op(!1,r,i.unprocessedBeforeInputData),o.dirty&&i.unprocessedBeforeInputData===null||!o.isCollapsed()||Mt(o.anchor.getNode())||n===null||o.applyDOMRange(n),i.unprocessedBeforeInputData=null;const a=o.anchor,c=o.focus,u=a.getNode(),d=c.getNode();if(t==="insertText"||t==="insertTranspose"){if(l===`
7
+ `)e.preventDefault(),fe(r,_l,!1);else if(l===lo)e.preventDefault(),fe(r,ah,void 0);else if(l==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else l!=null&&o5(o,n,l,e.timeStamp,!0)?(e.preventDefault(),fe(r,ls,l),M0(l)):i.unprocessedBeforeInputData=l;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":fe(r,ls,e),M0((e.dataTransfer?e.dataTransfer.getData("text/plain"):null)??e.data);break;case"insertFromComposition":{const f=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;const h=r._compositionKey;Rt(null),f||fe(r,ls,e),yc(h);break}case"insertLineBreak":Rt(null),fe(r,_l,!1);break;case"insertParagraph":Rt(null),i.isInsertLineBreak&&!yo?(i.isInsertLineBreak=!1,fe(r,_l,!1)):fe(r,ah,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":fe(r,fp,e);break;case"deleteByComposition":(function(f,h){return f!==h||F(f)||F(h)||!Di(f)||!Di(h)})(u,d)&&fe(r,_c,e);break;case"deleteByDrag":Eo(d5),fe(r,_c,e);break;case"deleteByCut":fe(r,_c,e);break;case"deleteContent":fe(r,Fl,!1);break;case"deleteWordBackward":fe(r,Vl,!0);break;case"deleteWordForward":fe(r,Vl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":fe(r,Bl,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":fe(r,Bl,!1);break;case"formatStrikeThrough":fe(r,Ti,"strikethrough");break;case"formatBold":fe(r,Ti,"bold");break;case"formatItalic":fe(r,Ti,"italic");break;case"formatUnderline":fe(r,Ti,"underline");break;case"historyUndo":fe(r,hp,void 0);break;case"historyRedo":fe(r,gp,void 0)}return!0}s(r8,"Yn");function i8(e){const t=Ue(),n=t._inputState,r=Ve(),i=e.data,o=l5(e);let l=!1;if(i!=null&&ve(r)){const a=tr(Sn(t)),c=a!==null?Yn(a,t._rootElement):null,u=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);const d=r.anchor.getNode(),f=e.inputType==="insertCompositionText"&&n.compositionPhase!=="ending-firefox"&&t.isComposing()&&X(d)&&An(d);if(!u&&!f&&o5(r,o,i,e.timeStamp,!1,c)){if(l=!0,n.compositionPhase==="ending-firefox"){const v=Gc(t,i);if(n.compositionPhase="idle",v)return Eo(xp),e_(),!0}const h=r.anchor.getNode();if(a===null||c===null)return!0;const g=r.isBackward(),p=g?r.anchor.offset:r.focus.offset,_=g?r.focus.offset:r.anchor.offset;Nl&&!r.isCollapsed()&&X(h)&&c.anchorNode!==null&&h.getTextContent().slice(0,p)+i+h.getTextContent().slice(p+_)===o2(c.anchorNode)||fe(t,ls,i);const y=i.length;ri&&y>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(r.anchor.offset-=y,r._cachedNodes=null,r._cachedIsBackward=null),Ol&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Rt(null))}}return l||(Op(!1,t,i!==null?i:void 0),n.compositionPhase==="ending-firefox"&&(Gc(t,i||void 0),Eo("composition-end"),n.compositionPhase="idle")),e_(),!0}s(i8,"Gn");function o8(e){const t=Ue(),n=t._inputState,r=Ve();if(ve(r)&&!t.isComposing()){n.compositionPhase="composing",n.hadOrphanedCompositionEvents=!1;const i=r.anchor,o=r.anchor.getNode();if(Rt(i.key),Eo("composition-start"),e.timeStamp<n.lastKeyDownTimeStamp+30||i.type==="element"||!r.isCollapsed()||!Ol&&(o.getFormat()!==r.format||X(o)&&o.getStyle()!==r.style)||X(o)&&(An(o)||i.offset===0&&!o.canInsertTextBefore()||i.offset===o.getTextContentSize()&&!o.canInsertTextAfter())){fe(t,ls,ip);const l=Ve();ve(l)&&Rt(l.anchor.key)}}return!0}s(o8,"Xn");function s8(e){const t=Ue();return t._inputState.compositionPhase="idle",Gc(t,e.data),Eo(xp),!0}s(s8,"Qn");function yc(e){if(e===null)return;const t=nt(e);if(!X(t)||t.getType()==="text"||An(t)||!t.isAttached())return;const n=Ve(),r=ve(n)&&n.anchor.key===e?n.anchor.offset:null,i=Ft(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),r!==null){const o=Math.min(r,i.getTextContentSize());i.select(o,o)}}s(yc,"Zn");function Gc(e,t){const n=e._compositionKey;if(Rt(null),n!==null&&t!=null){if(t===""){const i=nt(n),o=e.getElementByKey(n),l=o!==null&&X(i)?Qr(i,o,e):null;if(l!==null&&l.nodeValue!==null&&X(i)){const a=tr(Sn(e)),c=a&&Yn(a,e._rootElement);let u=null,d=null;c!==null&&c.anchorNode===l&&(u=c.anchorOffset,d=c.focusOffset),Dp(i,l.nodeValue,u,d,!0)}return yc(n),!1}if(t[t.length-1]===`
8
+ `){const i=Ve();if(ve(i)||As(i)){if(ve(i)){const o=i.focus;i.anchor.set(o.key,o.offset,o.type)}return fe(e,jc,null),yc(n),!1}}const r=nt(n);if(r!==null&&X(r)&&An(r)){r.markDirty();const i=Ve(),o=r.getTextContentSize(),l=ve(i)&&i.anchor.key===n?i.anchor.offset:o;return r.select(l,l).insertText(t),!0}}return Op(!0,e,t),yc(n),!1}s(Gc,"to");function l8(e){const t=Ue(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase==="ending-safari"){const r=n_(e);if(r&&jn(t,()=>{Gc(t,n.compositionEndData)}),n.compositionPhase="idle",n.compositionEndData="",r)return!0}if((function(r){return qe(r,"ArrowRight",{shiftKey:"any"})})(e))fe(t,VC,e);else if((function(r){return qe(r,"ArrowRight",{...Wr,shiftKey:"any"})})(e))fe(t,BC,e);else if((function(r){return qe(r,"ArrowLeft",{shiftKey:"any"})})(e))fe(t,HC,e);else if((function(r){return qe(r,"ArrowLeft",{...Wr,shiftKey:"any"})})(e))fe(t,KC,e);else if((function(r){return qe(r,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))fe(t,UC,e);else if((function(r){return qe(r,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))fe(t,WC,e);else if((function(r){return qe(r,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))n.isInsertLineBreak=!0,fe(t,jc,e);else if((function(r){return r.key===" "})(e))fe(t,zC,e);else if((function(r){return Vn&&qe(r,"o",{ctrlKey:!0})})(e))e.preventDefault(),n.isInsertLineBreak=!0,fe(t,_l,!0);else if((function(r){return qe(r,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))n.isInsertLineBreak=!1,fe(t,jc,e);else if((function(r){return qe(r,"Backspace",{shiftKey:"any"})||Vn&&qe(r,"h",{ctrlKey:!0})})(e))n_(e)?fe(t,jC,e)&&A0(n):(e.preventDefault(),fe(t,Fl,!0));else if((function(r){return r.key==="Escape"})(e))fe(t,JC,e);else if((function(r){return qe(r,"Delete",{})||Vn&&qe(r,"d",{ctrlKey:!0})})(e))(function(r){return r.key==="Delete"})(e)?fe(t,GC,e):(e.preventDefault(),fe(t,Fl,!1));else if((function(r){return qe(r,"Backspace",t_)})(e))e.preventDefault(),fe(t,Vl,!0);else if((function(r){return qe(r,"Delete",t_)})(e))e.preventDefault(),fe(t,Vl,!1);else if((function(r){return Vn&&qe(r,"Backspace",{metaKey:!0})})(e))e.preventDefault(),fe(t,Bl,!0);else if((function(r){return Vn&&(qe(r,"Delete",{metaKey:!0})||qe(r,"k",{ctrlKey:!0}))})(e))e.preventDefault(),fe(t,Bl,!1);else if((function(r){return qe(r,"b",Wr)})(e))e.preventDefault(),fe(t,Ti,"bold");else if((function(r){return qe(r,"u",Wr)})(e))e.preventDefault(),fe(t,Ti,"underline");else if((function(r){return qe(r,"i",Wr)})(e))e.preventDefault(),fe(t,Ti,"italic");else if((function(r){return qe(r,"Tab",{shiftKey:"any"})})(e))fe(t,qC,e);else if((function(r){return qe(r,"z",Wr)})(e))e.preventDefault(),fe(t,hp,void 0);else if((function(r){return Vn?qe(r,"z",{metaKey:!0,shiftKey:!0}):qe(r,"y",{ctrlKey:!0})||qe(r,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),fe(t,gp,void 0);else{const r=t._editorState._selection;(function(i){return qe(i,"a",Wr)})(e)?(e.preventDefault(),fe(t,e5,e)&&A0(n)):r===null||ve(r)||((function(i){return qe(i,"c",Wr)})(e)?(e.preventDefault(),fe(t,mp,e)):(function(i){return qe(i,"x",Wr)})(e)&&(e.preventDefault(),fe(t,_p,e)))}return(function(r){return r.ctrlKey||r.shiftKey||r.altKey||r.metaKey})(e)&&t.dispatchCommand(r5,e),!0}s(l8,"eo");function c5(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}s(c5,"no");var as=new Map;function I0(e){const t=f2(e.target);if(t===null)return;const n=fd(e.target);let r=null,i=null;const o=n!==null?Jc.get(n):void 0;if(n!==null){if(o!==void 0){const f=o.editors;let h=o.hasShadowEditor;if(h===void 0){h=!1;for(const g of f)if(g._rootElement!==null&&ii(g._rootElement.getRootNode())){h=!0;break}o.hasShadowEditor=h}if(h){let g=null,p=null;for(const _ of f){const y=_._rootElement;if(y===null)continue;const v=Yn(t,y).anchorNode;if(v!==null&&fo(v)===_){if(ii(y.getRootNode())){r=_,i=v;break}g===null&&(g=_,p=v)}}r===null&&g!==null&&(r=g,i=p)}else{const g=t.anchorNode;g===null||vt(g)&&g.shadowRoot!==null||(r=fo(g),r!==null&&(i=g))}}if(r===null){const f=ms(n);r=f!==null?fo(f):null}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(o!==void 0)for(const f of o.editors)f._inputState.isSelectionChangeFromMouseDown=!1;jn(r,()=>{const f=No(),h=i??Yn(t,r._rootElement).anchorNode;(vt(h)||yr(h))&&dn(id(f,t,r,e))})}const l=Np(r),a=l[l.length-1],c=a._key,u=as.get(c),d=u||a;d!==r&&k0(t,d,!1),k0(t,r,!0),r!==a?as.set(c,r):u&&as.delete(c)}s(I0,"ro");function dh(e){e._lexicalHandled=!0}s(dh,"io");function N0(e){return e._lexicalHandled===!0}s(N0,"so");function a8(e){const t=uh.get(e);if(t===void 0)return;const n=Jc.get(t);if(n===void 0)return;uh.delete(e);const r=Ca(e);dd(r)?((function(o){if(o._parentEditor!==null){const l=Np(o),a=l[l.length-1]._key;as.get(a)===o&&as.delete(a)}else as.delete(o._key)})(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&B(198);const i=c5(e);for(let o=0;o<i.length;o++)i[o]();e.__lexicalEventHandles=[]}s(a8,"co");function fh(e,t,n){Ht();const r=e.__key,i=e.getParent();if(i===null)return void(Zt(e)!==null&&B(367,r,String(Zt(e))));const o=(function(a){const c=Ve();if(!ve(c)||!F(a))return c;const{anchor:u,focus:d}=c,f=u.getNode(),h=d.getNode();return Ul(f,a)&&u.set(a.__key,0,"element"),Ul(h,a)&&d.set(a.__key,0,"element"),c})(e);let l=!1;if(ve(o)&&t){const a=o.anchor,c=o.focus;a.key===r&&(Xc(a,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0),c.key===r&&(Xc(c,e,i,e.getPreviousSibling(),e.getNextSibling()),l=!0)}else As(o)&&t&&e.isSelected()&&e.selectPrevious();if(ve(o)&&t&&!l){const a=e.getIndexWithinParent();ur(e),oo(o,i,a,-1)}else ur(e);n||kt(i)||i.canBeEmpty()||!i.isEmpty()||fh(i,t),t&&o&&Mt(i)&&i.isEmpty()&&i.selectEnd()}s(fh,"ao");function c8(e){return e}s(c8,"uo");var u5=Symbol.for("ephemeral");function qc(e){return e[u5]||!1}s(qc,"ho");var O0={configurable:!0,enumerable:!1,value:void 0,writable:!0},On=class{static{s(this,"_o")}__type;__key;__parent;__prev;__next;__state;[Rl];static getType(){const{ownNodeType:e}=Ea(this);return e===void 0&&B(64,this.name),e}static clone(e){B(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||M2(this.constructor);return Object.assign(t,{extends:n}),typeof e=="string"&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",O0),Object.defineProperty(this,Rl,O0),e2(this,e)}getType(){return this.__type}isInline(){B(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=nt(e);if(t===null)break;e=t.__parent!==null?t.__parent:Zt(t)}return!1}isSelected(e){const t=e||Ve();if(t==null)return!1;const n=t.getNodes().some(r=>r.__key===this.__key);if(X(this))return n;if(ve(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const r=this.getParent();if(We(this)&&this.isInline()&&r){const i=t.isBackward()?t.focus:t.anchor;if(r.is(i.getNode())&&i.offset===r.getChildrenSize()&&this.is(r.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:nt(e)}getParentOrThrow(){const e=this.getParent();return e===null&&B(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(kt(t)||Zt(e)!==null)return F(e)||e===this&&We(e)||B(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&B(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:nt(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:nt(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=F(this)?this:this.getParent(),n=F(e)?e:e.getParent(),r=t&&n?au(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=au(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?qp(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&B(279),!1)))}isParentOf(e){return Ul(e,this)}getNodesBetween(e){const t=this.isBefore(e),n=[],r=new Set;let i=this;for(;i!==null;){const o=i.__key;if(r.has(o)||(r.add(o),n.push(i)),i===e)break;const l=F(i)?t?i.getFirstChild():i.getLastChild():null;if(l!==null){i=l;continue}const a=t?i.getNextSibling():i.getPreviousSibling();if(a!==null){i=a;continue}const c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let u=null,d=c;do{if(d===null&&B(68),u=t?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),d===null)break;u!==null||r.has(d.__key)||n.push(d)}while(u===null);i=u}return t||n.reverse(),n}isDirty(){const e=Ue()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(qc(this))return this;const e=nt(this.__key);return e===null&&B(113),e}getWritable(){if(qc(this))return this;Ht();const e=Pr(),t=Ue(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,l=Ve();if(l!==null&&l.setCachedNodes(null),o.has(r))return ru(i),i;const a=Kp(i);return o.add(r),ru(a),n.set(r,a),a}getTextContent(){return D2(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){B(70)}updateDOM(e,t,n){B(71)}getDOMSlot(e){return new _C(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){B(18,this.name)}updateFromJSON(e){return(function(t,n){const r=t.getWritable(),i=n.$;let o=i;for(const l of AC(r).flatKeys)l in n&&(o!==void 0&&o!==i||(o={...i}),o[l]=n[l]);return(r.__state||o)&&sp(t).updateFromJSON(o),r})(this,e)}static transform(){return null}remove(e){fh(this,!0,e)}replace(e,t){Ht();let n=Ve();n!==null&&(n=n.clone()),af(this,e);const r=this.getLatest(),i=this.__key,o=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size,u=l.getParent(),d=u!==null?l.getIndexWithinParent():-1;ur(l),u!==null&&ve(n)&&oo(n,u,d,-1);const f=r.getPreviousSibling(),h=r.getNextSibling(),g=r.__prev,p=r.__next,_=r.__parent;fh(r,!1,!0),f===null?a.__first=o:f.getWritable().__next=o,l.__prev=g,h===null?a.__last=o:h.getWritable().__prev=o,l.__next=p,l.__parent=_,a.__size=c;let y=0;t&&(F(this)&&F(l)||B(139),y=l.getChildrenSize(),l.splice(y,0,this.getChildren()));const v=Jn(this);if(v.length>0){Mr(this)&&Mr(l)||B(368,this.__key,l.__key);for(const x of v){const C=Vi(this,x);C!==null&&(R2(this,x),Wp(l,x,C))}}if(ve(n)){dn(n);const x=n.anchor,C=n.focus;x.key===i&&(t&&x.type==="element"?x.set(l.__key,y+x.offset,"element"):$0(x,l)),C.key===i&&(t&&C.type==="element"?C.set(l.__key,y+C.offset,"element"):$0(C,l))}return qr()===i&&Rt(o),l}insertAfter(e,t=!0){Ht(),af(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.getParent(),o=Ve();let l=!1,a=!1;if(i!==null){const h=e.getIndexWithinParent();if(ve(o)){const g=i.__key,p=o.anchor,_=o.focus;l=p.type==="element"&&p.key===g&&p.offset===h+1,a=_.type==="element"&&_.key===g&&_.offset===h+1}ur(r),t&&ve(o)&&oo(o,i,h,-1)}else ur(r);const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=n.__next;if(c===null?u.__last=d:c.getWritable().__prev=d,u.__size++,n.__next=d,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,t&&ve(o)){const h=this.getIndexWithinParent();oo(o,u,h+1);const g=u.__key;l&&o.anchor.set(g,h+2,"element"),a&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Ht(),af(this,e);const n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();const i=r.__key,o=Ve(),l=r.getParent(),a=l!==null?r.getIndexWithinParent():-1;ur(r),l!==null&&t&&ve(o)&&oo(o,l,a,-1);const c=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),d=n.__prev,f=this.getIndexWithinParent();return c===null?u.__first=i:c.getWritable().__next=i,u.__size++,n.__prev=i,r.__prev=d,r.__next=n.__key,r.__parent=n.__parent,t&&ve(o)&&oo(o,this.getParentOrThrow(),f),e}isParentRequired(){return!1}createParentElementNode(){return mn()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Ht();const n=Kn(this);if(n!==null)return n.selectPrevious(e,t);const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(F(r))return r.select();if(!X(r)){const o=r.getIndexWithinParent()+1;return i.select(o,o)}return r.select(e,t)}selectNext(e,t){Ht();const n=Kn(this);if(n!==null)return n.selectNext(e,t);const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(F(r))return r.select(0,0);if(!X(r)){const o=r.getIndexWithinParent();return i.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function yp(e){return e instanceof On}s(yp,"po");var u8="historic",d8="history-push",xc="history-merge",f8="paste";var h8="collaboration",g8="skip-collab",p8="skip-scroll-into-view",m8="skip-dom-selection",d5="skip-selection-focus",_8="composition-start",xp="composition-end",v8="!important";function hh(e){const t={};if(!e)return t;let n="",r="",i=null,o=!1,l=!1,a=!1,c=0;const u=e.length;let d=-1;for(let g=0;g<u;g++){const p=e[g];if(o)p==="*"&&e[g+1]==="/"&&(o=!1,g++);else if(l)d===-1&&(d=g),l=!1;else if(i===null)if(p!=="/"||e[g+1]!=="*")if(p!=='"'&&p!=="'")if(p!=="(")if(p!==")")if(a||p!==":"||c!==0){if(p===";"&&c===0){d!==-1&&(a?r+=e.slice(d,g):n+=e.slice(d,g),d=-1);const _=n.trim(),y=r.trim();_!==""&&y!==""&&(t[_]=y),n="",r="",a=!1;continue}d===-1&&(d=g)}else d!==-1&&(n+=e.slice(d,g),d=-1),a=!0;else d===-1&&(d=g),c=Math.max(0,c-1);else d===-1&&(d=g),c++;else d===-1&&(d=g),i=p;else d!==-1&&(a?r+=e.slice(d,g):n+=e.slice(d,g),d=-1),o=!0,g++;else d===-1&&(d=g),p==="\\"?l=!0:p===i&&(i=null)}d!==-1&&(a?r+=e.slice(d,u):n+=e.slice(d,u));const f=n.trim(),h=r.trim();return f!==""&&h!==""&&(t[f]=h),t}s(hh,"Mo");function f5(e,t,n){const r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===v8?e.setProperty(t,r.slice(0,i).trim(),"important"):e.setProperty(t,n,"")}s(f5,"Ao");function y8(e,t){for(const n in t){const r=t[n];r==null?e.removeProperty(n):f5(e,n,r)}}s(y8,"Do");function gh(e,t,n=""){if(t===n)return;const r=hh(n),i=hh(t);for(const o in i)delete r[o],f5(e,o,i[o]);for(const o in r)e.removeProperty(o)}s(gh,"Po");function Qd(e,t){return 16&t?"code":t&128?"mark":32&t?"sub":64&t?"sup":null}s(Qd,"Fo");function ef(e,t){return 1&t?"strong":2&t?"em":"span"}s(ef,"Io");function h5(e,t,n,r,i){const o=r.classList;let l=cs(i,"base");l!==void 0&&o.add(...l),l=cs(i,"underlineStrikethrough");let a=!1;const c=8&t&&4&t;l!==void 0&&(8&n&&4&n?(a=!0,c||o.add(...l)):c&&o.remove(...l));for(const u in Gt){const d=Gt[u];if(l=cs(i,u),l!==void 0)if(n&d){if(a&&(u==="underline"||u==="strikethrough")){t&d&&o.remove(...l);continue}((t&d)===0||c&&u==="underline"||u==="strikethrough")&&o.add(...l)}else t&d&&o.remove(...l)}}s(h5,"Lo");function g5(e,t,n){const r=n.isComposing(),i=e+(r?Dl:""),o=xr(),l=Hp(o).$getDOMSlot(n,t,o),a=l.getFirstChild();if(a===null||a.nodeType!==Node.TEXT_NODE)return void l.insertChild(vn().createTextNode(i));const c=a,u=c.nodeValue;if(u!==i)if(r||ri){const[d,f,h]=(function(g,p){const _=g.length,y=p.length;let v=0,x=0;for(;v<_&&v<y&&g[v]===p[v];)v++;for(;x+v<_&&x+v<y&&g[_-x-1]===p[y-x-1];)x++;return[v,_-v-x,p.slice(v,y-x)]})(u,i);f!==0&&c.deleteData(d,f),c.insertData(d,h)}else c.nodeValue=i}s(g5,"Ko");function D0(e,t,n,r,i,o){g5(i,e,t);const l=o.theme.text;l!==void 0&&h5(0,0,r,e,l)}s(D0,"zo");function za(e,t){const n=vn().createElement(t);return n.appendChild(e),n}s(za,"Bo");function Zc(e){return e!=null&&e.__isInlineFormattable===!0}s(Zc,"Ro");var _a=class p5 extends On{static{s(this,"Wo")}__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return"text"}static clone(t){return new p5(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return IM[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===qr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Gt[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Pi(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,i=Qd(0,r),o=ef(0,r),l=i===null?o:i,a=vn().createElement(l);let c=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(c=vn().createElement(o),a.appendChild(c)),D0(c,this,0,r,this.__text,t);const u=this.__style;return u!==""&&gh(a.style,u),a}updateDOM(t,n,r){const i=this.__text,o=t.__format,l=this.__format,a=Qd(0,o),c=Qd(0,l),u=ef(0,o),d=ef(0,l);if((a===null?u:a)!==(c===null?d:c))return!0;if(a===c&&u!==d){const _=n.firstChild;_??B(48);const y=vn().createElement(d);return D0(y,this,0,l,i,r),n.replaceChild(y,_),!1}let f=n;c!==null&&a!==null&&(f=n.firstChild,f??B(49)),g5(i,f,this);const h=r.theme.text;h!==void 0&&o!==l&&h5(0,o,l,f,h);const g=t.__style,p=this.__style;return g!==p&&gh(n.style,p,g),!1}static importDOM(){return{"#text":s(()=>({conversion:E8,priority:0}),"#text"),b:s(()=>({conversion:C8,priority:0}),"b"),code:s(()=>({conversion:Ur,priority:0}),"code"),em:s(()=>({conversion:Ur,priority:0}),"em"),i:s(()=>({conversion:Ur,priority:0}),"i"),mark:s(()=>({conversion:Ur,priority:0}),"mark"),s:s(()=>({conversion:Ur,priority:0}),"s"),span:s(()=>({conversion:x8,priority:0}),"span"),strong:s(()=>({conversion:Ur,priority:0}),"strong"),sub:s(()=>({conversion:Ur,priority:0}),"sub"),sup:s(()=>({conversion:Ur,priority:0}),"sup"),u:s(()=>({conversion:Ur,priority:0}),"u")}}static importJSON(t){return Ft().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return vt(n)||B(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=za(n,"b")),this.hasFormat("italic")&&(n=za(n,"i")),this.hasFormat("strikethrough")&&(n=za(n,"s")),this.hasFormat("underline")&&(n=za(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Gt[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?kM[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Pi(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=AM[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){Ht();let r=t,i=n;const o=Ve(),l=this.getTextContent(),a=this.__key;if(typeof l=="string"){const c=l.length;r===void 0&&(r=c),i===void 0&&(i=c)}else r=0,i=0;if(!ve(o))return N5(a,r,a,i,"text","text");{const c=qr();c!==o.anchor.key&&c!==o.focus.key||Rt(a),o.setTextNodeRange(this,r,this,i)}return o}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,i){const o=this.getWritable(),l=o.__text,a=r.length;let c=t;c<0&&(c=a+c,c<0&&(c=0));const u=Ve();if(i&&ve(u)){const d=t+a;u.setTextNodeRange(o,d,o,d)}return o.__text=l.slice(0,c)+r+l.slice(c+n),o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){Ht();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const i=n.__key,o=qr(),l=r.length;t.sort((E,A)=>E-A),t.push(l);const a=[],c=t.length;for(let E=0,A=0;E<l&&A<=c;A++){const D=t[A];D>E&&(a.push(r.slice(E,D)),E=D)}const u=a.length;if(u===1)return[n];const d=a[0],f=n.getParent();let h;const g=n.getFormat(),p=n.getStyle(),_=n.__detail;let y=!1,v=null,x=null;const C=Ve();if(ve(C)){const[E,A]=C.isBackward()?[C.focus,C.anchor]:[C.anchor,C.focus];E.type==="text"&&E.key===i&&(v=E),A.type==="text"&&A.key===i&&(x=A)}n.isSegmented()?(h=Ft(d),h.__format=g,h.__style=p,h.__detail=_,h.__state=m0(n,h),y=!0):h=n.setTextContent(d);const b=[h];for(let E=1;E<u;E++){const A=Ft(a[E]);A.__format=g,A.__style=p,A.__detail=_,A.__state=m0(n,A);const D=A.__key;o===i&&Rt(D),b.push(A)}const S=v?v.offset:null,M=x?x.offset:null;let T=0;for(const E of b){if(!v&&!x)break;const A=T+E.getTextContentSize();if(v!==null&&S!==null&&S<=A&&S>=T&&(v.set(E.getKey(),S-T,"text"),S<A&&(v=null)),x!==null&&M!==null&&M<=A&&M>=T){x.set(E.getKey(),M-T,"text");break}T=A}if(f!==null){(function(D){const L=D.getPreviousSibling(),G=D.getNextSibling();L!==null&&ru(L),G!==null&&ru(G)})(this);const E=f.getWritable(),A=this.getIndexWithinParent();y?(E.splice(A,0,b),this.remove()):E.splice(A,1,b),ve(C)&&oo(C,f,A,u-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||B(50);const r=this.__key,i=t.__key,o=this.__text,l=o.length;qr()===i&&Rt(r);const a=Ve();if(ve(a)){const f=a.anchor,h=a.focus;f!==null&&f.key===i&&U0(f,n,r,t,l),h!==null&&h.key===i&&U0(h,n,r,t,l)}const c=t.__text,u=n?c+o:o+c;this.setTextContent(u);const d=this.getWritable();return t.remove(),d}isTextEntity(){return!1}};function x8(e){return{forChild:Cp(e.style),node:null}}s(x8,"Uo");function C8(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:Cp(t.style,n?void 0:"bold"),node:null}}s(C8,"$o");var R0=new WeakMap;function b8(e){if(!vt(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}s(b8,"Jo");function E8(e){const t=e;e.parentElement===null&&B(129);let n=t.textContent||"";if((function(r){let i,o=r.parentNode;const l=[r];for(;o!==null&&(i=R0.get(o))===void 0&&!b8(o);)l.push(o),o=o.parentNode;const a=i===void 0?o:i;for(let c=0;c<l.length;c++)R0.set(l[c],a);return a})(t)!==null)return{node:Ep(n)};if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,i=!0;for(;r!==null&&(r=L0(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,i=!0;for(;r!==null&&(r=L0(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Ft(n)}}s(E8,"jo");function L0(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const o=n.parentElement;if(o===null)return null;n=o}if(n=r,vt(n)){const o=n.style.display;if(o===""&&!C2(n)||o!==""&&!o.startsWith("inline"))return null}let i=n;for(;(i=t?n.firstChild:n.lastChild)!==null;)n=i;if(yr(n))return n;if(n.nodeName==="BR")return null}}s(L0,"Vo");var S8={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ur(e){const t=S8[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Cp(e.style,t),node:null}}s(Ur,"Yo");function Ft(e=""){return ba(new _a(e))}s(Ft,"Go");function X(e){return e instanceof _a}s(X,"Xo");function Cp(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i=n==="700"||n==="bold",o=r.includes("line-through"),l=e.fontStyle==="italic",a=r.includes("underline"),c=e.verticalAlign;return u=>((X(u)||Zc(u))&&(i&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),l&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),c!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),c!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),t&&!u.hasFormat(t)&&u.toggleFormat(t)),u)}s(Cp,"Qo");var nd=class m5 extends _a{static{s(this,"Zo")}static getType(){return"tab"}static clone(t){return new m5(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=cs(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return bp().updateFromJSON(t)}setTextContent(t){return super.setTextContent(" ")}spliceText(t,n,r,i){return r===""&&n===0||r===" "&&n===1||B(286),this}setDetail(t){return t!==2&&B(127),this}setMode(t){return t!=="normal"&&B(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function bp(){return ba(new nd)}s(bp,"tr");function rd(e){return e instanceof nd}s(rd,"er");var T8=class{static{s(this,"nr")}key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Gp(dr(ei(this,"next")),dr(ei(e,"next")))<0}getNode(){const e=nt(this.key);return e===null&&B(20),e}set(e,t,n,r){const i=this._selection,o=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,bo()||(qr()===o&&Rt(e),i!==null&&(i.setCachedNodes(null),ve(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function gr(e,t,n){return new T8(e,t,n)}s(gr,"or");function tf(e,t){let n=t.__key,r=e.offset,i="element";if(X(t)){i="text";const o=t.getTextContentSize();r>o&&(r=o)}else if(!F(t)){const o=t.getNextSibling();if(X(o))n=o.__key,r=0,i="text";else{const l=t.getParent();l&&(n=l.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}s(tf,"rr");function $0(e,t){if(F(t)){const n=t.getLastDescendant();F(n)||X(n)?tf(e,n):tf(e,t)}else tf(e,t)}s($0,"ir");var _5=class v5{static{s(this,"sr")}_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!As(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(i=>r.has(i))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new v5(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes().filter(l=>Zt(l)===null),r=n.length;if(r===0)return;const i=n[r-1];let o;if(X(i))o=i.select();else{const l=i.getIndexWithinParent()+1;o=i.getParentOrThrow().select(l,l)}o.insertNodes(t);for(let l=0;l<r;l++)n[l].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const i of n){const o=nt(i);o!==null&&r.push(o)}return bo()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes().filter(n=>Zt(n)===null);if((Ve()||No())===this&&t[0]){const n=_t(t[0],"next");H2(Ki(n,n))}for(const n of t)n.remove();y5()}};function y5(){const e=Dn();if(e.isEmpty()){const t=mn();e.append(t),t.select()}}s(y5,"lr");function ve(e){return e instanceof va}s(ve,"cr");var va=class x5{static{s(this,"ar")}format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(t,n,r,i){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!ve(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const i=[],[o,l]=r.getTextSlices();o&&i.push(o.caret.origin);const a=new Set,c=new Set;for(const u of r)if(Gn(u)){const{origin:d}=u;i.length===0?a.add(d):(c.add(d),i.push(d))}else{const{origin:d}=u;F(d)&&c.has(d)||i.push(d)}if(l&&i.push(l.caret.origin),Bi(r.focus)&&F(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=oi(r.focus.origin,"previous");Gn(u)&&a.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(i[i.length-1]);u=_s(u))a.delete(u.origin),i.pop();for(;i.length>1;){const u=i[i.length-1];if(!F(u)||c.has(u)||u.isEmpty()||a.has(u))break;i.pop()}if(i.length===0&&r.isCollapsed()){const u=dr(r.anchor),d=dr(r.anchor.getFlipped()),f=s(g=>fr(g)?g.origin:g.getNodeAtCaret(),"r"),h=f(u)||f(d)||(r.anchor.getNodeAtCaret()?u.origin:d.origin);i.push(h)}return i})(Zp(wh(this),"next"));return bo()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,i){return this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,i,"text"),this}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],i=this.anchor,o=this.focus,l=i.isBefore(o),[a,c]=ph(this);let u="",d=!0;for(let f=0;f<t.length;f++){const h=t[f];if(F(h)&&!h.isInline()){d||(u+=`
9
+ `);let g="";for(const p of Jn(h)){const _=Vi(h,p);_!==null&&(g+=_.getTextContent())}g!==""?(u+=g,d=!1):d=!h.isEmpty()}else if(d=!1,X(h)){let g=h.getTextContent();h===n?h===r?i.type==="element"&&o.type==="element"&&o.offset!==i.offset||(g=a<c?g.slice(a,c):g.slice(c,a)):g=l?g.slice(a):g.slice(c):h===r&&(g=l?g.slice(0,c):g.slice(0,a)),u+=g}else!We(h)&&!Ir(h)||h===r&&this.isCollapsed()||(u+=h.getTextContent())}return u}applyDOMRange(t){const n=Ue(),r=n.getEditorState()._selection,i=A5(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(i===null)return;const[o,l,a]=i;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(l.key,l.offset,l.type,!0),a&&(this.dirty=!0),Yo(this)}clone(){const t=this.anchor,n=this.focus;return new x5(gr(t.key,t.offset,t.type),gr(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Pi(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Gt[t];return(this.format&n)!==0}insertRawText(t){this.insertNodes(Ep(t))}insertText(t){const n=this.anchor,r=this.focus,i=this.format,o=this.style;let l=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(l=r,a=n),l.type==="element"&&(function(y,v,x,C){const b=y.getNode(),S=b.getChildAtIndex(y.offset),M=Ft();if(M.setFormat(x),M.setStyle(C),q5(S))S.splice(0,0,[M]);else if(S!==null){const T=kt(b)?mn().append(M):M;S.insertBefore(T)}else if(kt(b)){const T=b.getLastChild();F(T)&&!T.isInline()&&T.isEmpty()?T.append(M):b.append(mn().append(M))}else b.append(M);y.is(v)&&v.set(M.__key,0,"text"),y.set(M.__key,0,"text")})(l,a,i,o),a.type==="element"&&vs(a,dr(ei(a,"next")));const c=l.offset;let u=a.offset;const d=this.getNodes(),f=d.length;let h=d[0];X(h)||B(26);const g=h.getTextContent().length,p=h.getParentOrThrow();let _=d[f-1];if(f===1&&a.type==="element"&&(u=g,a.set(l.key,u,"text")),this.isCollapsed()&&c===g&&(An(h)||!h.canInsertTextAfter()||!p.canInsertTextAfter()&&h.getNextSibling()===null)){const y=h.getNextSibling();let v;if(X(y)&&y.canInsertTextBefore()&&!An(y)?v=y:(v=Ft(),v.setFormat(i),v.setStyle(o),p.canInsertTextAfter()?h.insertAfter(v):p.insertAfter(v)),v.select(0,0),h=v,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&c===0&&(An(h)||!h.canInsertTextBefore()||!p.canInsertTextBefore()&&h.getPreviousSibling()===null)){const y=h.getPreviousSibling();let v;if(!X(y)||An(y)?(v=Ft(),v.setFormat(i),p.canInsertTextBefore()?h.insertBefore(v):p.insertBefore(v)):v=y,v.select(),h=v,t!=="")return void this.insertText(t)}else if(h.isSegmented()&&c!==g)if(qr()!==null)h=h.setMode("normal").setFormat(i).setStyle(o);else{const y=Ft(h.getTextContent());y.setFormat(i),h.replace(y),h=y}else if(!this.isCollapsed()&&t!==""){const y=_.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||F(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),w5(this.anchor,this.focus),void this.insertText(t)}if(f===1){if(Di(h)){const C=Ft(t);C.select(),h.replace(C);return}const y=h.getFormat(),v=h.getStyle();if(c!==u||y===i&&v===o){if(rd(h)){const C=Ft(t);C.setFormat(i),C.setStyle(o),C.select(),h.replace(C);return}}else{if(h.getTextContent()!==""){const C=Ft(t);if(C.setFormat(i),C.setStyle(o),C.select(),c===0)h.insertBefore(C,!1);else{const[b]=h.splitText(c);b.insertAfter(C,!1)}C.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null);return}h.setFormat(i),h.setStyle(o)}const x=u-c;h=h.spliceText(c,x,t,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=y,this.style=v,h.isComposing()&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{const y=new Set([...h.getParentKeys(),..._.getParentKeys()]),v=F(h)?h:h.getParentOrThrow();let x=F(_)?_:_.getParentOrThrow(),C=_;if(!v.is(x)&&x.isInline())do C=x,x=x.getParentOrThrow();while(x.isInline());if(a.type==="text"&&(u!==0||_.getTextContent()==="")||a.type==="element"&&_.getIndexWithinParent()<u)if(X(_)&&!Di(_)&&u!==_.getTextContentSize()){if(_.isSegmented()){const E=Ft(_.getTextContent());_.replace(E),_=E}Mt(a.getNode())||a.type!=="text"||(X(_)||B(395),_=_.spliceText(0,u,"")),y.add(_.__key)}else{const E=_.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?_.remove():E.remove()}else y.add(_.__key);const b=x.getChildren(),S=new Set(d),M=v.is(x),T=v.isInline()&&h.getNextSibling()===null?v:h;for(let E=b.length-1;E>=0;E--){const A=b[E];if(A.is(h)||F(A)&&A.isParentOf(h))break;A.isAttached()&&(!S.has(A)||A.is(C)?M||T.insertAfter(A,!1):A.remove())}if(!M){let E=x,A=null;for(;E!==null;){const D=E.getChildren(),L=D.length;(L===0||D[L-1].is(A))&&(y.delete(E.__key),A=E),E=E.getParent()}}if(Di(h))if(c===g)h.select();else{const E=Ft(t);E.select(),h.replace(E)}else h=h.spliceText(c,g-c,t,!0),h.getTextContent()===""?h.remove():this.anchor.type==="text"&&(this.format=h.getFormat(),this.style=h.getStyle(),h.isComposing()&&(this.anchor.offset-=t.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let E=1;E<f;E++){const A=d[E],D=A.__key;y.has(D)||A.remove()}}}removeText(){const t=Ve()===this;yl(this,K2(wh(this))),t&&Ve()!==this&&dn(this)}formatText(t,n=null){b5(this,t,n)}insertNodes(t){if(t.length===0)return;this.isCollapsed()||this.removeText();const n=this.anchor.getNode();if(this.anchor.type==="element"&&F(n)&&Zt(n)!==null){let _=n.isShadowRoot()?n.getFirstChild()??n.append(mn()).getFirstChild():n.getFirstChild();if(n.isShadowRoot()&&_!==null&&!F(_)){const y=mn();_.insertBefore(y),_=y}if(_!==null){_.selectStart();const y=Ve();return ve(y)||B(369),y.insertNodes(t)}}if(this.anchor.type==="element"&&kt(n)){const _=rf(t),y=_.getLastDescendant();n.splice(this.anchor.offset,0,_.getChildren()),y!==null&&y.selectEnd();return}let r=(this.isBackward()?this.focus:this.anchor).getNode(),i=bi(r,hn);const o=t[t.length-1];if(F(i)&&"__language"in i){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const _=Gs(this);i.splice(_,0,t),o.selectEnd()}return}if(!t.some(_=>(F(_)||We(_))&&!_.isInline())){F(i)||B(211,r.constructor.name,r.getType());const _=Gs(this);i.splice(_,0,t),o.selectEnd();return}if(F(i)&&Zt(i)!==null){const _=Gs(this),y=_h(t);i.splice(_,0,y);const v=y[y.length-1];v!==void 0?v.selectEnd():i.select(_,_);return}if(i===null){const _=rf(t),y=_.getLastDescendant();let v=ei(this.anchor,"next");for(const x of _.getChildren())v=j2(x,v);y!==null&&y.selectEnd();return}if(F(i)&&!i.isParentRequired()&&!kt(i.getParentOrThrow())){const _=Gs(this),y=_h(t);i.splice(_,0,y);const v=y[y.length-1];v!==void 0?v.selectEnd():i.select(_,_);return}const l=rf(t),a=l.getLastDescendant(),c=l.getChildren(),u=!F(i)||!i.isEmpty()?this.insertParagraph():null;u&&!i.isAttached()&&(r=this.anchor.getNode(),i=bi(r,hn));const d=c[c.length-1];let f=c[0];var h;F(h=f)&&hn(h)&&!h.isEmpty()&&F(i)&&(!i.isEmpty()||i.canMergeWhenEmpty())&&(F(i)||B(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&B(212,r.constructor.name,r.getType()),(function(_,y){const v=y.getParentOrThrow().getLastChild();let x=y;const C=[y];for(;x!==v;)x.getNextSibling()||B(140),x=x.getNextSibling(),C.push(x);let b=_;for(const S of C)b=b.insertAfter(S)})(i,f));const g=bi(a,hn);u&&F(g)&&(u.canMergeWhenEmpty()||hn(d))&&(g.append(...u.getChildren()),u.remove()),F(i)&&i.isEmpty()&&i.remove(),a.selectEnd();const p=F(i)?i.getLastChild():null;Ir(p)&&g!==i&&p.remove()}insertParagraph(){const t=this.anchor.getNode();if(this.anchor.type==="element"&&kt(t)){const a=mn();return t.splice(this.anchor.offset,0,[a]),a.select(),a}const n=Gs(this),r=bi(this.anchor.getNode(),hn);if(r!==null&&Zt(r)!==null)return null;F(r)||B(213);const i=r.getChildAtIndex(n),o=i?[i,...i.getNextSiblings()]:[],l=r.insertNewAfter(this,!1);return l?(l.append(...o),l.selectStart(),l):null}insertLineBreak(t){const n=ya();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),i=n.getIndexWithinParent();r.select(i,i)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],i=t[n-1];const[o,l]=ph(this),a=this.isBackward(),[c,u]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[d,f]=a?[l,o]:[o,l];if(n===0)return[];if(n===1){if(X(r)&&!this.isCollapsed()){const h=r.splitText(d,f),g=d===0?h[0]:h[1];return g?(c.set(g.getKey(),0,"text"),u.set(g.getKey(),g.getTextContentSize(),"text"),[g]):[]}return[r]}if(X(r)&&(d===r.getTextContentSize()?t.shift():d!==0&&([,r]=r.splitText(d),t[0]=r,c.set(r.getKey(),0,"text"))),X(i)){const h=i.getTextContent().length;f===0?t.pop():f!==h&&([i]=i.splitText(f),t[t.length-1]=i,u.set(i.getKey(),i.getTextContentSize(),"text"))}return t}modify(t,n,r){if(eu(this,t,n,r))return;const i=t==="move",o=Ue(),l=tr(Sn(o));if(!l)return;const a=o._blockCursorElement,c=o._rootElement,u=this.focus.getNode();c===null||a===null||!F(u)||u.isInline()||u.canBeEmpty()||iu(a,o,c);const d=ps(o,this.focus.key);let f=d;if(this.focus.type==="text"&&(f=X(u)?Qr(u,d,o):null),this.dirty){const h=ps(o,this.anchor.key);let g=h;if(this.anchor.type==="text"){const p=this.anchor.getNode();g=X(p)?Qr(p,h,o):null}g&&f&&Qc(l,g,this.anchor.offset,f,this.focus.offset)}if(r==="character"&&X(u)&&u.isUnmergeable()&&(n?this.focus.offset===0:this.focus.offset===u.getTextContentSize())){const h=_t(u,n?"previous":"next").getNodeAtCaret();if(X(h)){if(!i){const g=h.getTextContentSize();n?this.focus.set(h.__key,g-1,"text"):this.focus.set(h.__key,1,"text"),this.dirty=!0;return}{const g=o.getElementByKey(h.getKey()),p=g?Qr(h,g,o):null;if(p){const _=n?p.length:0;Qc(l,p,_,p,_)}}}}if(S5(l,t,n?"backward":"forward",r),l.rangeCount>0){const h=Ds(l,o._rootElement),g=h||l.getRangeAt(0),p=this.anchor.getNode(),_=Mt(p)?p:$p(p);this.applyDOMRange(g),this.dirty=!0,!i&&(T5(this,n,_),(h?l.direction!=="backward":l.anchorNode===g.startContainer&&l.anchorOffset===g.startOffset)||E5(this))}r==="lineboundary"&&eu(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&F(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const i=n.getParent(),o=n.getNextSibling()||(i===null?null:i.getNextSibling());if(F(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,t))return;const o=jp(ei(r,t?"previous":"next"));if(o.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const c of o.iterNodeCarets("shadowRoot"))if(Gn(c)){if(!c.origin.isInline()){if(c.origin.isShadowRoot()){if(a.type==="merge-block")break;if(F(o.anchor.origin)&&o.anchor.origin.isEmpty()){const u=dr(c);yl(this,Ki(u,u)),o.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:c,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Bi(c)){if(F(c.origin)){if(c.origin.isInline()){if(!c.origin.isParentOf(o.anchor.origin))break}else a={block:c.origin,type:"merge-next-block"};continue}if(We(c.origin)){if(!c.origin.isIsolated())if(Jn(c.origin).length>0){if(F(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const u=Yc();u.add(c.origin.getKey()),dn(u)}}else if(a.type==="merge-next-block"&&(c.origin.isKeyboardSelectable()||!c.origin.isInline())&&F(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const u=Yc();u.add(c.origin.getKey()),dn(u)}else c.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:c,block:u}=a;return Jn(u).length>0?void 0:c.origin.isEmpty()&&!u.isEmpty()&&c.origin.getParent()===u.getParent()?void c.origin.remove(!0):(yl(this,Ki(!c.origin.isEmpty()&&u.isEmpty()?Do(_t(u,c.direction)):o.anchor,c)),this.removeText())}for(let c=r.getNode();c!==null;){if(Zt(c)!==null)return;if(F(c)&&c.isShadowRoot())break;c=c.getParent()}}const l=this.focus;if(nf(this,t,"character"),this.isCollapsed()){if(t&&r.offset===0&&F0(this,r.getNode()))return}else{const a=l.type==="text"?l.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const c=l.offset,u=a.getTextContentSize();if(a.is(i)||t&&c!==u||!t&&c!==0)return void V0(a,t,c)}else if(i!==null&&i.isSegmented()){const c=r.offset,u=i.getTextContentSize();if(i.is(a)||t&&c!==0||!t&&c!==u)return void V0(i,t,c)}(function(c,u){const d=c.anchor,f=c.focus,h=d.getNode();if(h===f.getNode()&&d.type==="text"&&f.type==="text"){const g=d.offset,p=f.offset,_=g<p,y=_?g:p,v=_?p:g,x=v-1;y!==x&&(function(C){return!(r2(C)||k8(C))})(h.getTextContent().slice(y,v))&&(u?f.set(f.key,x,f.type):d.set(d.key,x,d.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Mt(r.getParent())&&r.getPreviousSibling()===null&&F0(this,r),y5()}}deleteLine(t){const n=mh(this.anchor);if(n!==null&&We(Kn(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(t);this.isCollapsed()&&nf(this,t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):bi(this.anchor.getNode(),hn)!==bi(this.focus.getNode(),hn)?(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(t)):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;nf(this,t,"word")}this.isCollapsed()?this.deleteCharacter(t):this.removeText()}isBackward(){const t=this._cachedIsBackward;if(t!==null)return t;const n=this.focus.isBefore(this.anchor);return bo()||(this._cachedIsBackward=n),n}getStartEndPoints(){return[this.anchor,this.focus]}};function As(e){return e instanceof _5}s(As,"ur");function C5(e,t){if(As(e)){for(const v of e.getNodes())Zc(v)&&v.setFormat(t(v.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Rt(null);const n=[];for(const v of e.getNodes())X(v)?n.push(v):F(v)?v.setTextFormat(t(v.getTextFormat())):Zc(v)&&v.setFormat(t(v.getFormat()));const r=n.length;if(r===0)return e.setFormat(t(e.format)),void Rt(null);const i=e.anchor,o=e.focus,l=e.isBackward(),a=l?o:i,c=l?i:o;let u=0,d=n[0],f=a.type==="element"?0:a.offset;if(a.type==="text"&&f===d.getTextContentSize()&&(u=1,d=n[1],f=0),d==null)return;const h=r-1;let g=n[h];const p=c.type==="text"?c.offset:g.getTextContentSize();if(d.is(g)){if(f===p)return;const v=t(d.getFormat());if(An(d)||f===0&&p===d.getTextContentSize())d.setFormat(v);else{const x=d.splitText(f,p),C=f===0?x[0]:x[1];C.setFormat(v),a.type==="text"&&a.set(C.__key,0,"text"),c.type==="text"&&c.set(C.__key,p-f,"text")}e.format=v;return}f===0||An(d)||([,d]=d.splitText(f),f=0);const _=t(d.getFormat());d.setFormat(_);const y=t(g.getFormat());p>0&&(p===g.getTextContentSize()||An(g)||([g]=g.splitText(p)),g.setFormat(y));for(let v=u+1;v<h;v++){const x=n[v];x.setFormat(t(x.getFormat()))}a.type==="text"&&a.set(d.__key,f,"text"),c.type==="text"&&c.set(g.__key,p,"text"),e.format=_|y}s(C5,"fr");function w8(e,t){const n=[];for(const[r,i]of Object.entries(t))typeof i=="boolean"&&n.push([r,i]);n.length!==0&&C5(e,r=>{for(const[i,o]of n)r=Pi(r,i,o?Gt[i]:0);return r})}s(w8,"dr");function b5(e,t,n=null){const r=n===null&&ve(e)?Pi(e.format,t,null):n;C5(e,i=>Pi(i,t,r))}s(b5,"hr");function P0(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}s(P0,"gr");function ph(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[P0(n),P0(r)]}s(ph,"_r");function F0(e,t){for(let n=t;n;n=n.getParent()){if(F(n)){if(n.collapseAtStart(e))return!0;if(kt(n))break}if(n.getPreviousSibling())break}return!1}s(F0,"pr");function E5(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,o,!0)}s(E5,"yr");function S5(e,t,n,r){e.modify(t,n,r)}s(S5,"mr");function T5(e,t,n){const r=e.getNodes(),i=r.filter(a=>Ul(a,n));if(i.length===0||i.length===r.length)return!1;const o=t?i[0]:i[i.length-1],l=F(o)?o:o.getParentOrThrow();return t?l.selectStart():l.selectEnd(),!0}s(T5,"xr");function nf(e,t,n){if(eu(e,"extend",t,n))return;const r=Ue(),i=tr(Sn(r));if(!i||typeof i.modify!="function")return;const o=r._blockCursorElement,l=r._rootElement,a=e.anchor,c=e.focus.getNode();l===null||o===null||!F(c)||c.isInline()||c.canBeEmpty()||iu(o,r,l);const u=s(A=>{const D=A.getNode(),L=r.getElementByKey(A.key);return L!==null&&A.type==="text"&&X(D)?Qr(D,L,r):L},"a"),d=a.getNode(),f=u(a);if(f===null)return;const h=a.offset,g=e.isCollapsed(),p=e.focus,_=g?f:u(p);if(_===null)return;const y=p.offset;if(Qc(i,_,y,_,y),S5(i,"move",t?"backward":"forward",n),i.rangeCount===0)return;const v=Ds(i,l)||i.getRangeAt(0),x=v.startContainer,C=v.startOffset;if(g&&n==="character"&&a.type==="text"&&X(d)&&d.isUnmergeable()&&h===(t?0:d.getTextContentSize())){const A=_t(d,t?"previous":"next").getNodeAtCaret();if(X(A)){const D=t?A.getTextContentSize()-1:1;e.focus.set(A.__key,D,"text"),e.dirty=!0;return}}if(g&&n==="character"&&a.type==="text"){const A=t?0:d.getTextContentSize(),D=x===f?C:h!==A?A:-1;if(D>=0)return void(D!==h&&(e.focus.set(a.key,D,"text"),e.dirty=!0))}const[b,S,M,T]=t?[x,C,f,h]:[f,h,x,C],E=Mt(d)?d:$p(d);e.applyDOMRange({collapsed:!1,endContainer:M,endOffset:T,startContainer:b,startOffset:S}),e.dirty=!0,!T5(e,t,E)&&t&&E5(e),n==="lineboundary"&&eu(e,"extend",t,n,"decorators")}s(nf,"Cr");var k8=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function V0(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let l=0,a=0;for(let u=0;u<o;u++){const d=u===o-1;if(a=l,l+=i[u].length,t&&l===n||l>n||d){i.splice(u,1),d&&(a=void 0);break}}const c=i.join("").trim();c===""?r.remove():(r.setTextContent(c),r.select(a,a))}s(V0,"vr");function B0(e,t,n,r){let i,o=t,l=!1;if(vt(e)){let a=!1;const c=e.childNodes,u=c.length,d=r._blockCursorElement;o===u&&u>0&&(a=!0,o=u-1),Os(e,r)!==void 0||Wl(e,r)||(l=!0);let f=c[o],h=!1;if(f===d)f=c[o+1],h=!0;else if(d!==null){const g=d.parentNode;e===g&&t>Array.prototype.indexOf.call(g.children,d)&&o--}if(i=Xo(f),X(i))o=hr(i,a?"next":"previous");else{let g=Xo(e);if(g===null)return null;if(F(g)){const p=r.getElementByKey(g.getKey());p===null&&B(214),[g,o]=Rn(g,p,r).resolveChildIndex(g,p,e,t),F(g)||B(215),a&&o>=g.getChildrenSize()&&(o=Math.max(0,g.getChildrenSize()-1));let y=g.getChildAtIndex(o);if(F(y)&&(function(v,x,C){const b=v.getParent();return C===null||b===null||!b.canBeEmpty()||b!==C.getNode()})(y,0,n)){const v=a?y.getLastDescendant():y.getFirstDescendant();v===null?g=y:(y=v,g=F(y)?y:y.getParentOrThrow()),o=0}X(y)?(i=y,g=null,o=hr(y,a?"next":"previous")):y!==g&&a&&!h&&(F(g)||B(216),o=Math.min(g.getChildrenSize(),o+1))}else{const p=Kn(g),_=p!==null?p:g,y=_.getIndexWithinParent(),v=r.getElementByKey(g.getKey());let x="after";if(v!==null&&Xo(e)===g){const C=Rn(g,v,r);C.element!==v?x=C.resolveLeafPosition(v,e,t):t===0&&We(g)&&(x="before")}o=x==="before"?y:y+1,g=_.getParentOrThrow()}if(F(g))return[gr(g.__key,o,"element"),l]}}else i=Xo(e);return X(i)?[gr(i.__key,hr(i,o,"clamp"),"text"),l]:null}s(B0,"Tr");function H0(e,t,n){const r=e.offset,i=e.getNode();if(r===0){const o=i.getPreviousSibling(),l=i.getParent();if(t){if((n||!t)&&o===null&&F(l)&&l.isInline()){const a=l.getPreviousSibling();X(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else F(o)&&!n&&o.isInline()?e.set(o.__key,o.getChildrenSize(),"element"):X(o)&&!i.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,"text")}else if(r===i.getTextContent().length){const o=i.getNextSibling(),l=i.getParent();if(t&&F(o)&&o.isInline())e.set(o.__key,0,"element");else if((n||t)&&o===null&&F(l)&&l.isInline()&&!l.canInsertTextAfter()&&l.getTextContentSize()>1){const a=l.getNextSibling();X(a)&&e.set(a.__key,0,"text")}}}s(H0,"kr");function w5(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),i=e.is(t);H0(e,r,i),H0(t,!r,i),i&&t.set(e.key,e.offset,e.type)}}s(w5,"br");function mh(e){const t=nt(e.key);return t===null?null:N2(t)}s(mh,"Nr");function k5(e,t,n){const r=mh(e),i=mh(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;const o=n(r,i);if(r!==null)return F(r)?t.set(r.getKey(),o?r.getChildrenSize():0,"element"):t.set(r.getKey(),o?r.getTextContentSize():0,"text"),!0;const l=Kn(i);if(l===null)return!1;const a=l.getParent();if(a===null)return!1;const c=l.getIndexWithinParent();return t.set(a.getKey(),o?c+1:c,"element"),!0}s(k5,"wr");function M5(e){const t=k5(e.anchor,e.focus,(n,r)=>(function(i,o,l,a){if(l!==null&&a!==null){const d=Kn(l),f=Kn(a);if(d!==null&&d.is(f)){for(const h of hd(d).values()){if(h===l.getKey())return!0;if(h===a.getKey())return!1}return!0}return d===null||f===null||d.isBefore(f)}if(l!==null){const d=Kn(l),f=nt(o.key);return d===null||f===null||!(!d.is(f)&&!d.isParentOf(f))||d.isBefore(f)}const c=Kn(a),u=nt(i.key);return c!==null&&u!==null&&!c.is(u)&&!c.isParentOf(u)&&u.isBefore(c)})(e.anchor,e.focus,n,r));return t&&(e.dirty=!0),t}s(M5,"Er");function A5(e,t,n,r,i,o){if(e===null||n===null||!xa(i,e,n))return null;const l=B0(e,t,ve(o)?o.anchor:null,i);if(l===null)return null;const a=B0(n,r,ve(o)?o.focus:null,i);if(a===null)return null;const[c,u]=l,[d,f]=a;if(c.type==="element"&&d.type==="element"){const g=Xo(e),p=Xo(n);if(We(g)&&We(p))return null}const h=i._slotsUsed&&k5(c,d,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return w5(c,d),[c,d,u||f||h]}s(A5,"Or");function I5(e){return F(e)&&!e.isInline()}s(I5,"Mr");function N5(e,t,n,r,i,o){const l=Pr(),a=new va(gr(e,t,i),gr(n,r,o),0,"");return a.dirty=!0,l._selection=a,a}s(N5,"Ar");function O5(){const e=gr("root",0,"element"),t=gr("root",0,"element");return new va(e,t,0,"")}s(O5,"Dr");function Yc(){return new _5(new Set)}s(Yc,"Pr");function M8(e,t){return id(null,e,t,null)}s(M8,"Fr");function id(e,t,n,r){const i=n._window;if(i===null)return null;const o=r||i.event,l=o?o.type:void 0,a=l==="selectionchange",c=!Xf&&(a||l==="beforeinput"||l==="compositionstart"||l==="compositionend"||l==="click"&&o&&o.detail===3||l==="drop"||l===void 0);let u,d,f,h;if(ve(e)&&!c)return e.clone();{if(t===null)return null;const b=Yn(t,n._rootElement);if(u=b.anchorNode,d=b.focusNode,f=b.anchorOffset,h=b.focusOffset,(a||l===void 0)&&ve(e)&&!xa(n,u,d))return e.clone()}const g=A5(u,f,d,h,n,e);if(g===null)return null;const[p,_,y]=g;let v=0,x="";if(ve(e)){const b=e.anchor;if(p.key===b.key)v=e.format,x=e.style;else{const S=p.getNode();X(S)?(v=S.getFormat(),x=S.getStyle()):F(S)&&(v=S.getTextFormat(),x=S.getTextStyle())}}const C=new va(p,_,v,x);return y&&(C.dirty=!0),C}s(id,"Ir");function Ve(){return Pr()._selection}s(Ve,"Lr");function No(){return Ue()._editorState._selection}s(No,"Kr");function oo(e,t,n,r=1){const i=e.anchor,o=e.focus,l=i.getNode(),a=o.getNode();if(!t.is(l)&&!t.is(a))return;const c=t.__key;if(e.isCollapsed()){const u=i.offset;if(n<=u&&r>0||n<u&&r<0){const d=Math.max(0,u+r);i.set(c,d,"element"),o.set(c,d,"element"),K0(e)}}else{const u=e.isBackward(),d=u?o:i,f=d.getNode(),h=u?i:o,g=h.getNode();if(t.is(f)){const p=d.offset;(n<=p&&r>0||n<p&&r<0)&&d.set(c,Math.max(0,p+r),"element")}if(t.is(g)){const p=h.offset;(n<=p&&r>0||n<p&&r<0)&&h.set(c,Math.max(0,p+r),"element")}}K0(e)}s(oo,"zr");function K0(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),l=r.getNode();if(e.isCollapsed()){if(!F(o))return;const a=o.getChildrenSize(),c=n>=a,u=c?o.getChildAtIndex(a-1):o.getChildAtIndex(n);if(X(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text"),r.set(u.__key,d,"text")}return}if(F(o)){const a=o.getChildrenSize(),c=n>=a,u=c?o.getChildAtIndex(a-1):o.getChildAtIndex(n);if(X(u)){let d=0;c&&(d=u.getTextContentSize()),t.set(u.__key,d,"text")}}if(F(l)){const a=l.getChildrenSize(),c=i>=a,u=c?l.getChildAtIndex(a-1):l.getChildAtIndex(i);if(X(u)){let d=0;c&&(d=u.getTextContentSize()),r.set(u.__key,d,"text")}}}s(K0,"Br");function Xc(e,t,n,r,i){let o=null,l=0,a=null;r!==null?(o=r.__key,X(r)?(l=r.getTextContentSize(),a="text"):F(r)&&(l=r.getChildrenSize(),a="element")):i!==null&&(o=i.__key,X(i)?a="text":F(i)&&(a="element")),o!==null&&a!==null?e.set(o,l,a):(l=t.getIndexWithinParent(),l===-1&&(l=n.getChildrenSize()),e.set(n.__key,l,"element"))}s(Xc,"Rr");function U0(e,t,n,r,i){e.type==="text"?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}s(U0,"Wr");function Qc(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}s(Qc,"Ur");function W0(e,t,n){const r=ps(e,t.getKey());if(F(t)){const i=Rn(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}s(W0,"$r");function D5(e,t,n,r,i,o){const l=o.getRootNode(),a=Ns(l)||ii(l)?ms(l):null;if(i.has("collaboration")&&a!==o||a!==null&&ud(a,a))return;const c=Yn(r,o);let u;if(!ve(t))return void(e!==null&&xa(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());const d=t.anchor,f=t.focus,h=d.getNode(),g=f.getNode(),[p,_]=W0(n,h,d.offset),[y,v]=W0(n,g,f.offset),x=t.format,C=t.style,b=t.isCollapsed();let S=p,M=y,T=!1;if(d.type==="text"?(S=X(h)?Qr(h,p,n):null,T=h.getFormat()!==x||h.getStyle()!==C):ve(e)&&e.anchor.type==="text"&&(T=!0),f.type==="text"&&(M=X(g)?Qr(g,y,n):null),S!==null&&M!==null){if(b&&(e===null||T||ve(e)&&(e.format!==x||e.style!==C))&&(function(E,A,D,L,G,$){E._inputState.collapsedSelectionFormat={format:A,key:G,offset:L,style:D,timeStamp:$}})(n,x,C,_,d.key,performance.now()),(r.type!=="Range"||!b)&&c.anchorOffset===_&&c.focusOffset===v&&c.anchorNode===S&&c.focusNode===M){if(a===null||!o.contains(a)){const E=a!==null?fo(a):null;E!==null&&E!==n||i.has("skip-selection-focus")||o.focus({preventScroll:!0})}if(d.type!=="element")return}if(Qc(r,S,_,M,v),ri&&t.isCollapsed()&&o!==null&&!i.has("skip-selection-focus")){const E=ou(o);if(E===null||!o.contains(E)){const A=ms(o.ownerDocument),D=A!==null?fo(A):null;D!==null&&D!==n||o.focus({preventScroll:!0})}}if(!i.has("skip-scroll-into-view")&&t.isCollapsed()&&o!==null&&o===ou(o)){const E=ve(t)&&t.anchor.type==="element"?S.childNodes[_]||null:(u===void 0&&(u=m2(r,o)),u);if(E!==null){let A;if(yr(E)){const D=E.ownerDocument.createRange();D.selectNode(E),A=D.getBoundingClientRect()}else A=E.getBoundingClientRect();(function(D,L,G){const $=fd(G),z=Lp($);if($===null||z===null)return;const W=G.getBoundingClientRect();if(L.bottom<W.top)return;let{top:ye,bottom:q}=L,ge=0,me=0,oe=G;for(;oe!==null;){const Z=oe===$.body;if(Z){const de=z.visualViewport;if(de){const ue=de.offsetTop;ge=ue,me=ue+de.height}else ge=0,me=Sn(D).innerHeight;const ce=z.getComputedStyle($.documentElement),j=parseFloat(ce.scrollPaddingTop),ne=parseFloat(ce.scrollPaddingBottom);isFinite(j)&&(ge+=j),isFinite(ne)&&(me-=ne)}else{const de=oe===G?W:oe.getBoundingClientRect();ge=de.top,me=de.bottom}let pe=0;if(ye<ge?pe=-(ge-ye):q>me&&(pe=q-me),pe!==0)if(Z)z.scrollBy(0,pe);else{const de=oe.scrollTop;oe.scrollTop+=pe;const ce=oe.scrollTop-de;ye-=ce,q-=ce}if(Z)break;oe=Oo(oe)}})(n,A,o)}}(function(E){E._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}s(D5,"Hr");function A8(e){let t=Ve()||No();t===null&&(t=Dn().selectEnd()),t.insertNodes(e)}s(A8,"Jr");function R5(e,t){for(const n of e.split(/(\r?\n|\t)/))n===`
10
+ `||n===`\r
11
+ `?t.linebreak():n===" "?t.tab():n!==""&&t.text(n)}s(R5,"jr");function Ep(e){const t=[];return R5(e,{linebreak:s(()=>t.push(ya()),"linebreak"),tab:s(()=>t.push(bp()),"tab"),text:s(n=>t.push(Ft(n)),"text")}),t}s(Ep,"Vr");function I8(){const e=Ve();return e===null?"":e.getTextContent()}s(I8,"qr");function _h(e){const t=[];for(const n of e)Ir(n)||(!F(n)&&!We(n)||n.isInline()?t.push(n):F(n)&&t.push(..._h(n.getChildren())));return t}s(_h,"Yr");function Gs(e){let t=e;e.isCollapsed()||t.removeText();const n=Ve();ve(n)&&(t=n),ve(t)||B(161);const r=t.anchor;let i=r.getNode(),o=r.offset;for(;!hn(i)&&Zt(i)===null;){const l=i;if([i,o]=N8(i,o),l.is(i))break}return o}s(Gs,"Gr");function N8(e,t){const n=e.getParent();if(!n){const i=mn();return Dn().append(i),i.select(),[Dn(),0]}if(X(e)){const i=e.splitText(t);if(i.length===0)return[n,e.getIndexWithinParent()];const o=t===0?0:1;return[n,i[0].getIndexWithinParent()+o]}if(!F(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const i=new va(gr(e.__key,t,"element"),gr(e.__key,t,"element"),0,""),o=e.insertNewAfter(i);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}s(N8,"Xr");function z0(e){return Ir(e)||u2(e)||X(e)||e.isParentRequired()}s(z0,"Qr");function rf(e){const t=mn();let n=null;for(let r=0;r<e.length;r++){const i=e[r];if(z0(i)){if(n===null){n=i.createParentElementNode(),t.append(n);const o=e[r+1];if(Ir(i)&&(o===void 0||!z0(o)))continue}n.append(i)}else t.append(i),n=null}return t}s(rf,"Zr");function eu(e,t,n,r,i="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[d,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(d.key,d.offset,d.type),!0}const o=ei(e.focus,n?"previous":"next"),l=r==="lineboundary",a=t==="move";let c=o,u=i==="decorators-and-blocks";if(!U2(c)){for(const d of c){u=!1;const{origin:f}=d;if(!We(f)||f.isIsolated()||(c=d,!l||!f.isInline()))break}if(u)for(const d of jp(o).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Gn(d))d.origin.isInline()||(c=d);else{if(F(d.origin))continue;We(d.origin)&&!d.origin.isInline()&&(c=d)}break}}if(c===o)return!1;if(a&&!l&&We(c.origin)&&c.origin.isKeyboardSelectable()){const d=Yc();return d.add(c.origin.getKey()),dn(d),!0}return c=dr(c),a&&vs(e.anchor,c),vs(e.focus,c),u||!l}s(eu,"ti");var Kt=null,Tt=null,_n=!1,of=!1,Cc=!1,sf=new Set,bc=0,j0={characterData:!0,childList:!0,subtree:!0};function bo(){return _n||Kt!==null&&Kt._readOnly}s(bo,"ai");function Ht(){_n&&B(13)}s(Ht,"ui");function L5(){bc>99&&B(14)}s(L5,"fi");function Pr(){return Kt===null&&B(195,P5()),Kt}s(Pr,"di");function O8(e){Pr()!==null&&Tt===null&&(Tt=e),Tt!==e&&gC(378)}s(O8,"hi");function Ue(){return Tt===null&&B(337,P5()),Tt}s(Ue,"gi");function $5(){Ue()._dirtyType=2}s($5,"_i");function P5(){let e=0;const t=new Set,n=gs.version;if(typeof window<"u")for(const i of g2(document)){const o=Ca(i);if(dd(o))e++;else if(o){let l=String(o.constructor.version||"<0.17.1");l===n&&(l+=" (separately built, likely a bundler configuration issue)"),t.add(l)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}s(P5,"pi");function F5(){return Tt}s(F5,"yi");function J0(e,t,n){const r=t.__type,i=Mp(e,r);let o=n.get(r);o===void 0&&(o=Array.from(i.transforms),n.set(r,o));const l=o.length;for(let a=0;a<l&&(o[a](t),t.isAttached());a++);}s(J0,"mi");function G0(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}s(G0,"xi");function V5(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const i of r)n.add(i)}s(V5,"Ci");function D8(e){return tu(e,Ue()._nodes)}s(D8,"Si");function tu(e,t){const n=e.type,r=t.get(n);r===void 0&&B(17,n);const i=r.klass;e.type!==i.getType()&&B(18,i.name);const o=i.importJSON(e),l=e.children;if(F(o)&&Array.isArray(l))for(let c=0;c<l.length;c++){const u=tu(l[c],t);o.append(u)}const a=e.$slots;if(a){Mr(o)||B(379,i.name);for(const c in a)Wp(o,c,tu(a[c],t))}return o}s(tu,"vi");function q0(e,t,n){const r=Kt,i=_n,o=Tt;Kt=t,_n=!0,Tt=e;try{return n()}finally{Kt=r,_n=i,Tt=o}}s(q0,"Ti");function wi(e,t){const n=Cc;Cc=!0;try{(function(r,i){const o=r._pendingEditorState,l=r._rootElement,a=r._headless||l===null;if(o===null)return void(!r._updating&&r._deferred.length>0&&Z0(r,r._deferred));const c=r._editorState,u=c._selection,d=o._selection,f=r._dirtyType!==0,h=Kt,g=_n,p=Tt,_=r._updating,y=r._observer;let v=null;if(r._pendingEditorState=null,r._editorState=o,!a&&f&&y!==null){Tt=r,Kt=o,_n=!1,r._updating=!0;try{const E=r._dirtyType,A=r._dirtyElements,D=r._dirtyLeaves;y.disconnect(),v=zM(c,o,r,E,A,D)}catch(E){if(E instanceof Error&&r._onError(E),of)throw E;Z5(r,null,l,o),TC(r),r._dirtyType=2,of=!0,wi(r,c),of=!1;return}finally{y.observe(l,j0),r._updating=_,Kt=h,_n=g,Tt=p}}o._readOnly||(o._readOnly=!0);const x=r._dirtyLeaves,C=r._dirtyElements,b=r._normalizedNodes,S=r._updateTags;f&&(r._dirtyType=0,r._cloneNotNeeded.clear(),r._dirtyLeaves=new Set,r._dirtyElements=new Map,r._normalizedNodes=new Set),r._updateTags=new Set,(function(E,A){const D=E._decorators;let L=E._pendingDecorators||D;const G=A._nodeMap;let $;for($ in L)G.has($)||(L===D&&(L=n2(E)),delete L[$])})(r,o);const M=a?null:tr(Sn(r));if(r._editable&&M!==null&&(f||d===null||d.dirty||!d.is(u))&&l!==null&&!S.has("skip-dom-selection")){Tt=r,Kt=o;try{if(y!==null&&y.disconnect(),f||d===null||d.dirty){const E=r._blockCursorElement;E!==null&&iu(E,r,l),D5(u,d,r,M,S,l)}(function(E,A,D){let L=E._blockCursorElement;if(ve(D)&&D.isCollapsed()&&D.anchor.type==="element"&&A.contains(ou(A))){const G=D.anchor,$=G.getNode(),z=G.offset;let W=!1,ye=null;if(z===$.getChildrenSize())Ec($.getChildAtIndex(z-1))&&(W=!0);else{const q=$.getChildAtIndex(z);if(q!==null&&Ec(q)){const ge=q.getPreviousSibling();(ge===null||Ec(ge))&&(W=!0,ye=E.getElementByKey(q.__key))}}if(W){const q=Rn($,E.getElementByKey($.__key),E).element;L===null&&(E._blockCursorElement=L=(function(ge){const me=ge.theme,oe=vn().createElement("div");oe.contentEditable="false",oe.setAttribute("data-lexical-cursor","true");let Z=me.blockCursor;return Z!==void 0&&(typeof Z=="string"&&(Z=me.blockCursor=Ta(Z)),Z!==void 0&&oe.classList.add(...Z)),oe})(E._config)),A.style.caretColor="transparent",ye===null?q.appendChild(L):q.insertBefore(L,ye);return}}L!==null&&iu(L,E,A)})(r,l,d)}finally{y!==null&&y.observe(l,j0),Tt=p,Kt=h}}v!==null&&(function(E,A,D,L,G){const $=Array.from(E._listeners.mutation),z=$.length;for(let W=0;W<z;W++){const[ye,q]=$[W];for(const ge of q){const me=A.get(ge);me!==void 0&&ye(me,{dirtyLeaves:L,prevEditorState:G,updateTags:D})}}})(r,v,S,x,c),ve(d)||d===null||u!==null&&u.is(d)||r.dispatchCommand(lp,void 0);const T=r._pendingDecorators;T!==null&&(r._decorators=T,r._pendingDecorators=null,vl("decorator",r,!0,T)),(function(E,A,D){const L=Q0(A),G=Q0(D);L!==G&&vl("textcontent",E,!0,G)})(r,i||c,o),vl("update",r,!0,{dirtyElements:C,dirtyLeaves:x,editorState:o,mutatedNodes:v,normalizedNodes:b,prevEditorState:i||c,tags:S}),!_&&Z0(r,r._deferred),(function(E){const A=E._updates;if(A.length===0)return void(E._cascadeCount=0);if((function(L){sf.has(L)||(sf.add(L),setTimeout(()=>{sf.delete(L),L._cascadeCount=0},0))})(E),E._cascadeCount++>99)return E._updates=[],E._cascadeCount=0,void E._onWarn(new Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${E._config.namespace}`));const D=A.shift();if(D){const[L,G]=D;od(E,L,G)}})(r)})(e,t)}finally{Cc=n}}s(wi,"ki");function vl(e,t,n,...r){const i=t._updating;t._updating=n;try{const o=t._listeners[e],l=Array.from(o);for(const[a,c]of l){c&&c();const u=a(...r);o.has(a)?o.set(a,u):u&&u()}}finally{t._updating=i}}s(vl,"bi");function B5(e,t,n,r){const i=Np(e);let o;if(!Cc)for(let l=0;l<i.length;l++)i[l]._updating||(i[l]._cascadeCount=0);for(let l=4;l>=0;l--)for(let a=0;a<i.length;a++){const c=i[a];if(a>0&&c._updating){o=c;break}const u=c._commands.get(t);if(u!==void 0){const d=u[l];if(d.size>0){let f=!1;if(jn(c,()=>{for(const h of d)if(h(n,r))return void(f=!0)}),f)return f}}}return o&&o.update(()=>{B5(o,t,n,r)}),!1}s(B5,"Ni");function Z0(e,t){if(e._deferred=[],t.length!==0){const n=e._updating;e._updating=!0;try{for(let r=0;r<t.length;r++)t[r]()}finally{e._updating=n}}}s(Z0,"wi");function Y0(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const i=n.shift();if(i){const[o,l]=i,a=e._pendingEditorState;let c;l!==void 0&&(c=l.onUpdate,l.skipTransforms&&(r=!0),l.discrete&&(a===null&&B(191),a._flushSync=!0),c&&e._deferred.push(c),V5(e,l.tag)),a==null?od(e,o,l):o()}}return r}s(Y0,"Ei");function od(e,t,n){const r=e._updateTags;let i,o=!1,l=!1;n!==void 0&&(i=n.onUpdate,V5(e,n.tag),o=n.skipTransforms||!1,l=n.discrete||!1),i&&e._deferred.push(i);const a=e._editorState;let c=e._pendingEditorState,u=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=K5(c||a),u=!0),c._flushSync=l;const d=Kt,f=_n,h=Tt,g=e._updating;Kt=c,_n=!1,e._updating=!0,Tt=e;const p=e._headless||e.getRootElement()===null;kp(null);try{u&&(p?a._selection!==null&&(c._selection=a._selection.clone()):c._selection=(function(v,x){const C=v.getEditorState()._selection,b=tr(Sn(v));return ve(C)||C==null?id(C,b,v,x):C.clone()})(e,n&&n.event||null));const _=e._compositionKey;t(),o=Y0(e,o),(function(v,x){const C=x.getEditorState()._selection,b=v._selection;if(ve(b)){const S=b.anchor,M=b.focus;let T;if(S.type==="text"&&(T=S.getNode(),T.selectionTransform(C,b)),M.type==="text"){const E=M.getNode();T!==E&&E.selectionTransform(C,b)}}})(c,e),e._dirtyType!==0&&(o?(function(v,x){const C=x._dirtyLeaves,b=v._nodeMap;for(const S of C){const M=b.get(S);X(M)&&M.isAttached()&&M.isSimpleText()&&!M.isUnmergeable()&&y0(M)}})(c,e):(function(v,x){const C=x._dirtyLeaves,b=x._dirtyElements,S=v._nodeMap,M=qr(),T=new Map;let E=C,A=E.size,D=b,L=D.size;for(;A>0||L>0;){if(A>0){x._dirtyLeaves=new Set;for(const G of E){const $=S.get(G);X($)&&$.isAttached()&&$.isSimpleText()&&!$.isUnmergeable()&&y0($),$!==void 0&&G0($,M)&&J0(x,$,T),C.add(G)}if(E=x._dirtyLeaves,A=E.size,A>0){bc++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,D.delete("root")&&D.set("root",!0);for(const G of D){const $=G[0],z=G[1];if(b.set($,z),!z)continue;const W=S.get($);W!==void 0&&G0(W,M)&&J0(x,W,T)}E=x._dirtyLeaves,A=E.size,D=x._dirtyElements,L=D.size,bc++}x._dirtyLeaves=C,x._dirtyElements=b})(c,e),Y0(e),(function(v,x,C,b){const S=v._nodeMap,M=x._nodeMap,T=[];for(const[D]of b){const L=M.get(D);L!==void 0&&(L.isAttached()||(F(L)&&Uc(L,D,S,M,T,b),S.has(D)||b.delete(D),T.push(D)))}for(const D of C){const L=M.get(D);L===void 0||L.isAttached()||(Mr(L)&&L.__slots!==null&&Uc(L,D,S,M,T,C),S.has(D)||C.delete(D),T.push(D))}for(const D of T)M.delete(D);const E=Ue(),A=E._compositionKey;A===null||M.has(A)||(E._compositionKey=null)})(a,c,e._dirtyLeaves,e._dirtyElements)),_!==e._compositionKey&&(c._flushSync=!0);const y=c._selection;if(ve(y)){e._slotsUsed&&M5(y);const v=c._nodeMap,x=y.anchor.key,C=y.focus.key;v.get(x)!==void 0&&v.get(C)!==void 0||B(19)}else As(y)&&y._nodes.size===0&&(c._selection=null)}catch(_){_ instanceof Error&&e._onError(_),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),wi(e);return}finally{Kt=d,_n=f,Tt=h,e._updating=g,bc=0}e._dirtyType!==0||e._deferred.length>0||(function(_,y){const v=y.getEditorState()._selection,x=_._selection;if(x!==null){if(x.dirty||!x.is(v))return!0}else if(v!==null)return!0;return!1})(c,e)?c._flushSync?(c._flushSync=!1,wi(e)):u&&K8(()=>{wi(e)}):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}s(od,"Oi");function jn(e,t,n){Tt===e&&n===void 0?t():od(e,t,n)}s(jn,"Mi");function R8(e){if(kt(e)){let t=null;for(const n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}s(R8,"Ai");var Is=class extends On{static{s(this,"Di")}__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for("ElementNode"),{$transform:R8,extends:On})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle="",this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&B(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return MM[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Jn(this).length===0}isDirty(){const e=Ue()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];for(const n of Jn(this)){const r=Vi(this,n);F(r)&&e.push(...r.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(X(t)&&e.push(t),F(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;F(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;F(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const i=t[n-1];return F(i)&&i.getLastDescendant()||i||null}const r=t[e];return F(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:nt(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&B(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:nt(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&B(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=D2(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),F(i)&&r!==n-1&&!i.isInline()&&(e+=lo)}return e}getTextContentSize(){let e=(function(r){let i=0;for(const o of Jn(r)){const l=Vi(r,o);l!==null&&(i+=l.getTextContentSize())}return i})(this);const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),F(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Kc[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=Gt[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Pi(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Ht();const n=Ve();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const a=this.getFirstChild();if(X(a)||F(a))return a.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const a=this.getLastChild();if(X(a)||F(a))return a.select()}}r===void 0&&(r=o),i===void 0&&(i=o);const l=this.__key;return ve(n)?(n.anchor.set(l,r,"element"),n.focus.set(l,i,"element"),n.dirty=!0,n):N5(l,r,l,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""&&Kc[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){qc(this)&&B(324,this.__key,this.__type);const r=this.getChildrenSize(),i=this.getWritable();e+t<=r||B(226,String(e),String(t),String(r));for(const h of n);const o=i.__key,l=[],a=[],c=this.getChildAtIndex(e+t);let u=null,d=r-t+n.length;if(e!==0)if(e===r)u=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(u=h.getPreviousSibling())}if(t>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<t;g++){h===null&&B(100);const p=h.getNextSibling(),_=h.__key;ur(h.getWritable()),a.push(_),h=p}}let f=u;for(const h of n){f!==null&&h.is(f)&&(u=f=f.getPreviousSibling());const g=h.getWritable();g.__parent===o&&d--,ur(g);const p=h.__key;if(f===null)i.__first=p,g.__prev=null;else{const _=f.getWritable();_.__next=p,g.__prev=_.__key}h.__key===o&&B(76),g.__parent=o,l.push(p),f=h}if(e+t===r)f!==null&&(f.getWritable().__next=null,i.__last=f.__key);else if(c!==null){const h=c.getWritable();if(f!==null){const g=f.getWritable();h.__prev=f.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=d,a.length){const h=Ve();if(ve(h)){const g=new Set(a),p=new Set(l),{anchor:_,focus:y}=h;X0(_,g,p)&&Xc(_,_.getNode(),this,u,c),X0(y,g,p)&&Xc(y,y.getNode(),this,u,c),d!==0||this.canBeEmpty()||kt(this)||this.remove()}}return i}getDOMSlot(e){return new vC(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(vt(t)){const n=this.getIndent();n>0&&(t.style.paddingInlineStart=40*n+"px",t.setAttribute("data-lexical-indent",String(n)));const r=this.getDirection();r&&(t.dir=r)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===""||kt(this)||this.getChildren().some(X)||(t!==0&&(e.textFormat=t),n!==""&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=Rn(this,e,t);let r=n.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const o=t.getElementByKey(i.getKey());o!==null&&(r==null?(n.insertChild(o),r=o):r!==o&&n.replaceChild(o,r),r=r.nextSibling)}}};function F(e){return e instanceof Is}s(F,"Pi");function X0(e,t,n){let r=e.getNode();for(;r;){const i=r.__key;if(t.has(i)&&!n.has(i))return!0;r=r.getParent()}return!1}s(X0,"Fi");var Sp=class extends On{static{s(this,"Ii")}__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&B(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function We(e){return e instanceof Sp}s(We,"Li");var sd=class H5 extends Is{static{s(this,"Ki")}__cachedText;static getType(){return"root"}static clone(){return new H5}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){B(51)}getTextContent(){const t=this.__cachedText;return t===null||!bo()&&Ue()._dirtyType!==0?super.getTextContent():t}remove(){B(52)}replace(t){B(53)}insertBefore(t){B(54)}insertAfter(t){B(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const i of r)F(i)||We(i)||B(282);return super.splice(t,n,r)}static importJSON(t){return Dn().updateFromJSON(t)}collapseAtStart(){return!0}};function Mt(e){return e instanceof sd}s(Mt,"zi");function K5(e){return new wp(CC(e._nodeMap),null,e._slotsUsed)}s(K5,"Bi");function Tp(){return new wp(new Map([["root",new sd]]),null,!1)}s(Tp,"Ri");function vh(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&B(130,n.name),F(e)){const i=t.children;Array.isArray(i)||B(59,n.name);const o=e.getChildren();for(let l=0;l<o.length;l++){const a=vh(o[l]);i.push(a)}}const r=Jn(e);if(r.length>0){const i={};for(const o of r){const l=Vi(e,o);l===null&&B(366,n.name,o),i[o]=vh(l)}t.$slots=i}return t}s(vh,"Wi");function L8(e){return e instanceof wp}s(L8,"Ui");var wp=class U5{static{s(this,"$i")}_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(t,n=null,r=!1){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=r}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return q0(n&&n.editor||null,this,t)}clone(t){const n=new U5(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return q0(null,this,()=>({root:vh(Dn())}))}},W5=class extends Is{static{s(this,"Hi")}static getType(){return"artificial"}createDOM(e){return vn().createElement("div")}},ld=class z5 extends On{static{s(this,"Ji")}static getType(){return"linebreak"}static clone(t){return new z5(t.__key)}constructor(t){super(t)}getTextContent(){return`
12
+ `}createDOM(){return vn().createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:s(t=>j5(t)||J5(t)?null:{conversion:$8,priority:0},"br")}}static importJSON(t){return ya().updateFromJSON(t)}};function $8(e){return{node:ya()}}s($8,"ji");function ya(){return ba(new ld)}s(ya,"Vi");function Ir(e){return e instanceof ld}s(Ir,"qi");function j5(e){const t=e.parentElement;if(t!==null&&Bp(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&nu(n)){const r=t.lastChild;if(r===e||r.previousSibling===e&&nu(r))return!0}}return!1}s(j5,"Yi");function J5(e){const t=e.parentElement;if(t!==null&&Bp(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&nu(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&nu(r))return!0}return!1}s(J5,"Gi");function nu(e){return yr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}s(nu,"Xi");var ad=class G5 extends Is{static{s(this,"Qi")}static getType(){return"paragraph"}static clone(t){return new G5(t.__key)}createDOM(t){const n=vn().createElement("p"),r=cs(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:s(t=>({conversion:P8,priority:0}),"p")}}exportDOM(t){const{element:n}=super.exportDOM(t);if(vt(n)){this.isEmpty()&&n.append(vn().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return mn().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(X);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=mn();r.setTextFormat(t.format),r.setTextStyle(t.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||X(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function P8(e){const t=mn();if(T2(t,e),E2(e,t),t.getFormatType()===""){const n=e.getAttribute("align");n&&n&&n in Kc&&t.setFormat(n)}return S2(t,e),{node:t}}s(P8,"Zi");function mn(){return ba(new ad)}s(mn,"ts");function q5(e){return e instanceof ad}s(q5,"es");function F8(e){}s(F8,"ns");function Z5(e,t,n,r,i){const o=e._keyToDOMMap;o.clear(),e._editorState=Tp(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};const l=e._observer;l!==null&&(l.disconnect(),e._observer=null),t!==null&&(t.textContent="",(function(a,c){const u=`__lexicalKey_${c._key}`;delete a[u]})(t,e)),n!==null&&(n.textContent="",o.set("root",n),t2(n,e,"root"))}s(Z5,"hs");function Y5(e){const t=new Set,n=new Set;for(const{klass:r,ownNodeConfig:i}of Sa(e)){const o=r.transform;if(!n.has(o)){n.add(o);const l=r.transform();l&&t.add(l)}if(i){const l=i.$transform;l&&t.add(l)}}return t}s(Y5,"gs");var Kl={$createDOM:s((e,t)=>e.createDOM(t._config,t),"$createDOM"),$decorateDOM:s((e,t,n,r)=>{},"$decorateDOM"),$exportDOM:s((e,t)=>{const n=cd(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},"$exportDOM"),$extractWithChild:s((e,t,n,r,i)=>F(e)&&e.extractWithChild(t,n,r),"$extractWithChild"),$getDOMSlot:s((e,t,n)=>e.getDOMSlot(t),"$getDOMSlot"),$getSlotTargetElement:s((e,t,n,r)=>null,"$getSlotTargetElement"),$shouldExclude:s((e,t,n)=>F(e)&&e.excludeFromCopy("html"),"$shouldExclude"),$shouldInclude:s((e,t,n)=>!t||e.isSelected(t),"$shouldInclude"),$updateDOM:s((e,t,n,r)=>e.updateDOM(t,n,r._config),"$updateDOM")};function V8(e){const t=e||{},n=F5(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,o=t.disableEvents||!1,l=Tp(),a=t.namespace||(i!==null?i._config.namespace:i2()),c=t.editorState,u=[sd,_a,ld,nd,ad,W5,...t.nodes||[]],{onError:d,onWarn:f,html:h}=t,g=t.editable===void 0||t.editable;let p;if(e===void 0&&n!==null)p=n._nodes;else{p=new Map;for(let y=0;y<u.length;y++){let v=u[y],x=null,C=null;if(v&&typeof v=="object"){const M=v;v=M.replace,x=M.with,C=M.withKlass||null}if(typeof v!="function"||!v.prototype||!(v===On||v.prototype instanceof On)){let M="<unknown>";try{M=JSON.parse(xC)}catch{}B(365,String(y-u.length+(t.nodes?t.nodes.length:0)),typeof v=="function"?`${v.name}${typeof v.getType=="function"?` (type ${String(v.getType())})`:""}`:String(v),String(M))}Ea(v);const b=v.getType(),S=Y5(v);p.set(b,{exportDOM:h&&h.export?h.export.get(v):void 0,klass:v,replace:x,replaceWithKlass:C,sharedNodeState:kC(u[y]),transforms:S})}}const _=new gs(l,i,p,{disableEvents:o,dom:{...Kl,...e&&e.dom},namespace:a,theme:r},d||console.error,f||F8,(function(y,v){const x=new Map,C=new Set,b=s(S=>{Object.keys(S).forEach(M=>{let T=x.get(M);T===void 0&&(T=[],x.set(M,T)),T.push(S[M])})},"r");return y.forEach(S=>{const M=S.klass.importDOM;if(M==null||C.has(M))return;C.add(M);const T=M.call(S.klass);T!==null&&b(T)}),v&&b(v),x})(p,h?h.import:void 0),g,e);return c!==void 0&&(_._pendingEditorState=c,_._dirtyType=2),(function(y){y.registerCommand(ap,r8,0),y.registerCommand(cp,i8,0),y.registerCommand(up,o8,0),y.registerCommand(dp,s8,0),y.registerCommand(pp,l8,0)})(_),_}s(V8,"ps");function B8(e,t){const n=e.get(t);e.delete(t),n&&n()}s(B8,"ys");function qs(e,t,n){return e.set(t,n),B8.bind(null,e,t)}s(qs,"ms");var gs=class{static{s(this,"xs")}static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,o,l,a,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Yf,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=i2(),this._onError=i,this._onWarn=o,this._htmlConversions=l,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:"root",offset:0,style:"",timeStamp:0},compositionEndData:"",compositionPhase:"idle",hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return qs(this._listeners.update,e)}registerEditableListener(e){return qs(this._listeners.editable,e)}registerDecoratorListener(e){return qs(this._listeners.decorator,e)}registerTextContentListener(e){return qs(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return Yp(qs(t,e,e(this._rootElement,null)||void 0),()=>(function(n,r,i){const o=n.get(r);o&&o(),n.set(r,r(...i)||void 0)})(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&B(35);const r=this._commands;r.has(e)||r.set(e,[new Js,new Js,new Js,new Js,new Js]);const i=r.get(e);i===void 0&&B(36,String(e));const o=(function(a){return 7&a})(n),l=i[o];return o!==n?l.addFront(t):l.addBack(t),()=>{l.delete(t),i.every(a=>a.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let o=i.get(t);o===void 0&&(o=new Set,i.set(t,o)),o.add(r);const l=n&&n.skipInitialization;return l!==void 0&&l||this.initializeMutationListener(t,r),()=>{o.delete(r),o.size===0&&i.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&B(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=xh(n).get(t.getType());if(!r)return;const i=new Map;for(const o of r.keys())i.set(o,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){const o=this.registerNodeTransformToKlass(i,t);r.push(o)}return(function(o,l){const a=xh(o.getEditorState()),c=[];for(const u of l){const d=a.get(u);d&&c.push(d)}c.length!==0&&o.update(()=>{for(const u of c)for(const d of u.keys()){const f=nt(d);f&&f.markDirty()}},o._pendingEditorState===null?{tag:xc}:void 0)})(this,r.map(o=>o.klass.getType())),()=>{r.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return fe(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=cs(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Z5(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||a8(t),n!=null&&t.classList.remove(...n)),e!==null){const i=Lp(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,TC(this),this._updateTags.add(xc),wi(this),this._config.disableEvents||(function(l,a){const c=l.ownerDocument;uh.set(l,c);let u=Jc.get(c);u===void 0&&(u={editors:new Set,hasShadowEditor:void 0},Jc.set(c,u)),u.editors.add(a),u.hasShadowEditor=void 0,l.__lexicalEditor=a;const d=c5(l);d.push(n8.register(c));for(let f=0;f<ch.length;f++){const[h,g]=ch[f],p=typeof g=="function"?_=>{N0(_)||(dh(_),(a.isEditable()||h==="click")&&g(_,a))}:_=>{if(N0(_))return;dh(_);const y=a.isEditable();switch(h){case"cut":return y&&fe(a,_p,_);case"copy":return fe(a,mp,_);case"paste":return y&&fe(a,fp,_);case"dragstart":return y&&fe(a,YC,_);case"dragover":return y&&fe(a,XC,_);case"dragend":return y&&fe(a,QC,_);case"focus":return y&&fe(a,t5,_);case"blur":return y&&fe(a,n5,_);case"drop":return y&&fe(a,ZC,_)}};d.push(vp(l,h,p))}})(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(xc),wi(this);vl("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&B(38);let n=e;n._readOnly&&(n=K5(e),n._selection=e._selection?e._selection.clone():null),SC(this);const r=this._pendingEditorState,i=t!==void 0?t.tag:null;r===null||r.isEmpty()||(i!=null&&this._updateTags.add(i),wi(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,jn(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(const[o,l]of n._nodeMap.entries())F(l)?this._dirtyElements.set(o,!0):this._dirtyLeaves.add(o)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return(function(n,r,i){const o=Tp(),l=Kt,a=_n,c=Tt,u=r._dirtyElements,d=r._dirtyLeaves,f=r._cloneNotNeeded,h=r._dirtyType;r._dirtyElements=new Map,r._dirtyLeaves=new Set,r._cloneNotNeeded=new Set,r._dirtyType=0,Kt=o,_n=!1,Tt=r,kp(null);try{const g=r._nodes;tu(n.root,g),i&&i(),o._readOnly=!0,o._parsed=!0}catch(g){g instanceof Error&&r._onError(g)}finally{r._dirtyElements=u,r._dirtyLeaves=d,r._cloneNotNeeded=f,r._dirtyType=h,Kt=l,_n=a,Tt=c}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(...e){const[t,n]=e.length===1?["force-commit",e[0]]:e;return t==="force-commit"&&wi(this),(t==="pending"?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(n,r,i){n._updating?n._updates.push([r,i]):od(n,r,i)})(this,e,t)}focus(e,t={}){const n=this._rootElement;n!==null&&(n.setAttribute("autocapitalize","off"),jn(this,()=>{const r=Ve(),i=Dn();r!==null?r.dirty||dn(r.clone()):i.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),Eo("focus"),c2(()=>{n.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=tr(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,vl("editable",this,!0,e),this._slotsUsed&&this.update(()=>$5()))}toJSON(){return{editorState:this._editorState.toJSON()}}};gs.version=xC;var yh=null;function kp(e){yh=e}s(kp,"Ss");var X5=1;function H8(){X5=1}s(H8,"Ts");function Mp(e,t){const n=cd(e,t);return n===void 0&&B(30,t),n}s(Mp,"ks");function cd(e,t){return e._nodes.get(t)}s(cd,"bs");var K8=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function ud(e,t){const n=t!==void 0?t:(()=>{const o=e.getRootNode();return Ns(o)||ii(o)?ms(o):null})();if(!vt(n)||n.hasAttribute("data-lexical-slot"))return!1;const r=Ip(n),i=n.nodeName;return yp(r)&&(i==="INPUT"||i==="TEXTAREA"||n.contentEditable==="true"&&Ca(n)==null)}s(ud,"ws");var U8=ud;function xa(e,t,n){const r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return fo(t)===e&&e.read("latest",()=>!ud(t))}s(xa,"Os");function dd(e){return e instanceof gs}s(dd,"Ms");function fo(e){let t=e;for(;t!=null;){const n=Ca(t);if(dd(n))return n;t=Oo(t)}return null}s(fo,"As");function Ca(e){return e?e.__lexicalEditor:null}s(Ca,"Ds");function W8(e){return TM.test(e)?"rtl":wM.test(e)?"ltr":null}s(W8,"Ps");function Di(e){return rd(e)||e.isToken()}s(Di,"Fs");function An(e){return Di(e)||e.isSegmented()}s(An,"Is");function yr(e){return Rs(e)&&e.nodeType===3}s(yr,"Ls");function Ns(e){return Rs(e)&&e.nodeType===9}s(Ns,"Ks");function Q5(e){let t=e;for(;t!=null;){if(yr(t))return t;t=t.firstChild}return null}s(Q5,"zs");function Pi(e,t,n){const r=Gt[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t==="subscript"?i&=~Gt.superscript:t==="superscript"?i&=~Gt.subscript:t==="lowercase"?(i&=~Gt.uppercase,i&=~Gt.capitalize):t==="uppercase"?(i&=~Gt.lowercase,i&=~Gt.capitalize):t==="capitalize"&&(i&=~Gt.lowercase,i&=~Gt.uppercase),i}s(Pi,"Bs");function z8(e){return X(e)||Ir(e)||We(e)}s(z8,"Rs");function e2(e,t){const n=(function(){const l=yh;return yh=null,l})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);Ht(),L5();const r=Ue(),i=Pr(),o=""+X5++;i._nodeMap.set(o,e),F(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType===0&&(r._dirtyType=1),e.__key=o}s(e2,"Ws");function ur(e){Zt(e)!==null&&B(380,e.__key,String(Zt(e)));const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling(),l=o!==null?o.__key:null,a=i!==null?i.__key:null,c=i!==null?i.getWritable():null,u=o!==null?o.getWritable():null;i===null&&(r.__first=l),o===null&&(r.__last=a),c!==null&&(c.__next=l),u!==null&&(u.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}s(ur,"Us");var j8=ur;function ru(e){L5(),qc(e)&&B(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent!==null?t.__parent:Fi(t)?t.__slotHost:null,r=Pr(),i=Ue(),o=r._nodeMap,l=i._dirtyElements;n!==null&&(function(c,u,d){let f=c;for(;f!==null;){if(d.has(f))return;const h=u.get(f);if(h===void 0)break;d.set(f,!1),f=h.__parent!==null?h.__parent:Fi(h)?h.__slotHost:null}})(n,o,l);const a=t.__key;i._dirtyType===0&&(i._dirtyType=1),F(e)?l.set(a,!0):i._dirtyLeaves.add(a)}s(ru,"Hs");function Rt(e){Ht();const t=Ue(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=nt(n);r!==null&&r.getWritable()}if(e!==null){const r=nt(e);r!==null&&r.getWritable()}}}s(Rt,"Js");function qr(){return bo()?null:Ue()._compositionKey}s(qr,"js");function nt(e,t){const n=(t||Pr())._nodeMap.get(e);return n===void 0?null:n}s(nt,"Vs");function Ap(e,t){const n=Os(e,Ue());return n!==void 0?nt(n,t):null}s(Ap,"qs");function t2(e,t,n){e[`__lexicalKey_${t._key}`]=n}s(t2,"Ys");function Os(e,t){return e[`__lexicalKey_${t._key}`]}s(Os,"Gs");function Ip(e,t){let n=e;for(;n!=null;){const r=Ap(n,t);if(r!==null)return r;n=Oo(n)}return null}s(Ip,"Xs");function n2(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}s(n2,"Qs");function Q0(e){return e.read(()=>Dn().getTextContent())}s(Q0,"Zs");function Dn(){return Pr()._nodeMap.get("root")}s(Dn,"tl");function dn(e){Ht();const t=Pr();e!==null&&(e.dirty=!0,e.setCachedNodes(null),ve(e)&&Ue()._slotsUsed&&M5(e)),t._selection=e}s(dn,"el");function e_(){Ht(),SC(Ue())}s(e_,"nl");function Xo(e){const t=(function(n,r){let i=n;for(;i!=null;){const o=Os(i,r);if(o!==void 0)return o;i=Oo(i)}return null})(e,Ue());return t===null?null:nt(t)}s(Xo,"ol");function r2(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}s(r2,"rl");function Np(e){const t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}s(Np,"il");function i2(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}s(i2,"sl");function o2(e){return yr(e)?e.nodeValue:null}s(o2,"ll");function Op(e,t,n){const r=tr(Sn(t));if(r===null)return;const i=Yn(r,t._rootElement),o=i.anchorNode;let{anchorOffset:l,focusOffset:a}=i;if(o!==null){let c=o2(o);const u=Ip(o);if(c!==null&&X(u)){if((c===Dl||c===ip)&&n){const d=n.length;c=n,l=d,a=d}c!==null&&Dp(u,c,l,a,e)}}}s(Op,"cl");function Dp(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const l=o.isComposing();if(o.isToken()&&l)return;let a=t;if((l||i)&&(t.endsWith(Dl)&&(a=t.slice(0,-Dl.length)),i)){const u=ip;let d;for(;(d=a.indexOf(u))!==-1;)a=a.slice(0,d)+a.slice(d+u.length),n!==null&&n>d&&(n=Math.max(d,n-u.length)),r!==null&&r>d&&(r=Math.max(d,r-u.length))}const c=o.getTextContent();if(i||a!==c){const u=Ve();if(a===""){if(Rt(null),pa||yo||ma)o.remove();else{const _=Ue();lf(o,"",u),setTimeout(()=>{_.update(()=>{o.isAttached()&&o.getTextContent()===""&&o.remove()})},20)}return}const d=o.getParent(),f=No(),h=o.getTextContentSize(),g=qr(),p=o.getKey();if(o.isToken()&&!l||g!==null&&p===g&&!l||ve(f)&&(d!==null&&!d.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===e.__key&&f.anchor.offset===0&&!o.canInsertTextBefore()&&!l||f.focus.key===e.__key&&f.focus.offset===h&&!o.canInsertTextAfter()&&!l))return void o.markDirty();if(!ve(u)||n===null||r===null)return void lf(o,a,u);if(u.setTextNodeRange(o,n,o,r),o.isSegmented()){const _=Ft(o.getTextContent());o.replace(_),o=_}lf(o,a,u)}}}s(Dp,"al");function lf(e,t,n){if(e.setTextContent(t),ve(n)){const r=e.getKey();let i=!1;for(const o of["anchor","focus"]){const l=n[o];l.type==="text"&&l.key===r&&(l.offset=hr(e,l.offset,"clamp"),i=!0)}i&&(n._cachedNodes=null,n._cachedIsBackward=null)}}s(lf,"ul");function ja(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}s(ja,"fl");function s2(e,t){return ja(e,t,"altKey")&&ja(e,t,"ctrlKey")&&ja(e,t,"shiftKey")&&ja(e,t,"metaKey")}s(s2,"dl");function qe(e,t,n){if(!s2(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;const r="Key"+t.toUpperCase();return e.code===r}s(qe,"hl");var Wr={ctrlKey:!Vn,metaKey:Vn},t_={altKey:Vn,ctrlKey:!Vn};function n_(e){return e.key==="Backspace"}s(n_,"pl");function J8(e){const t=Dn();if(ve(e)){const n=e.anchor,r=e.focus,i=n.getNode();if(Mt(i))return n.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),Yo(e),e;const o=i.getTopLevelElementOrThrow(),l=o.getParent();if(l===null)return F(o)&&(n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Yo(e)),e;const a=l;return n.set(a.getKey(),0,"element"),r.set(a.getKey(),a.getChildrenSize(),"element"),Yo(e),e}{const n=t.select(0,t.getChildrenSize());return dn(Yo(n)),n}}s(J8,"yl");function cs(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const i=e[t];if(typeof i=="string"){const o=Ta(i);return n[t]=o,o}return i}s(cs,"ml");function Rp(e,t,n,r,i){if(n.size===0)return;const o=r.__type,l=r.__key,a=t.get(o);a===void 0&&B(33,o);const c=a.klass;let u=e.get(c);u===void 0&&(u=new Map,e.set(c,u));const d=u.get(l),f=d==="destroyed"&&i==="created";(d===void 0||f)&&u.set(l,f?"updated":i)}s(Rp,"xl");function G8(e){const t=e.getType(),n=Pr();if(n._readOnly){const o=xh(n).get(t);return o?Array.from(o.values()):[]}const r=n._nodeMap,i=[];for(const[,o]of r)o instanceof e&&o.__type===t&&o.isAttached()&&i.push(o);return i}s(G8,"Cl");function r_(e,t,n){const r=e.getParent();let i=n,o=e;return r!==null&&(t&&n===0?(i=o.getIndexWithinParent(),o=r):t||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(t?i-1:i)}s(r_,"Sl");function l2(e,t){const n=e.offset;if(e.type==="element")return r_(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const i=t?r.getPreviousSibling():r.getNextSibling();return i===null?r_(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):i}}return null}s(l2,"vl");function a2(e){const t=Sn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}s(a2,"Tl");function fe(e,t,n){return B5(e,t,n,e)}s(fe,"kl");function ps(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&B(75,t),n}s(ps,"bl");function Oo(e){const t=e.assignedSlot||e.parentElement;if(t!==null)return t;const n=e.parentNode;return ii(n)?n.host:null}s(Oo,"Nl");function fd(e){return Ns(e)?e:vt(e)?e.ownerDocument:null}s(fd,"wl");function q8(e){return Ue()._updateTags.has(e)}s(q8,"El");function Eo(e){Ht(),Ue()._updateTags.add(e)}s(Eo,"Ol");function c2(e){Ht(),Ue()._deferred.push(e)}s(c2,"Ml");function Ul(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}s(Ul,"Al");function Lp(e){const t=fd(e);return t?t.defaultView:null}s(Lp,"Dl");function Sn(e){const t=e._window;return t===null&&B(78),t}s(Sn,"Pl");function u2(e){return F(e)&&e.isInline()||We(e)&&e.isInline()}s(u2,"Fl");function $p(e){let t=e.getLatest();for(;t!==null;){if(Zt(t)!==null&&F(t))return t;const n=t.getParentOrThrow();if(kt(n))return n;t=n}return t}s($p,"Il");function Pp(e){return F(e)&&e.isShadowRoot()}s(Pp,"Ll");function kt(e){return Mt(e)||Pp(e)}s(kt,"Kl");function Fp(e,t=!1){const n=e.constructor.clone(e);return e2(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}s(Fp,"zl");function ba(e){const t=Ue(),n=e.getType(),r=cd(t,n);r===void 0&&B(200,e.constructor.name,n);const{replace:i,replaceWithKlass:o}=r;if(i!==null){const l=i(e),a=l.constructor;return o!==null?l instanceof o||B(201,o.name,o.getType(),a.name,a.getType(),e.constructor.name,n):l instanceof e.constructor&&a!==e.constructor||B(202,a.name,a.getType(),e.constructor.name,n),l.__key===e.__key&&B(203,e.constructor.name,n,a.name,a.getType()),l}return e}s(ba,"Bl");function af(e,t){!Mt(e.getParent())||F(t)||We(t)||B(99)}s(af,"Rl");function d2(e){const t=nt(e);return t===null&&B(63,e),t}s(d2,"Wl");function Ec(e){if(!e||e.isInline())return!1;if(We(e))return!0;if(F(e)){if(e.isShadowRoot()){const t=e.getParent();return!(F(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}s(Ec,"Ul");function iu(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}s(iu,"$l");function tr(e){return er?(e||window).getSelection():null}s(tr,"Hl");function f2(e){const t=Lp(e);return t?t.getSelection():null}s(f2,"Jl");function ii(e){return x2(e)&&"host"in e}s(ii,"jl");var Z8=[];function h2(e){const t=e.getRootNode();if(t===e||!ii(t))return Z8;const n=[t];let r=t.host;for(;;){const i=r.getRootNode();if(i===r||!ii(i))break;n.push(i),r=i.host}return n}s(h2,"ql");function*g2(e){const t=[e];let n;for(;n=t.pop();){yield*n.querySelectorAll('[data-lexical-editor="true"]');const r=(Ns(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT);let i;for(;i=r.nextNode();)i.shadowRoot&&t.push(i.shadowRoot)}}s(g2,"Yl");function p2(e){return e!==null?e.ownerDocument:document}s(p2,"Gl");function vn(){const e=F5();return p2(e!==null?e._rootElement:null)}s(vn,"Xl");function Ds(e,t){if(t===null||typeof e.getComposedRanges!="function")return null;const n=h2(t);if(n.length===0)return null;const r=e.getComposedRanges;try{const i=r.call(e,{shadowRoots:n})[0];if(i!==void 0)return i}catch{}try{const i=r.apply(e,n)[0];if(i!==void 0)return i}catch{}return null}s(Ds,"Ql");function m2(e,t){const n=Ds(e,t);if(n!==null){const r=_2(n);if(r!==null)return r}return e.rangeCount>0?e.getRangeAt(0):null}s(m2,"Zl");function Yn(e,t){const n=Ds(e,t);return n===null?e:v2(n,y2(e))}s(Yn,"tc");function Y8(e,t){const n=Ds(e,t);if(n===null)return{points:e,range:e.rangeCount>0?e.getRangeAt(0):null};const r=_2(n)??(e.rangeCount>0?e.getRangeAt(0):null);return{points:v2(n,y2(e)),range:r}}s(Y8,"ec");function _2(e){const t=e.startContainer.ownerDocument;if(t===null)return null;const n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}s(_2,"nc");function v2(e,t){const{startContainer:n,startOffset:r,endContainer:i,endOffset:o}=e;return t==="backward"?{anchorNode:i,anchorOffset:o,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:o}}s(v2,"oc");function y2(e){return e.direction}s(y2,"rc");function ou(e){const t=e.getRootNode();return Ns(t)||ii(t)?t.activeElement:null}s(ou,"ic");function ms(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){const n=t.shadowRoot.activeElement;if(n===null)break;t=n}return t}s(ms,"sc");function Vp(e){const t=e.target;if(t!==null&&vt(t)&&t.shadowRoot!==null&&typeof e.composedPath=="function"){const n=e.composedPath();if(n.length>0)return n[0]}return t}s(Vp,"lc");function X8(e,t){let n=e.getChildAtIndex(t);n??=e,kt(e)&&B(102);const r=s(l=>{const a=l.getParentOrThrow(),c=kt(a),u=l!==n||c?Fp(l):l;if(c)return F(l)&&F(u)||B(133),l.insertAfter(u),[l,u,u];{const[d,f,h]=r(a),g=l.getNextSiblings();return h.append(u,...g),[d,f,u]}},"r"),[i,o]=r(n);return[i,o]}s(X8,"cc");function Q8(e){return vt(e)&&e.tagName==="A"}s(Q8,"ac");function eA(e){return vt(e)&&e.tagName==="TR"}s(eA,"uc");function tA(e){return vt(e)&&(e.tagName==="TD"||e.tagName==="TH")}s(tA,"fc");function vt(e){return Rs(e)&&e.nodeType===1}s(vt,"dc");function Rs(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}s(Rs,"hc");function x2(e){return Rs(e)&&e.nodeType===11}s(x2,"gc");var nA=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function C2(e){return!(!vt(e)||!e.style.display.startsWith("inline"))||nA.test(e.nodeName)}s(C2,"pc");var rA=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function Bp(e){return(!vt(e)||!e.style.display.startsWith("inline"))&&rA.test(e.nodeName)}s(Bp,"mc");function hn(e){if(We(e)&&!e.isInline())return!0;if(!F(e)||kt(e))return!1;const t=e.getFirstChild(),n=t===null||Ir(t)||X(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}s(hn,"xc");function xr(){return Ue()}s(xr,"Cc");function Hp(e=xr()){return e._config.dom||Kl}s(Hp,"Sc");function Rn(e,t,n=xr()){const r=Hp(n).$getDOMSlot(e,t,n);return F(e)&&(b2(r)||B(344,e.getKey(),e.getType())),r}s(Rn,"vc");function iA(e,t,n,r){const i=e.read("latest",()=>{const o=nt(t);return o!==null?(function(l,a,c=xr()){const u=Vi(l,a);if(u===null)return null;const d=c.getElementByKey(u.getKey());return d!==null?d.parentElement:null})(o,n,e):null});return i!==null&&(i.parentElement!==r&&r.appendChild(i),i.style.display=""),i}s(iA,"Tc");function oA(e,t,n){n.style.display="none";const r=e.getElementByKey(t);r!==null&&n.parentElement!==r&&r.insertBefore(n,r.firstChild)}s(oA,"kc");function b2(e){return e instanceof vC}s(b2,"bc");function Qr(e,t,n=xr()){return Q5(Rn(e,t,n).element)}s(Qr,"Nc");var i_=new WeakMap,sA=new Map;function xh(e){if(!e._readOnly&&e.isEmpty())return sA;e._readOnly||B(192);let t=i_.get(e);return t||(t=(function(n){const r=new Map;for(const[i,o]of n._nodeMap){const l=o.__type;let a=r.get(l);a||(a=new Map,r.set(l,a)),a.set(i,o)}return r})(e),i_.set(e,t)),t}s(xh,"Oc");function Kp(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}s(Kp,"Mc");function lA(e){return(t=Kp(e))[u5]=!0,t;var t}s(lA,"Ac");function E2(e,t){const n=e.getAttribute("data-lexical-indent");if(n!==null){const o=parseInt(n,10);if(Number.isFinite(o)&&o>=0)return void t.setIndent(o)}const r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}s(E2,"Dc");function S2(e,t){const n=t.getAttribute("dir");return n==="ltr"||n==="rtl"?e.setDirection(n):e}s(S2,"Pc");function T2(e,t){const n=t.style.textAlign;return n&&n in Kc?e.setFormat(n):e}s(T2,"Fc");function w2(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}s(w2,"Ic");function Up(e){return e.__lexicalUnmanaged===!0}s(Up,"Lc");function k2(e,t=xr()){const n=t.isEditable();e.contentEditable=n?"true":"false",n?e.__lexicalEditor=t:delete e.__lexicalEditor}s(k2,"Kc");function Wl(e,t){let n=e;for(;n!=null;){if(n.__lexicalCapturedSelection===!0)return!0;if(vt(n)&&n.hasAttribute("data-lexical-slot")||Os(n,t)!==void 0)return!1;n=Oo(n)}return!1}s(Wl,"zc");function Zs(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==On[t]}s(Zs,"Bc");var o_=new WeakMap;function Ea(e){const t=o_.get(e);if(t)return t;const n=e.prototype!=null&&a0 in e.prototype?e.prototype[a0]():void 0,r=(function(c){if(!(c===On||c.prototype instanceof On)){let u="<unknown>",d="<unknown>";try{u=c.getType()}catch{}try{gs.version&&(d=JSON.parse(gs.version))}catch{}B(290,c.name,u,d)}return c===Sp||c===Is||c===On})(e),i=!r&&Zs(e,"getType")?e.getType():void 0;let o,l=i;if(n)if(i)o=n[i];else{for(const[c,u]of Object.entries(n))l=c,o=u;if(!o)for(const c of Object.getOwnPropertySymbols(n)){const u=n[c];if(u){o=u;break}}}if(!r&&l&&(Zs(e,"getType")||(e.getType=()=>l),Zs(e,"clone")||(e.clone=c=>(kp(c),new e)),Zs(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(c=>new e().updateFromJSON(c))),!Zs(e,"importDOM")&&o)){const{importDOM:c}=o;c&&(e.importDOM=()=>c)}const a={klass:e,ownNodeConfig:o,ownNodeType:l};return o_.set(e,a),a}s(Ea,"Wc");function*Sa(e){for(let t=e;t&&(t===On||yp(t.prototype));){const n=Ea(t);yield n,t=n.ownNodeConfig&&n.ownNodeConfig.extends||M2(t)}}s(Sa,"Uc");function aA(e){const t=new Map,n=new Map;for(const r of e){const{ownNodeType:i}=Ea(r);i&&(n.set(i,r),t.set(i,new Set))}for(const[r,i]of n)for(const{ownNodeType:o}of Sa(i)){const l=o&&t.get(o);l&&l.add(r)}return t}s(aA,"$c");function cA(e){const t=xr();return Ht(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}s(cA,"Hc");var bi=s((e,t)=>{let n=e;for(;n!=null&&!Mt(n);){if(t(n))return n;n=n.getParent()}return null},"Jc");function zl(e,t){const n=[];let r=e.__first;for(;r!==null;){const i=t===null?nt(r):t.get(r);i??B(174),n.push(r),r=i.__next}return n}s(zl,"jc");function M2(e){const t=Object.getPrototypeOf(e);if(typeof t=="function"&&t!==Function.prototype)return t;const n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}s(M2,"Vc");var A2=new Map;function Mr(e){return F(e)||We(e)}s(Mr,"Yc");function Fi(e){return F(e)||We(e)}s(Fi,"Gc");function Zt(e){const t=e.getLatest();return Fi(t)?t.__slotHost:null}s(Zt,"Xc");function Kn(e){const t=Zt(e);if(t===null)return null;const n=nt(t);return F(n)||We(n)||B(370),n}s(Kn,"Qc");function I2(e){const t=Kn(e);if(t===null)return null;const n=e.getLatest().__key;for(const[r,i]of hd(t))if(i===n)return r;return null}s(I2,"Zc");function N2(e){let t=e.getLatest();for(;t!==null;){if(Zt(t)!==null)return t;t=t.getParent()}return null}s(N2,"ta");function hd(e){const t=e.getLatest();return Mr(t)&&t.__slots!==null?t.__slots:A2}s(hd,"ea");function Jn(e){return Array.from(hd(e).keys())}s(Jn,"na");function Vi(e,t){const n=hd(e).get(t);return n===void 0?null:nt(n)}s(Vi,"oa");var uA=["__proto__","constructor","prototype"],s_=Symbol("slotMapOwner");function Ch(e){let t=e.__slots;return t!==null&&t[s_]===e||(t=new Map(t),t[s_]=e,e.__slots=t),t}s(Ch,"sa");var l_=new WeakMap,dA=[];function O2(e){for(const{ownNodeConfig:t}of Sa(e)){const n=t&&t.slots;if(n)return n}return dA}s(O2,"aa");function D2(e){let t="";for(const n of Jn(e)){const r=Vi(e,n);r!==null&&(t+=r.getTextContent())}return t}s(D2,"ua");function a_(e,t,n){const r=n.get(e),i=n.get(t);return r!==void 0?i!==void 0?r-i:-1:i!==void 0?1:e<t?-1:e>t?1:0}s(a_,"fa");function fA(e){const t=e.__slots;if(t===null||t.size<2)return;const n=(function(l){let a=l_.get(l);if(a===void 0){const c=O2(l),u=new Map;for(const d of c)uA.includes(d)&&B(371,l.name,d),u.has(d)&&B(372,l.name,d),u.set(d,u.size);a=u,l_.set(l,a)}return a})(e.constructor);let r=null,i=!0;for(const l of t.keys()){if(r!==null&&a_(r,l,n)>0){i=!1;break}r=l}if(i)return;const o=Array.from(t).sort(([l],[a])=>a_(l,a,n));t.clear();for(const[l,a]of o)t.set(l,a)}s(fA,"da");function Wp(e,t,n){t!=="__proto__"&&t!=="constructor"&&t!=="prototype"||B(373,t);const r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!F(n)&&!We(n)||n.isInline())&&B(374,n.__key);const i=e.getWritable(),o=Ch(i),l=o.get(t);l!==void 0&&L2(l);const a=n.getWritable(),c=Kn(a);if(c!==null){const u=I2(a);u!==null&&Ch(c.getWritable()).delete(u),a.__slotHost=null}return ur(a),a.__slotHost=i.__key,o.set(t,a.__key),fA(i),(function(){const u=xr();u._slotsUsed=!0,u._pendingEditorState&&(u._pendingEditorState._slotsUsed=!0)})(),i}s(Wp,"ha");function R2(e,t){const n=e.getWritable();if(n.__slots===null)return n;const r=n.__slots.get(t);return r!==void 0&&(L2(r),Ch(n).delete(t)),n}s(R2,"ga");function L2(e){const t=nt(e);if(t===null)return;const n=t.getWritable();Fi(n)||B(377,e),n.__slotHost=null,n.remove()}s(L2,"pa");var hA={next:"previous",previous:"next"},gd=class{static{s(this,"ma")}origin;constructor(e){this.origin=e}[Symbol.iterator](){return Jp({hasNext:Bi,initial:this.getAdjacentCaret(),map:s(e=>e,"map"),step:s(e=>e.getAdjacentCaret(),"step")})}getAdjacentCaret(){return _t(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return _t(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n="next"){const r=n===this.direction?t:Array.from(t).reverse();let i=this;const o=this.getParentAtCaret(),l=new Map;for(let a=i.getAdjacentCaret();a!==null&&l.size<e;a=a.getAdjacentCaret()){const c=a.origin.getWritable();l.set(c.getKey(),c)}for(const a of r){if(l.size>0){const c=i.getNodeAtCaret();if(c){if(l.delete(c.getKey()),l.delete(a.getKey()),!(c.is(a)||i.origin.is(a))){const u=a.getParent();u&&u.is(o)&&a.remove(),c.replace(a)}}else c===null&&B(263,Array.from(l).join(" "))}else i.insert(a);i=_t(a,this.direction)}for(const a of l.values())a.remove();return this}},bh=class $2 extends gd{static{s(this,"xa")}type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:oi(t,this.direction)}getParentCaret(t="root"){return _t(zp(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Gi(this.direction);return _t(this.getNodeAtCaret(),t)||oi(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof $2&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}},gA={root:Mt,shadowRoot:kt};function Gi(e){return hA[e]}s(Gi,"Sa");function zp(e,t="root"){return e===null||gA[t](e)?null:Zt(e)===null?e:null}s(zp,"va");var su=class Eh extends gd{static{s(this,"Ta")}type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:_t(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return F(this.origin)?oi(this.origin,this.direction):null}getParentCaret(t="root"){return _t(zp(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Gi(this.direction);return _t(this.getNodeAtCaret(),t)||oi(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Eh&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Eh||t instanceof lu)&&this.direction===t.direction&&this.origin.is(t.origin)}},lu=class Sh extends gd{static{s(this,"ka")}type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Hi(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return _t(zp(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Hi(this.origin,Gi(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Sh&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof su||t instanceof Sh)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return _t(this.origin,this.direction)}};function fr(e){return e instanceof lu}s(fr,"ba");function pA(e){return e instanceof gd}s(pA,"Na");function Bi(e){return e instanceof su}s(Bi,"wa");function Gn(e){return e instanceof bh}s(Gn,"Ea");var mA={next:class extends lu{static{s(this,"next")}direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends lu{static{s(this,"previous")}direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},_A={next:class extends su{static{s(this,"next")}direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends su{static{s(this,"previous")}direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},vA={next:class extends bh{static{s(this,"next")}direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends bh{static{s(this,"previous")}direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function _t(e,t){return e?new _A[t](e):null}s(_t,"Da");function Hi(e,t,n){return e?new mA[t](e,hr(e,n)):null}s(Hi,"Pa");function hr(e,t,n="error"){const r=e.getTextContentSize();let i=t==="next"?r:t==="previous"?0:t;return(i<0||i>r)&&(n!=="clamp"&&gC(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}s(hr,"Fa");function Th(e,t){return new V2(e,t)}s(Th,"Ia");function oi(e,t){return F(e)?new vA[t](e):null}s(oi,"La");function P2(e){return e&&e.getChildCaret()||e}s(P2,"Ka");function _s(e){return e&&P2(e.getAdjacentCaret())}s(_s,"za");var yA=class F2{static{s(this,"Ba")}type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new F2(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=s(i=>{const o=this[i].getLatest();return fr(o)?(function(l,a){const{direction:c,origin:u}=l;return Th(l,hr(u,a==="focus"?Gi(c):c)-l.offset)})(o,i):null},"t"),n=t("anchor"),r=t("focus");if(n&&r){const{caret:i}=n,{caret:o}=r;if(i.isSameNodeCaret(o))return[Th(i,o.offset-i.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=fr(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=fr(r),o=s(l=>l.isSameNodeCaret(r)?null:_s(l)||l.getParentCaret(t),"r");return Jp({hasNext:s(l=>l!==null&&!(i&&r.isSameNodeCaret(l)),"hasNext"),initial:n.isSameNodeCaret(r)?null:o(n),map:s(l=>l,"map"),step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}},V2=class{static{s(this,"Ra")}type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Hi(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function xA(e){return e instanceof V2}s(xA,"Wa");function jp(e){return Ki(e,_t(Dn(),e.direction))}s(jp,"Ua");function B2(e){return Ki(e,e)}s(B2,"$a");function Ki(e,t){return e.direction!==t.direction&&B(265),new yA(e,t,e.direction)}s(Ki,"Ha");function Jp(e){const{initial:t,hasNext:n,step:r,map:i}=e;let o=t;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const l={done:!1,value:i(o)};return o=r(o),l}}}s(Jp,"Ja");function Gp(e,t){const n=au(e.origin,t.origin);switch(n===null&&B(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",i=t.type==="text";return r&&i?(function(o,l){return Math.sign(o-l)})(e.offset,t.offset):e.type===t.type?0:r?-1:i?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return qp(n)}}s(Gp,"ja");function qp(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let o=t,l=n;for(;o&&l;o=o.getNextSibling(),l=l.getNextSibling()){if(o.__key===i)return-1;if(l.__key===r)return 1}return o===null?1:-1}s(qp,"Va");function Ja(e,t){return t.is(e)}s(Ja,"qa");function c_(e){return F(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}s(c_,"Ya");function au(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,i]=c_(e);r;i=r,r=r.getParent())n.set(r,i);for(let[r,i]=c_(t);r;i=r,r=r.getParent()){const o=n.get(r);if(o!==void 0)return o===null?(Ja(e,r)||B(276),{commonAncestor:r,type:"ancestor"}):i===null?(Ja(t,r)||B(277),{commonAncestor:r,type:"descendant"}):((F(o)||Ja(e,o))&&(F(i)||Ja(t,i))&&r.is(o.getParent())&&r.is(i.getParent())||B(278),{a:o,b:i,commonAncestor:r,type:"branch"})}return null}s(au,"Ga");function ei(e,t){const{type:n,key:r,offset:i}=e,o=d2(e.key);return n==="text"?(X(o)||B(266,o.getType(),r),Hi(o,t,i)):(F(o)||B(267,o.getType(),r),W2(o,e.offset,t))}s(ei,"Xa");function vs(e,t){const{origin:n,direction:r}=t,i=r==="next";fr(t)?e.set(n.getKey(),t.offset,"text"):Bi(t)?X(n)?e.set(n.getKey(),hr(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(i?1:0),"element"):(Gn(t)&&F(n)||B(268),e.set(n.getKey(),i?0:n.getChildrenSize(),"element"))}s(vs,"Qa");function H2(e){const t=Ve(),n=ve(t)?t:O5();return yl(n,e),dn(n),n}s(H2,"Za");function yl(e,t){vs(e.anchor,t.anchor),vs(e.focus,t.focus)}s(yl,"tu");function wh(e){const{anchor:t,focus:n}=e,r=ei(t,"next"),i=ei(n,"next"),o=Gp(r,i)<=0?"next":"previous";return Ki(Nr(r,o),Nr(i,o))}s(wh,"eu");function Do(e){const{direction:t,origin:n}=e,r=_t(n,Gi(t)).getNodeAtCaret();return r?_t(r,t):oi(n.getParentOrThrow(),t)}s(Do,"nu");function u_(e,t="root"){const n=[e];for(let r=Gn(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Do(r));return n}s(u_,"ou");function cf(e){return!!e&&e.origin.isAttached()}s(cf,"ru");function K2(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let i=t;const o=Zp(e,r),l=u_(o.anchor,n),a=u_(o.focus.getFlipped(),n),c=new Set,u=[];for(const p of o.iterNodeCarets(n))if(Gn(p))c.add(p.origin.getKey());else if(Bi(p)){const{origin:_}=p;F(_)&&!c.has(_.getKey())||u.push(_)}for(const p of u)p.remove();for(const p of o.getTextSlices()){if(!p)continue;const{origin:_}=p.caret,y=_.getTextContentSize(),v=Do(_t(_,r)),x=_.getMode();if(Math.abs(p.distance)===y&&i==="removeEmptySlices"||x==="token"&&p.distance!==0)v.remove();else if(p.distance!==0){i="removeEmptySlices";let C=p.removeTextSlice();const b=p.caret.origin;if(x==="segmented"){const S=C.origin,M=Ft(S.getTextContent()).setStyle(S.getStyle()).setFormat(S.getFormat());v.replaceOrInsert(M),C=Hi(M,r,C.offset)}b.is(l[0].origin)&&(l[0]=C),b.is(a[0].origin)&&(a[0]=C.getFlipped())}}let d,f;for(const p of l)if(cf(p)){d=dr(p);break}for(const p of a)if(cf(p)){f=dr(p);break}const h=(function(p,_,y){if(!p||!_)return null;const v=p.getParentAtCaret(),x=_.getParentAtCaret();if(!v||!x)return null;const C=v.getParents().reverse();C.push(v);const b=x.getParents().reverse();b.push(x);const S=Math.min(C.length,b.length);let M;for(M=0;M<S&&C[M]===b[M];M++);const T=s((D,L)=>{let G;for(let $=M;$<D.length;$++){const z=D[$];if(kt(z))return;!G&&L(z)&&(G=z)}return G},"a"),E=T(C,hn),A=E&&T(b,D=>y.has(D.getKey())&&hn(D));return A&&Jn(A).length>0?null:E&&A?[E,A]:null})(d,f,c);if(h){const[p,_]=h;oi(p,"previous").splice(0,_.getChildren());let y=_.getParent();for(_.remove(!0);y&&y.isEmpty();){const v=y;y=y.getParent(),v.remove(!0)}}else if(f){const p=(function(v){if(Gn(v)){const x=v.origin;if(hn(x))return x}else{const x=v.getParentAtCaret();if(x&&hn(x))return x}return null})(f),_=p&&p.getParent(),y=p&&p.getParents().findLast(Pp);if(p&&_&&!Mt(_)&&p.isEmpty()&&c.has(p.getKey())&&Jn(p).length===0&&(!y||c.has(y.getKey()))){p.remove(!0);let v=_;for(;v&&!Mt(v)&&v.isEmpty();){const x=v.getParent();if(x&&Mt(x)&&x.getChildrenSize()<=1)break;const C=v;v=x,C.remove(!0)}}}const g=[d,f,...l,...a].find(cf);if(g)return B2(Nr(dr(g),e.direction));B(269,JSON.stringify(l.map(p=>p.origin.__key)))}s(K2,"iu");function dr(e){const t=(function(i){let o=i;for(;Gn(o);){const l=_s(o);if(!Gn(l))break;o=l}return o})(e.getLatest()),{direction:n}=t;if(X(t.origin))return fr(t)?t:Hi(t.origin,n,n);const r=t.getAdjacentCaret();return Bi(r)&&X(r.origin)?Hi(r.origin,n,Gi(n)):t}s(dr,"su");function U2(e){return fr(e)&&e.offset!==hr(e.origin,e.direction)}s(U2,"lu");function Nr(e,t){return e.direction===t?e:e.getFlipped()}s(Nr,"cu");function Zp(e,t){return e.direction===t?e:Ki(Nr(e.focus,t),Nr(e.anchor,t))}s(Zp,"au");function W2(e,t,n){let r=oi(e,"next");for(let i=0;i<t;i++){const o=r.getAdjacentCaret();if(o===null)break;r=o}return Nr(r,n)}s(W2,"uu");function CA(e,t="root"){let n=0,r=e,i=_s(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=_s(r)}return i&&[i,n]}s(CA,"fu");function bA(e){const{origin:t,offset:n,direction:r}=e;if(n===hr(t,r))return e.getSiblingCaret();if(n===hr(t,Gi(r)))return Do(e.getSiblingCaret());const[i]=t.splitText(n);return X(i)||B(281),Nr(_t(i,"next"),r)}s(bA,"du");function EA(e,t){return!0}s(EA,"hu");function z2(e,{$copyElementNode:t=Fp,$splitTextPointCaretNext:n=bA,rootMode:r="shadowRoot",$shouldSplit:i=EA,removeEmptyDestination:o=!1}={}){if(fr(e))return n(e);const l=e.getParentCaret(r);if(l){const{origin:a}=l;if(Gn(e)){const u=Do(l);if(o&&a.isEmpty())return a.remove(),u;if(!a.canBeEmpty()||!i(a,"first"))return u}const c=(function(u){const d=[];for(let f=u.getAdjacentCaret();f;f=f.getAdjacentCaret())d.push(f.origin);return d})(e);(c.length>0||!o&&a.canBeEmpty()&&i(a,"last"))&&l.insert(t(a).splice(0,0,c))}return l}s(z2,"gu");function j2(e,t,n){let r=Nr(t,"next");fr(r)&&(r.offset===0?r=_t(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=_t(r.origin,"next"))),r.origin.is(e)&&(Bi(r)||B(342,e.getKey(),e.getType()),r=Do(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let i=r;i;i=z2(i,n))r=i;return fr(r)&&B(283),r.insert(e.isInline()?mn().append(e):e),Nr(_t(e.getLatest(),"next"),t.direction)}s(j2,"_u");function SA(e){return e}s(SA,"pu");function TA(...e){return e}s(TA,"yu");function wA(e,t){return[e,t]}s(wA,"mu");function kA(e){return e}s(kA,"xu");function MA(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}s(MA,"Cu");function Ta(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}s(Ta,"Su");function AA(e,...t){const n=Ta(...t);n.length>0&&e.classList.add(...n)}s(AA,"vu");function IA(e,...t){const n=Ta(...t);n.length>0&&e.classList.remove(...n)}s(IA,"Tu");function Yp(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}s(Yp,"ku");function NA(e,t,n){return Yp(...Object.entries(t).map(([r,i])=>vp(e,r,i,n)))}s(NA,"bu");var w=hM,kh=w.$addUpdateTag,ci=w.$applyNodeReplacement,OA=w.$assumeActiveEditor,Ui=w.$caretFromPoint,J2=w.$caretRangeFromSelection,TU=w.$cloneWithProperties,DA=w.$cloneWithPropertiesEphemeral,Mh=w.$comparePointCaretNext,tn=w.$copyNode,G2=w.$create,wU=w.$createChildrenArray,Or=w.$createLineBreakNode,cu=w.$createNodeSelection,Xe=w.$createParagraphNode,kU=w.$createPoint,pd=w.$createRangeSelection,MU=w.$createRangeSelectionFromDom,Xp=w.$createTabNode,pr=w.$createTextNode,q2=w.$extendCaretToRange,dt=w.$findMatchingParent,RA=w.$formatText,AU=w.$fullReconcile,Ah=w.$generateNodesFromRawText,LA=w.$getAdjacentChildCaret,IU=w.$getAdjacentNode,NU=w.$getAdjacentSiblingOrParentSiblingCaret,OU=w.$getCaretInDirection,xl=w.$getCaretRange,Z2=w.$getCaretRangeInDirection,$A=w.$getCharacterOffsets,Wi=w.$getChildCaret,d_=w.$getChildCaretAtIndex,DU=w.$getChildCaretOrSelf,md=w.$getCollapsedCaretRange,RU=w.$getCommonAncestor,LU=w.$getCommonAncestorResultBranchOrder,$U=w.$getDOMSlot,PU=w.$getDOMTextNode,bn=w.$getDocument,Wt=w.$getEditor,Y2=w.$getEditorDOMRenderConfig,si=w.$getNearestNodeFromDOMNode,FU=w.$getNearestRootOrShadowRoot,yn=w.$getNodeByKey,VU=w.$getNodeByKeyOrThrow,BU=w.$getNodeFromDOMNode,X2=w.$getPreviousSelection,Lt=w.$getRoot,re=w.$getSelection,qn=w.$getSiblingCaret,PA=w.$getSlot,Qp=w.$getSlotFrame,HU=w.$getSlotHost,KU=w.$getSlotNameWithinHost,FA=w.$getSlotNames,em=w.$getState,UU=w.$getStateChange,WU=w.$getTextContent,zU=w.$getTextNodeOffset,VA=w.$getTextPointCaret,jU=w.$getTextPointCaretSlice,JU=w.$getWritableNodeState,Q2=w.$hasAncestor,GU=w.$hasUpdateTag,tm=w.$insertNodeToNearestRootAtCaret,Ls=w.$insertNodes,ys=w.$isBlockElementNode,nm=w.$isChildCaret,Un=w.$isDecoratorNode,BA=w.$isEditorState,qU=w.$isElementDOMSlot,xe=w.$isElementNode,eb=w.$isExtendableTextPointCaret,ZU=w.$isInlineElementOrDecoratorNode,YU=w.$isInlineFormattable,tb=w.$isLeafNode,XU=w.$isLexicalNode,Dr=w.$isLineBreakNode,QU=w.$isNodeCaret,He=w.$isNodeSelection,wa=w.$isParagraphNode,ie=w.$isRangeSelection,ka=w.$isRootNode,xn=w.$isRootOrShadowRoot,HA=w.$isSelectionCapturedInDecoratorInput,Sc=w.$isShadowRootNode,uu=w.$isSiblingCaret,eW=w.$isSlotChild,tW=w.$isSlotHost,du=w.$isTabNode,Ie=w.$isTextNode,rm=w.$isTextPointCaret,nW=w.$isTextPointCaretSlice,KA=w.$isTokenOrSegmented,rW=w.$isTokenOrTab,iW=w.$markSlotEditable,UA=w.$needsBlockCursorBeside,oW=w.$nodesOfType,zi=w.$normalizeCaret,jl=w.$normalizeSelection__EXPERIMENTAL,sW=w.$onUpdate,WA=w.$parseSerializedNode,lW=w.$removeFromParent,aW=w.$removeSlot,cW=w.$removeTextFromCaretRange,Cl=w.$rewindSiblingCaret,zA=w.$selectAll,uW=w.$setCompositionKey,Cr=w.$setDirectionFromDOM,ui=w.$setFormatFromDOM,Ih=w.$setPointFromCaret,Xn=w.$setSelection,xs=w.$setSelectionFromCaretRange,dW=w.$setSlot,us=w.$setState,jA=w.$setTextFormat,JA=w.$splitAtPointCaretNext,fW=w.$splitNode,GA=w.$updateDOMSelection,hW=w.$updateRangeSelectionFromCaretRange,nb=w.ArtificialNode__DO_NOT_USE,gW=w.BEFORE_INPUT_COMMAND,rb=w.BLUR_COMMAND,Qo=w.CAN_REDO_COMMAND,es=w.CAN_UNDO_COMMAND,f_=w.CAN_USE_BEFORE_INPUT,_d=w.CAN_USE_DOM,qA=w.CLEAR_EDITOR_COMMAND,ZA=w.CLEAR_HISTORY_COMMAND,im=w.CLICK_COMMAND,YA=w.COLLABORATION_TAG,XA=w.COMMAND_PRIORITY_BEFORE_CRITICAL,QA=w.COMMAND_PRIORITY_BEFORE_EDITOR,pW=w.COMMAND_PRIORITY_BEFORE_HIGH,mW=w.COMMAND_PRIORITY_BEFORE_LOW,_W=w.COMMAND_PRIORITY_BEFORE_NORMAL,Rr=w.COMMAND_PRIORITY_CRITICAL,Ae=w.COMMAND_PRIORITY_EDITOR,Jl=w.COMMAND_PRIORITY_HIGH,st=w.COMMAND_PRIORITY_LOW,vW=w.COMMAND_PRIORITY_NORMAL,yW=w.COMPOSITION_END_COMMAND,ib=w.COMPOSITION_END_TAG,xW=w.COMPOSITION_START_COMMAND,e7=w.COMPOSITION_START_TAG,t7=w.CONTROLLED_TEXT_INSERTION_COMMAND,ob=w.COPY_COMMAND,n7=w.CUT_COMMAND,sb=w.CUT_TAG,CW=w.DEFAULT_EDITOR_DOM_CONFIG,uf=w.DELETE_CHARACTER_COMMAND,r7=w.DELETE_LINE_COMMAND,i7=w.DELETE_WORD_COMMAND,bW=w.DRAGEND_COMMAND,lb=w.DRAGOVER_COMMAND,om=w.DRAGSTART_COMMAND,ab=w.DROP_COMMAND,Ma=w.DecoratorNode,Lr=w.ElementNode,sm=w.FOCUS_COMMAND,o7=w.FORMAT_ELEMENT_COMMAND,cb=w.FORMAT_TEXT_COMMAND,ho=w.HISTORIC_TAG,ub=w.HISTORY_MERGE_TAG,db=w.HISTORY_PUSH_TAG,fu=w.INDENT_CONTENT_COMMAND,EW=w.INPUT_COMMAND,h_=w.INSERT_LINE_BREAK_COMMAND,Nh=w.INSERT_PARAGRAPH_COMMAND,fb=w.INSERT_TAB_COMMAND,Ga=w.INTERNAL_$isBlock,SW=w.IS_ALL_FORMATTING,TW=w.IS_ANDROID,wW=w.IS_ANDROID_CHROME,kW=w.IS_APPLE,s7=w.IS_APPLE_WEBKIT,g_=w.IS_BOLD,MW=w.IS_CHROME,l7=w.IS_CODE,a7=w.IS_FIREFOX,c7=w.IS_HIGHLIGHT,p_=w.IS_IOS,m_=w.IS_ITALIC,u7=w.IS_SAFARI,__=w.IS_STRIKETHROUGH,df=w.IS_SUBSCRIPT,ff=w.IS_SUPERSCRIPT,v_=w.IS_UNDERLINE,hb=w.KEY_ARROW_DOWN_COMMAND,gb=w.KEY_ARROW_LEFT_COMMAND,d7=w.KEY_ARROW_RIGHT_COMMAND,pb=w.KEY_ARROW_UP_COMMAND,vd=w.KEY_BACKSPACE_COMMAND,lm=w.KEY_DELETE_COMMAND,mb=w.KEY_DOWN_COMMAND,yd=w.KEY_ENTER_COMMAND,xd=w.KEY_ESCAPE_COMMAND,AW=w.KEY_MODIFIER_COMMAND,_b=w.KEY_SPACE_COMMAND,am=w.KEY_TAB_COMMAND,vb=w.LineBreakNode,f7=w.MOVE_TO_END,h7=w.MOVE_TO_START,IW=w.NODE_STATE_DIRECT,NW=w.NODE_STATE_KEY,OW=w.NODE_STATE_LATEST,Oh=w.OUTDENT_CONTENT_COMMAND,Gl=w.PASTE_COMMAND,yb=w.PASTE_TAG,cm=w.ParagraphNode,g7=w.REDO_COMMAND,p7=w.REMOVE_TEXT_COMMAND,xb=w.RootNode,um=w.SELECTION_CHANGE_COMMAND,m7=w.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,_7=w.SELECT_ALL_COMMAND,v7=w.SET_TEXT_FORMAT_COMMAND,DW=w.SKIP_COLLAB_TAG,y7=w.SKIP_DOM_SELECTION_TAG,x7=w.SKIP_SCROLL_INTO_VIEW_TAG,Cb=w.SKIP_SELECTION_FOCUS_TAG,C7=w.TEXT_TYPE_TO_FORMAT,bb=w.TabNode,$s=w.TextNode,b7=w.UNDO_COMMAND,mr=w.addClassNamesToElement,Eb=w.buildImportMap,ts=w.configExtension,br=w.createCommand,Sb=w.createEditor,RW=w.createRefCountedRegistry,LW=w.createSharedNodeState,Aa=w.createState,E7=w.declarePeerDependency,Fr=w.defineExtension,S7=w.findAllLexicalElementsDeep,T7=w.flipDirection,Tb=w.getActiveElement,w7=w.getActiveElementDeep,k7=w.getComposedEventTarget,$W=w.getComposedStaticRange,PW=w.getDOMOwnerDocument,Ia=w.getDOMSelection,FW=w.getDOMSelectionFromTarget,M7=w.getDOMSelectionPoints,VW=w.getDOMSelectionRange,BW=w.getDOMSelectionRangeAndPoints,A7=w.getDOMShadowRoots,HW=w.getDOMTextNode,KW=w.getDeclaredSlots,wb=w.getEditorPropertyFromDOMNode,I7=w.getNearestEditorFromDOMNode,kb=w.getParentElement,UW=w.getRegisteredNode,WW=w.getRegisteredNodeOrThrow,zW=w.getRegisteredSubtypeMap,N7=w.getRootOwnerDocument,jW=w.getStaticNodeConfig,y_=w.getStyleObjectFromCSS,JW=w.getTextDirection,GW=w.getTransformSetFromKlass,hu=w.isBlockDomNode,qW=w.isCurrentlyReadOnlyMode,ZW=w.isDOMCapturingSelection,Mb=w.isDOMDocumentNode,O7=w.isDOMNode,D7=w.isDOMShadowRoot,Cd=w.isDOMTextNode,YW=w.isDOMUnmanaged,x_=w.isDocumentFragment,XW=w.isExactShortcutMatch,Ab=w.isHTMLAnchorElement,Ke=w.isHTMLElement,QW=w.isHTMLTableCellElement,ez=w.isHTMLTableRowElement,Dh=w.isInlineDomNode,R7=w.isLastChildInBlockNode,Ib=w.isLexicalEditor,tz=w.isModifierMatch,L7=w.isOnlyChildInBlockNode,nz=w.isSelectionCapturedInDecoratorInput,$7=w.isSelectionWithinEditor,rz=w.iterStaticNodeConfigChain,iz=w.makeStepwiseIterator,At=w.mergeRegister,oz=w.mountSlotContainer,bl=w.normalizeClassNames,P7=w.registerEventListener,Rh=w.registerEventListeners,bd=w.removeClassNamesFromElement,sz=w.removeFromParent,lz=w.resetRandomKey,Ro=w.safeCast,Tc=w.setDOMStyleFromCSS,az=w.setDOMStyleObject,cz=w.setDOMUnmanaged,Ps=w.setNodeIndentFromDOM,Ed=w.shallowMergeConfig,uz=w.stopLexicalPropagation,dz=w.toggleTextFormatType,F7=w.tokenizeRawText,fz=w.unmountSlotContainer;function V7(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(V7,"B$1");function Nb(e){const t=Wt().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}s(Nb,"R");function Ob(e){return Nb(ka(e)?e:e.getParentOrThrow())}s(Ob,"O$1");function qa(e){const t=Ob(e);return t!==null&&t.direction==="rtl"}s(qa,"_");function Db(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!KA(t)&&r!==null){const[i,o]=r,l=e.isBackward(),a=i.getNode(),c=o.getNode(),u=t.is(a),d=t.is(c);if(u||d){const[f,h]=$A(e),g=a.is(c),p=t.is(l?c:a),_=t.is(l?a:c);let y,v=0;g?(v=f>h?h:f,y=f>h?f:h):p?(v=l?h:f,y=void 0):_&&(v=0,y=l?f:h);const x=t.__text.slice(v,y);x!==t.__text&&(n==="clone"&&(t=DA(t)),t.__text=x)}}return t}s(Db,"L$1");function C_(e){if(e.type==="text")return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return xe(t)||V7(177),e.offset===t.getChildrenSize()}s(C_,"M$1");function B7(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}s(B7,"W");function H7(e,t,n){let r=Ui(e,n);if(eb(r))return!1;for(;r;r=r.getParentCaret()){const i=r.getParentAtCaret();if(!i||r.getNodeAtCaret())return!1;if(t.is(i))return!0}return!1}s(H7,"X$2");function K7(e,t,n=B7){if(!e)return;const r=e.getStartEndPoints();let i=!1,o=null;const l=new Map;if(r){const[a,c]=r,u=dt(a.getNode(),Ga);o=dt(c.getNode(),Ga);const d=e.isBackward()?"previous":"next";i=xe(o)&&!o.is(u)&&(function(f,h,g){const p=f.getNode();return(!xe(p)||!p.isEmpty())&&H7(f,h,g)})(c,o,T7(d)),xe(u)&&l.set(u.getKey(),u),xe(o)&&!i&&l.set(o.getKey(),o)}for(const a of e.getNodes())if(xe(a)&&Ga(a)){if(i&&a.is(o))continue;l.set(a.getKey(),a)}else if(!r){const c=dt(a,Ga);xe(c)&&l.set(c.getKey(),c)}for(const a of l.values()){const c=t();n(a,c),a.replace(c,!0)}}s(K7,"q$1");function Rb(e){const t=Lb(e);return t!==null&&t.writingMode==="vertical-rl"}s(Rb,"Z$2");function Lb(e){const t=e.anchor.getNode();return xe(t)?Nb(t):Ob(t)}s(Lb,"ee$2");function b_(e,t){let n=Rb(e)?!t:t;$b(e)&&(n=!n);const r=Ui(e.focus,n?"previous":"next");if(eb(r))return!1;if(rm(r)&&!du(r.origin)&&r.origin.isUnmergeable()){const i=r.getNodeAtCaret();if(Ie(i)&&!du(i))return!0}for(const i of q2(r)){if(nm(i))return!i.origin.isInline();if(!xe(i.origin)){if(Un(i.origin))return!0;break}}return!1}s(b_,"te$2");function U7(e,t,n,r){e.modify(t?"extend":"move",n,r)}s(U7,"ne$1");function $b(e){const t=Lb(e);return t!==null&&t.direction==="rtl"}s($b,"oe$1");function E_(e,t,n){const r=$b(e);let i;i=Rb(e)||r?!n:n,U7(e,t,i,"character")}s(E_,"le$2");function W7(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(W7,"Z$1");function Pb(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}s(Pb,"_t$4");function Fb(e){const t=dt(e,n=>xe(n)&&!n.isInline());return xe(t)||W7(4,e.__key),t}s(Fb,"It$3");function Vb(e){const t=re()||X2();let n;if(ie(t))n=Ui(t.focus,"next");else{if(t!=null){const l=t.getNodes(),a=l[l.length-1];a&&(n=qn(a,"next"))}n=n||Wi(Lt(),"previous").getFlipped().insert(Xe())}const r=tm(e,n),i=LA(r),o=nm(i)?zi(i):r;return xs(md(o)),e.getLatest()}s(Vb,"Bt$3");function dm(e,t){const n=t();return e.replace(n),n.append(e),n}s(dm,"Tt$6");function Zr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}s(Zr,"Mt$4");function Za(e){let t=null;if(Zr(e,DragEvent)?t=e.dataTransfer:Zr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}s(Za,"Ft$4");function Lh(e){const t=re();if(!ie(t))return!1;const n=new Set,r=t.getNodes();for(let i=0;i<r.length;i++){const o=r[i],l=o.getKey();if(n.has(l))continue;const a=dt(o,u=>xe(u)&&!u.isInline());if(a===null)continue;const c=a.getKey();a.canIndent()&&!n.has(c)&&(n.add(c),e(a))}return n.size>0}s(Lh,"$t$6");var hf=!(a7||!_d)&&void 0;function z7(e,t=!1){let n=1;if((function(){if(hf===void 0){const r=document.createElement("div");r.style.position="absolute",r.style.opacity="0",r.style.width="100px",r.style.left="-1000px",document.body.appendChild(r);const i=r.getBoundingClientRect();r.style.setProperty("zoom","2"),hf=r.getBoundingClientRect().width===i.width,document.body.removeChild(r)}return hf})()||t){const r=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(r.getComputedStyle(e).getPropertyValue("zoom")),e=kb(e)}return n}s(z7,"Ut$4");var j7=Symbol.for("preact-signals");function Sd(){if(ti>1)return void ti--;let e,t=!1;for((function(){let n=gu;for(gu=void 0;n!==void 0;)n.S.v===n.v&&(n.S.i=n.i),n=n.o})();El!==void 0;){let n=El;for(El=void 0,pu++;n!==void 0;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Hb(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=r}}if(pu=0,ti--,t)throw e}s(Sd,"$t$5");function Bb(e){if(ti>0)return e();$h=++J7,ti++;try{return e()}finally{Sd()}}s(Bb,"Tt$5");var Ze,El;function S_(e){const t=Ze;Ze=void 0;try{return e()}finally{Ze=t}}s(S_,"Ut$3");var gu,ti=0,pu=0,J7=0,$h=0,wc=0;function T_(e){if(Ze===void 0)return;let t=e.n;return t===void 0||t.t!==Ze?(t={i:0,S:e,p:Ze.s,n:void 0,t:Ze,e:void 0,x:void 0,r:t},Ze.s!==void 0&&(Ze.s.n=t),Ze.s=t,e.n=t,32&Ze.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ze.s,t.n=void 0,Ze.s.n=t,Ze.s=t),t):void 0}s(T_,"Ht$2");function sn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}s(sn,"Xt$1");function ql(e,t){return new sn(e,t)}s(ql,"Yt$1");function Hb(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}s(Hb,"qt$2");function w_(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}s(w_,"Qt");function Kb(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}s(Kb,"te$1");function Vo(e,t){sn.call(this,void 0),this.x=e,this.s=void 0,this.g=wc-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}s(Vo,"ee$1");function Ub(e){const t=e.m;if(e.m=void 0,typeof t=="function"){ti++;const n=Ze;Ze=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,fm(e),r}finally{Ze=n,Sd()}}}s(Ub,"ie$2");function fm(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ub(e)}s(fm,"oe");function G7(e){if(Ze!==this)throw new Error("Out-of-order effect");Kb(this),Ze=e,this.f&=-2,8&this.f&&fm(this),Sd()}s(G7,"se$2");function Jo(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}s(Jo,"re$2");function Lo(e,t){const n=new Jo(e,t);try{n.c()}catch(i){throw n.d(),i}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}s(Lo,"ce$1");function Na(e,t={}){const n={};for(const r in e){const i=t[r];n[r]=ql(i===void 0?e[r]:i)}return n}s(Na,"ae$1");sn.prototype.brand=j7,sn.prototype.h=function(){return!0},sn.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:S_(()=>{var n;(n=this.W)==null||n.call(this)}))},sn.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&S_(()=>{var r;(r=this.Z)==null||r.call(this)}))}},sn.prototype.subscribe=function(e){return Lo(()=>{const t=this.value,n=Ze;Ze=void 0;try{e(t)}finally{Ze=n}},{name:"sub"})},sn.prototype.valueOf=function(){return this.value},sn.prototype.toString=function(){return this.value+""},sn.prototype.toJSON=function(){return this.value},sn.prototype.peek=function(){const e=Ze;Ze=void 0;try{return this.value}finally{Ze=e}},Object.defineProperty(sn.prototype,"value",{get(){const e=T_(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(pu>100)throw new Error("Cycle detected");(function(t){ti!==0&&pu===0&&t.l!==$h&&(t.l=$h,gu={S:t,v:t.v,i:t.i,o:gu})})(this),this.v=e,this.i++,wc++,ti++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Sd()}}}}),Vo.prototype=new sn,Vo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wc))return!0;if(this.g=wc,this.f|=1,this.i>0&&!Hb(this))return this.f&=-2,!0;const e=Ze;try{w_(this),Ze=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ze=e,Kb(this),this.f&=-2,!0},Vo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}sn.prototype.S.call(this,e)},Vo.prototype.U=function(e){if(this.t!==void 0&&(sn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Vo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Vo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=T_(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Jo.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}},Jo.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ub(this),w_(this),ti++;const e=Ze;return Ze=this,G7.bind(this,e)},Jo.prototype.N=function(){2&this.f||(this.f|=2,this.u=El,El=this)},Jo.prototype.d=function(){this.f|=8,1&this.f||fm(this)},Jo.prototype.dispose=function(){this.d()};function q7(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}s(q7,"ve$1");function Z7(e,t){let n;return ql(e(),{unwatched(){n&&(n(),n=void 0)},watched(){this.value=e(),n=t(this)}})}s(Z7,"Ce$1");function et(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(et,"Ie$2");var Wb;try{Wb="0.48.0+prod.esm"}catch{}var Y7=Wb??'"<unknown>+source"',X7=new Set(["__proto__","constructor","prototype"]);function zb(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const i in r)!X7.has(i)&&Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=zb(n[i],r[i]));return e}return t}s(zb,"ke$2");var hm=0,Ph=1,jb=2,gf=3,Ya=4,Bo=5,pf=6,Ys=7;function mf(e){return e.id===hm}s(mf,"Ue$2");function Jb(e){return e.id===jb}s(Jb,"We$2");function Q7(e){return(function(t){return t.id===Ph})(e)||et(305,String(e.id),String(Ph)),Object.assign(e,{id:jb})}s(Q7,"Be$2");var eI=new Set,tI=class{static{s(this,"Ge$1")}builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:hm}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Ed;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;Jb(t)||et(306,String(t.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(l,a,c){return Object.assign(l,{config:a,id:gf,registerState:c})})(t,this.mergeConfigs(),n);let o;this.state=i,this.extension.init&&(o=this.extension.init(e,i.config,n)),this.state=(function(l,a,c){return Object.assign(l,{id:Ya,initResult:a,registerState:c})})(i,o,r)}build(e){const t=this.state;let n;t.id!==Ya&&et(307,String(t.id),String(Bo)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));const r={...t.registerState,getOutput:s(()=>n,"getOutput"),getSignal:this.getSignal.bind(this)};this.state=(function(i,o,l){return Object.assign(i,{id:Bo,output:o,registerState:l})})(t,n,r)}register(e,t){this._signal=t;const n=this.state;n.id!==Bo&&et(308,String(n.id),String(Bo));const r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=(function(i){return Object.assign(i,{id:pf})})(n),()=>{const i=this.state;i.id!==Ys&&et(309,String(n.id),String(Ys)),this.state=(function(o){return Object.assign(o,{id:Bo})})(i),r&&r()}}afterRegistration(e){const t=this.state;let n;return t.id!==pf&&et(310,String(t.id),String(pf)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(r){return Object.assign(r,{id:Ys})})(t),n}getSignal(){return this._signal===void 0&&et(311),this._signal}getInitResult(){this.extension.init===void 0&&et(312,this.extension.name);const e=this.state;return(function(t){return t.id>=Ya})(e)||et(313,String(e.id),String(Ya)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=gf})(e)||et(314,String(e.id),String(gf)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&et(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=Ys})(e)||et(316,String(e.id),String(Ys)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||eI}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Bo})(e)||et(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},k_={tag:ub};function nI(){const e=Lt();e.isEmpty()&&e.append(Xe())}s(nI,"Je$2");var Gb=Fr({config:Ro({setOptions:k_,updateOptions:k_}),init:s(({$initialEditorState:e=nI})=>({$initialEditorState:e,initialized:!1}),"init"),afterRegistration(e,{updateOptions:t,setOptions:n},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:o}=i;if(BA(o))e.setEditorState(o,n);else if(typeof o=="function")e.update(()=>{o(e)},t);else if(o&&(typeof o=="string"||typeof o=="object")){const l=e.parseEditorState(o);e.setEditorState(l,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[xb,$s,vb,bb,cm]}),M_=Symbol.for("@lexical/extension/LexicalBuilder");function rI(...e){return Oa.fromExtensions(e).buildEditor()}s(rI,"Ye$1");function A_(){}s(A_,"qe$2");function iI(e){throw e}s(iI,"Qe$1");function Xa(e){return Array.isArray(e)?e:[e]}s(Xa,"tn$1");var _f=Y7,Oa=class kc{static{s(this,"nn$1")}roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=_f,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Xa(Gb)];for(const r of t)n.push(Xa(r));return new kc(n)}static maybeFromEditor(t){const n=t[M_];return n&&(n.PACKAGE_VERSION!==_f&&et(292,n.PACKAGE_VERSION,_f),n instanceof kc||et(293)),n}static fromEditor(t){const n=kc.maybeFromEditor(t);return n===void 0&&et(294),n}constructEditor(){const{$initialEditorState:t,onError:n,onWarn:r,...i}=this.buildCreateEditorArgs(),o=Object.assign(Sb({...i,...n?{onError:s(l=>{n(l,o)},"onError")}:{},...r?{onWarn:s(l=>{r(l,o)},"onWarn")}:{}}),{[M_]:this});for(const l of this.sortedExtensionReps())l.build(o);return o}buildEditor(){let t=A_;function n(){try{t()}finally{t=A_}}s(n,"e");const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=At(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&et(295,t.name),n}addEdge(t,n,r){const i=this.outgoingConfigEdges.get(t);i?i.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const o=this.incomingEdges.get(n);o?o.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&et(296);const[n]=Xa(t);typeof n.name!="string"&&et(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(r!==void 0&&r.extension!==n&&et(298,n.name),!r){r=new tI(this,n),this.extensionNameMap.set(n.name,r);const i=this.conflicts.get(n.name);typeof i=="string"&&et(299,n.name,i);for(const o of n.conflictsWith||[])this.extensionNameMap.has(o)&&et(299,n.name,o),this.conflicts.set(o,n.name);for(const o of n.dependencies||[]){const l=Xa(o);this.addEdge(n.name,l[0].name,l.slice(1)),this.addExtension(l)}for(const[o,l]of n.peerDependencies||[])this.addEdge(n.name,o,l?[l]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=s((r,i)=>{let o=r.state;if(Jb(o))return;const l=r.extension.name;var a;mf(o)||et(300,l,i||"[unknown]"),mf(a=o)||et(304,String(a.id),String(hm)),o=Object.assign(a,{id:Ph}),r.state=o;const c=this.outgoingConfigEdges.get(l);if(c)for(const u of c.keys()){const d=this.extensionNameMap.get(u);d&&n(d,l)}o=Q7(o),r.state=o,t.push(r)},"e");for(const r of this.extensionNameMap.values())mf(r.state)&&n(r);for(const r of t)for(const[i,o]of this.outgoingConfigEdges.get(r.extension.name)||[])if(o.length>0){const l=this.extensionNameMap.get(i);if(l)for(const a of o)l.configs.add(a)}for(const[r,...i]of this.roots)if(i.length>0){const o=this.extensionNameMap.get(r.name);o===void 0&&et(301,r.name);for(const l of i)o.configs.add(l)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],o=r.signal;for(const l of n){const a=l.register(t,o);a&&i.push(a)}for(const l of n){const a=l.afterRegistration(t);a&&i.push(a)}return At(...i)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,i=new Map,o={},l={},a=this.sortedExtensionReps();for(const d of a){const{extension:f}=d;if(f.onError!==void 0&&(t.onError=f.onError),f.onWarn!==void 0&&(t.onWarn=f.onWarn),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const h of q7(f)){if(typeof h!="function"){const g=r.get(h.replace);g&&et(302,f.name,h.replace.name,g.extension.name),r.set(h.replace,d)}n.add(h)}if(f.html){if(f.html.export)for(const[h,g]of f.html.export.entries())i.set(h,g);f.html.import&&Object.assign(o,f.html.import)}f.theme&&zb(l,f.theme)}Object.keys(l).length>0&&(t.theme=l),n.size&&(t.nodes=[...n]);const c=Object.keys(o).length>0,u=i.size>0;(c||u)&&(t.html={},c&&(t.html.import=o),u&&(t.html.export=i));for(const d of a)d.init(t);return t.onError||(t.onError=iI),t}};function oI(e,t){const n=Oa.fromEditor(e).getExtensionRep(t);return n===void 0&&et(303,t.name),n.getExtensionDependency()}s(oI,"on$1");function qi(e,t){const n=Oa.maybeFromEditor(e);if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}s(qi,"sn");function sI(e){return qi(Wt(),e)}s(sI,"dn");var qb=br("INSERT_HORIZONTAL_RULE_COMMAND"),Da=class Zb extends Ma{static{s(this,"hn")}static getType(){return"horizontalrule"}static clone(t){return new Zb(t.__key)}static importJSON(t){return Td().updateFromJSON(t)}static importDOM(){return{hr:s(()=>({conversion:lI,priority:0}),"hr")}}exportDOM(){return{element:bn().createElement("hr")}}createDOM(t){const n=bn().createElement("hr");return mr(n,t.theme.hr),n}getTextContent(){return`
13
+ `}isInline(){return!1}updateDOM(){return!1}};function lI(){return{node:Td()}}s(lI,"gn");function Td(){return G2(Da)}s(Td,"pn");function Yb(e){return e instanceof Da}s(Yb,"mn$1");var aI=Fr({build:s((e,t)=>Na({inheritEditableFromParent:t.inheritEditableFromParent}),"build"),config:Ro({$getParentEditor:s(function(){const e=Wt();return Oa.fromEditor(e),e},"$getParentEditor"),inheritEditableFromParent:!1}),init:s((e,t,n)=>{const r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},"init"),name:"@lexical/extension/NestedEditor",register:s((e,t,n)=>Lo(()=>{const r=e._parentEditor;if(r&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(r.isEditable()),r.registerEditableListener(e.setEditable.bind(e))}),"register")}),cI=new Set([Cb,x7]),hz=Fr({build:s((e,t,n)=>Na(t),"build"),config:Ro({$fixFocusOverselection:s(function(){const e=re();if(ie(e)&&!e.isCollapsed()){const t=Z2(J2(e),"next");let n=t.focus;for(rm(n)&&t.anchor.origin!==n.origin&&n.offset===0&&(n=Cl(n.getSiblingCaret())),uu(n)&&t.anchor.origin!==n.origin&&Dr(n.origin)&&(n=Cl(n));nm(n)&&t.anchor.origin!==n.origin;)n=Cl(qn(n.origin,"next"));if(uu(n)&&xe(n.origin)&&(n=zi(Wi(n.origin,"previous")).getFlipped()),n=zi(n),!n.isSamePointCaret(t.focus)){const r=xs(xl(t.anchor,n)),i=Wt().getRootElement(),o=i&&Ia(i.ownerDocument.defaultView);o&&GA(X2(),r,Wt(),o,cI,i)}}},"$fixFocusOverselection"),dateNow:Date.now,disabled:!1,thresholdMsec:100}),name:"@lexical/NormalizeTripleClickSelection",register:s((e,t,n)=>Lo(()=>{const r=n.getOutput();if(!r.disabled.value)return e.registerRootListener(i=>{if(!i)return;let o=0;const l=s(a=>{if(a?a.detail===3:o>0){const c=r.dateNow.peek()();o=a&&a.type==="mousedown"||c-o<=r.thresholdMsec.peek()?c:0}return o},"o");return At(e.registerCommand(um,()=>(l(null)&&(o=0,r.$fixFocusOverselection.peek()()),!1),XA),Rh(i,{mousedown:l,mouseup:l},!0))})}),"register")});function uI(e){return e.canIndent()}s(uI,"Fn");function dI(e,t,n=uI){return At(e.registerCommand(am,r=>{const i=re();if(!ie(i))return!1;r.preventDefault();const o=(function(l){if(l.getNodes().filter(h=>ys(h)&&h.canIndent()).length>0)return!0;const a=l.anchor,c=l.focus,u=c.isBefore(a)?c:a,d=u.getNode(),f=Fb(d);if(f.canIndent()){const h=f.getKey();let g=pd();if(g.anchor.set(h,0,"element"),g.focus.set(h,0,"element"),g=jl(g),g.anchor.is(u))return!0}return!1})(i)?r.shiftKey?Oh:fu:fb;return e.dispatchCommand(o,void 0)},Ae),e.registerCommand(fu,()=>{const r=typeof t=="number"?t:t?t.peek():null,i=re();if(!ie(i))return!1;const o=typeof n=="function"?n:n.peek();return Lh(l=>{if(o(l)){const a=l.getIndent()+1;(!r||a<r)&&l.setIndent(a)}})},Rr))}s(dI,"Mn$1");function fI(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;const o=t._selection,l=e._selection;if(i)return 1;if(!(ie(o)&&ie(l)&&l.isCollapsed()&&o.isCollapsed()))return 0;const a=(function(v,x,C){const b=v._nodeMap,S=[];for(const M of x){const T=b.get(M);T!==void 0&&S.push(T)}for(const[M,T]of C){if(!T)continue;const E=b.get(M);E===void 0||ka(E)||S.push(E)}return S})(t,n,r);if(a.length===0)return 0;if(a.length>1){const v=t._nodeMap,x=v.get(o.anchor.key),C=v.get(l.anchor.key);return x&&C&&!e._nodeMap.has(x.__key)&&Ie(x)&&x.__text.length===1&&o.anchor.offset===1?2:0}const c=a[0],u=e._nodeMap.get(c.__key);if(!Ie(u)||!Ie(c)||u.__mode!==c.__mode)return 0;const d=u.__text,f=c.__text;if(d===f)return 0;const h=o.anchor,g=l.anchor;if(h.key!==g.key||h.type!=="text")return 0;const p=h.offset,_=g.offset,y=f.length-d.length;return y===1&&_===p-1?2:y===-1&&_===p+1?3:y===-1&&_===p?4:0}s(fI,"E$1");function hI(e,t,n){let r=n(),i=0,o=r,l=0,a=null;return(c,u,d,f,h,g)=>{const p=n();if(g.has(e7)&&(o=r,l=i,a=c),g.has(ho))return i=0,r=p,2;g.has(ib)&&a&&(r=o,i=l,c=a);const _=g.has(yb)||g.has(sb)?0:fI(c,u,f,h,e.isComposing()),y=(()=>{const v=d===null||d.editor===e,x=g.has(db);if(!x&&v&&g.has(ub))return 0;if(_===1)return 2;if(c===null)return 1;const C=u._selection;if(!(f.size>0||h.size>0))return C!==null?0:2;const b=typeof t=="number"?t:t.peek();return x===!1&&_!==0&&_===i&&p<r+b&&v||f.size===1&&(function(S,M,T){const E=M._nodeMap.get(S),A=T._nodeMap.get(S),D=M._selection,L=T._selection;return!(ie(D)&&ie(L)&&D.anchor.type==="element"&&D.focus.type==="element"&&L.anchor.type==="text"&&L.focus.type==="text"||!Ie(E)||!Ie(A)||E.__parent!==A.__parent)&&JSON.stringify(M.read(()=>E.exportJSON()))===JSON.stringify(T.read(()=>A.exportJSON()))})(Array.from(f)[0],c,u)?0:1})();return r=p,i=_,y}}s(hI,"D");function I_(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}s(I_,"M");function gI(e,t,n,r=Date.now,i,o=null){const l=hI(e,n,r),a=s(()=>{i&&i(t)},"m");return a(),At(e.registerCommand(b7,()=>((function(c,u,d){const f=u.redoStack,h=u.undoStack;if(h.length!==0){const g=u.current,p=h.pop();g!==null&&(f.push(g),c.dispatchCommand(Qo,!0)),h.length===0&&c.dispatchCommand(es,!1),u.current=p||null,d&&d(u),p&&p.editor.setEditorState(p.editorState,{tag:ho})}})(e,t,i),!0),Ae),e.registerCommand(g7,()=>((function(c,u,d){const f=u.redoStack,h=u.undoStack;if(f.length!==0){const g=u.current;g!==null&&(h.push(g),c.dispatchCommand(es,!0));const p=f.pop();f.length===0&&c.dispatchCommand(Qo,!1),u.current=p||null,d&&d(u),p&&p.editor.setEditorState(p.editorState,{tag:ho})}})(e,t,i),!0),Ae),e.registerCommand(qA,()=>(I_(t,i),!1),Ae),e.registerCommand(ZA,()=>(I_(t,i),e.dispatchCommand(Qo,!1),e.dispatchCommand(es,!1),!0),Ae),e.registerUpdateListener(({editorState:c,prevEditorState:u,dirtyLeaves:d,dirtyElements:f,tags:h})=>{const g=t.current,p=t.redoStack,_=t.undoStack,y=g===null?null:g.editorState;if(g!==null&&c===y)return;const v=l(u,c,g,d,f,h);if(v===1){if(p.length!==0&&(t.redoStack=[],e.dispatchCommand(Qo,!1)),g!==null){_.push({...g});const x=typeof o=="number"||o===null?o:o.peek();x!==null&&_.length>x&&_.splice(0,_.length-x),e.dispatchCommand(es,!0)}}else if(v===2)return;t.current={editor:e,editorState:c},a()}))}s(gI,"O");function gm(){return{current:null,redoStack:[],undoStack:[]}}s(gm,"z");var ds=Fr({build:s((e,{delay:t,createInitialHistoryState:n,disabled:r,maxDepth:i,now:o},l)=>({...Na({delay:t,disabled:r,historyState:n(e),maxDepth:i,now:o}),...l.getInitResult()}),"build"),config:Ro({createInitialHistoryState:gm,delay:300,disabled:typeof window>"u",maxDepth:null,now:Date.now}),init:s(()=>({canRedo:ql(!1),canUndo:ql(!1)}),"init"),name:"@lexical/history/History",register:s((e,t,n)=>{const{canUndo:r,canRedo:i}=n.getInitResult(),o=n.getOutput(),l=s(a=>Bb(()=>{r.value=a!=null&&a.undoStack.length>0,i.value=a!=null&&a.redoStack.length>0}),"s");return Lo(()=>{if(!o.disabled.value)return gI(e,o.historyState.value,o.delay,()=>o.now.peek()(),l,o.maxDepth);l(null)})},"register")}),pI=Fr({build:s((e,{disabled:t,parentEditor:n})=>Na({disabled:t,parentEditor:n||e._parentEditor}),"build"),config:Ro({disabled:!1,parentEditor:null}),dependencies:[ts(ds,{disabled:!0})],name:"@lexical/history/SharedHistory",register:s((e,t,n)=>Lo(()=>{const{disabled:r,parentEditor:i}=n.getOutput();if(!r.value){const{output:o}=n.getDependency(ds),l=(function(c){return c?qi(c,ds.name):null})(i.value);if(!l)return;const a=l.output;Bb(()=>{o.delay.value=a.delay.value,o.historyState.value=a.historyState.value,o.now.value=a.now.value,o.disabled.value=a.disabled.value})}}),"register")});function Fs(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(Fs,"nt$3");var fs;function Xb(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}s(Xb,"rt$3");function Qb(e){return fs&&fs.editor===e?fs:void 0}s(Qb,"st$3");function mI(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;return[n,r(Xb(e,n))]}return t}s(mI,"ct$2");function _I(e,t){let n=t;for(const r of e){const[i,o]=mI(n,r),l=i.key;if(n===t&&Xb(n,i)===o)continue;const a=n===t||n===void 0?vI(t):n;a[l]=o,n=a}return n}s(_I,"lt$3");function vI(e){return Object.create(e||null)}s(vI,"ut$2");function eE(e,t){return[e,t]}s(eE,"ft$2");function yI(e,t,n,r=Wt()){const i=fs,o=Qb(r);try{return fs={...o,editor:r,[e]:t},n()}finally{fs=i}}s(yI,"dt$4");function tE(e,t=()=>{}){return(n,r=Wt())=>i=>{const o=Qb(r),l=o&&o[e],a=_I(n,l||t(r));return a&&a!==l?yI(e,a,i,r):i()}}s(tE,"pt$3");function nE(e,t,n,r){return Object.assign(Aa(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}s(nE,"ht$3");function xI(e){if(!Mb(e))return;const t=e;if(t.querySelector("style")===null)return;const n=new Map;function r(i){let o=n.get(i);if(o===void 0){o=new Set;for(let l=0;l<i.style.length;l++)o.add(i.style[l]);n.set(i,o)}return o}s(r,"s");try{for(const i of Array.from(t.styleSheets)){let o;try{o=i.cssRules}catch{continue}for(const l of Array.from(o)){if(!Zr(l,CSSStyleRule))continue;let a;try{a=t.querySelectorAll(l.selectorText)}catch{continue}for(const c of Array.from(a)){if(!Ke(c))continue;const u=r(c);for(let d=0;d<l.style.length;d++){const f=l.style[d];u.has(f)||c.style.setProperty(f,l.style.getPropertyValue(f),l.style.getPropertyPriority(f))}}}}}catch{}}s(xI,"mt$4");var rE="@lexical/html/DOM",iE=Symbol.for("@lexical/html/DOMExportContext"),CI="@lexical/html/DOMImport",oE=Symbol.for("@lexical/html/DOMImportContext");function bI(e,t,n){return nE(iE,e,t,n)}s(bI,"Ct$4");var EI=bI("isExport",Boolean);function SI(e){const t=qi(e,rE);return t?t.output.defaults:void 0}s(SI,"Dt$4");function TI(e){const t=qi(e,rE);return t?t.output.runtime:void 0}s(TI,"Ot$5");function wI(e=Wt()){const t=TI(e);return t?t.getSessionConfig():Y2(e)}s(wI,"Nt$5");var kI=tE(iE,SI),wd=Symbol.for("@lexical/html/SelectorImpl");function Zl(e,t){const n={kind:"element",predicate:(r=t,r.length===0?Ke:r.length===1?r[0]:(o,l)=>{for(const a of r)if(!a(o,l))return!1;return!0}),tags:e};var r;const i=s(o=>Zl(e,[...t,o]),"s");return{[wd]:n,attr:s((o,l,a)=>i(Fh(o,l,a)),"attr"),classAll:s((...o)=>i(lE(o)),"classAll"),classAny:s((...o)=>i((function(l){const a=sE(l);return a.length===0?()=>!1:c=>{if(!Ke(c))return!1;const u=c.classList;for(const d of a)if(u.contains(d))return!0;return!1}})(o)),"classAny"),styleAny:s((o,l,a)=>i((function(c,u,d){if(typeof u=="string")return f=>Ke(f)&&f.style.getPropertyValue(c)===u;if(u instanceof RegExp){const f=d&&d.capture,h=u;return(g,p)=>{if(!Ke(g))return!1;const _=g.style.getPropertyValue(c);if(!_)return!1;const y=_.match(h);return y!==null&&(f!==void 0&&(p[f]=y),!0)}}Fs(362,JSON.stringify(c))})(o,l,a)),"styleAny")}}s(Zl,"se$1");function sE(e){const t=[];for(const n of e)n&&t.push(n);return t}s(sE,"ie$1");function lE(e){const t=sE(e);return t.length===0?()=>!0:n=>{if(!Ke(n))return!1;const r=n.classList;for(const i of t)if(!r.contains(i))return!1;return!0}}s(lE,"ce");function Fh(e,t,n){if(t===!0)return r=>Ke(r)&&r.hasAttribute(e);if(typeof t=="string")return r=>Ke(r)&&r.getAttribute(e)===t;if(t instanceof RegExp){const r=n&&n.capture,i=t;return(o,l)=>{if(!Ke(o))return!1;const a=o.getAttribute(e);if(a==null)return!1;const c=a.match(i);return c!==null&&(r!==void 0&&(l[r]=c),!0)}}Fs(361,JSON.stringify(e))}s(Fh,"le$1");var MI={kind:"text",predicate:Cd,tags:new Set},AI={[wd]:MI},II={kind:"comment",predicate:s(e=>e.nodeType===8,"predicate"),tags:new Set},NI={[wd]:II},ns={any:s(()=>Zl(new Set,[]),"any"),comment:s(()=>NI,"comment"),tag(...e){e.length>0||Fs(363);const t=new Set;for(const n of e)t.add(n.toUpperCase());return Zl(t,[])},text:s(()=>AI,"text")};function aE(e,t){return Ke(e)&&e.nodeName===t.toUpperCase()}s(aE,"he$1");var cE=/[A-Za-z0-9_-]/,OI=class{static{s(this,"me$1")}constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||""}consume(){return this.source[this.pos++]||""}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){const e=this.pos;for(;!this.eof()&&cE.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){const e=this.consume();this.assert(e==='"'||e==="'","expected quote");const t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()==="\\"?this.pos+=2:this.pos++;this.assert(!this.eof(),"unterminated string");const n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,"$1")}assert(e,t){e||Fs(364,String(this.pos+1),t,this.source)}};function DI(e){const t=new Set,n=[],r=[];if(e.skipWhitespace(),e.peek()==="*")e.consume();else if(cE.test(e.peek())){const i=e.readIdent();i&&t.add(i.toUpperCase())}for(;!e.eof();){const i=e.peek();if(i==="."){e.consume();const o=e.readIdent();e.assert(o!=="",'expected class name after "."'),r.push(o)}else if(i==="#"){e.consume();const o=e.readIdent();e.assert(o!=="",'expected id after "#"'),n.push(Fh("id",o))}else{if(i!=="[")break;{e.consume(),e.skipWhitespace();const o=e.readIdent();e.assert(o!=="",'expected attribute name after "["'),e.skipWhitespace();let l=!0;if(e.peek()==="="){e.consume(),e.skipWhitespace();const a=e.peek();a==='"'||a==="'"?l=e.readQuoted():(l=e.readIdent(),e.assert(l!=="","expected attribute value")),e.skipWhitespace()}e.assert(e.peek()==="]",'expected "]"'),e.consume(),n.push(Fh(o,l))}}}return r.length>0&&n.push(lE(r)),{predicates:n,tags:t}}s(DI,"ye$1");function RI(e){const t=new OI(e,0),n=[];for(;;){const i=DI(t);if(n.push(i),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===",",'expected "," (selector lists are the only supported combinator)'),t.consume(),t.skipWhitespace()}if(n.length===1)return Zl(n[0].tags,n[0].predicates);const r=new Set;for(const i of n)for(const o of i.tags)r.add(o);return Zl(r,[(i,o)=>{for(const l of n){const a=i.nodeName;if(l.tags.size>0&&!l.tags.has(a))continue;let c=!0;for(const u of l.predicates)if(!u(i,o)){c=!1;break}if(c)return!0}return!1}])}s(RI,"xe$2");function pm(e,t,n){return nE(oE,e,t,n)}s(pm,"$e$1");var Vh=pm("textFormat",()=>0),LI=pm("textStyle",()=>({}));function $I(e){if(!Ke(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}s($I,"De$1");function PI(e){if(Cd(e))return!0;if(!Ke(e))return!1;const t=e.style.display;return t?t.startsWith("inline"):!hu(e)&&Dh(e)}s(PI,"we$1");var FI=pm("whitespaceConfig",()=>({isInline:PI,preservesWhitespace:$I}));function VI(e){const t=qi(e,CI);return t?t.output.defaults:void 0}s(VI,"Ne$1");var gz=tE(oE,VI);function mm(e){return ys(e)||Un(e)&&!e.isInline()}s(mm,"We$1");function uE(e,t){const n=[];let r=[];const i=s(()=>{r.length!==0&&(n.push(t().splice(0,0,r)),r=[])},"r");for(const o of e)if(mm(o)){if(i(),xe(o)){const l=uE(o.getChildren(),t);o.splice(0,o.getChildrenSize(),l)}n.push(o)}else r.push(o);return i(),n}s(uE,"Re");function dE(e,t){if(!Ke(t))return e;const n=t.style.textAlign;if(!_m(n))return e;for(const r of e)ys(r)&&r.getFormatType()===""&&r.setFormat(n);return e}s(dE,"Fe$1");function BI(e,t,n){e.length===1&&Dr(e[0])&&(e=[]);const r=Xe();if(Ke(n)){const i=n.style.textAlign;_m(i)&&r.setFormat(i)}return[r.splice(0,0,e)]}s(BI,"Te$1");var fE={$accepts:mm,$packageRun:BI,name:"BlockSchema"},$o=ns,HI=new Set(["center","end","justify","left","right","start"]);function _m(e){return HI.has(e)}s(_m,"Be$1");var KI={B:{fontWeight:"bold"},EM:{fontStyle:"italic"},I:{fontStyle:"italic"},S:{textDecoration:"line-through"},STRONG:{fontWeight:"bold"},SUB:{verticalAlign:"sub"},SUP:{verticalAlign:"super"},U:{textDecoration:"underline"}},UI={CODE:l7,MARK:c7},WI=new Set(["font-weight","font-style","text-decoration","vertical-align"]),zI={$import:s((e,t)=>{const n=e.get(Vh),r=KI[t.nodeName],i=(function(h){return{fontStyle:h.style.fontStyle,fontWeight:h.style.fontWeight,textDecoration:h.style.textDecoration,verticalAlign:h.style.verticalAlign}})(t),o=r?(l=r,{fontStyle:(a=i).fontStyle||l.fontStyle,fontWeight:a.fontWeight||l.fontWeight,textDecoration:a.textDecoration||l.textDecoration,verticalAlign:a.verticalAlign||l.verticalAlign}):i;var l,a;let c=(u=n,d=(function(h){let g=0,p=0;const{fontWeight:_,fontStyle:y,textDecoration:v,verticalAlign:x}=h;if(_==="700"||_==="bold"?g|=g_:_!=="normal"&&_!=="400"||(p|=g_),y==="italic"?g|=m_:y==="normal"&&(p|=m_),v){const C=v.split(" ");C.includes("underline")&&(g|=v_),C.includes("line-through")&&(g|=__),C.includes("none")&&(p|=v_|__)}return x==="sub"?(g|=df,p|=ff):x==="super"?(g|=ff,p|=df):x==="baseline"&&(p|=df|ff),{clear:p,set:g}})(o),u&~d.clear|d.set);var u,d;const f=UI[t.nodeName];return f&&(c|=f),c===n?e.$importChildren(t):e.$importChildren(t,{context:[eE(Vh,c)]})},"$import"),match:$o.tag("b","strong","em","i","code","mark","s","sub","sup","u","span"),name:"@lexical/html/inline-format"};function N_(e,t,n){let r=e;for(;;){let i=null;for(;(i=t?r.nextSibling:r.previousSibling)===null;){const l=r.parentNode;if(l===null)return null;r=l}if(r=i,!n.isInline(r))return null;let o=r;for(;(o=t?r.firstChild:r.lastChild)!==null;)r=o;if(Cd(r))return r;if(r.nodeName==="BR")return null}}s(N_,"Je$1");function O_(e,t){return t!==0&&Ie(e)?e.setFormat(t):e}s(O_,"Qe");function D_(e,t){if(Ie(e)){const n=(function(r){let i="";for(const o in r)WI.has(o)||(i+=`${o}: ${r[o]}; `);return i.trimEnd()})(t);n!==""&&e.setStyle(n)}return e}s(D_,"Ke$1");var jI={$import:s((e,t)=>{const n=e.get(Vh),r=e.get(LI),i=e.get(FI);if((function(a,c){let u=a.parentNode;for(;u!==null;){if(c.preservesWhitespace(u))return!0;u=u.parentNode}return!1})(t,i)){const a=Ah(t.textContent||"");for(const c of a)O_(c,n),D_(c,r);return a}const o=(function(a,c){let u=(a.textContent||"").replace(/\r/g,"").replace(/[ \t\n]+/g," ");if(u.length===0)return"";if(u[0]===" "){let d=a,f=!0;for(;d!==null&&(d=N_(d,!1,c))!==null;){const h=d.textContent||"";if(h.length>0){/[ \t\n]$/.test(h)&&(u=u.slice(1)),f=!1;break}}f&&(u=u.slice(1))}if(u.length>0&&u[u.length-1]===" "){let d=a,f=!0;for(;d!==null&&(d=N_(d,!0,c))!==null;)if((d.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(u=u.slice(0,-1))}return u})(t,i);if(o==="")return[];const l=pr(o);return O_(l,n),D_(l,r),[l]},"$import"),match:$o.text(),name:"@lexical/html/#text"},JI={$import:s(()=>[],"$import"),match:$o.tag("script","style"),name:"@lexical/html/script-style-ignore"},GI={$import:s((e,t)=>L7(t)||R7(t)?[]:[Or()],"$import"),match:$o.tag("br"),name:"@lexical/html/br"},qI={$import:s((e,t)=>{const n=Xe();if(ui(n,t),Ps(t,n),n.getFormatType()===""){const r=t.getAttribute("align");r&&_m(r)&&n.setFormat(r)}return Cr(n,t),[n.splice(0,0,e.$importChildren(t))]},"$import"),match:$o.tag("p"),name:"@lexical/html/p"},ZI={$import:s((e,t,n)=>Wt().hasNode(Da)?[Td()]:n(),"$import"),match:$o.tag("hr"),name:"@lexical/html/hr"},pz=[JI,qI,ZI,{$import:s((e,t,n)=>hu(t)?dE(e.$importChildren(t,{schema:fE}),t):n(),"$import"),match:$o.any(),name:"@lexical/html/transparent-block"},jI,GI,zI];function YI(e,t){const n=[];let r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}s(YI,"on");function XI(e){const t=[],n=new Map,r=[],i=[],o=[],l=new Set;e.forEach((c,u)=>{const d=(function(h){const g=h[wd];return g===void 0&&Fs(360),g})(c.match),f=c.name||(function(h,g){return h.kind==="text"?`#text@${g}`:h.kind==="comment"?`#comment@${g}`:h.tags.size===0?`*@${g}`:`${Array.from(h.tags).join(",").toLowerCase()}@${g}`})(d,u);if(c.name&&l.add(c.name),t.push({$import:c.$import,name:f,predicate:d.predicate}),d.kind==="text")i.push(u);else if(d.kind==="comment")o.push(u);else if(d.tags.size===0)r.push(u);else for(const h of d.tags){let g=n.get(h);g||(g=[],n.set(h,g)),g.push(u)}});const a=new Map;if(r.length===0)for(const[c,u]of n)a.set(c,u);else for(const[c,u]of n)a.set(c,YI(u,r));return{byTag:a,commentIndices:o,rules:t,textIndices:i,wildcardIndices:r}}s(XI,"rn");var mz=Object.freeze([]);function QI(e){const t=[];for(const n of e)if(e6(n))for(const r of n.rules)t.push(r);else t.push(n);return t}s(QI,"ln");function e6(e){return typeof e=="object"&&e!==null&&"__type"in e&&e.__type==="CompiledOverlayRules"}s(e6,"un");function hE(e){const t=QI(e);return{__type:"CompiledOverlayRules",dispatch:XI(t),rules:t}}s(hE,"fn");var _z=Object.freeze({}),vz={$import:s((e,t)=>e.$importChildren(t),"$import"),match:ns.any(),name:"@lexical/html/default-hoist"},zt={any:ns.any,comment:ns.comment,css:RI,tag:ns.tag,text:ns.text},gE=new Set(["STYLE","SCRIPT"]);function t6(e,t){xI(t);const n=Mb(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const o of n)if(!gE.has(o.nodeName)){const l=mE(o,e,i,!1);if(l!==null)for(const a of l)r.push(a)}return(function(o){for(const l of o)l.getParent()&&l.getNextSibling()instanceof nb&&l.insertAfter(Or());for(const l of o){const a=l.getParent();a&&a.splice(l.getIndexWithinParent(),1,l.getChildren())}})(i),r}s(t6,"kn");function n6(e,t=null,n=Wt()){return kI([eE(EI,!0)],n)(()=>{const r=Lt(),i=wI(n),o=ie(t)?Qp(t.anchor.getNode()):null,l=e.append.bind(e);for(const a of(xe(o)?o:r).getChildren())pE(n,a,l,t,i);return e})}s(n6,"Dn");function r6(e,t=null){return(typeof document>"u"||typeof window>"u"&&global.window===void 0)&&Fs(338),OA(e),n6(bn().createElement("div"),t,e).innerHTML}s(r6,"On");function pE(e,t,n,r=null,i=Y2(e)){let o=i.$shouldInclude(t,r,e);const l=i.$shouldExclude(t,r,e);let a=t;r!==null&&Ie(t)&&(a=Db(r,t,"clone"));const{element:c,after:u,append:d,$getChildNodes:f}=i.$exportDOM(a,e);if(!c)return!1;const h=bn().createDocumentFragment(),g=f?f():xe(a)?a.getChildren():[],p=o&&He(r)&&xe(t)?null:r,_=h.append.bind(h);for(const y of g){const v=pE(e,y,_,p,i);!o&&v&&i.$extractWithChild(t,y,r,"html",e)&&(o=!0)}if(o&&!l){if((Ke(c)||x_(c))&&(d?d(h):c.append(h)),n(c),u){const y=u.call(a,c);y&&(x_(c)?c.replaceChildren(y):c.replaceWith(y))}}else n(h);return o}s(pE,"Mn");function mE(e,t,n,r,i=new Map,o){const l=[];if(gE.has(e.nodeName))return l;let a=null;const c=(function(p,_){const{nodeName:y}=p,v=_._htmlConversions.get(y.toLowerCase());let x=null;if(v!==void 0)for(const C of v){const b=C(p);b!==null&&(x===null||(x.priority||0)<=(b.priority||0))&&(x=b)}return x!==null?x.conversion:null})(e,t),u=c?c(e):null;let d=null;if(u!==null){d=u.after;const p=u.node;if(a=Array.isArray(p)?p[p.length-1]:p,a!==null){for(const[,_]of i)if(a=_(a,o),!a)break;a&&l.push(...Array.isArray(p)?p:[a])}u.forChild!=null&&i.set(e.nodeName,u.forChild)}const f=e.childNodes;let h=[];const g=(a==null||!xn(a))&&(a!=null&&ys(a)||r);for(let p=0;p<f.length;p++)h.push(...mE(f[p],t,n,g,new Map(i),a));if(d!=null&&(h=d(h)),hu(e)&&(h=i6(e,h,g?()=>{const p=new nb;return n.push(p),p}:Xe)),a==null)if(h.length>0)for(const p of h)l.push(p);else hu(e)&&(function(p){return p.nextSibling==null||p.previousSibling==null?!1:Dh(p.nextSibling)&&Dh(p.previousSibling)})(e)&&l.push(Or());else xe(a)&&a.append(...h);return l}s(mE,"Nn");function i6(e,t,n){const r=e.style.textAlign,i=[];let o=[];for(let l=0;l<t.length;l++){const a=t[l];if(ys(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(o.push(a),l===t.length-1||l<t.length-1&&ys(t[l+1])){const c=n();c.setFormat(r),c.append(...o),i.push(c),o=[]}}return i}s(i6,"En");function mu(e,t,n=null){const r=N7(n),i=n?A7(n):[],o=n!==null&&i.length>0;if(o&&typeof r.caretPositionFromPoint=="function"){const l=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(l!==null&&(function(a,c){for(let u=a;u!==null;){if(u===c)return!0;u=kb(u)}return!1})(l.offsetNode,n))return{node:l.offsetNode,offset:l.offset}}if(o){const l=n.getRootNode();if(D7(l)){const a=l.elementFromPoint(e,t);if(a!==null&&n.contains(a)){const c=(function(u,d,f,h){const g=h.createRange(),p=s(T=>d<T.top?T.top-d:d>T.bottom?d-T.bottom:0,"i"),_=s(T=>u<T.left?T.left-u:u>T.right?u-T.right:0,"l"),y=h.createTreeWalker(f,NodeFilter.SHOW_TEXT);let v=null,x=1/0,C=1/0;for(let T=y.nextNode();T;T=y.nextNode()){g.selectNodeContents(T);for(const E of g.getClientRects()){const A=p(E),D=_(E);(A<x||A===x&&D<C)&&(x=A,C=D,v=T)}}if(v===null)return null;let b=0,S=1/0,M=1/0;for(let T=0;T<=v.length;T++){g.setStart(v,T),g.collapse(!0);const E=g.getBoundingClientRect(),A=p(E),D=Math.abs(u-E.left);(A<S||A===S&&D<M)&&(S=A,M=D,b=T)}return{node:v,offset:b}})(e,t,a,r);if(c!==null)return c}}}if(typeof r.caretRangeFromPoint=="function"){const l=r.caretRangeFromPoint(e,t);return l===null?null:{node:l.startContainer,offset:l.startOffset}}if(typeof r.caretPositionFromPoint=="function"){const l=r.caretPositionFromPoint(e,t);return l===null?null:{node:l.offsetNode,offset:l.offset}}return null}s(mu,"et$1");function rs(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(rs,"nt$2");var Bh={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function o6(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:s(t=>t,"createHTML")}).createHTML(e):e}s(o6,"rt$2");var R_=s((e,t)=>{if(!ie(t))return t.insertRawText(e),!0;const n=s(r=>{const i=re();ie(i)&&r(i)},"n");return F7(e,{linebreak:s(()=>n(r=>r.insertParagraph()),"linebreak"),tab:s(()=>n(r=>r.insertNodes([Xp()])),"tab"),text:s(r=>n(i=>i.insertText(r)),"text")}),!0},"it$2"),Hh={"application/x-lexical-editor":[(e,t,n)=>{try{const r=Wt(),i=JSON.parse(e);if(i&&i.namespace===r._config.namespace&&Array.isArray(i.nodes))return L_(r,bE(i.nodes),t),!0}catch{}return n()}],"text/html":[(e,t,n)=>{try{const r=Wt(),i=new DOMParser().parseFromString(o6(e),"text/html");return L_(r,t6(r,i),t),!0}catch{return n()}}],"text/plain":[R_],"text/uri-list":[R_]};function s6(e,t,n,r){if(!e)return!1;const i=s(o=>!!e[o]&&e[o](t,n,i.bind(null,o-1),r),"r");return i(e.length-1)}s(s6,"ct$1");function _E(e,t,n){const r=t.getData("text/plain");for(const i of(function(o){return Object.keys(o.$importMimeType).filter(l=>o.$importMimeType[l]!==void 0).sort((l,a)=>{const c=o.priority[l],u=o.priority[a];return c===void 0&&u===void 0?l<a?-1:l>a?1:0:c===void 0?1:u===void 0?-1:c-u})})(e)){const o=t.getData(i);if(o&&(i!=="text/html"||o!==r)&&s6(e.$importMimeType[i],o,n,t))return!0}return!1}s(_E,"st$2");var l6={$importMimeType:Hh,$insertDataTransfer:s((e,t)=>_E({$importMimeType:Hh,priority:Bh},e,t),"$insertDataTransfer"),priority:Bh},a6=Fr({build:s((e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:s((n,r)=>_E(t,n,r),"$insertDataTransfer"),priority:t.priority}),"build"),config:Ro({$importMimeType:Hh,priority:Bh}),mergeConfig(e,t){const n=Ed(e,t);if(t.$importMimeType){const r={...e.$importMimeType};for(const[i,o]of Object.entries(t.$importMimeType))if(o){const l=r[i];r[i]=l?[...l,...o]:o}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:"@lexical/clipboard/Import"});function vE(e,t=re()){return t??rs(166),ie(t)&&t.isCollapsed()||t.getNodes().length===0?"":r6(e,t)}s(vE,"pt$2");function yE(e,t=re()){return t??rs(166),ie(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(CE(e,t))}s(yE,"dt$3");function Kh(e,t,n){(function(){const r=sI(a6.name);return r?r.output:l6})().$insertDataTransfer(e,t)}s(Kh,"gt");var xE="application/x-lexical-drag";function c6(e,t){const n={editorKey:t.getKey()};e.setData(xE,JSON.stringify(n))}s(c6,"xt$3");function u6(e,t,n){const r=e.dataTransfer;if(r===null)return!1;const i=(function(u){const d=u.getData(xE);if(!d)return null;let f;try{f=JSON.parse(d)}catch{return null}return(h=f)!==null&&typeof h=="object"&&"editorKey"in h&&typeof h.editorKey=="string"?f:null;var h})(r);if(i===null)return!1;const o=(function(u,d){const f=mu(u.clientX,u.clientY,d.getRootElement());if(f===null)return null;const h=si(f.node);if(h===null)return null;if(Ie(h))return VA(h,"next",f.offset);if(xe(h))return d_(h,f.offset,"next");const g=h.getParent();return g===null?null:d_(g,h.getIndexWithinParent()+1,"next")})(e,t);if(o===null)return!1;const l=JA(o);if(l===null)return!1;const a=i.editorKey===t.getKey(),c=re();if(a){if(!ie(c)||c.isCollapsed())return!1;if((function(u,d){const{anchor:f,focus:h}=Z2(J2(d),"next");return Mh(f,u)<0&&Mh(u,h)<0})(o,c))return e.preventDefault(),!0;c.removeText()}if(!l.origin.isAttached())return e.preventDefault(),!0;if(n(r,xs(md(l)),t),!a){const u=t.getRootElement(),d=u?u.ownerDocument:null,f=d?(function(h,g){for(const p of S7(g)){const _=wb(p);if(Ib(_)&&_.getKey()===h&&Ke(p))return p}return null})(i.editorKey,d):null;f!==null&&f.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}s(u6,"ht$2");function d6(e,t){return u6(e,t,Kh)}s(d6,"Tt$4");function L_(e,t,n){e.dispatchCommand(m7,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(ie(r)&&r.isCollapsed()){const i=r.anchor;let o=null;const l=Ui(i,"previous");if(l)if(rm(l))o=l.origin;else{const a=xl(l,Wi(Lt(),"next").getFlipped());for(const c of a){if(Ie(c.origin)){o=c.origin;break}if(xe(c.origin)&&!c.origin.isInline())break}}if(o&&Ie(o)){const a=o.getFormat(),c=o.getStyle();r.format===a&&r.style===c||(r.format=a,r.style=c,r.dirty=!0)}}})(n))}s(L_,"Mt$3");function Uh(e,t,n,r=[]){let i=t===null||n.isSelected(t);const o=xe(n)&&n.excludeFromCopy("html");let l=n;t!==null&&Ie(l)&&(l=Db(t,l,"clone"));const a=xe(l)?l.getChildren():[],c=(function(d){const f=d.exportJSON(),h=d.constructor;if(f.type!==h.getType()&&rs(58,h.name),xe(d)){const g=f.children;Array.isArray(g)||rs(59,h.name)}return f})(l);Ie(l)&&l.getTextContentSize()===0&&(i=!1);const u=i&&He(t)&&xe(n)?null:t;for(let d=0;d<a.length;d++){const f=a[d],h=Uh(e,u,f,c.children);!i&&xe(n)&&h&&n.extractWithChild(f,t,"clone")&&(i=!0)}if(i&&!o){const d=FA(l);if(d.length>0){const f={};for(const h of d){const g=PA(l,h);g===null&&rs(366,l.constructor.name,h);const p=[];Uh(e,null,g,p),p.length===1&&p[0].type===g.getType()||rs(385,h,l.constructor.name,String(p.length),String(p.length>0?p[0].type:"none")),f[h]=p[0]}c.$slots=f}}if(i&&!o)r.push(c);else if(Array.isArray(c.children))for(let d=0;d<c.children.length;d++){const f=c.children[d];r.push(f)}return i}s(Uh,"vt$4");function CE(e,t){const n=[],r=Lt(),i=ie(t)?t.anchor.getNode():He(t)?t.getNodes()[0]??null:null,o=i!==null?Qp(i):null,l=(xe(o)?o:r).getChildren();for(let a=0;a<l.length;a++)Uh(e,t,l[a],n);return{namespace:e._config.namespace,nodes:n}}s(CE,"wt$3");function bE(e){const t=[];for(const n of e)t.push(WA(n));return t}s(bE,"$t$3");var Ho=null;async function $_(e,t,n){if(Ho!==null)return!1;if(t!==null)return new Promise((u,d)=>{e.update(()=>{u(P_(e,t,n))})});const r=e.getRootElement(),i=e._window||window,o=i.document,l=Ia(i);if(r===null||l===null)return!1;const a=o.createElement("span");a.style.position="fixed",a.style.top="-1000px",a.append(o.createTextNode("#")),r.append(a);const c=o.createRange();return c.setStart(a,0),c.setEnd(a,1),l.removeAllRanges(),l.addRange(c),new Promise((u,d)=>{const f=e.registerCommand(ob,h=>(Zr(h,ClipboardEvent)&&(f(),Ho!==null&&(i.clearTimeout(Ho),Ho=null),u(P_(e,h,n))),!0),Rr);Ho=i.setTimeout(()=>{f(),Ho=null,u(!1)},50),o.execCommand("copy"),a.remove()})}s($_,"Dt$3");function P_(e,t,n){if(n===void 0){const i=Ia(e._window),o=re();if(!o||o.isCollapsed()||!i)return!1;const l=M7(i,e.getRootElement()),a=l.anchorNode,c=l.focusNode;if(a!==null&&c!==null&&!$7(e,a,c))return!1;n=EE(o)}t.preventDefault();const r=t.clipboardData;return r!==null&&(SE(r,n),!0)}s(P_,"Nt$4");var f6=[["text/html",vE],["application/x-lexical-editor",yE]];function EE(e=re()){return(function(t,n){const r={"text/plain":""};for(const[i,o]of Object.entries(t))if(o){const l=g6(o,n);l!==null&&(r[i]=l)}return r})(h6(),e)}s(EE,"Rt$3");function SE(e,t){for(const[n]of f6)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}s(SE,"St$4");function h6(e=Wt()){const t=qi(e,p6.name);return t?t.output:TE}s(h6,"Ot$4");var TE={"application/x-lexical-editor":[(e,t)=>e?yE(Wt(),e):t()],"text/html":[(e,t)=>e?vE(Wt(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function g6(e,t){const n=s(r=>e[r]?e[r](t,n.bind(null,r-1)):null,"n");return n(e.length-1)}s(g6,"Et$3");var p6=Fr({build:s((e,t,n)=>t.$exportMimeType,"build"),config:Ro({$exportMimeType:TE}),mergeConfig(e,t){const n=Ed(e,t);if(t.$exportMimeType){const r={...e.$exportMimeType};for(const[i,o]of Object.entries(t.$exportMimeType))if(o){const l=r[i];r[i]=l?[...l,...o]:o}n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"}),m6={bold:"bold",italic:"italic",strikeThrough:"strikethrough",subscript:"subscript",superscript:"superscript",underline:"underline"},_u=Symbol.for("@lexical/dragon/WindowState");function _6(e,t,n){const r=(function(i){let o=i[_u];return o===void 0&&(o={dispose:s(()=>{},"dispose"),editors:new Map,installs:new Set},i[_u]=o),o})(e);if(r.installs.size===0){const i=x6.bind(e);e.addEventListener("message",i,!0),r.dispose=()=>{e.removeEventListener("message",i,!0)}}if(r.installs.add(t),n){const i=r.editors.get(n)||new Set;i.add(t),r.editors.set(n,i)}return v6.bind(null,e,r,t,n)}s(_6,"p$4");function v6(e,t,n,r){if(r){const i=t.editors.get(r);i&&i.delete(n)&&i.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[_u])}s(v6,"m$3");function F_(e){return e&&e.ownerDocument.defaultView}s(F_,"y$2");function y6(e){const t=Z7(()=>F_(e.getRootElement()),n=>e.registerRootListener(r=>{n.value=F_(r)}));return Lo(()=>{const n=t.value;if(n)return _6(n,Symbol("@lexical/dragon/editorInstall"),e)})}s(y6,"b$2");function x6(e){if(e.origin!==this.location.origin)return;const t=(function(r){const i=r[_u];if(i===void 0)return null;const o=wb(w7(r.document));return Ib(o)&&i.editors.has(o)?o:null})(this);if(t===null)return;const n=e.data;if(typeof n=="string"){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol==="nuanria_messaging"&&r.type==="request"){const i=r.payload;if(i&&i.functionId==="makeChanges"){const o=i.args;if(Array.isArray(o)){const[l,a,c,u,d,f]=o;if(![l,a,u,d].every(Number.isFinite)||typeof c!="string"&&c!==-1)return;t.update(()=>{const h=re();if(ie(h)){const g=h.anchor;let p=g.getNode(),_=0,y=0;if(Ie(p)&&l>=0&&a>=0&&(_=l,y=l+a,h.setTextNodeRange(p,_,p,y)),typeof c!="string"||_===y&&c===""||(h.insertRawText(c),p=g.getNode()),Ie(p)){const v=p.getTextContentSize();_=Math.min(Math.max(u,0),v),y=u<0||d<0?_:Math.min(u+d,v),h.setTextNodeRange(p,_,p,y)}if(typeof f=="string"&&d>0&&!h.isCollapsed()){const v=m6[f];v!==void 0&&h.formatText(v)}e.stopImmediatePropagation()}})}}}}}s(x6,"x$4");var C6={$import:s((e,t)=>{const n=Ar(t.nodeName.toLowerCase());return Ps(t,n),ui(n,t),Cr(n,t),[n.splice(0,0,e.$importChildren(t))]},"$import"),match:zt.tag("h1","h2","h3","h4","h5","h6"),name:"@lexical/rich-text/heading"},b6={$import:s((e,t)=>{const n=Vs();return ui(n,t),Ps(t,n),Cr(n,t),[n.splice(0,0,e.$importChildren(t))]},"$import"),match:zt.tag("blockquote"),name:"@lexical/rich-text/blockquote"},yz={$import:s((e,t)=>{const n=Vs({shadowRoot:!0});return ui(n,t),Ps(t,n),Cr(n,t),[n.splice(0,0,e.$importChildren(t,{schema:fE}))]},"$import"),match:zt.tag("blockquote"),name:"@lexical/rich-text/blockquote-shadow-root"},xz=[C6,b6,{$import:s((e,t,n)=>{const r=t.firstChild;return r&&Ke(i=r)&&i.nodeName==="SPAN"&&i.style.fontSize==="26pt"?e.$importChildren(t):n();var i},"$import"),match:zt.tag("p"),name:"@lexical/rich-text/google-docs-title-p"},{$import:s((e,t,n)=>t.style.fontSize!=="26pt"?n():[Ar("h1").splice(0,0,e.$importChildren(t))],"$import"),match:zt.tag("span"),name:"@lexical/rich-text/google-docs-title-span"}],V_=br("DRAG_DROP_PASTE_FILE"),vf=Aa("shadowRoot",{parse:Boolean}),kd=class wE extends Lr{static{s(this,"Nt$3")}static getType(){return"quote"}static clone(t){return new wE(t.__key)}$config(){return this.config("quote",{extends:Lr,stateConfigs:[{flat:!0,stateConfig:vf}]})}isShadowRoot(){return em(this,vf)}setIsShadowRoot(t){return us(this,vf,t)}createDOM(t){const n=bn().createElement("blockquote");return mr(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:s(t=>({conversion:E6,priority:0}),"blockquote")}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Ke(n)){this.isEmpty()&&n.append(bn().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const i=this.getDirection();i&&(n.dir=i)}return{element:n}}static importJSON(t){return Vs().updateFromJSON(t)}exportJSON(){return super.exportJSON()}insertNewAfter(t,n){const r=Xe(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,n),r}collapseAtStart(){if(this.isShadowRoot()){for(const n of this.getChildren())this.insertBefore(n);return this.remove(),!0}const t=Xe();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Vs(e){const t=ci(new kd);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}s(Vs,"St$3");function Wh(e){return e instanceof kd}s(Wh,"bt$3");var Ra=class kE extends Lr{static{s(this,"_t$3")}__tag;static getType(){return"heading"}static clone(t){return new kE(t.__tag,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__tag=t.__tag}constructor(t="h1",n){super(n),this.__tag=t}getTag(){return this.getLatest().__tag}setTag(t){const n=this.getWritable();return n.__tag=t,n}createDOM(t){const n=this.__tag,r=bn().createElement(n),i=t.theme.heading;if(i!==void 0){const o=i[n];mr(r,o)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:s(t=>({conversion:Ko,priority:0}),"h1"),h2:s(t=>({conversion:Ko,priority:0}),"h2"),h3:s(t=>({conversion:Ko,priority:0}),"h3"),h4:s(t=>({conversion:Ko,priority:0}),"h4"),h5:s(t=>({conversion:Ko,priority:0}),"h5"),h6:s(t=>({conversion:Ko,priority:0}),"h6"),p:s(t=>{const n=t.firstChild;return n!==null&&B_(n)?{conversion:s(()=>({node:null}),"conversion"),priority:3}:null},"p"),span:s(t=>B_(t)?{conversion:s(n=>({node:Ar("h1")}),"conversion"),priority:3}:null,"span")}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Ke(n)){this.isEmpty()&&n.append(bn().createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const i=this.getDirection();i&&(n.dir=i)}return{element:n}}static importJSON(t){return Ar(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,i=this.getLastDescendant(),o=!i||t&&t.anchor.key===i.getKey()&&r===i.getTextContentSize()||!t?Xe():Ar(this.getTag()),l=this.getDirection();if(o.setDirection(l),this.insertAfter(o,n),r===0&&!this.isEmpty()&&t){const a=Xe();a.select(),this.replace(a,!0)}return o}collapseAtStart(){if(this.isEmpty()){const t=Xe();this.getChildren().forEach(n=>t.append(n)),this.replace(t)}return!0}extractWithChild(){return!0}};function B_(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}s(B_,"Tt$3");function Ko(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Ar(t),Ps(e,n),ui(n,e),Cr(n,e)),{node:n}}s(Ko,"wt$2");function E6(e){const t=Vs();return ui(t,e),Ps(e,t),Cr(t,e),{node:t}}s(E6,"Ot$3");function Ar(e="h1"){return ci(new Ra(e))}s(Ar,"kt$3");function Md(e){return e instanceof Ra}s(Md,"Kt$2");function H_(e){const t=si(e);return Un(t)}s(H_,"Et$2");function Uo(e,t,n,r){let i=!1,o=null;if(e.isCollapsed()&&e.anchor.type==="text"){const a=e.anchor.getNode();if(Ie(a)){o=a;const c=e.anchor.offset,u=c===a.getTextContentSize()&&a.getNextSibling()===null,d=c===0&&a.getPreviousSibling()===null;i=n==="end"&&u||n==="start"&&d||n==="both"&&(u||d)}}let l=!1;for(const[a,c]of Object.entries(r)){if(c==null||!c[t])continue;const u=a;if(c.onlyAtBoundary){if(!(i&&o&&Ie(o)&&o.hasFormat(u)))continue;l=!0}e.hasFormat(u)&&e.toggleFormat(u)}l&&e.setStyle("")}s(Uo,"Ft$2");var S6={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function Qa(e,t){return(function(n,r){if(!n.isCollapsed())return!1;const i=Ui(n.focus,r),o=dt(i.origin,Sc);if(!o)return!1;const l=n.focus.getNode();if(!o.is(l)&&!Q2(l,o))return!1;const a=xl(i,qn(o,r));if(a.getTextSlices().some(f=>f&&f.getTextContentSize()>0))return!1;const c=xl(a.anchor.getSiblingCaret(),a.focus);let u=c.anchor.origin;for(const f of c){if(!uu(f)||!f.origin.is(u.getParent()))return!1;u=f.origin}let d=o;for(const f of q2(qn(o,r))){if(!f.origin.is(d.getParent())){if(UA(f.origin)){const h=qn(d,r);return xs(xl(h,h)),!0}break}if(!Sc(f.origin))break;d=f.origin}return!1})(e,t)||(function(n,r){if(!n.isCollapsed()||n.anchor.type!=="element")return!1;const i=Ui(n.anchor,r).getNodeAtCaret();return!(!Sc(i)||i.isInline()||(xs(md(zi(Wi(i,r)))),0))})(e,t)}s(Qa,"Rt$2");function K_(e){return Un(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}s(K_,"At$3");function ec(e){const t=cu();t.add(e),Xn(t)}s(ec,"Pt$3");function U_(e,t){if(!e.isCollapsed())return!1;const n=e.focus,r=n.getNode(),i=t?"previous":"next",o=Ui(n,i);if(n.type==="element"&&xe(r)&&(ka(r)||Sc(r))){const v=o.getNodeAtCaret();return!(v===null||!K_(v))&&(ec(v.__key),!0)}const l=dt(xe(r)?r:r.getParentOrThrow(),v=>xe(v)&&!v.isInline()&&xn(v.getParent()));if(l===null)return!1;const a=qn(l,i).getNodeAtCaret();if(a===null||!K_(a))return!1;if(l.getTextContentSize()===0)return ec(a.__key),!0;const c=Wt().getRootElement();if(c===null)return!1;const u=Ia(c.ownerDocument.defaultView);if(u===null||u.rangeCount===0)return!1;const d=u.anchorNode,f=u.anchorOffset,h=u.focusNode,g=u.focusOffset;u.modify("move",t?"backward":"forward","line");const p=u.anchorNode,_=u.anchorOffset;if(p===null)return W_(u,d,f,h,g),!1;const y=si(p);return W_(u,d,f,h,g),y===null?!1:(p===d&&_===f||!y.is(l)&&!Q2(y,l))&&(ec(a.__key),!0)}s(U_,"zt$2");function W_(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}s(W_,"Mt$2");function z_(e,t){if(!e.isCollapsed())return!1;const n=e.focus.getNode(),r=dt(xe(n)?n:n.getParentOrThrow(),y=>xe(y)&&!y.isInline());if(r===null)return!1;const i=Wt(),o=i.getRootElement();if(o===null)return!1;const l=o.ownerDocument.defaultView;if(l===null)return!1;let a=!1;for(const y of r.getChildren())if(xe(y)&&y.isInline()){const v=i.getElementByKey(y.getKey());if(v!==null){const x=l.getComputedStyle(v).display;if(x==="inline-grid"||x==="inline-flex"){a=!0;break}}}if(!a)return!1;const c=qn(r,t?"previous":"next").getNodeAtCaret();if(c===null||!xe(c)){if(t){const y=r.getFirstDescendant();Ie(y)?y.select(0,0):r.select(0,0)}else{const y=r.getLastDescendant();if(Ie(y)){const v=y.getTextContentSize();y.select(v,v)}else{const v=r.getChildrenSize();r.select(v,v)}}return!0}const u=i.getElementByKey(c.getKey());if(u===null)return!1;const d=Ia(l);if(d===null||d.rangeCount===0)return!1;const f=d.getRangeAt(0).cloneRange();f.collapse(!0);const h=f.getBoundingClientRect(),g=u.getBoundingClientRect(),p=g.top+g.height/2;if(h.height>0){const y=mu(h.left,p,o);if(y!==null&&u.contains(y.node)){const v=o.ownerDocument.createRange();return v.setStart(y.node,y.offset),v.collapse(!0),e.applyDOMRange(v),e.dirty=!0,!0}}const _=t?c.getLastDescendant():c.getFirstDescendant();if(Ie(_)){const y=t?_.getTextContentSize():0;_.select(y,y)}else{const y=c.getChildrenSize();c.select(t?y:0,t?y:0)}return!0}s(z_,"$t$2");function tc(e,t){const n=qn(e,t),r=n.getAdjacentCaret();r!==null&&xe(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?xs(md(n)):t==="next"?e.selectNext(0,0):e.selectPrevious()}s(tc,"Jt$1");function j_(e,t,n){n.preventDefault(),n.stopPropagation();const r=e.getNodes();if(r.length===0)return!0;const i=r.map(c=>qn(c,"next")).sort(Mh),o=(t?i[0]:i[i.length-1]).origin,l=dt(o,c=>c!==o&&xe(c)&&!c.isInline())??Lt(),a=t?0:l.getChildrenSize();return l.select(a,a),!0}s(j_,"Lt$3");function T6(e,t=ql(S6)){return At(e.registerCommand(im,()=>{const n=re();return He(n)?(n.clear(),!0):(ie(n)&&Uo(n,"click","both",t.peek()),!1)},Ae),e.registerCommand(uf,n=>{const r=re();return ie(r)?(r.deleteCharacter(n),!0):!!He(r)&&(r.deleteNodes(),!0)},Ae),e.registerCommand(i7,n=>{const r=re();return!!ie(r)&&(r.deleteWord(n),!0)},Ae),e.registerCommand(r7,n=>{const r=re();return!!ie(r)&&(r.deleteLine(n),!0)},Ae),e.registerCommand(t7,n=>{const r=re();if(typeof n=="string")r!==null&&r.insertText(n);else{if(r===null)return!1;const i=n.dataTransfer;if(i!=null)Kh(i,r,e);else if(ie(r)){const o=n.data;return o&&r.insertText(o),!0}}return!0},Ae),e.registerCommand(p7,()=>{const n=re();return!!ie(n)&&(n.removeText(),!0)},Ae),e.registerCommand(cb,n=>{const r=re();return!(!ie(r)&&!He(r))&&(RA(r,n),!0)},Ae),e.registerCommand(v7,n=>{const r=re();return!(!ie(r)&&!He(r))&&(jA(r,n),!0)},Ae),e.registerCommand(o7,n=>{const r=re();if(!ie(r)&&!He(r))return!1;const i=r.getNodes();for(const o of i){const l=dt(o,a=>xe(a)&&!a.isInline());l!==null&&l.setFormat(n)}return!0},Ae),e.registerCommand(h_,n=>{const r=re();return!!ie(r)&&(r.insertLineBreak(n),!0)},Ae),e.registerCommand(Nh,()=>{const n=re();return!!ie(n)&&(n.insertParagraph(),!0)},Ae),e.registerCommand(fb,()=>{const n=Xp(),r=re();return ie(r)&&(n.setFormat(r.format),n.setStyle(r.style)),Ls([n]),!0},Ae),e.registerCommand(fu,()=>Lh(n=>{const r=n.getIndent();n.setIndent(r+1)}),Ae),e.registerCommand(Oh,()=>Lh(n=>{const r=n.getIndent();r>0&&n.setIndent(Math.max(0,r-1))}),Ae),e.registerCommand(pb,n=>{const r=re();if(He(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),tc(i[0],"previous"),!0}else if(ie(r)&&(!n.shiftKey&&Qa(r,"previous")||!n.shiftKey&&U_(r,!0)||!n.shiftKey&&z_(r,!0)))return n.preventDefault(),!0;return!1},Ae),e.registerCommand(hb,n=>{const r=re();if(He(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),tc(i[0],"next"),!0}else if(ie(r)&&((function(i){const o=i.focus;return o.key==="root"&&o.offset===Lt().getChildrenSize()})(r)||!n.shiftKey&&Qa(r,"next")||!n.shiftKey&&U_(r,!1)||!n.shiftKey&&z_(r,!1)))return n.preventDefault(),!0;return!1},Ae),e.registerCommand(gb,n=>{const r=re();if(He(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),tc(i[0],qa(i[0])?"next":"previous"),!0}if(!ie(r))return!1;if(!n.shiftKey&&Qa(r,qa(r.anchor.getNode())?"next":"previous"))return n.preventDefault(),!0;if(n.shiftKey||Uo(r,"arrow","start",t.peek()),b_(r,!0)){const i=n.shiftKey;return n.preventDefault(),E_(r,i,!0),!0}return!1},Ae),e.registerCommand(d7,n=>{const r=re();if(He(r)){const i=r.getNodes();if(i.length>0)return n.preventDefault(),tc(i[0],qa(i[0])?"previous":"next"),!0}if(!ie(r))return!1;if(!n.shiftKey&&Qa(r,qa(r.anchor.getNode())?"previous":"next"))return n.preventDefault(),!0;if(n.shiftKey||Uo(r,"arrow","end",t.peek()),b_(r,!1)){const i=n.shiftKey;return n.preventDefault(),E_(r,i,!1),!0}return!1},Ae),e.registerCommand(vd,n=>{const r=re();if(!He(r)&&H_(n.target))return!1;if(ie(r)){if((function(i){if(!i.isCollapsed())return!1;const{anchor:o}=i;if(o.offset!==0)return!1;const l=o.getNode();if(ka(l))return!1;const a=Fb(l);return a.getIndent()>0&&(a.is(l)||l.is(a.getFirstDescendant()))})(r))return n.preventDefault(),e.dispatchCommand(Oh,void 0);if(p_&&f_)return!1}else if(!He(r))return!1;return n.preventDefault(),e.dispatchCommand(uf,!0)},Ae),e.registerCommand(lm,n=>{const r=re();return!(!He(r)&&H_(n.target))&&!(!ie(r)&&!He(r))&&(n.preventDefault(),e.dispatchCommand(uf,!1))},Ae),e.registerCommand(yd,n=>{let r=re();if(He(r)){const i=r.getNodes();i.length===1&&Un(i[0])&&!i[0].isInline()&&(r=i[0].selectNext())}if(!ie(r))return!1;if(Uo(r,"enter","both",t.peek()),n!==null){if((p_||u7||s7)&&f_)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(h_,!1)}return e.dispatchCommand(Nh,void 0)},Ae),e.registerCommand(xd,()=>{const n=re();return!!ie(n)&&(e.blur(),!0)},Ae),e.registerCommand(ab,n=>{const[,r]=Za(n);if(r.length>0){const i=n.clientX,o=n.clientY,l=mu(i,o,e.getRootElement());if(l!==null){const{offset:a,node:c}=l,u=si(c);if(u!==null){const d=pd();if(Ie(u))d.anchor.set(u.getKey(),a,"text"),d.focus.set(u.getKey(),a,"text");else{const h=u.getParentOrThrow().getKey(),g=u.getIndexWithinParent()+1;d.anchor.set(h,g,"element"),d.focus.set(h,g,"element")}const f=jl(d);Xn(f)}e.dispatchCommand(V_,r)}return n.preventDefault(),!0}return d6(n,e)},Ae),e.registerCommand(om,n=>{const[r]=Za(n),i=re();return!(r&&!ie(i))&&(ie(i)&&!i.isCollapsed()&&n.dataTransfer!==null&&(SE(n.dataTransfer,EE(i)),c6(n.dataTransfer,e)),!0)},Ae),e.registerCommand(lb,n=>{const[r]=Za(n),i=re();if(r&&!ie(i))return!1;const o=n.clientX,l=n.clientY,a=mu(o,l,e.getRootElement());if(a!==null){const c=si(a.node);Un(c)&&n.preventDefault()}return!0},Ae),e.registerCommand(_7,()=>{const n=re();return zA(ie(n)&&Qp(n.anchor.getNode())!==null?n:null),!0},Ae),e.registerCommand(ob,n=>($_(e,Zr(n,ClipboardEvent)?n:null),!0),Ae),e.registerCommand(n7,n=>((async function(r,i){await $_(i,Zr(r,ClipboardEvent)?r:null),i.update(()=>{const o=re();ie(o)?o.removeText():He(o)&&o.getNodes().forEach(l=>l.remove())},{tag:sb})})(n,e),!0),Ae),e.registerCommand(Gl,n=>{const[,r,i]=Za(n);return r.length>0&&!i?(e.dispatchCommand(V_,r),!0):O7(n.target)&&HA(n.target)?!1:re()!==null&&((function(o,l){o.preventDefault(),l.update(()=>{const a=re(),c=Zr(o,InputEvent)||Zr(o,KeyboardEvent)?null:o.clipboardData;c!=null&&a!==null&&Kh(c,a,l)},{tag:yb})})(n,e),!0)},Ae),e.registerCommand(_b,()=>{const n=re();return ie(n)&&Uo(n,"space","both",t.peek()),!1},Ae),e.registerCommand(am,()=>{const n=re();return ie(n)&&Uo(n,"tab","both",t.peek()),!1},Ae),e.registerCommand(f7,n=>{const r=re();if(He(r))return j_(r,!1,n);if(!ie(r))return!1;const{anchor:i}=r;if(i.type!=="element"||i.offset!==0)return!1;const o=i.getNode();if(!xe(o))return!1;const l=o.getFirstChild();if(!Un(l)||!l.isInline())return!1;const a=o.getKey(),c=o.selectEnd();return n.shiftKey&&c.anchor.set(a,0,"element"),n.preventDefault(),n.stopPropagation(),!0},Ae),e.registerCommand(h7,n=>{const r=re();if(He(r))return j_(r,!0,n);if(!ie(r))return!1;const{anchor:i,focus:o}=r,l=dt(o.getNode(),u=>xe(u)&&!u.isInline());if(l===null)return!1;const a=l.getFirstChild();if(!Un(a)||!a.isInline()||dt(i.getNode(),u=>xe(u)&&!u.isInline())!==l)return!1;const c=l.getKey();return(o.type!=="element"||o.key!==c||o.offset!==0)&&(r.focus.set(c,0,"element"),n.shiftKey||r.anchor.set(c,0,"element"),n.preventDefault(),n.stopPropagation(),!0)},Ae))}s(T6,"qt$1");ME.peek=N6;var w6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],k6={canContainEols:["highlight"],enter:{highlight:M6},exit:{highlight:A6}};function M6(e){this.enter({type:"highlight",children:[]},e)}s(M6,"enterHighlight");function A6(e){this.exit(e)}s(A6,"exitHighlight");var I6={unsafe:[{character:"=",inConstruct:"phrasing",notInConstruct:w6}],handlers:{highlight:ME}};function ME(e,t,n,r){const o=n.createTracker(r),l=n.enter("highlight");let a=o.move("==");return a+=o.move(n.containerPhrasing(e,{before:a,after:"=",...o.current()})),a+=o.move("=="),l(),a}s(ME,"handleMark");function N6(){return"="}s(N6,"peekMark");var O6=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],J_={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function AE(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}s(AE,"isDecimal");function D6(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}s(D6,"isHexadecimal");function R6(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}s(R6,"isAlphabetical");function G_(e){return R6(e)||AE(e)}s(G_,"isAlphanumerical");var L6=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function $6(e,t){const n=t||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let o=0,l=-1,a="",c,u;n.position&&("start"in n.position||"indent"in n.position?(u=n.position.indent,c=n.position.start):c=n.position);let d=(c?c.line:0)||1,f=(c?c.column:0)||1,h=p(),g;for(o--;++o<=e.length;)if(g===10&&(f=(u?u[l]:0)||1),g=e.charCodeAt(o),g===38){const v=e.charCodeAt(o+1);if(v===9||v===10||v===12||v===32||v===38||v===60||Number.isNaN(v)||r&&v===r){a+=String.fromCharCode(g),f++;continue}const x=o+1;let C=x,b=x,S;if(v===35){b=++C;const $=e.charCodeAt(b);$===88||$===120?(S="hexadecimal",b=++C):S="decimal"}else S="named";let M="",T="",E="";const A=S==="named"?G_:S==="decimal"?AE:D6;for(b--;++b<=e.length;){const $=e.charCodeAt(b);if(!A($))break;E+=String.fromCharCode($),S==="named"&&O6.includes(E)&&(M=E,T=e0(E))}let D=e.charCodeAt(b)===59;if(D){b++;const $=S==="named"?e0(E):!1;$&&(M=E,T=$)}let L=1+b-x,G="";if(!(!D&&n.nonTerminated===!1))if(!E)S!=="named"&&_(4,L);else if(S==="named"){if(D&&!T)_(5,1);else if(M!==E&&(b=C+M.length,L=1+b-C,D=!1),!D){const $=M?1:3;if(n.attribute){const z=e.charCodeAt(b);z===61?(_($,L),T=""):G_(z)?T="":_($,L)}else _($,L)}G=T}else{D||_(2,L);let $=Number.parseInt(E,S==="hexadecimal"?16:10);if(P6($))_(7,L),G="�";else if($ in J_)_(6,L),G=J_[$];else{let z="";F6($)&&_(6,L),$>65535&&($-=65536,z+=String.fromCharCode($>>>10|55296),$=56320|$&1023),G=z+String.fromCharCode($)}}if(G){y(),h=p(),o=b-1,f+=b-x+1,i.push(G);const $=p();$.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,G,{start:h,end:$},e.slice(x-1,b)),h=$}else E=e.slice(x-1,b),a+=E,f+=E.length,o=b-1}else g===10&&(d++,l++,f=0),Number.isNaN(g)?y():(a+=String.fromCharCode(g),f++);return i.join("");function p(){return{line:d,column:f,offset:o+((c?c.offset:0)||0)}}function _(v,x){let C;n.warning&&(C=p(),C.column+=x,C.offset+=x,n.warning.call(n.warningContext||void 0,L6[v],C,v))}function y(){a&&(i.push(a),n.text&&n.text.call(n.textContext||void 0,a,{start:h,end:p()}),a="")}}s($6,"parseEntities");function P6(e){return e>=55296&&e<=57343||e>1114111}s(P6,"prohibited");function F6(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}s(F6,"disallowed");var V6=/["&'<>`]/g,B6=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,H6=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,K6=/[|\\{}()[\]^$+*?.]/g,q_=new WeakMap;function U6(e,t){if(e=e.replace(t.subset?W6(t.subset):V6,r),t.subset||t.escapeOnly)return e;return e.replace(B6,n).replace(H6,r);function n(i,o,l){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,l.charCodeAt(o+2),t)}function r(i,o,l){return t.format(i.charCodeAt(0),l.charCodeAt(o+1),t)}}s(U6,"core");function W6(e){let t=q_.get(e);return t||(t=z6(e),q_.set(e,t)),t}s(W6,"charactersToExpressionCached");function z6(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(K6,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}s(z6,"charactersToExpression");function j6(e){return"&#x"+e.toString(16).toUpperCase()+";"}s(j6,"formatBasic");function J6(e,t){return U6(e,Object.assign({format:j6},t))}s(J6,"stringifyEntitiesLight");var IE=" ";function G6(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:f,mdxJsxFlowTagExpressionAttribute:h,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:l,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:f,mdxJsxTextTagExpressionAttribute:h,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:l},exit:{mdxJsxFlowTagClosingMarker:a,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:u,mdxJsxFlowTagNameLocal:d,mdxJsxFlowTagExpressionAttribute:g,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:p,mdxJsxFlowTagAttributeNameLocal:_,mdxJsxFlowTagAttributeValueLiteral:y,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:v,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:x,mdxJsxFlowTag:C,mdxJsxTextTagClosingMarker:a,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:u,mdxJsxTextTagNameLocal:d,mdxJsxTextTagExpressionAttribute:g,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:p,mdxJsxTextTagAttributeNameLocal:_,mdxJsxTextTagAttributeValueLiteral:y,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:v,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:x,mdxJsxTextTag:C}};function e(){this.buffer()}function t(T){return{line:T.line,column:T.column,offset:T.offset}}function n(T){this.config.enter.data.call(this,T),this.config.exit.data.call(this,T)}function r(T){const E={name:void 0,attributes:[],close:!1,selfClosing:!1,start:T.start,end:T.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=E,this.buffer()}function i(T){const E=this.data.mdxJsxTagStack;if(E.length===0)throw new an("Unexpected closing slash `/` in tag, expected an open tag first",{start:T.start,end:T.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function o(T){const E=this.data.mdxJsxTag;if(E.close)throw new an("Unexpected attribute in closing tag, expected the end of the tag",{start:T.start,end:T.end},"mdast-util-mdx-jsx:unexpected-attribute")}function l(T){const E=this.data.mdxJsxTag;if(E.close)throw new an("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:T.start,end:T.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function a(){const T=this.data.mdxJsxTag;T.close=!0}function c(T){const E=this.data.mdxJsxTag;E.name=this.sliceSerialize(T)}function u(T){const E=this.data.mdxJsxTag;E.name+="."+this.sliceSerialize(T)}function d(T){const E=this.data.mdxJsxTag;E.name+=":"+this.sliceSerialize(T)}function f(T){const E=this.data.mdxJsxTag;o.call(this,T),E.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:t(T.start),end:void 0}})}function h(T){const E=this.data.mdxJsxTag;o.call(this,T),E.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:t(T.start),end:void 0}}),this.buffer()}function g(T){const E=this.data.mdxJsxTag,A=E.attributes[E.attributes.length-1];A.type;const D=T.estree;A.value=this.resume(),A.position,A.position.end=t(T.end),D&&(A.data={estree:D})}function p(T){const E=this.data.mdxJsxTag,A=E.attributes[E.attributes.length-1];A.type,A.name=this.sliceSerialize(T),A.position,A.position.end=t(T.end)}function _(T){const E=this.data.mdxJsxTag,A=E.attributes[E.attributes.length-1];A.type,A.name+=":"+this.sliceSerialize(T),A.position,A.position.end=t(T.end)}function y(T){const E=this.data.mdxJsxTag,A=E.attributes[E.attributes.length-1];A.value=$6(this.resume(),{nonTerminated:!1}),A.position,A.position.end=t(T.end)}function v(T){const E=this.data.mdxJsxTag,A=E.attributes[E.attributes.length-1];A.type;const D={type:"mdxJsxAttributeValueExpression",value:this.resume()},L=T.estree;L&&(D.data={estree:L}),A.value=D,A.position,A.position.end=t(T.end)}function x(){const T=this.data.mdxJsxTag;T.selfClosing=!0}function C(T){const E=this.data.mdxJsxTag,A=this.data.mdxJsxTagStack,D=A[A.length-1];if(E.close&&D.name!==E.name)throw new an("Unexpected closing tag `"+M(E)+"`, expected corresponding closing tag for `"+M(D)+"` ("+Ka(D)+")",{start:T.start,end:T.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),E.close?A.pop():this.enter({type:T.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:E.name||null,attributes:E.attributes,children:[]},T,b),E.selfClosing||E.close?this.exit(T,S):A.push(E)}function b(T,E){const A=this.data.mdxJsxTagStack,D=A[A.length-1],L=T?" before the end of `"+T.type+"`":"",G=T?{start:T.start,end:T.end}:void 0;throw new an("Expected a closing tag for `"+M(D)+"` ("+Ka({start:E.start,end:E.end})+")"+L,G,"mdast-util-mdx-jsx:end-tag-mismatch")}function S(T,E){const A=this.data.mdxJsxTag;throw new an("Expected the closing tag `"+M(A)+"` either after the end of `"+E.type+"` ("+Ka(E.end)+") or another opening tag after the start of `"+E.type+"` ("+Ka(E.start)+")",{start:T.start,end:T.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function M(T){return"<"+(T.close?"/":"")+(T.name||"")+">"}}s(G6,"mdxJsxFromMarkdown");function q6(e){const t=e||{},n=t.quote||'"',r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,o=t.printWidth||Number.POSITIVE_INFINITY,l=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return a.peek=Y6,{handlers:{mdxJsxFlowElement:a,mdxJsxTextElement:a},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function a(c,u,d,f){const h=c.type==="mdxJsxFlowElement",g=c.name?!c.children||c.children.length===0:!1,p=OE(NE(d)),_=d.createTracker(f),y=d.createTracker(f),v=[],x=(h?p:"")+"<"+(c.name||""),C=d.enter(c.type);if(_.move(x),y.move(x),c.attributes&&c.attributes.length>0){if(!c.name)throw new Error("Cannot serialize fragment w/ attributes");let E=-1;for(;++E<c.attributes.length;){const A=c.attributes[E];let D;if(A.type==="mdxJsxExpressionAttribute")D="{"+(A.value||"")+"}";else{if(!A.name)throw new Error("Cannot serialize attribute w/o name");const L=A.value,G=A.name;let $="";if(L!=null)if(typeof L=="object")$="{"+(L.value||"")+"}";else{const z=r&&Q1(L,n)>Q1(L,l)?l:n;$=z+J6(L,{subset:[z]})+z}D=G+($?"=":"")+$}v.push(D)}}let b=!1;const S=v.join(" ");h&&(/\r?\n|\r/.test(S)||_.current().now.column+S.length+(g?i?2:3:1)>o)&&(b=!0);let M=_,T=x;if(b){M=y;let E=-1;for(;++E<v.length;)v[E]=p+IE+v[E];T+=M.move(`
14
+ `+v.join(`
15
+ `)+`
16
+ `+p)}else S&&(T+=M.move(" "+S));return g&&(T+=M.move((i||b?"":" ")+"/")),T+=M.move(">"),c.children&&c.children.length>0&&(c.type==="mdxJsxTextElement"?T+=M.move(d.containerPhrasing(c,{...M.current(),before:">",after:"<"})):(M.shift(2),T+=M.move(`
17
+ `),T+=M.move(Z6(c,d,M.current())),T+=M.move(`
18
+ `))),g||(T+=M.move((h?p:"")+"</"+(c.name||"")+">")),C(),T}s(a,"mdxElement")}s(q6,"mdxJsxToMarkdown");function Z6(e,t,n){const r=t.indexStack,i=e.children,o=t.createTracker(n),l=OE(NE(t)),a=[];let c=-1;for(r.push(-1);++c<i.length;){const u=i[c];r[r.length-1]=c;const d={before:`
19
+ `,after:`
20
+ `,...o.current()},f=t.handle(u,e,t,d),h=u.type==="mdxJsxFlowElement"?f:t.indentLines(f,function(g,p,_){return(_?"":l)+g});a.push(o.move(h)),u.type!=="list"&&(t.bulletLastUsed=void 0),c<i.length-1&&a.push(o.move(`
21
+
22
+ `))}return r.pop(),a.join("")}s(Z6,"containerFlow$1");function NE(e){let t=0,n=e.stack.length;for(;--n>-1;){const r=e.stack[n];if(r==="blockquote"||r==="listItem")break;r==="mdxJsxFlowElement"&&t++}return t}s(NE,"inferDepth");function OE(e){return IE.repeat(e)}s(OE,"createIndent");function Y6(){return"<"}s(Y6,"peekElement");var Z_=Object.prototype.hasOwnProperty;function Y_(e,t,n){for(n of e.keys())if(Sl(n,t))return n}s(Y_,"find");function Sl(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Sl(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Y_(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Y_(t,i),!i)||!Sl(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Z_.call(e,n)&&++r&&!Z_.call(t,n)||!(n in t)||!Sl(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}s(Sl,"dequal");var zh,DE,RE,LE,$E=!0;typeof process<"u"&&({FORCE_COLOR:zh,NODE_DISABLE_COLORS:DE,NO_COLOR:RE,TERM:LE}={},$E=process.stdout&&process.stdout.isTTY);var De={enabled:!DE&&RE==null&&LE!=="dumb"&&(zh!=null&&zh!=="0"||$E),reset:lt(0,0),bold:lt(1,22),dim:lt(2,22),italic:lt(3,23),underline:lt(4,24),inverse:lt(7,27),hidden:lt(8,28),strikethrough:lt(9,29),black:lt(30,39),red:lt(31,39),green:lt(32,39),yellow:lt(33,39),blue:lt(34,39),magenta:lt(35,39),cyan:lt(36,39),white:lt(37,39),gray:lt(90,39),grey:lt(90,39),bgBlack:lt(40,49),bgRed:lt(41,49),bgGreen:lt(42,49),bgYellow:lt(43,49),bgBlue:lt(44,49),bgMagenta:lt(45,49),bgCyan:lt(46,49),bgWhite:lt(47,49)};function X_(e,t){let n=0,r,i="",o="";for(;n<e.length;n++)r=e[n],i+=r.open,o+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+o}s(X_,"run");function X6(e,t){let n={has:e,keys:t};return n.reset=De.reset.bind(n),n.bold=De.bold.bind(n),n.dim=De.dim.bind(n),n.italic=De.italic.bind(n),n.underline=De.underline.bind(n),n.inverse=De.inverse.bind(n),n.hidden=De.hidden.bind(n),n.strikethrough=De.strikethrough.bind(n),n.black=De.black.bind(n),n.red=De.red.bind(n),n.green=De.green.bind(n),n.yellow=De.yellow.bind(n),n.blue=De.blue.bind(n),n.magenta=De.magenta.bind(n),n.cyan=De.cyan.bind(n),n.white=De.white.bind(n),n.gray=De.gray.bind(n),n.grey=De.grey.bind(n),n.bgBlack=De.bgBlack.bind(n),n.bgRed=De.bgRed.bind(n),n.bgGreen=De.bgGreen.bind(n),n.bgYellow=De.bgYellow.bind(n),n.bgBlue=De.bgBlue.bind(n),n.bgMagenta=De.bgMagenta.bind(n),n.bgCyan=De.bgCyan.bind(n),n.bgWhite=De.bgWhite.bind(n),n}s(X6,"chain");function lt(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:De.enabled?X_(this.keys,r+""):r+""):r===void 0?X6([e],[n]):De.enabled?X_([n],r+""):r+""}}s(lt,"init");function di(){}s(di,"Diff");di.prototype={diff:s(function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.callback;typeof i=="function"&&(o=i,i={}),this.options=i;var l=this;function a(b){return o?(setTimeout(function(){o(void 0,b)},0),!0):b}s(a,"done"),t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var c=n.length,u=t.length,d=1,f=c+u;i.maxEditLength&&(f=Math.min(f,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,g=Date.now()+h,p=[{oldPos:-1,lastComponent:void 0}],_=this.extractCommon(p[0],n,t,0);if(p[0].oldPos+1>=u&&_+1>=c)return a([{value:this.join(n),count:n.length}]);var y=-1/0,v=1/0;function x(){for(var b=Math.max(y,-d);b<=Math.min(v,d);b+=2){var S=void 0,M=p[b-1],T=p[b+1];M&&(p[b-1]=void 0);var E=!1;if(T){var A=T.oldPos-b;E=T&&0<=A&&A<c}var D=M&&M.oldPos+1<u;if(!E&&!D){p[b]=void 0;continue}if(!D||E&&M.oldPos+1<T.oldPos?S=l.addToPath(T,!0,void 0,0):S=l.addToPath(M,void 0,!0,1),_=l.extractCommon(S,n,t,b),S.oldPos+1>=u&&_+1>=c)return a(Q6(l,S.lastComponent,n,t,l.useLongestToken));p[b]=S,S.oldPos+1>=u&&(v=Math.min(v,b-1)),_+1>=c&&(y=Math.max(y,b+1))}d++}if(s(x,"execEditLength"),o)s((function b(){setTimeout(function(){if(d>f||Date.now()>g)return o();x()||b()},0)}),"exec")();else for(;d<=f&&Date.now()<=g;){var C=x();if(C)return C}},"diff"),addToPath:s(function(t,n,r,i){var o=t.lastComponent;return o&&o.added===n&&o.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}},"addToPath"),extractCommon:s(function(t,n,r,i){for(var o=n.length,l=r.length,a=t.oldPos,c=a-i,u=0;c+1<o&&a+1<l&&this.equals(n[c+1],r[a+1]);)c++,a++,u++;return u&&(t.lastComponent={count:u,previousComponent:t.lastComponent}),t.oldPos=a,c},"extractCommon"),equals:s(function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},"equals"),removeEmpty:s(function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},"removeEmpty"),castInput:s(function(t){return t},"castInput"),tokenize:s(function(t){return t.split("")},"tokenize"),join:s(function(t){return t.join("")},"join")};function Q6(e,t,n,r,i){for(var o=[],l;t;)o.push(t),l=t.previousComponent,delete t.previousComponent,t=l;o.reverse();for(var a=0,c=o.length,u=0,d=0;a<c;a++){var f=o[a];if(f.removed){if(f.value=e.join(r.slice(d,d+f.count)),d+=f.count,a&&o[a-1].added){var g=o[a-1];o[a-1]=o[a],o[a]=g}}else{if(!f.added&&i){var h=n.slice(u,u+f.count);h=h.map(function(_,y){var v=r[d+y];return v.length>_.length?v:_}),f.value=e.join(h)}else f.value=e.join(n.slice(u,u+f.count));u+=f.count,f.added||(d+=f.count)}}var p=o[c-1];return c>1&&typeof p.value=="string"&&(p.added||p.removed)&&e.equals("",p.value)&&(o[c-2].value+=p.value,o.pop()),o}s(Q6,"buildValues");var eN=new di;function tN(e,t,n){return eN.diff(e,t,n)}s(tN,"diffChars");var Q_=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ev=/\S/,PE=new di;PE.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ev.test(e)&&!ev.test(t)};PE.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&Q_.test(t[n])&&Q_.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var vm=new di;vm.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
23
+ `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};function nN(e,t,n){return vm.diff(e,t,n)}s(nN,"diffLines");var rN=new di;rN.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var iN=new di;iN.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function Mc(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Mc=s(function(t){return typeof t},"_typeof"):Mc=s(function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},"_typeof"),Mc(e)}s(Mc,"_typeof");var oN=Object.prototype.toString,Yl=new di;Yl.useLongestToken=!0;Yl.tokenize=vm.tokenize;Yl.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(o,l){return typeof l>"u"?n:l}:r;return typeof e=="string"?e:JSON.stringify(jh(e,null,null,i),i," ")};Yl.equals=function(e,t){return di.prototype.equals.call(Yl,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function jh(e,t,n,r,i){t=t||[],n=n||[],r&&(e=r(i,e));var o;for(o=0;o<t.length;o+=1)if(t[o]===e)return n[o];var l;if(oN.call(e)==="[object Array]"){for(t.push(e),l=new Array(e.length),n.push(l),o=0;o<e.length;o+=1)l[o]=jh(e[o],t,n,r,i);return t.pop(),n.pop(),l}if(e&&e.toJSON&&(e=e.toJSON()),Mc(e)==="object"&&e!==null){t.push(e),l={},n.push(l);var a=[],c;for(c in e)e.hasOwnProperty(c)&&a.push(c);for(a.sort(),o=0;o<a.length;o+=1)c=a[o],l[c]=jh(e[c],t,n,r,c);t.pop(),n.pop()}else l=e;return l}s(jh,"canonicalize");var vu=new di;vu.tokenize=function(e){return e.slice()};vu.join=vu.removeEmpty=function(e){return e};function sN(e,t,n){return vu.diff(e,t,n)}s(sN,"diffArrays");var So={"--":De.red,"··":De.grey,"++":De.green},Cs=De.dim().italic,lN=De.dim("→"),aN=De.dim("·"),cN=De.dim("↵"),Ac=s((e,t)=>So[e](e+Jh(t))+`
24
+ `,"LOG"),uN=s((e,t)=>De.dim("L"+String(e).padStart(t,"0")+" "),"LINE"),Jh=s(e=>e.replace(/[ ]/g,aN).replace(/\t/g,lN).replace(/(\r?\n)/g,cN),"PRETTY");function dN(e,t,n){let r=e.removed?"--":e.added?"++":"··",i=e.value.replace(/\r?\n$/,"").split(`
25
+ `),o=0,l,a="";for(e.added?a+=So[r]().underline(Cs("Expected:"))+`
26
+ `:e.removed&&(a+=So[r]().underline(Cs("Actual:"))+`
27
+ `);o<i.length;o++)l=i[o],l!=null&&(t&&(a+=uN(t+o,n)),a+=Ac(r,l||`
28
+ `));return a}s(dN,"line");function fN(e,t){let n=sN(e,t),r=0,i=0,o=0,l,a,c,u,d,f=Ac("··","[");for(;r<n.length;r++)for(c=(l=n[r]).removed?"--":l.added?"++":"··",l.added?f+=So[c]().underline(Cs("Expected:"))+`
29
+ `:l.removed&&(f+=So[c]().underline(Cs("Actual:"))+`
30
+ `),i=0;i<l.value.length;i++)for(u=l.value[i]&&typeof l.value[i]=="object",a=ol(l.value[i]).split(/\r?\n/g),o=0;o<a.length;)d=" "+a[o++]+(u?"":","),u&&o===a.length&&i+1<l.value.length&&(d+=","),f+=Ac(c,d);return f+Ac("··","]")}s(fN,"arrays");function tv(e,t,n=0){let r=0,i,o="",l=nN(e,t),a=String(t.split(/\r?\n/g).length-n).length;for(;r<l.length;r++)o+=dN(i=l[r],n,a),n&&!i.removed&&(n+=i.count);return o}s(tv,"lines");function nv(e,t){let n=tN(e,t),r=0,i="",o,l=e.length,a=t.length,c=Jh(e),u=Jh(t);if(o=n[r],l!==a){if(o.removed&&n[r+1]){let d=o.count-n[r+1].count;d==0||(d>0?(t=" ".repeat(d)+t,u=" ".repeat(d)+u,a+=d):d<0&&(e=" ".repeat(-d)+e,c=" ".repeat(-d)+c,l+=-d))}}if(i+=FE(c,u,l,a),l===a)for(o=" ";r<l;r++)o+=e[r]===t[r]?" ":"^";else for(o=" ";r<n.length;r++)o+=(n[r].added||n[r].removed?"^":" ").repeat(Math.max(n[r].count,0)),r+1<n.length&&(n[r].added&&n[r+1].removed||n[r].removed&&n[r+1].added)&&(n[r+1].count-=n[r].count);return i+De.red(o)}s(nv,"chars");function FE(e,t,n=String(e).length,r=String(t).length){let i=4,o=Math.max(n,r),l=typeof e,a=typeof t;if(l!==a){i=2;let c=i+o-n,u=i+o-r;e+=" ".repeat(c)+De.dim(`[${l}]`),t+=" ".repeat(u)+De.dim(`[${a}]`),n+=c+l.length+2,r+=u+a.length+2,o=Math.max(n,r)}return So["++"]("++"+t+" ".repeat(i+o-r)+Cs("(Expected)"))+`
31
+ `+So["--"]("--"+e+" ".repeat(i+o-n)+Cs("(Actual)"))+`
32
+ `}s(FE,"direct");function yu(e,t){var n,r=0,i,o=Array.isArray(e),l=[],a=o?Array(e.length):{};if(o)for(r=0;r<a.length;r++)i=e[r],!i||typeof i!="object"?a[r]=i:a[r]=yu(i,t[r]);else{for(n in t)l.push(n);for(;r<l.length;r++)Object.prototype.hasOwnProperty.call(e,n=l[r])&&(!(i=e[n])||typeof i!="object"?a[n]=i:a[n]=yu(i,t[n]));for(n in e)a.hasOwnProperty(n)||(a[n]=e[n])}return a}s(yu,"sort");function hN(){var e=new Set;return s(function(n,r){return r===void 0?"[__VOID__]":typeof r=="number"&&r!==r?"[__NAN__]":typeof r=="bigint"?r.toString():!r||typeof r!="object"?r:e.has(r)?"[Circular]":(e.add(r),r)},"print")}s(hN,"circular");function ol(e){return JSON.stringify(e,hN(),2).replace(/"\[__NAN__\]"/g,"NaN").replace(/"\[__VOID__\]"/g,"undefined")}s(ol,"stringify");function gN(e,t){if(Array.isArray(t)&&Array.isArray(e))return fN(e,t);if(t instanceof RegExp)return nv(""+e,""+t);let n=e&&typeof e=="object",r=t&&typeof t=="object";return n&&r&&(e=yu(e,t)),r&&(t=ol(t)),n&&(e=ol(e)),t&&typeof t=="object"&&(e=ol(yu(e,t)),t=ol(t)),n=typeof e=="string",r=typeof t=="string",n&&/\r?\n/.test(e)?tv(e,""+t):r&&/\r?\n/.test(t)?tv(""+e,t):n&&r?nv(e,t):FE(e,t)}s(gN,"compare");function xu(e){e=e.replace(/\r?\n/g,`
33
+ `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}s(xu,"dedent");var pN=class extends Error{static{s(this,"Assertion")}constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function Cn(e,t,n,r,i,o,l){if(e)return;let a=l||o;if(l instanceof Error)throw l;let c=i&&i(t,n);throw new pN({actual:t,expects:n,operator:r,message:a,details:c,generated:!l})}s(Cn,"assert");function mN(e,t){Cn(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}s(mN,"ok");function _N(e,t,n){Cn(e===t,e,t,"is",gN,"Expected values to be strictly equal:",n)}s(_N,"is");function li(e,t){Cn(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}s(li,"not");li.ok=li;_N.not=function(e,t,n){Cn(e!==t,e,t,"is.not",!1,"Expected values not to be strictly equal",n)};li.equal=function(e,t,n){Cn(!Sl(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};li.type=function(e,t,n){let r=typeof e;Cn(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};li.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";Cn(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};li.snapshot=function(e,t,n){e=xu(e),t=xu(t),Cn(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};li.fixture=function(e,t,n){e=xu(e),t=xu(t),Cn(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};li.match=function(e,t,n){typeof t=="string"?Cn(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):Cn(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};li.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?Cn(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?Cn(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||Cn(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};var Xs={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},rv={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},iv={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"},Qs="highlightSequenceTemporary",ov="highlightSequence",vN="highlight",yN="highlightText";function xN(){const e={name:"highlight",tokenize:n,resolveAll:t};return{text:{[Xs.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[Xs.equalsTo]}};function t(r,i){let o=-1;for(;++o<r.length;)if(r[o][0]==="enter"&&r[o][1].type===Qs&&r[o][1]._close){let l=o;for(;l--;)if(r[l][0]==="exit"&&r[l][1].type===Qs&&r[l][1]._open&&r[o][1].end.offset-r[o][1].start.offset===r[l][1].end.offset-r[l][1].start.offset){r[o][1].type=ov,r[l][1].type=ov;const a={type:vN,start:Object.assign({},r[l][1].start),end:Object.assign({},r[o][1].end)},c={type:yN,start:Object.assign({},r[l][1].end),end:Object.assign({},r[o][1].start)},u=[["enter",a,i],["enter",r[l][1],i],["exit",r[l][1],i],["enter",c,i]],d=i.parser.constructs.insideSpan.null;d&&jd(u,u.length,0,bk(d,r.slice(l+1,o),i)),jd(u,u.length,0,[["exit",c,i],["enter",r[o][1],i],["exit",r[o][1],i],["exit",a,i]]),jd(r,l-1,o-l+3,u),o=l+u.length-2;break}}for(o=-1;++o<r.length;)r[o][1].type===Qs&&(r[o][1].type=iv.data);return r}function n(r,i,o){const l=this.previous,a=this.events;let c=0;return u;function u(f){return mN(f===Xs.equalsTo,"expected `=`"),l===Xs.equalsTo&&a[a.length-1][1].type!==iv.characterEscape?o(f):(r.enter(Qs),d(f))}function d(f){const h=n0(l);if(f===Xs.equalsTo)return c>1?o(f):(r.consume(f),c++,d);if(c<2)return o(f);const g=r.exit(Qs),p=n0(f);return g._open=!p||p===rv.attentionSideAfter&&!!h,g._close=!h||h===rv.attentionSideAfter&&!!p,i(f)}}}s(xN,"highlightMark");var CN={}.hasOwnProperty,bN=Symbol("continue"),yf=Symbol("exit"),EN=Symbol("skip");function SN(e,t){let n,r;typeof t=="function"?n=t:t&&typeof t=="object"&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(o,l,a,c){return xf(o)&&(u.displayName="node ("+o.type+")"),u;function u(){const d=n?sv(n(o,l,a,c)):[];if(d[0]===yf)return d;if(d[0]!==EN){let f;for(f in o)if(CN.call(o,f)&&o[f]&&typeof o[f]=="object"&&f!=="data"&&f!=="position"){const h=c.concat(o),g=o[f];if(Array.isArray(g)){const p=g;let _=0;for(;_>-1&&_<p.length;){const y=p[_];if(xf(y)){const v=i(y,f,_,h)();if(v[0]===yf)return v;_=typeof v[1]=="number"?v[1]:_+1}else _++}}else if(xf(g)){const p=i(g,f,void 0,h)();if(p[0]===yf)return p}}}return r?sv(r(o,l,a,c)):d}s(u,"visit")}s(i,"build")}s(SN,"visit");function sv(e){return Array.isArray(e)?e:typeof e=="number"?[bN,e]:[e]}s(sv,"toResult");function xf(e){return!!(e&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.length>0)}s(xf,"nodelike");function TN(e,t){const n=t.prefix||"",r=t.suffix||"",i=Object.assign({},t.acornOptions),o=[],l=[],a=i.onComment,c=i.onToken;let u=!1,d,f;const h=Object.assign({},i,{onComment:o,preserveParens:!0});c&&(h.onToken=l);const g=wN(e,t.tokenTypes),p=g.value,_=n+p+r,y=t.expression&&lv(p);if(y&&!t.allowEmpty)throw new an("Unexpected empty expression",{place:x(0),ruleId:"unexpected-empty-expression",source:"micromark-extension-mdx-expression"});try{d=t.expression&&!y?t.acorn.parseExpressionAt(_,0,h):t.acorn.parse(_,h)}catch(C){const b=C,S=x(b.pos);b.message=String(b.message).replace(/ \(\d+:\d+\)$/,""),b.pos=S.offset,b.loc={line:S.line,column:S.column-1},f=b,u=b.raisedAt>=n.length+p.length||b.message==="Unterminated comment"}if(d&&t.expression&&!y)if(lv(_.slice(d.end,_.length-r.length)))d={type:"Program",start:0,end:n.length+p.length,body:[{type:"ExpressionStatement",expression:d,start:0,end:n.length+p.length}],sourceType:"module",comments:[]};else{const C=x(d.end),b=new Error("Unexpected content after expression");b.pos=C.offset,b.loc={line:C.line,column:C.column-1},f=b,d=void 0}if(d){if(d.comments=o,SN(d,function(C,b,S,M){let T=M[M.length-1],E=b;C.type==="ParenthesizedExpression"&&T&&E&&(typeof S=="number"&&(T=T[E],E=S),T[E]=C.expression),v(C)}),Array.isArray(a))a.push(...o);else if(typeof a=="function")for(const C of o)a(C.type==="Block",C.value,C.start,C.end,C.loc.start,C.loc.end);for(const C of l)C.end<=n.length||C.start-n.length>=p.length||(v(C),Array.isArray(c)?c.push(C):c(C))}return{estree:d,error:f,swallow:u};function v(C){const b=x(C.start),S=x(C.end);C.start=b.offset,C.end=S.offset,C.loc={start:{line:b.line,column:b.column-1,offset:b.offset},end:{line:S.line,column:S.column-1,offset:S.offset}},C.range=[C.start,C.end]}function x(C){let b=C-n.length;b<0?b=0:b>p.length&&(b=p.length);let S=kN(g.stops,b);return S||(S={line:t.start.line,column:t.start.column,offset:t.start.offset}),S}}s(TN,"eventsToAcorn");function lv(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,""))}s(lv,"empty$1");function wN(e,t){const n={value:"",stops:[]};let r=-1;for(;++r<e.length;){const i=e[r];if(i[0]==="enter"){const o=i[1].type;if(o==="lineEnding"||t.includes(o)){const l=i[2].sliceStream(i[1]);for(;l.length>0&&l[0]===-1;)l.shift();const a=MN(l);n.stops.push([n.value.length,i[1].start]),n.value+=a,n.stops.push([n.value.length,i[1].end])}}}return n}s(wN,"collect");function kN(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;const[r,i]=e[n-1],o=t-r;return{line:i.line,column:i.column+o,offset:i.offset+o}}s(kN,"relativeToPoint");function MN(e){let t=-1;const n=[];let r;for(;++t<e.length;){const i=e[t];let o;if(typeof i=="string")o=i;else switch(i){case-5:o="\r";break;case-4:o=`
34
+ `;break;case-3:o=`\r
35
+ `;break;case-2:o=" ";break;case-1:if(r)continue;o=" ";break;default:o=String.fromCharCode(i)}r=i===-2,n.push(o)}return n.join("")}s(MN,"serializeChunks");function Cf(e){const t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=av(n.start,r[0]||t.start),o=av(n.end,r[1]||t.end);if(i&&o)return{start:i,end:o}}s(Cf,"positionFromEstree");function av(e,t){if(e&&typeof e=="object"){const n="line"in e?bf(e.line):void 0,r="column"in e?bf(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:bf(t)}}}s(av,"pointOrUndefined");function bf(e){return typeof e=="number"&&e>-1?e:void 0}s(bf,"numberOrUndefined");var is="https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression",AN="#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-",IN="#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed",cv="#unexpected-type-in-code-expected-an-object-spread-spread",NN="#unexpected-extra-content-in-spread-only-a-single-spread-is-supported",ON="#could-not-parse-expression-with-acorn";function uv(e,t,n,r,i,o,l,a,c,u,d){const f=this,h=this.events.length+3;let g=0,p,_;return y;function y(b){return e.enter(n),e.enter(r),e.consume(b),e.exit(r),p=f.now(),v}function v(b){if(b===null){if(_)throw _;const S=new an("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:f.now(),ruleId:"unexpected-eof",source:"micromark-extension-mdx-expression"});throw S.url=is+AN,S}if(Tr(b))return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),C;if(b===125&&g===0){const S=o?DN.call(f,o,l,i,h,p,u||!1,c||!1):{type:"ok",estree:void 0};if(S.type==="ok"){e.enter(r),e.consume(b),e.exit(r);const M=e.exit(n);return a&&S.estree&&Object.assign(M,{estree:S.estree}),t}return _=S.message,e.enter(i),e.consume(b),x}return e.enter(i),x(b)}function x(b){return b===125&&g===0||b===null||Tr(b)?(e.exit(i),v(b)):(b===123&&!o?g+=1:b===125&&(g-=1),e.consume(b),x)}function C(b){const S=f.now();if(S.line!==p.line&&!d&&f.parser.lazy[S.line]){const M=new an("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:f.now(),ruleId:"unexpected-lazy",source:"micromark-extension-mdx-expression"});throw M.url=is+IN,M}return Pc(b)?Gg(e,v,"linePrefix",3)(b):v(b)}}s(uv,"factoryMdxExpression");function DN(e,t,n,r,i,o,l){const a=TN(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:o,prefix:l?"({":"",suffix:l?"})":""}),c=a.estree;if(l&&c){const u=c.body[0];if(u.type!=="ExpressionStatement"||u.expression.type!=="ObjectExpression"){const d=Cf(u),f=new an("Unexpected `"+u.type+"` in code: expected an object spread (`{...spread}`)",{place:d.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=is+cv,f}if(u.expression.properties[1]){const d=Cf(u.expression.properties[1]),f=new an("Unexpected extra content in spread: only a single spread is supported",{place:d.start,ruleId:"spread-extra",source:"micromark-extension-mdx-expression"});throw f.url=is+NN,f}if(u.expression.properties[0]&&u.expression.properties[0].type!=="SpreadElement"){const d=Cf(u.expression.properties[0]),f=new an("Unexpected `"+u.expression.properties[0].type+"` in code: only spread elements are supported",{place:d.start,ruleId:"non-spread",source:"micromark-extension-mdx-expression"});throw f.url=is+cv,f}}if(a.error){const u=new an("Could not parse expression with acorn",{cause:a.error,place:{line:a.error.loc.line,column:a.error.loc.column+1,offset:a.error.pos},ruleId:"acorn",source:"micromark-extension-mdx-expression"});return u.url=is+ON,{type:"nok",message:u}}return{type:"ok",estree:c}}s(DN,"mdxExpressionParse");var dv="https://github.com/micromark/micromark-extension-mdx-jsx";function VE(e,t,n,r,i,o,l,a,c,u,d,f,h,g,p,_,y,v,x,C,b,S,M,T,E,A,D,L,G,$,z,W){const ye=this;let q,ge;return me;function me(I){return e.enter(a),e.enter(c),e.consume(I),e.exit(c),oe}function oe(I){return Xi(I)?n(I):(q=Z,Fe(I))}function Z(I){if(I===47)return e.enter(u),e.consume(I),e.exit(u),q=pe,Fe;if(I===62)return Ln(I);if(I!==null&&I>=0&&rr(I))return e.enter(f),e.enter(h),e.consume(I),de;ze(I,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(I===33?" (note: to create a comment in MDX, use `{/* text */}`)":""))}function pe(I){if(I===62)return Ln(I);if(I!==null&&I>=0&&rr(I))return e.enter(f),e.enter(h),e.consume(I),de;ze(I,"before name","a character that can start a name, such as a letter, `$`, or `_`"+(I===42||I===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function de(I){if(I!==null&&I>=0&&js(I,{jsx:!0}))return e.consume(I),de;if(I===46||I===47||I===58||I===62||I===123||Xi(I)||yi(I))return e.exit(h),q=ce,Fe(I);ze(I,"in name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(I===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function ce(I){if(I===46)return e.enter(g),e.consume(I),e.exit(g),q=j,Fe;if(I===58)return e.enter(_),e.consume(I),e.exit(_),q=Ne,Fe;if(I===47||I===62||I===123||I!==null&&I>=0&&rr(I))return e.exit(f),Pe(I);ze(I,"after name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function j(I){if(I!==null&&I>=0&&rr(I))return e.enter(p),e.consume(I),ne;ze(I,"before member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ne(I){if(I!==null&&I>=0&&js(I,{jsx:!0}))return e.consume(I),ne;if(I===46||I===47||I===62||I===123||Xi(I)||yi(I))return e.exit(p),q=ue,Fe(I);ze(I,"in member name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(I===64?" (note: to create a link in MDX, use `[text](url)`)":""))}function ue(I){if(I===46)return e.enter(g),e.consume(I),e.exit(g),q=j,Fe;if(I===47||I===62||I===123||I!==null&&I>=0&&rr(I))return e.exit(f),Pe(I);ze(I,"after member name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Ne(I){if(I!==null&&I>=0&&rr(I))return e.enter(y),e.consume(I),$e;ze(I,"before local name","a character that can start a name, such as a letter, `$`, or `_`"+(I===43||I!==null&&I>46&&I<58?" (note: to create a link in MDX, use `[text](url)`)":""))}function $e(I){if(I!==null&&I>=0&&js(I,{jsx:!0}))return e.consume(I),$e;if(I===47||I===62||I===123||Xi(I)||yi(I))return e.exit(y),q=Re,Fe(I);ze(I,"in local name","a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Re(I){if(I===47||I===62||I===123||I!==null&&I>=0&&rr(I))return e.exit(f),Pe(I);ze(I,"after local name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function Pe(I){if(I===47)return e.enter(d),e.consume(I),e.exit(d),q=Yt,Fe;if(I===62)return Ln(I);if(I===123)return uv.call(ye,e,rt,v,x,C,r,i,o,!0,!1,l)(I);if(I!==null&&I>=0&&rr(I))return e.enter(b),e.enter(S),e.enter(M),e.consume(I),Je;ze(I,"before attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function rt(I){return q=Pe,Fe(I)}function Je(I){if(I!==null&&I>=0&&js(I,{jsx:!0}))return e.consume(I),Je;if(I===47||I===58||I===61||I===62||I===123||Xi(I)||yi(I))return e.exit(M),q=pt,Fe(I);ze(I,"in attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function pt(I){if(I===58)return e.enter(T),e.consume(I),e.exit(T),q=It,Fe;if(I===61)return e.exit(S),e.enter(A),e.consume(I),e.exit(A),q=Ge,Fe;if(I===47||I===62||I===123||Xi(I)||yi(I)||I!==null&&I>=0&&rr(I))return e.exit(S),e.exit(b),q=Pe,Fe(I);ze(I,"after attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function It(I){if(I!==null&&I>=0&&rr(I))return e.enter(E),e.consume(I),ut;ze(I,"before local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ut(I){if(I!==null&&I>=0&&js(I,{jsx:!0}))return e.consume(I),ut;if(I===47||I===61||I===62||I===123||Xi(I)||yi(I))return e.exit(E),e.exit(S),q=jt,Fe(I);ze(I,"in local attribute name","an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function jt(I){if(I===61)return e.enter(A),e.consume(I),e.exit(A),q=Ge,Fe;if(I===47||I===62||I===123||I!==null&&I>=0&&rr(I))return e.exit(b),Pe(I);ze(I,"after local attribute name","a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ge(I){if(I===34||I===39)return e.enter(D),e.enter(L),e.consume(I),e.exit(L),ge=I,Nt;if(I===123)return uv.call(ye,e,yt,$,z,W,r,i,o,!1,!1,l)(I);ze(I,"before attribute value","a character that can start an attribute value, such as `\"`, `'`, or `{`"+(I===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":""))}function yt(I){return e.exit(b),q=Pe,Fe(I)}function Nt(I){return I===null&&ze(I,"in attribute value","a corresponding closing quote `"+String.fromCodePoint(ge)+"`"),I===ge?(e.enter(L),e.consume(I),e.exit(L),e.exit(D),e.exit(b),ge=void 0,q=Pe,Fe):Tr(I)?(q=Nt,Fe(I)):(e.enter(G),it(I))}function it(I){return I===null||I===ge||Tr(I)?(e.exit(G),Nt(I)):(e.consume(I),it)}function Yt(I){if(I===62)return Ln(I);ze(I,"after self-closing slash","`>` to end the tag"+(I===42||I===47?" (note: JS comments in JSX tags are not supported in MDX)":""))}function Ln(I){return e.enter(c),e.consume(I),e.exit(c),e.exit(a),t}function Fe(I){return Tr(I)?(e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),$n):Pc(I)||yi(I)?(e.enter("esWhitespace"),$t(I)):q(I)}function $t(I){return Tr(I)?(e.exit("esWhitespace"),Fe(I)):Pc(I)||yi(I)?(e.consume(I),$t):(e.exit("esWhitespace"),q(I))}function $n(I){if(!l&&ye.parser.lazy[ye.now().line]){const Pn=new an("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ye.now(),"micromark-extension-mdx-jsx:unexpected-lazy");throw Pn.url=dv+"#unexpected-lazy-line-in-container-expected-line-to-be",Pn}return Fe(I)}function ze(I,Pn,R){const Y=new an("Unexpected "+(I===null?"end of file":"character `"+(I===96?"` ` `":String.fromCodePoint(I))+"` ("+RN(I)+")")+" "+Pn+", expected "+R,ye.now(),"micromark-extension-mdx-jsx:unexpected-"+(I===null?"eof":"character"));throw Y.url=dv+(I===null?"#unexpected-end-of-file-at-expected-expect":"#unexpected-character-at-expected-expect"),Y}}s(VE,"factoryTag");function RN(e){return"U+"+e.toString(16).toUpperCase().padStart(4,"0")}s(RN,"serializeCharCode");function LN(e,t){return{name:"mdxJsxTextTag",tokenize:n};function n(r,i,o){return VE.call(this,r,i,o,e,t.acornOptions,t.addResult,!0,"mdxJsxTextTag","mdxJsxTextTagMarker","mdxJsxTextTagClosingMarker","mdxJsxTextTagSelfClosingMarker","mdxJsxTextTagName","mdxJsxTextTagNamePrimary","mdxJsxTextTagNameMemberMarker","mdxJsxTextTagNameMember","mdxJsxTextTagNamePrefixMarker","mdxJsxTextTagNameLocal","mdxJsxTextTagExpressionAttribute","mdxJsxTextTagExpressionAttributeMarker","mdxJsxTextTagExpressionAttributeValue","mdxJsxTextTagAttribute","mdxJsxTextTagAttributeName","mdxJsxTextTagAttributeNamePrimary","mdxJsxTextTagAttributeNamePrefixMarker","mdxJsxTextTagAttributeNameLocal","mdxJsxTextTagAttributeInitializerMarker","mdxJsxTextTagAttributeValueLiteral","mdxJsxTextTagAttributeValueLiteralMarker","mdxJsxTextTagAttributeValueLiteralValue","mdxJsxTextTagAttributeValueExpression","mdxJsxTextTagAttributeValueExpressionMarker","mdxJsxTextTagAttributeValueExpressionValue")}}s(LN,"jsxText");function $N(e,t){return{concrete:!0,name:"mdxJsxFlowTag",tokenize:n};function n(r,i,o){const l=this;return a;function a(f){return c(f)}function c(f){return VE.call(l,r,u,o,e,t.acornOptions,t.addResult,!1,"mdxJsxFlowTag","mdxJsxFlowTagMarker","mdxJsxFlowTagClosingMarker","mdxJsxFlowTagSelfClosingMarker","mdxJsxFlowTagName","mdxJsxFlowTagNamePrimary","mdxJsxFlowTagNameMemberMarker","mdxJsxFlowTagNameMember","mdxJsxFlowTagNamePrefixMarker","mdxJsxFlowTagNameLocal","mdxJsxFlowTagExpressionAttribute","mdxJsxFlowTagExpressionAttributeMarker","mdxJsxFlowTagExpressionAttributeValue","mdxJsxFlowTagAttribute","mdxJsxFlowTagAttributeName","mdxJsxFlowTagAttributeNamePrimary","mdxJsxFlowTagAttributeNamePrefixMarker","mdxJsxFlowTagAttributeNameLocal","mdxJsxFlowTagAttributeInitializerMarker","mdxJsxFlowTagAttributeValueLiteral","mdxJsxFlowTagAttributeValueLiteralMarker","mdxJsxFlowTagAttributeValueLiteralValue","mdxJsxFlowTagAttributeValueExpression","mdxJsxFlowTagAttributeValueExpressionMarker","mdxJsxFlowTagAttributeValueExpressionValue")(f)}function u(f){return Pc(f)?Gg(r,d,"whitespace")(f):d(f)}function d(f){const h=l.parser.constructs.flow[123],g=Array.isArray(h)?h:h?[h]:[];let p;for(const _ of g)if(_.name==="mdxFlowExpression"){p=_;break}return f===60?a(f):f===123&&p?r.attempt(p,d,o)(f):f===null||Tr(f)?i(f):o(f)}}}s($N,"jsxFlow");function PN(e){const t=e||{},n=t.acorn;let r;if(n){if(!n.parse||!n.parseExpressionAt)throw new Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:"module"},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw new Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:$N(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:LN(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}s(PN,"mdxJsx");function FN(){return{disable:{null:["autolink","codeIndented","htmlFlow","htmlText"]}}}s(FN,"mdxMd");var fv={}.hasOwnProperty;function VN(e,t){const n=t||{};function r(i,...o){let l=r.invalid;const a=r.handlers;if(i&&fv.call(i,e)){const c=String(i[e]);l=fv.call(a,c)?a[c]:r.unknown}if(l)return l.call(this,i,...o)}return s(r,"one"),r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}s(VN,"zwitch");var BN={}.hasOwnProperty;function BE(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)BE(e,t.extensions[n]);for(r in t)if(BN.call(t,r))switch(r){case"extensions":break;case"unsafe":hv(e[r],t[r]);break;case"join":hv(e[r],t[r]);break;case"handlers":HN(e[r],t[r]);break;default:e.options[r]=t[r]}return e}s(BE,"configure");function hv(e,t){t&&e.push(...t)}s(hv,"list");function HN(e,t){t&&Object.assign(e,t)}s(HN,"map");var KN=[UN];function UN(e,t,n,r){if(t.type==="code"&&t0(t,r)&&(e.type==="list"||e.type===t.type&&t0(e,r)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Mk(t,r))?void 0:n.spread?1:0}s(UN,"joinDefaults");var to=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],WN=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
36
+ `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:to},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
37
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:to},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
38
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:to},{atBreak:!0,character:"+",after:`(?:[ \r
39
+ ])`},{atBreak:!0,character:"-",after:`(?:[ \r
40
+ -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
41
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:to},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:to},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:to},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:to},{atBreak:!0,character:"~"}];function zN(e){return e.label||!e.identifier?e.label||"":Hk(e.identifier)}s(zN,"association");function jN(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}s(jN,"compilePattern");function JN(e,t,n){const r=t.indexStack,i=e.children||[],o=[];let l=-1,a=n.before,c;r.push(-1);let u=t.createTracker(n);for(;++l<i.length;){const d=i[l];let f;if(r[r.length-1]=l,l+1<i.length){let p=t.handle.handlers[i[l+1].type];p&&p.peek&&(p=p.peek),f=p?p(i[l+1],e,t,{before:"",after:"",...u.current()}).charAt(0):""}else f=n.after;o.length>0&&(a==="\r"||a===`
42
+ `)&&d.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",u=t.createTracker(n),u.move(o.join("")));let h=t.handle(d,e,t,{...u.current(),after:f,before:a});c&&c===h.slice(0,1)&&(h=Jf(c.charCodeAt(0))+h.slice(1));const g=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,g&&(o.length>0&&g.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+Jf(a.charCodeAt(0))),g.after&&(c=f)),u.move(h),o.push(h),a=h.slice(-1)}return r.pop(),o.join("")}s(JN,"containerPhrasing");function GN(e,t,n){const r=t.indexStack,i=e.children||[],o=t.createTracker(n),l=[];let a=-1;for(r.push(-1);++a<i.length;){const c=i[a];r[r.length-1]=a,l.push(o.move(t.handle(c,e,t,{before:`
43
+ `,after:`
44
+ `,...o.current()}))),c.type!=="list"&&(t.bulletLastUsed=void 0),a<i.length-1&&l.push(o.move(qN(c,i[a+1],e,t)))}return r.pop(),l.join("")}s(GN,"containerFlow");function qN(e,t,n,r){let i=r.join.length;for(;i--;){const o=r.join[i](e,t,n,r);if(o===!0||o===1)break;if(typeof o=="number")return`
45
+ `.repeat(1+o);if(o===!1)return`
46
+
47
+ <!---->
48
+
49
+ `}return`
50
+
51
+ `}s(qN,"between");var ZN=/\r?\n|\r/g;function YN(e,t){const n=[];let r=0,i=0,o;for(;o=ZN.exec(e);)l(e.slice(r,o.index)),n.push(o[0]),r=o.index+o[0].length,i++;return l(e.slice(r)),n.join("");function l(a){n.push(t(a,i,!a))}s(l,"one")}s(YN,"indentLines");function XN(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],l={};let a=-1;for(;++a<e.unsafe.length;){const d=e.unsafe[a];if(!Ek(e.stack,d))continue;const f=e.compilePattern(d);let h;for(;h=f.exec(r);){const g="before"in d||!!d.atBreak,p="after"in d,_=h.index+(g?h[1].length:0);i.includes(_)?(l[_].before&&!g&&(l[_].before=!1),l[_].after&&!p&&(l[_].after=!1)):(i.push(_),l[_]={before:g,after:p})}}i.sort(QN);let c=n.before?n.before.length:0;const u=r.length-(n.after?n.after.length:0);for(a=-1;++a<i.length;){const d=i[a];d<c||d>=u||d+1<u&&i[a+1]===d+1&&l[d].after&&!l[d+1].before&&!l[d+1].after||i[a-1]===d-1&&l[d].before&&!l[d-1].before&&!l[d-1].after||(c!==d&&o.push(gv(r.slice(c,d),"\\")),c=d,/[!-/:-@[-`{-~]/.test(r.charAt(d))&&(!n.encode||!n.encode.includes(r.charAt(d)))?o.push("\\"):(o.push(Jf(r.charCodeAt(d))),c++))}return o.push(gv(r.slice(c,u),n.after)),o.join("")}s(XN,"safe");function QN(e,t){return e-t}s(QN,"numerical");function gv(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],o=e+t;let l=-1,a=0,c;for(;c=n.exec(o);)r.push(c.index);for(;++l<r.length;)a!==r[l]&&i.push(e.slice(a,r[l])),i.push("\\"),a=r[l];return i.push(e.slice(a)),i.join("")}s(gv,"escapeBackslashes");function e4(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:c,current:l,shift:a};function l(){return{now:{line:i,column:o},lineShift:r}}function a(u){r+=u}function c(u){const d=u||"",f=d.split(/\r?\n|\r/g),h=f[f.length-1];return i+=f.length-1,o=f.length===1?o+h.length:1+h.length+r,d}}s(e4,"track");function HE(e,t){const n=t||{},r={associationId:zN,containerPhrasing:i4,containerFlow:o4,createTracker:e4,compilePattern:jN,enter:o,handlers:{...Kk},handle:void 0,indentLines:YN,indexStack:[],join:[...KN],options:{},safe:s4,stack:[],unsafe:[...WN]};BE(r,n),r.options.tightDefinitions&&r.join.push(r4),r.handle=VN("type",{invalid:t4,unknown:n4,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
52
+ `,after:`
53
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
54
+ `),i;function o(l){return r.stack.push(l),a;function a(){r.stack.pop()}s(a,"exit")}s(o,"enter")}s(HE,"toMarkdown");function t4(e){throw new Error("Cannot handle value `"+e+"`, expected node")}s(t4,"invalid$1");function n4(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}s(n4,"unknown");function r4(e,t){if(e.type==="definition"&&e.type===t.type)return 0}s(r4,"joinDefinition");function i4(e,t){return JN(e,this,t)}s(i4,"containerPhrasingBound");function o4(e,t){return GN(e,this,t)}s(o4,"containerFlowBound");function s4(e,t){return XN(this,e,t)}s(s4,"safeBound");var l4=["mdxJsxTextElement","mdxJsxFlowElement"];function KE(e){return l4.includes(e.type)&&a4.includes(e.name)}s(KE,"isMdastHTMLNode");var a4=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","input","ins","kbd","label","legend","li","link","main","map","mark","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];function c4(e,t){const n=pv(e),r=pv(t);return u4({...n,...r})}s(c4,"mergeStyleAttributes");function pv(e){const t={};return e.split(";").filter(n=>n.trim()!=="").forEach(n=>{const[r,i]=n.split(":").map(o=>o.trim());t[r]=i}),t}s(pv,"styleToObject");function u4(e){return Object.entries(e).map(([t,n])=>`${t}: ${n}`).join("; ")}s(u4,"objectToStyle");function d4(e){return e.children instanceof Array}s(d4,"isParent$1");function UE({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let o=null;const l=new Set,a=new Map;t=[...t].sort((v,x)=>(x.priority??0)-(v.priority??0)),f(e,null);function c(v,x){l.add(v),x&&a.set(v,{...x})}s(c,"registerReferredComponent");function u(v,x){if(o===null)return o=x,o;if(!d4(v))throw new Error("Attempting to append children to a non-parent");const C=v.children,b=C.at(-1);if(b){const S=t.find(M=>{var T;return(T=M.shouldJoin)==null?void 0:T.call(M,b,x)});if(S){const M=S.join(b,x);return C.splice(C.length-1,1,M),M}}return C.push(x),x}s(u,"appendToParent");function d(v,x){v.getChildren().forEach(C=>{f(C,x)})}s(d,"visitChildren");function f(v,x,C=null){var b;const S=t.find((M,T)=>{var E;return C?.has(T)?!1:(E=M.testLexicalNode)==null?void 0:E.call(M,v)});if(!S)throw new Error(`no lexical visitor found for ${v.getType()}`,{cause:v});(b=S.visitLexicalNode)==null||b.call(S,{lexicalNode:v,mdastParent:x,actions:{addAndStepInto(M,T={},E=!0){const A={type:M,...T,...E?{children:[]}:{}};u(x,A),xe(v)&&E&&d(v,A)},appendToParent:u,visitChildren:d,visit:f,registerReferredComponent:c,nextVisitor(){f(v,x,(C??new Set).add(t.indexOf(S)))}}})}if(s(f,"visit"),o===null)throw new Error("traversal ended with no root element");const h=new Map,g=new Map;for(const v of l){const x=n.find(C=>C.name===v)??a.get(v)??n.find(C=>C.name==="*");if(!x)throw new Error(`Component ${v} is used but not imported`);if(x.source)if(x.defaultExport)g.set(v,x.source);else{const{source:C}=x,b=h.get(C);b?b.push(v):h.set(C,[v])}}if(!i){for(const[v,x]of h.entries()){const C=x.filter(b=>a.has(b));C.length>0?h.set(v,C):h.delete(v)}for(const v of g.keys())a.has(v)||g.delete(v)}const p=Array.from(h).map(([v,x])=>({type:"mdxjsEsm",value:`import { ${x.join(", ")} } from '${v}'`}));p.push(...Array.from(g).map(([v,x])=>({type:"mdxjsEsm",value:`import ${v} from '${x}'`})));const _=o,y=_.children.find(v=>v.type==="yaml");return y?_.children.splice(_.children.indexOf(y)+1,0,...p):_.children.unshift(...p),Ic(_,[]),WE(_),r||zE(_),_}s(UE,"exportLexicalTreeToMdast");function WE(e){if("children"in e&&e.children.length>0){if(KE(e)&&e.children.length===1){const t=e.children[0];t.type==="mdxJsxTextElement"&&t.name==="span"&&(t.attributes.forEach(n=>{if(n.type==="mdxJsxAttribute"){const r=e.attributes.find(i=>i.type==="mdxJsxAttribute"&&i.name===n.name);if(r)if(n.name==="className"){const i=new Set([...r.value.split(" "),...n.value.split(" ")]);r.value=Array.from(i).join(" ")}else n.name==="style"&&(r.value=c4(r.value,n.value));else e.attributes.push(n)}}),e.children=t.children)}e.children.forEach(t=>{WE(t)})}}s(WE,"collapseNestedHtmlTags");function zE(e){if(Object.hasOwn(e,"children")){const t=e,n=[];t.children.forEach(r=>{r.type==="mdxJsxTextElement"&&r.name==="u"?n.push({type:"html",value:"<u>"},...r.children,{type:"html",value:"</u>"}):(n.push(r),zE(r))}),t.children=n}}s(zE,"convertUnderlineJsxToHtml");var mv=/\s+$/,_v=/^\s+/;function Ic(e,t){if(e.type==="strong"||e.type==="emphasis"){const n=e.children.at(-1);if(n?.type==="text"){const i=mv.exec(n.value);if(i){n.value=n.value.replace(mv,"");const o=t.at(-1);o&&(o.children.splice(o.children.indexOf(e)+1,0,{type:"text",value:i[0]}),Ic(o,t.slice(0,-1)))}}const r=e.children.at(0);if(r?.type==="text"){const i=_v.exec(r.value);if(i){r.value=r.value.replace(_v,"");const o=t.at(-1);o&&(o.children.splice(o.children.indexOf(e),0,{type:"text",value:i[0]}),Ic(o,t.slice(0,-1)))}}}if("children"in e&&e.children.length>0){const n=e;n.children.forEach(r=>{Ic(r,[...t,n])})}}s(Ic,"fixWrappingWhitespace");function jE({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:o}){return HE(UE({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:o}),{extensions:n,...t})+`
55
+ `}s(jE,"exportMarkdownFromLexical");var so=class extends Error{static{s(this,"JsxKindMismatchError")}constructor(e,t,n,r){const i=e.name??"Fragment",o=e.type==="mdxJsxFlowElement"?"flow":"text",l=r?` ${r}`:"";super(`JSX component "${i}" was parsed as ${o} but is declared as ${t.kind} (kindMismatchPolicy: "${n}").${l}`),this.name="JsxKindMismatchError"}},f4=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell","footnote","mdxJsxTextElement","textDirective","leafDirective"]),h4=new Set(["root","blockquote","listItem","footnoteDefinition","mdxJsxFlowElement","containerDirective"]);function Nc(e){return e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement"}s(Nc,"isJsxNode");function JE(e,t){return t.find(n=>n.name===e.name)??t.find(n=>n.name==="*")}s(JE,"findDescriptor");function Oc(e,t){return(e.type==="mdxJsxFlowElement"?"flow":"text")!==t.kind}s(Oc,"isMismatch");function GE(e,t,n){if(Nc(e)){const r=JE(e,t);if(r&&n(e)&&Oc(e,r))throw new so(e,r,"error")}"children"in e&&e.children.forEach(r=>{GE(r,t,n)})}s(GE,"assertNoMismatches");function g4(e,t,n){const r=s(f=>n(f)?JE(f,t):void 0,"findOwnedDescriptor");function i(f){const h=f4.has(f.type)?"phrasing":h4.has(f.type)?"flow":"structural";return h==="phrasing"?f.children=f.children.flatMap(g=>a(g,f.type)):h==="flow"?f.children=f.children.flatMap(g=>u(g)):f.children=f.children.map(g=>l(g,f.type)),f}s(i,"normalizeParent");function o(f){return"children"in f&&i(f),f}s(o,"normalizeDescendants");function l(f,h){if(Nc(f)){const g=r(f);if(g&&Oc(f,g))throw new so(f,g,"normalize",`The ${h} parent does not declare whether its children are flow or phrasing content.`)}return o(f)}s(l,"normalizeStructuralChild");function a(f,h){if(!Nc(f))return[o(f)];const g=r(f);if(!g||!Oc(f,g))return[o(f)];if(f.type==="mdxJsxTextElement")throw new so(f,g,"normalize",`It cannot be lifted from ${h} without changing surrounding phrasing content.`);return[o(d(f,g))]}s(a,"normalizePhrasingChild");function c(f){const h=f.children.find(p=>{if(p.type!=="mdxJsxTextElement")return!1;const _=r(p);return _?.kind==="flow"});if(!h)return[i(f)];const g=r(h);if(f.children.length!==1)throw new so(h,g,"normalize","It has surrounding phrasing content, and normalization would need to split the paragraph.");return[o({...h,type:"mdxJsxFlowElement",children:h.children.length===0?[]:[{type:"paragraph",children:h.children}]})]}s(c,"normalizeParagraph");function u(f){if(f.type==="paragraph")return c(f);if(!Nc(f))return[o(f)];const h=r(f);if(!h||!Oc(f,h))return[o(f)];if(f.type==="mdxJsxTextElement")throw new so(f,h,"normalize","A text JSX node can be normalized to flow only when it is the sole child of a paragraph.");return[{type:"paragraph",children:[o(d(f,h))]}]}s(u,"normalizeFlowChild");function d(f,h){if(f.children.length===0)return{...f,type:"mdxJsxTextElement",children:[]};if(f.children.length!==1||f.children[0].type!=="paragraph")throw new so(f,h,"normalize","Its block children cannot be represented as one phrasing-content sequence without data loss.");return{...f,type:"mdxJsxTextElement",children:f.children[0].children}}return s(d,"convertFlowToText"),i(e)}s(g4,"normalizeTree");function p4(e,t,n,r=()=>!0){return n==="source"?e:n==="error"?(GE(e,t,r),e):g4(structuredClone(e),t,r)}s(p4,"reconcileJsxKindMismatches");function el(e){return e.children instanceof Array}s(el,"isParent");var Gh=class extends Error{static{s(this,"MarkdownParseError")}constructor(e,t){super(e),this.name="MarkdownParseError",this.cause=t}},qh=class extends Error{static{s(this,"UnrecognizedMarkdownConstructError")}constructor(e){super(e),this.name="UnrecognizedMarkdownConstructError"}};function m4(e){const t=new Map;return e.type!=="root"?{importDeclarations:{}}:(e.children.filter(n=>n.type==="mdxjsEsm").filter(n=>n.value.startsWith("import ")).forEach(n=>{var r,i;(((i=(r=n.data)==null?void 0:r.estree)==null?void 0:i.body)??[]).forEach(o=>{o.type==="ImportDeclaration"&&o.specifiers.forEach(l=>{t.set(l.local.name,{source:`${o.source.value}`,defaultExport:l.type==="ImportDefaultSpecifier"})})})}),{importDeclarations:Object.fromEntries(t.entries())})}s(m4,"gatherMetadata");function _4({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...o}){var l;let a;try{a=Lk(t,{extensions:r,mdastExtensions:i})}catch(c){throw c instanceof Error?new Gh(`Error parsing markdown: ${c.message}`,c):new Gh(`Error parsing markdown: ${c}`,c)}a.children.length===0&&a.children.push({type:"paragraph",children:[]}),((l=a.children.at(-1))==null?void 0:l.type)!=="paragraph"&&a.children.push({type:"paragraph",children:[]}),qE({root:e,mdastRoot:a,visitors:n,...o})}s(_4,"importMarkdownToLexical");function qE({root:e,mdastRoot:t,visitors:n,...r}){n=n.sort((d,f)=>(f.priority??0)-(d.priority??0));function i(d,f=null){return n.find((h,g)=>f?.has(g)?!1:typeof h.testNode=="string"?h.testNode===d.type:h.testNode(d,r))}s(i,"findVisitor"),t=p4(t,r.jsxComponentDescriptors,r.jsxKindMismatchPolicy??"source",d=>{var f;return((f=i(d))==null?void 0:f.jsxKindReconciliationOwner)===!0});const o=new WeakMap,l=new WeakMap,a=m4(t);function c(d,f){if(!el(d))throw new Error("Attempting to visit children of a non-parent");d.children.forEach(h=>{u(h,f,d)})}s(c,"visitChildren");function u(d,f,h,g=null){const p=i(d,g);if(!p)try{throw new qh(`Unsupported markdown syntax: ${HE(d)}`)}catch{throw new qh(`Parsing of the following markdown structure failed: ${JSON.stringify({type:d.type,name:"name"in d?d.name:"N/A"})}`)}p.visitNode({mdastNode:d,lexicalParent:f,mdastParent:h,descriptors:r,metaData:a,actions:{visitChildren:c,nextVisitor(){u(d,f,h,(g??new Set).add(n.indexOf(p)))},addAndStepInto(_){f.append(_),el(d)&&c(d,_)},addFormatting(_,y){y||el(d)&&(y=d),y&&o.set(y,_|(o.get(h)??0))},removeFormatting(_,y){y||el(d)&&(y=d),y&&o.set(y,_^(o.get(h)??0))},getParentFormatting(){return o.get(h)??0},addStyle(_,y){y||el(d)&&(y=d),y&&l.set(y,_)},getParentStyle(){return l.get(h)??""}}})}s(u,"visit"),u(t,e,null)}s(qE,"importMdastTreeToLexical");function go(){}s(go,"noop$1");var v4=Object.defineProperty,y4=s((e,t,n)=>t in e?v4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$3"),Ef=s((e,t,n)=>y4(e,typeof t!="symbol"?t+"":t,n),"__publicField$3"),vv="generic-html",ym=class ZE extends Lr{static{s(this,"GenericHTMLNode")}constructor(t,n,r,i){super(i),Ef(this,"__tag"),Ef(this,"__nodeType"),Ef(this,"__attributes"),this.__tag=t,this.__nodeType=n,this.__attributes=r}static getType(){return vv}static clone(t){return new ZE(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(t){const n=this.getWritable();n.__attributes=t}getStyle(){var t;return(t=this.__attributes.find(n=>n.name==="style"))==null?void 0:t.value}createDOM(){const t=this.__tag,n=document.createElement(t);return this.__attributes.forEach(r=>{n.setAttribute(r.name,r.value)}),n}updateDOM(){return!1}static importDOM(){return{}}exportDOM(t){const{element:n}=super.exportDOM(t);return{element:n}}static importJSON(t){const n=YE(t.tag,t.mdxType,t.attributes);return n.setFormat(t.format),n.setIndent(t.indent),n.setDirection(t.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:vv,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType==="mdxJsxTextElement"}};function YE(e,t,n){return ci(new ym(e,t,n))}s(YE,"$createGenericHTMLNode");function x4(e){return e instanceof ym}s(x4,"$isGenericHTMLNode");var C4={testLexicalNode:x4,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto("mdxJsxTextElement",{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},b4={testLexicalNode:Dr,visitLexicalNode:s(({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:"text",value:`
56
+ `})},"visitLexicalNode")},E4={testLexicalNode:wa,visitLexicalNode:s(({actions:e})=>{e.addAndStepInto("paragraph")},"visitLexicalNode")},S4={testLexicalNode:ka,visitLexicalNode:s(({actions:e})=>{e.addAndStepInto("root")},"visitLexicalNode")};function yv(e){return e.type==="text"}s(yv,"isMdastText");var T4=["u","span","sub","sup"],w4={shouldJoin:s((e,t)=>{if(["text","emphasis","strong","highlight"].includes(e.type))return e.type===t.type;if(e.type==="mdxJsxTextElement"&&t.type==="mdxJsxTextElement"&&T4.includes(t.name)){const n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},"shouldJoin"),join(e,t){return yv(e)&&yv(t)?{type:"text",value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:Ie,visitLexicalNode:s(({lexicalNode:e,mdastParent:t,actions:n})=>{const r=e.getPreviousSibling(),i=Ie(r)?r.getFormat():0,o=e.getTextContent(),l=e.getFormat(),a=e.getStyle();let c=t;if(a&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"span",children:[],attributes:[{type:"mdxJsxAttribute",name:"style",value:a}]})),i&l&8&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),i&l&64&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),i&l&32&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),i&l&2&&(c=n.appendToParent(c,{type:"emphasis",children:[]})),i&l&1&&(c=n.appendToParent(c,{type:"strong",children:[]})),i&l&4&&(c=n.appendToParent(c,{type:"delete",children:[]})),i&l&128&&(c=n.appendToParent(c,{type:"highlight",children:[]})),l&8&&!(i&8)&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"u",children:[],attributes:[]})),l&64&&!(i&64)&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"sup",children:[],attributes:[]})),l&32&&!(i&32)&&(c=n.appendToParent(c,{type:"mdxJsxTextElement",name:"sub",children:[],attributes:[]})),l&2&&!(i&2)&&(c=n.appendToParent(c,{type:"emphasis",children:[]})),l&1&&!(i&1)&&(c=n.appendToParent(c,{type:"strong",children:[]})),l&4&&!(i&4)&&(c=n.appendToParent(c,{type:"delete",children:[]})),l&128&&!(i&128)&&(c=n.appendToParent(c,{type:"highlight",children:[]})),l&16){n.appendToParent(c,{type:"inlineCode",value:o});return}n.appendToParent(c,{type:"text",value:o})},"visitLexicalNode")},k4={testNode:"break",visitNode:s(function({lexicalParent:e}){e.append(Or())},"visitNode")};function nc(e,t){return[{testNode:s(n=>n.type==="mdxJsxTextElement"&&n.name===e,"testNode"),visitNode({actions:n,mdastNode:r,lexicalParent:i}){n.addFormatting(t),n.visitChildren(r,i)}},{testNode:s(n=>n.type==="html"&&n.value===`<${e}>`,"testNode"),visitNode({actions:n,mdastParent:r}){n.addFormatting(t,r)}},{testNode:s(n=>n.type==="html"&&n.value===`</${e}>`,"testNode"),visitNode({actions:n,mdastParent:r}){n.removeFormatting(t,r)}}]}s(nc,"buildFormattingVisitors");var M4={testNode:"delete",visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},A4={testNode:"highlight",visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},I4={testNode:"inlineCode",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(pr(e.value).setFormat(t.getParentFormatting()|16))}},N4=[{testNode:"emphasis",visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:"strong",visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...nc("u",8),...nc("code",16),I4,M4,A4,...nc("sup",64),...nc("sub",32)],O4={testNode:KE,visitNode:s(function({mdastNode:e,actions:t,lexicalParent:n}){e.name==="span"&&e.attributes.length===1&&e.attributes[0].type==="mdxJsxAttribute"&&e.attributes[0].name==="style"?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(YE(e.name,e.type,e.attributes))},"visitNode"),priority:-100},D4=["listitem","admonition"],R4={testNode:"paragraph",visitNode:s(function({mdastNode:e,mdastParent:t,lexicalParent:n,actions:r}){const i=n.getType();if(D4.includes(i)){const o=t?.children.indexOf(e)??-1,l=o>0?t?.children.at(o-1):void 0;i==="listitem"&&l?.type==="paragraph"&&n.append(Or(),Or()),r.visitChildren(e,n)}else r.addAndStepInto(Xe())},"visitNode")},L4={testNode:"root",visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},$4={testNode:"text",visitNode({mdastNode:e,actions:t}){const n=pr(e.value);n.setFormat(t.getParentFormatting());const r=t.getParentStyle();r!==""&&n.setStyle(r),t.addAndStepInto(n)}},ir={dash:45,eof:null,exclamationMark:33,greaterThan:62},no={data:"data",lineEnding:"lineEnding",linePrefix:"linePrefix"};function P4(e){return{canContainEols:["comment"],enter:{comment(t){this.buffer()}},exit:{comment(t){this.resume()}}}}s(P4,"commentFromMarkdown");var xv=s((e,t,n)=>{return r;function r(p){return e.enter("comment"),e.consume(p),i}function i(p){return p===ir.exclamationMark?(e.consume(p),o):n(p)}function o(p){return p===ir.dash?(e.consume(p),l):n(p)}function l(p){return p===ir.dash?(e.consume(p),a):n(p)}function a(p){return p===ir.greaterThan?n(p):Tr(p)?d(p):(e.enter(no.data),p===ir.dash?(e.consume(p),c):u(p))}function c(p){return p===ir.greaterThan?n(p):u(p)}function u(p){return p===ir.eof?n(p):p===ir.dash?(e.consume(p),h):Tr(p)?(e.exit(no.data),d(p)):(e.consume(p),u)}function d(p){return e.enter(no.lineEnding),e.consume(p),e.exit(no.lineEnding),Gg(e,f,no.linePrefix)}function f(p){return Tr(p)?d(p):(e.enter(no.data),u(p))}function h(p){return p===ir.dash?(e.consume(p),g):u(p)}function g(p){return p===ir.greaterThan?(e.exit(no.data),e.enter("commentEnd"),e.consume(p),e.exit("commentEnd"),e.exit("comment"),t(p)):p===ir.dash?(e.consume(p),g):u(p)}},"tokenize"),F4={flow:{60:{tokenize:xv,concrete:!0}},text:{60:{tokenize:xv}}},V4="_bold_6j9u9_10",B4="_italic_6j9u9_14",H4="_underline_6j9u9_18",K4="_strikethrough_6j9u9_34",U4="_underlineStrikethrough_6j9u9_38",W4="_subscript_6j9u9_42",z4="_superscript_6j9u9_47",j4="_code_6j9u9_52",J4="_quote_6j9u9_59",G4="_nestedListItem_6j9u9_66",q4="_listitem_6j9u9_76",Z4="_listItemChecked_6j9u9_80",Y4="_listItemUnchecked_6j9u9_81",X4="_admonitionDanger_6j9u9_158",Q4="_admonitionInfo_6j9u9_159",eO="_admonitionNote_6j9u9_160",tO="_admonitionTip_6j9u9_161",nO="_admonitionCaution_6j9u9_162",rO="_mdxExpression_6j9u9_195",Pt={bold:V4,italic:B4,underline:H4,strikethrough:K4,underlineStrikethrough:U4,subscript:W4,superscript:z4,code:j4,quote:J4,nestedListItem:G4,listitem:q4,listItemChecked:Z4,listItemUnchecked:Y4,admonitionDanger:X4,admonitionInfo:Q4,admonitionNote:eO,admonitionTip:tO,admonitionCaution:nO,mdxExpression:rO},XE={quote:Pt.quote,text:{bold:Pt.bold,italic:Pt.italic,underline:Pt.underline,code:Pt.code,strikethrough:Pt.strikethrough,subscript:Pt.subscript,superscript:Pt.superscript,underlineStrikethrough:Pt.underlineStrikethrough},list:{listitem:Pt.listitem,listitemChecked:Pt.listItemChecked,listitemUnchecked:Pt.listItemUnchecked,nested:{listitem:Pt.nestedListItem}},admonition:{danger:Pt.admonitionDanger,info:Pt.admonitionInfo,note:Pt.admonitionNote,tip:Pt.admonitionTip,caution:Pt.admonitionCaution}},QE=(0,m.createContext)(null);function fn(){const e=(0,m.useContext)(QE);return e??(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",t);for(const o of n)i.append("v",o);throw r.search=i.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}s(fn,"o$6");function iO(){return Lt().getTextContent()}s(iO,"s$6");function oO(e,t=!0){if(e)return!1;let n=iO();return t&&(n=n.trim()),n===""}s(oO,"f$3");function sO(e){if(!oO(e,!1))return!1;const t=Lt().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const i=t[r];if(Un(i))return!1;if(xe(i)){if(!wa(i)||i.__indent!==0)return!1;const o=i.getChildren(),l=o.length;for(let a=0;a<l;a++){const c=o[r];if(!Ie(c))return!1}}}return!0}s(sO,"c$4");function eS(e){return()=>sO(e)}s(eS,"g");var tS=_d?m.useLayoutEffect:m.useEffect;function lO({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:o,ariaExpanded:l,ariaInvalid:a,ariaLabel:c,ariaLabelledBy:u,ariaMultiline:d,ariaOwns:f,ariaRequired:h,autoCapitalize:g,className:p,id:_,role:y="textbox",spellCheck:v=!0,style:x,tabIndex:C,"data-testid":b,...S},M){const[T,E]=(0,m.useState)(e.isEditable()),A=(0,m.useCallback)(L=>{L&&L.ownerDocument&&L.ownerDocument.defaultView?e.setRootElement(L):e.setRootElement(null)},[e]),D=(0,m.useMemo)(()=>(function(...L){return G=>{for(const $ of L)typeof $=="function"?$(G):$!=null&&($.current=G)}})(M,A),[A,M]);return tS(()=>(E(e.isEditable()),e.registerEditableListener(L=>{E(L)})),[e]),(0,ee.jsx)("div",{"aria-activedescendant":T?t:void 0,"aria-autocomplete":T?n:"none","aria-controls":T?r:void 0,"aria-describedby":i,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":T&&y==="combobox"?!!l:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":c,"aria-labelledby":u,"aria-multiline":d,"aria-owns":T?f:void 0,"aria-readonly":!T||void 0,"aria-required":h,autoCapitalize:g,className:p,contentEditable:T,"data-testid":b,id:_,ref:D,role:y,spellCheck:v,style:x,tabIndex:C??(T?void 0:-1),...S})}s(lO,"b$1");var aO=(0,m.forwardRef)(lO);function Cv(e){return e.read("latest",eS(e.isComposing()))}s(Cv,"x$3");var xm=(0,m.forwardRef)(cO);function cO(e,t){const{placeholder:n,...r}=e,[i]=fn();return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(aO,{editor:i,...r,ref:t}),n!=null&&(0,ee.jsx)(uO,{editor:i,content:n})]})}s(cO,"E");function uO({content:e,editor:t}){const n=(function(l){const[a,c]=(0,m.useState)(()=>Cv(l));return tS(()=>{function u(){const d=Cv(l);c(d)}return s(u,"t"),u(),At(l.registerUpdateListener(()=>{u()}),l.registerEditableListener(()=>{u()}))},[l]),a})(t),[r,i]=(0,m.useState)(t.isEditable());if((0,m.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(l=>{i(l)})),[t]),!n)return null;let o=null;return typeof e=="function"?o=e(r):e!==null&&(o=e),o===null?null:(0,ee.jsx)("div",{"aria-hidden":!0,children:o})}s(uO,"y$1");var dO=class extends m.Component{static{s(this,"t$3")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:new Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function Cm({children:e,fallback:t,onError:n}){return(0,ee.jsx)(dO,{fallback:t===void 0?(0,ee.jsx)("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}):t,onError:n,children:e})}s(Cm,"e$2");var Cu=Fr({name:"@lexical/react/ReactProvider"});function fO(e,t){const[n]=t,r=e.decorators.map(i=>typeof i=="function"?(0,ee.jsx)(i,{context:t}):i);return function(i){const{EditorChildrenComponent:o=e.EditorChildrenComponent,ErrorBoundary:l=e.ErrorBoundary,contentEditable:a=e.contentEditable,children:c}=i,u=(function(f,h){const[g,p]=(0,m.useMemo)(()=>[y=>f.registerDecoratorListener(y),()=>f.getDecorators()],[f]),_=(0,m.useSyncExternalStore)(g,p,p);return(0,m.useMemo)(()=>{const y=[];for(const v in _){const x=f.getElementByKey(v);if(x!==null){const C=(0,ee.jsx)(h,{onError:s(b=>{f._onError(b)},"onError"),children:(0,ee.jsx)(m.Suspense,{fallback:null,children:_[v]})});y.push((0,Bc.createPortal)(C,x,v))}}return y},[h,_,f])})(n,l),d=(0,m.useMemo)(()=>r.map((f,h)=>(0,ee.jsx)(l,{onError:s(g=>{n._onError(g)},"onError"),children:(0,ee.jsx)(m.Suspense,{fallback:null,children:f})},h)),[l]);return(0,ee.jsx)(QE.Provider,{value:t,children:(0,ee.jsxs)(o,{context:t,contentEditable:a,children:[c,d,u]})})}}s(fO,"p$2");function hO({contentEditable:e,children:t}){return(0,ee.jsxs)(ee.Fragment,{children:[e,t]})}s(hO,"h");var nS=Fr({build(e,t,n){n.getPeer(Cu.name)||(function(i,...o){const l=new URL("https://lexical.dev/docs/error"),a=new URLSearchParams;a.append("code",i);for(const c of o)a.append("v",c);throw l.search=a.toString(),Error(`Minified Lexical error #${i}; visit ${l.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(321,[...n.getDirectDependentNames()].join(" "));const r=[e,{getTheme:s(()=>e._config.theme,"getTheme")}];return{Component:fO(t,r),context:r}},config:{EditorChildrenComponent:hO,ErrorBoundary:Cm,contentEditable:(0,ee.jsx)(xm,{}),decorators:[]},mergeConfig(e,t){const n=Ed(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:"@lexical/react/React",peerDependencies:[E7(Cu.name)]}),gO=new WeakSet,pO=new WeakMap,mO=new Set([xb,$s,vb,bb,cm]),ro=new WeakMap;function _O(e){return ts(ds,{createInitialHistoryState:s(()=>e,"createInitialHistoryState"),disabled:!1})}s(_O,"externalHistoryExtension");function rS({name:e,namespace:t,nodes:n,theme:r,editable:i=!0,parentEditor:o,historyMode:l,historyState:a,initialEditorState:c,onError:u=s(d=>{throw d},"onError")}){const d=[Cu,ts(nS,{contentEditable:null}),ts(Gb,{setOptions:{tag:ho},updateOptions:{tag:ho}})];if(o&&d.push(ts(aI,{$getParentEditor:s(()=>o,"$getParentEditor"),inheritEditableFromParent:!0})),l==="nested-shared")d.push(pI);else if(l==="root-shared"||l==="nested-external"){if(!a)throw new Error(`${l} requires a historyState`);d.push(_O(a))}else l==="table-local"&&d.push(ts(ds,{disabled:!1}));const f=Fr({name:e,namespace:t,nodes:n?.filter(b=>!mO.has(b)),theme:r,editable:i,$initialEditorState:c,onError:u,dependencies:d}),h=rI(f),g=qi(h,ds.name),p=g?.output.historyState.value;p&&pO.set(h,p),p&&(ro.has(p)||ro.set(p,p.current));const _=p?h.registerUpdateListener(({dirtyElements:b,dirtyLeaves:S,tags:M})=>{const T=p.current;if(M.has(ho)){ro.set(p,T);return}if(b.size>0||S.size>0){ro.set(p,T);return}const E=ro.get(p);T?.editor===h&&E&&E.editor!==h&&(p.undoStack.push({...E}),p.redoStack=[],h.dispatchCommand(es,!0),h.dispatchCommand(Qo,!1)),ro.set(p,T)}):()=>{},y=new Set,v=p?h.registerCommand(sm,()=>{const b=setTimeout(()=>{y.delete(b),h.dispatchCommand(es,p.undoStack.length>0),h.dispatchCommand(Qo,p.redoStack.length>0)});return y.add(b),!1},st):()=>{},x=h.dispose.bind(h);let C=!1;return h.dispose=()=>{C||(C=!0,y.forEach(clearTimeout),y.clear(),v(),_(),x())},l==="root-shared"&&gO.add(h),h}s(rS,"createExtensionEditor");var Xl=br("NESTED_EDITOR_UPDATED_COMMAND"),fi=he(null),gt=he(null),Zh=he(""),Yh=he(!0),_r=he(!1,e=>{e.sub(e.pipe(_r,mt(fi)),([t,n])=>{n?.setEditable(!t)})}),Xh=he(""),bv=he(!1),Ql=he(!1),vO=he(0),bu=he(null),Qh=wt(e=>{e.link(e.pipe(bu,ed(t=>t!==null)),Qh)}),yO=wt(e=>{e.sub(e.pipe(yO,mt(gt)),([t,n])=>{n?.dispatchCommand(cb,t)})}),bs=he(null,e=>{e.sub(e.pipe(bs,mt(gt)),([t,n])=>{if(!t||!n)return;const r=t.anchor.getNode();let i=r.getKey()==="root"?r:dt(r,l=>{const a=l.getParent();return a!==null&&xn(a)});i??(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null){const l=Md(i)?i.getTag():i.getType();e.pub(SO,l)}})}),iS=he(""),To=he(""),Eu=he(!1),Ad=wt(e=>{e.link(To,Ad),e.sub(iS,t=>{e.pubIn({[Eu]:!0,[To]:t})})}),eg=wt(e=>{e.link(e.pipe(Ad,mt(tg),ed(([,t])=>!t),$i(([t])=>t)),eg)},!0),bm=he([]),Em=he([]),oS=he([]),sS=he([]),Id=he([]),Sm=he([]),Su=he({}),Tm=he(!1),Nd=he([]),xO=he("source"),lS=he([]),La=he([]),Es=he(""),Po=he(null),CO=he(null),aS=he(null),hi=rn(Em),$r=rn(bm),Tu=rn(oS),wu=rn(sS),gi=rn(Id),wm=rn(Sm),tg=he(!1),km=wt(e=>{e.sub(e.pipe(km,mt(To,fi,Ql),ed(([t,n])=>t.trim()!==n.trim())),([t,,n,r])=>{e.pub(tg,!0),n?.update(()=>{Lt().clear(),Mm(e,Lt(),t),r?n.focus():Xn(null)},{onUpdate:s(()=>{e.pub(tg,!1)},"onUpdate")})})}),cS=wt(e=>{e.sub(e.pipe(cS,mt(gt,Ql)),([t,n,r])=>{n?.update(()=>{const i=re();if(i!==null){const o={children:[],append(l){this.children.push(l)},getType(){return i.getNodes()[0].getType()}};Mm(e,o,t),Ls(o.children)}r?n.focus():Xn(null)})})});function uS(){return hC((e,[t,n])=>(e.forEach(r=>{if(!r)throw new Error("You have a subscription that does not return a teardown");r()}),n?t.map(r=>r(n)):[]),[])}s(uS,"rebind");var dS=he(null),fS=he([],e=>{e.pipe(e.combine(fS,gt),uS())}),hS=he([],e=>{e.pipe(e.combine(hS,fi),uS())}),gS=he(null,go,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),ng=wt(),pi=he(e=>{throw new Error(`No icon component for ${e}`)});function rn(e,t){return wt((n,r)=>{n.changeWith(e,r,(i,o)=>{Array.isArray(o)||(o=[o]);let l=i;for(const a of o)i.includes(a)||(l=[...l,a]);return l}),t?.(n,r)})}s(rn,"Appender");function pS(e){const t=re();ie(t)&&e.pubIn({[bs]:t,[vO]:t.format})}s(pS,"handleSelectionChange");var Od=rn(hS,(e,t)=>{e.pub(t,[n=>n.registerCommand(um,(r,i)=>(e.pubIn({[gt]:i,[Ql]:!0}),i._parentEditor===null&&i.getEditorState().read(()=>{e.pub(gS,{rootNode:Lt(),editorType:"lexical",editorRef:i})}),pS(e),!1),Rr),n=>n.registerUpdateListener(({dirtyElements:r,dirtyLeaves:i,editorState:o})=>{if(e.getValue(bu)!==null||r.size===0&&i.size===0)return;let l;o.read(()=>{Lt().getLastChild()instanceof Ma&&n.update(()=>{Lt().append(Xe())},{discrete:!0}),l=jE({root:Lt(),visitors:e.getValue(Id),jsxComponentDescriptors:e.getValue(Nd),toMarkdownExtensions:e.getValue(Sm),toMarkdownOptions:e.getValue(Su),jsxIsAvailable:e.getValue(Tm)})}),e.pub(To,l.trim()),e.pub(Eu,!1)}),n=>n.registerCommand(sm,()=>(e.pub(Ql,!0),!1),Rr)])}),ea=rn(fS,(e,t)=>{e.pub(t,[n=>n.registerUpdateListener(({editorState:r})=>{r.read(()=>{pS(e)})}),n=>n.registerCommand(rb,r=>{var i;const o=e.getValue(fi);return o&&((i=o.getRootElement())!=null&&i.contains(r.relatedTarget)||e.pubIn({[Ql]:!1,[ng]:r})),!1},Rr)])});function Mm(e,t,n){try{_4({root:t,visitors:e.getValue(bm),mdastExtensions:e.getValue(sS),markdown:n,syntaxExtensions:e.getValue(oS),jsxComponentDescriptors:e.getValue(Nd),jsxKindMismatchPolicy:e.getValue(xO),directiveDescriptors:e.getValue(lS),codeBlockEditorDescriptors:e.getValue(La),defaultCodeBlockLanguage:e.getValue(Es)}),e.pub(bu,null)}catch(r){if(r instanceof Gh||r instanceof qh||r instanceof so)e.pubIn({[To]:n,[bu]:{error:r.message,source:n}});else throw r}}s(Mm,"tryImportingMarkdown");var mS=he([]),Bs=rn(mS),_S=he([]),Cz=rn(_S),vS=he([]),bz=rn(vS),yS=he([]),Ez=rn(yS),bO=he([]),Am=rn(bO),xS=he([]),CS=rn(xS),EO=he(!1,e=>{e.link(e.pipe(gt,$i(t=>{var n,r;return["td","th"].includes(((r=(n=t?.getRootElement())==null?void 0:n.parentNode)==null?void 0:r.nodeName.toLowerCase())??"")})),EO)}),Ev=he(gm()),SO=he(""),Sz=wt(),rg=wt(e=>{e.sub(e.pipe(rg,mt(gt)),([t,n])=>{n?.update(()=>{const r=re();ie(r)&&(K7(r,t),setTimeout(()=>{n.focus()}))})})}),Im=wt(e=>{e.sub(e.pipe(Im,mt(gt)),([t,n])=>{n?.focus(()=>{n.getEditorState().read(()=>{const r=re();ie(r)&&(n.update(()=>{const i=t();i.isInline()?(Ls([i]),xn(i.getParentOrThrow())&&dm(i,Xe).selectEnd()):Vb(i),setTimeout(()=>{"select"in i&&typeof i.select=="function"&&i.select()})}),setTimeout(()=>{n.dispatchCommand(Xl,void 0)}))})},{defaultSelection:"rootEnd"})})}),ta=he("rich-text",e=>{function t(){return hC((n,r)=>({current:n.next,next:r}),{current:"rich-text",next:"rich-text"})}s(t,"currentNextViewMode"),e.sub(e.pipe(ta,t(),mt(na)),([{current:n},r])=>{(n==="source"||n==="diff")&&e.pub(km,r)}),e.sub(e.pipe(ta,t(),ed(n=>n.current==="rich-text"),mt(gt)),([,n])=>{n?.dispatchCommand(Xl,void 0)})}),na=he("",e=>{e.link(To,na),e.link(na,Ad)},!0),bS=he([]),Hs=rn(bS),ES=he(()=>{throw new Error("No translation function provided")}),Sv=he(XE),TO=En({init(e,t){const n=t?.initialMarkdown??"";e.register(Od),e.register(ea),e.register(Ad),e.register(na),e.pubIn({[iS]:t?.trim?n.trim():n,[pi]:t?.iconComponentFor,[$r]:[L4,R4,$4,k4,...N4],[hi]:[cm,$s,ym],[gi]:[S4,E4,w4,b4,C4],[Zh]:t?.contentEditableClassName,[Yh]:t?.spellCheck,[Su]:t?.toMarkdownOptions,[bv]:t?.autoFocus,[Xh]:t?.placeholder,[_r]:t?.readOnly,[ES]:t?.translation,[Ev]:gm(),[wu]:[Sk(),k6],[Tu]:[Uk(),xN()],[wm]:[q6(),wk(),I6],[Sv]:t?.lexicalTheme??XE}),e.singletonSub(Qh,t?.onError),e.singletonSub(eg,r=>{t?.onChange(r,e.getValue(Eu))}),e.singletonSub(ng,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[wu]:[G6(),P4()],[Tu]:[PN(),FN(),F4],[$r]:O4})},postInit(e,t){const n=rS({name:"@mdxeditor/root",editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??"MDXEditor",nodes:[...e.getValue(Em),...t?.additionalLexicalNodes??[]],theme:e.getValue(Sv),historyMode:t?.suppressSharedHistory?"none":"root-shared",historyState:e.getValue(Ev),initialEditorState:t?.editorState===null?null:()=>{const i=t?.initialMarkdown.trim()??"";Mm(e,Lt(),i)}});s0(e,()=>{n.dispose()});const r=t?.autoFocus;if(t?.editorState!==null&&r){const i=setTimeout(()=>{n.focus(go,{defaultSelection:r===!0?"rootStart":r.defaultSelection??"rootStart"})});s0(e,()=>{clearTimeout(i)})}e.pub(fi,n),e.pub(gt,n)},update(e,t){e.pubIn({[Zh]:t?.contentEditableClassName,[Yh]:t?.spellCheck,[Su]:t?.toMarkdownOptions,[bv]:t?.autoFocus,[Xh]:t?.placeholder,[_r]:t?.readOnly}),e.singletonSub(eg,n=>{t?.onChange(n,e.getValue(Eu))}),e.singletonSub(ng,t?.onBlur),e.singletonSub(Qh,t?.onError)}});function mi(){return ni(ES)}s(mi,"useTranslation");function SS({initialEditor:e,children:t}){const{Component:n}=oI(e,nS).output;return(0,ee.jsx)(n,{children:t})}s(SS,"r");var wO=_d?m.useLayoutEffect:m.useEffect;function kO(e){return{initialValueFn:s(()=>e.isEditable(),"initialValueFn"),subscribe:s(t=>e.registerEditableListener(t),"subscribe")}}s(kO,"a$2");function MO(){return(function(e){const[t]=fn(),n=(0,m.useMemo)(()=>e(t),[t,e]),[r,i]=(0,m.useState)(()=>n.initialValueFn()),o=(0,m.useRef)(r);return wO(()=>{const{initialValueFn:l,subscribe:a}=n,c=l();return o.current!==c&&(o.current=c,i(c)),a(u=>{o.current=u,i(u)})},[n,e]),r})(kO)}s(MO,"l$6");function AO(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(AO,"y");var Nm=_d?m.useLayoutEffect:m.useEffect;function IO({editor:e,ErrorBoundary:t}){return(function(n,r){const[i,o]=(0,m.useState)(()=>n.getDecorators());return Nm(()=>n.registerDecoratorListener(l=>{(0,Bc.flushSync)(()=>{o(l)})}),[n]),(0,m.useEffect)(()=>{o(n.getDecorators())},[n]),(0,m.useMemo)(()=>{const l=[],a=Object.keys(i);for(let c=0;c<a.length;c++){const u=a[c],d=(0,ee.jsx)(r,{onError:s(h=>n._onError(h),"onError"),children:(0,ee.jsx)(m.Suspense,{fallback:null,children:i[u]})}),f=n.getElementByKey(u);f!==null&&l.push((0,Bc.createPortal)(d,f,u))}return l},[r,i,n])})(e,t)}s(IO,"L");function NO({editor:e,ErrorBoundary:t}){return(function(n){const r=Oa.maybeFromEditor(n);if(r&&r.hasExtensionByName(Cu.name)){for(const i of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(i)&&AO(320,i);return!0}return!1})(e)?null:(0,ee.jsx)(IO,{editor:e,ErrorBoundary:t})}s(NO,"b");function Tv(e){return e.read("latest",eS(e.isComposing()))}s(Tv,"v");function TS({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=fn();return(function(i){Nm(()=>At(T6(i),y6(i)),[i])})(r),(0,ee.jsxs)(ee.Fragment,{children:[e,(0,ee.jsx)(OO,{content:t}),(0,ee.jsx)(NO,{editor:r,ErrorBoundary:n})]})}s(TS,"w");function OO({content:e}){const[t]=fn(),n=(function(i){const[o,l]=(0,m.useState)(()=>Tv(i));return Nm(()=>{function a(){const c=Tv(i);l(c)}return s(a,"e"),a(),At(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),o})(t),r=MO();return n?typeof e=="function"?e(r):e:null}s(OO,"C");var DO=ws(((e,t)=>{(function(){"use strict";var n={}.hasOwnProperty;function r(){for(var l="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(l=o(l,i(c)))}return l}s(r,"classNames");function i(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return r.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var a="";for(var c in l)n.call(l,c)&&l[c]&&(a=o(a,c));return a}s(i,"parseValue");function o(l,a){return a?l?l+" "+a:l+a:l}s(o,"appendClass"),typeof t<"u"&&t.exports?(r.default=r,t.exports=r):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return r}):window.classNames=r})()})),tt=da(DO(),1),wS={undo:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z",fill:"currentColor"})),redo:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z",fill:"currentColor"})),format_bold:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z",fill:"currentColor"})),format_italic:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z",fill:"currentColor"})),format_underlined:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z",fill:"currentColor"})),format_highlight:m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"},m.createElement("path",{d:"m9 11-6 6v3h9l3-3"}),m.createElement("path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4"})),code:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z",fill:"currentColor"})),strikeThrough:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z",fill:"currentColor"})),superscript:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z",fill:"currentColor"})),subscript:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z",fill:"currentColor"})),format_list_bulleted:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z",fill:"currentColor"})),format_list_numbered:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z",fill:"currentColor"})),format_list_checked:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z",fill:"currentColor"})),link:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z",fill:"currentColor"})),add_photo:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z",fill:"currentColor"})),table:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z",fill:"currentColor"})),horizontal_rule:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M4.5 12.75V11.25H19.5V12.75H4.5Z",fill:"currentColor"})),frontmatter:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M4.5 8.75V7.25H8.5V8.75H4.5Z",fill:"currentColor"}),m.createElement("path",{d:"M4.5 14.75V13.25H8.5V14.75H4.5Z",fill:"currentColor"}),m.createElement("path",{d:"M9.5 8.75V7.25H13.5V8.75H9.5Z",fill:"currentColor"}),m.createElement("path",{d:"M9.5 14.75V13.25H13.5V14.75H9.5Z",fill:"currentColor"}),m.createElement("path",{d:"M14.5 8.75V7.25H18.5V8.75H14.5Z",fill:"currentColor"}),m.createElement("path",{d:"M14.5 14.75V13.25H18.5V14.75H14.5Z",fill:"currentColor"})),frame_source:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z",fill:"currentColor"})),arrow_drop_down:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z",fill:"currentColor"})),admonition:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z",fill:"currentColor"})),rich_text:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z",fill:"currentColor"}),m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z",fill:"currentColor"}),m.createElement("path",{d:"M12.5 7H17.5V8.25H12.5V7Z",fill:"currentColor"}),m.createElement("path",{d:"M12.5 9.25H17.5V10.5H12.5V9.25Z",fill:"currentColor"})),difference:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),m.createElement("rect",{x:"9",y:"10",width:"5.5",height:"1.5",fill:"currentColor"}),m.createElement("rect",{x:"9",y:"15",width:"5.5",height:"1.5",fill:"currentColor"}),m.createElement("rect",{x:"11",y:"8",width:"1.5",height:"5.5",fill:"currentColor"})),markdown:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z",fill:"currentColor"}),m.createElement("path",{d:"M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z",fill:"currentColor"}),m.createElement("path",{d:"M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z",fill:"currentColor"})),open_in_new:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z",fill:"currentColor"})),link_off:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z",fill:"currentColor"})),edit:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z",fill:"currentColor"})),content_copy:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z",fill:"currentColor"})),more_horiz:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z",fill:"currentColor"})),more_vert:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z",fill:"currentColor"})),close:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z",fill:"currentColor"})),settings:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})),delete_big:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),delete_small:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z",fill:"currentColor"})),format_align_center:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_left:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z",fill:"currentColor"})),format_align_right:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z",fill:"currentColor"})),add_row:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z",fill:"currentColor"}),m.createElement("path",{d:"M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z",fill:"currentColor"})),add_column:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z",fill:"currentColor"}),m.createElement("path",{d:"M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z",fill:"currentColor"})),insert_col_left:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z",fill:"currentColor"})),insert_row_above:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z",fill:"currentColor"})),insert_row_below:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z",fill:"currentColor"})),insert_col_right:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z",fill:"currentColor"})),check:m.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.createElement("path",{d:"M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z",fill:"currentColor"}))},RO="_editorRoot_er3ed_53",LO="_editorWrapper_er3ed_155",$O="_toolbarRoot_er3ed_162",PO="_readOnlyToolbarRoot_er3ed_189",FO="_toolbarToggleItem_er3ed_208",VO="_toolbarGroupOfGroups_er3ed_219",BO="_toolbarToggleSingleGroup_er3ed_224",HO="_toolbarButton_er3ed_239",KO="_activeToolbarButton_er3ed_275",UO="_toolbarButtonDropdownContainer_er3ed_286",WO="_selectContainer_er3ed_288",zO="_selectItem_er3ed_301",jO="_toolbarButtonSelectTrigger_er3ed_307",JO="_selectTrigger_er3ed_308",GO="_selectDropdownArrow_er3ed_373",qO="_contentEditable_er3ed_379",ZO="_codeMirrorWrapper_er3ed_391",YO="_codeMirrorToolbar_er3ed_408",XO="_propertyPanelTitle_er3ed_430",QO="_propertyEditorTable_er3ed_438",eD="_iconButton_er3ed_456",tD="_readOnlyColumnCell_er3ed_461",nD="_buttonsFooter_er3ed_474",rD="_propertyEditorInput_er3ed_480",iD="_primaryButton_er3ed_506",oD="_secondaryButton_er3ed_507",sD="_smallButton_er3ed_522",lD="_dialogForm_er3ed_534",aD="_linkDialogEditForm_er3ed_540",cD="_linkDialogInputContainer_er3ed_548",uD="_linkDialogInputWrapper_er3ed_554",dD="_linkDialogInput_er3ed_548",fD="_linkDialogAnchor_er3ed_586",hD="_linkDialogPopoverContent_er3ed_600",gD="_tableColumnEditorPopoverContent_er3ed_601",pD="_dialogContent_er3ed_602",mD="_largeDialogContent_er3ed_614",_D="_dialogTitle_er3ed_624",vD="_dialogCloseButton_er3ed_630",yD="_popoverContent_er3ed_637",xD="_popoverArrow_er3ed_649",CD="_linkDialogPreviewAnchor_er3ed_653",bD="_tooltipTrigger_er3ed_676",ED="_tooltipContent_er3ed_680",SD="_actionButton_er3ed_694",TD="_primaryActionButton_er3ed_701",wD="_tableEditor_er3ed_713",kD="_toolCell_er3ed_724",MD="_tableColumnEditorTrigger_er3ed_743",AD="_addRowButton_er3ed_745",ID="_addColumnButton_er3ed_746",ND="_tableColumnEditorToolbar_er3ed_788",OD="_toggleGroupRoot_er3ed_801",DD="_tableToolsColumn_er3ed_819",RD="_leftAlignedCell_er3ed_828",LD="_rightAlignedCell_er3ed_832",$D="_centeredCell_er3ed_836",PD="_dialogOverlay_er3ed_869",FD="_focusedImage_er3ed_915",VD="_imageWrapper_er3ed_919",BD="_editImageToolbar_er3ed_932",HD="_editImageButton_er3ed_936",KD="_inlineEditor_er3ed_942",UD="_blockEditor_er3ed_951",WD="_nestedEditor_er3ed_960",zD="_genericComponentName_er3ed_979",jD="_diffSourceToggleWrapper_er3ed_985",JD="_ggDiffSourceToggle_er3ed_993",GD="_diffSourceToggle_er3ed_985",qD="_selectWithLabel_er3ed_1011",ZD="_toolbarTitleMode_er3ed_1026",YD="_imageControlWrapperResizing_er3ed_1031",XD="_imageResizer_er3ed_1035",QD="_imageResizerN_er3ed_1044",eR="_imageResizerNe_er3ed_1050",tR="_imageResizerE_er3ed_1056",nR="_imageResizerSe_er3ed_1062",rR="_imageResizerS_er3ed_1062",iR="_imageResizerSw_er3ed_1074",oR="_imageResizerW_er3ed_1080",sR="_imageResizerNw_er3ed_1086",lR="_imagePlaceholder_er3ed_1092",aR="_imageDimensionsContainer_er3ed_1100",cR="_placeholder_er3ed_1105",uR="_rootContentEditableWrapper_er3ed_1118",dR="_downshiftInputWrapper_er3ed_1128",fR="_downshiftInput_er3ed_1128",hR="_downshiftAutocompleteContainer_er3ed_1159",gR="_textInput_er3ed_1205",pR="_multiFieldForm_er3ed_1213",mR="_formField_er3ed_1219",_R="_markdownParseError_er3ed_1230",vR="_popupContainer_er3ed_1239",yR="_inputSizer_er3ed_1244",J={editorRoot:RO,editorWrapper:LO,toolbarRoot:$O,readOnlyToolbarRoot:PO,toolbarToggleItem:FO,toolbarGroupOfGroups:VO,toolbarToggleSingleGroup:BO,toolbarButton:HO,activeToolbarButton:KO,toolbarButtonDropdownContainer:UO,selectContainer:WO,selectItem:zO,toolbarButtonSelectTrigger:jO,selectTrigger:JO,selectDropdownArrow:GO,contentEditable:qO,codeMirrorWrapper:ZO,codeMirrorToolbar:YO,propertyPanelTitle:XO,propertyEditorTable:QO,iconButton:eD,readOnlyColumnCell:tD,buttonsFooter:nD,propertyEditorInput:rD,primaryButton:iD,secondaryButton:oD,smallButton:sD,dialogForm:lD,linkDialogEditForm:aD,linkDialogInputContainer:cD,linkDialogInputWrapper:uD,linkDialogInput:dD,linkDialogAnchor:fD,linkDialogPopoverContent:hD,tableColumnEditorPopoverContent:gD,dialogContent:pD,largeDialogContent:mD,dialogTitle:_D,dialogCloseButton:vD,popoverContent:yD,popoverArrow:xD,linkDialogPreviewAnchor:CD,tooltipTrigger:bD,tooltipContent:ED,actionButton:SD,primaryActionButton:TD,tableEditor:wD,toolCell:kD,tableColumnEditorTrigger:MD,addRowButton:AD,addColumnButton:ID,tableColumnEditorToolbar:ND,toggleGroupRoot:OD,tableToolsColumn:DD,leftAlignedCell:RD,rightAlignedCell:LD,centeredCell:$D,dialogOverlay:PD,focusedImage:FD,imageWrapper:VD,editImageToolbar:BD,editImageButton:HD,inlineEditor:KD,blockEditor:UD,nestedEditor:WD,genericComponentName:zD,diffSourceToggleWrapper:jD,ggDiffSourceToggle:JD,diffSourceToggle:GD,selectWithLabel:qD,toolbarTitleMode:ZD,imageControlWrapperResizing:YD,imageResizer:XD,imageResizerN:QD,imageResizerNe:eR,imageResizerE:tR,imageResizerSe:nR,imageResizerS:rR,imageResizerSw:iR,imageResizerW:oR,imageResizerNw:sR,imagePlaceholder:lR,imageDimensionsContainer:aR,placeholder:cR,rootContentEditableWrapper:uR,downshiftInputWrapper:dR,downshiftInput:fR,downshiftAutocompleteContainer:hR,textInput:gR,multiFieldForm:pR,formField:mR,markdownParseError:_R,popupContainer:vR,inputSizer:yR};function xR(e){try{const t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?C_(n)?r:i:C_(t)?r:i}catch{return null}}s(xR,"getSelectedNode");var CR=["transform","perspective","filter","backdrop-filter","contain","container-type"],bR=["layout","paint","strict","content"];function ER(e){let t=e?.parentElement;for(;t;){const n=window.getComputedStyle(t),r=n.willChange.split(",").map(i=>i.trim()).some(i=>CR.includes(i));if(n.transform!=="none"||n.perspective!=="none"||n.filter!=="none"||n.backdropFilter!=="none"||bR.includes(n.contain)||n.containerType!=="normal"||n.contentVisibility==="auto"||r)return t;t=t.parentElement}return null}s(ER,"getFixedContainingBlock");function kS(e,t){const n=ER(t);if(n){const r=n.getBoundingClientRect();return{top:Math.round(e.top-r.top),left:Math.round(e.left-r.left),width:Math.round(e.width),height:Math.round(e.height)}}return{top:Math.round(e.top),left:Math.round(e.left),width:Math.round(e.width),height:Math.round(e.height)}}s(kS,"adjustedRectangle");function MS(e,t){const n=e.getRootElement(),r=e.getElementByKey(t);return n===null||r===null?null:kS(r.getBoundingClientRect(),n)}s(MS,"getNodeRectangle");function AS(e){const t=re(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){const o=n.getRangeAt(0);let l;if(n.isCollapsed){let a=n.anchorNode;a?.nodeType==3&&(a=a.parentNode),l=a.getBoundingClientRect(),l.width=0}else if(n.anchorNode===i){let a=i;for(;a.firstElementChild!=null;)a=a.firstElementChild;l=a.getBoundingClientRect()}else l=o.getBoundingClientRect();return kS(l,i)}else if(r?.className!=="link-input")return null;return null}s(AS,"getSelectionRectangle");function SR(e,t){let n=null,r=[],i="";e.getEditorState().read(()=>{const a=re();!a||ie(a)&&a.isCollapsed()||a.getNodes().length===0||(r=CE(e,a).nodes,r.length>0&&(n=Sb()))},{editor:e});const o=n;if(!o||r.length===0)return"";const l={error:void 0,failed:!1};if(o.update(()=>{try{const a=Lt(),c=bE(r);let u=Xe();const d=s(()=>{u.isEmpty()||(a.append(u),u=Xe())},"appendInlineContainer");for(const f of c)f.isInline()?u.append(f):(d(),a.append(f));d(),i=jE({root:a,...t})}catch(a){l.failed=!0,l.error=a}},{discrete:!0,skipTransforms:!0}),l.failed)throw l.error;return i.replace(/\n+$/u,"")}s(SR,"getSelectionAsMarkdown");var TR=s(({children:e})=>{const t=ni(fi);return m.createElement(SS,{initialEditor:t},e)},"LexicalProvider"),wR=s(()=>{const e=mi(),t=Mn(aS),n=Mn(dS),r=s(f=>{n(f),t(f?{current:f}:null)},"onRef"),[i,o,l,a,c,u,d]=vr(Zh,Yh,mS,_S,yS,Xh,vS);return m.createElement(m.Fragment,null,a.map((f,h)=>m.createElement(f,{key:h})),m.createElement(IS,{wrappers:c},m.createElement("div",{className:(0,tt.default)(J.rootContentEditableWrapper,"mdxeditor-root-contenteditable")},m.createElement(TS,{contentEditable:m.createElement("div",{ref:r,className:"mdxeditor-contenteditable-wrapper"},m.createElement(xm,{className:(0,tt.default)(J.contentEditable,i),ariaLabel:e("contentArea.editableMarkdown","editable markdown"),spellCheck:o})),placeholder:m.createElement("div",{className:(0,tt.default)(J.contentEditable,J.placeholder,i)},m.createElement("p",null,u)),ErrorBoundary:Cm}))),l.map((f,h)=>m.createElement(f,{key:h})),d.map((f,h)=>m.createElement(f,{key:h})))},"RichTextEditor"),kR={listItemIndent:"one"},MR=s(e=>wS[e],"defaultIconComponentFor");function AR(e,t,n={}){let r=t;for(const[i,o]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(o));return r}s(AR,"defaultTranslation");var IS=s(({wrappers:e,children:t})=>{if(e.length===0)return m.createElement(m.Fragment,null,t);const n=e[0];return m.createElement(n,null,m.createElement(IS,{wrappers:e.slice(1)},t))},"RenderRecursiveWrappers"),IR=s(({children:e,className:t,overlayContainer:n})=>{const r=m.useRef(null),i=m.useRef(null),o=Mn(Po),l=Mn(CO);return m.useEffect(()=>{const a=document.createElement("div");return a.classList.add("mdxeditor-popup-container",J.editorRoot,J.popupContainer,...(t??"").trim().split(" ").filter(Boolean)),(n??document.body).appendChild(a),r.current=a,o(r),l(i),()=>{a.remove()}},[t,r,n,o,l]),m.createElement("div",{className:(0,tt.default)("mdxeditor",J.editorRoot,J.editorWrapper,t),ref:i},e)},"EditorRootElement");function NR(e){return{getMarkdown:s(()=>{const t=e.getValue(ta);return t==="source"||t==="diff"?e.getValue(na):e.getValue(To)},"getMarkdown"),setMarkdown:s(t=>{e.pub(km,t)},"setMarkdown"),insertMarkdown:s(t=>{e.pub(cS,t)},"insertMarkdown"),focus:s((t,n)=>{var r;(r=e.getValue(fi))==null||r.focus(t,n)},"focus"),getContentEditableHTML:s(()=>{var t;return((t=e.getValue(aS))==null?void 0:t.current.innerHTML)??""},"getContentEditableHTML"),getSelectionMarkdown:s(()=>{const t=e.getValue(ta);if(t==="source"||t==="diff")return"";const n=e.getValue(gt);if(!n)return"";const r=e.getValue(Id),i=e.getValue(Sm),o=e.getValue(Su),l=e.getValue(Nd),a=e.getValue(Tm);return SR(n,{visitors:r,toMarkdownExtensions:i,toMarkdownOptions:o,jsxComponentDescriptors:l,jsxIsAvailable:a})},"getSelectionMarkdown")}}s(NR,"createMethods");var OR=s(({onReady:e,onDispose:t})=>{const n=Qu(),r=m.useMemo(()=>NR(n),[n]);return m.useLayoutEffect(()=>(e(r),()=>{t(r)}),[r,t,e]),null},"Methods"),DR=m.forwardRef((e,t)=>{const n=m.useRef(null),r=m.useRef(null),i=m.useRef([]),o=m.useRef(e.trim===!1?e.markdown:e.markdown.trim()),l=m.useCallback(d=>{const f=n.current;f&&r.current===null?d(f):i.current.push(d)},[]),a=m.useMemo(()=>({getMarkdown:s(()=>{var d;return((d=n.current)==null?void 0:d.getMarkdown())??o.current},"getMarkdown"),setMarkdown:s(d=>{o.current=d,l(f=>{f.setMarkdown(d)})},"setMarkdown"),insertMarkdown:s(d=>{l(f=>{f.insertMarkdown(d)})},"insertMarkdown"),focus:s((d,f)=>{l(h=>{h.focus(d,f)})},"focus"),getContentEditableHTML:s(()=>{var d;return((d=n.current)==null?void 0:d.getContentEditableHTML())??""},"getContentEditableHTML"),getSelectionMarkdown:s(()=>{var d;return((d=n.current)==null?void 0:d.getSelectionMarkdown())??""},"getSelectionMarkdown")}),[l]),c=m.useCallback(d=>{if(n.current=d,r.current===d)return;if(i.current.length===0){o.current=d.getMarkdown();return}r.current=d;const f=s(()=>{if(n.current!==d){r.current===d&&(r.current=null);return}const h=i.current.shift();if(!h){r.current=null,o.current=d.getMarkdown();return}h(d),queueMicrotask(f)},"replayNext");f()},[]),u=m.useCallback(d=>{n.current===d&&(o.current=d.getMarkdown(),n.current=null)},[]);return m.useImperativeHandle(t,()=>a,[a]),m.createElement(fM,{plugins:[TO({contentEditableClassName:e.contentEditableClassName??"",spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??go,onBlur:e.onBlur??go,toMarkdownOptions:e.toMarkdownOptions??kR,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??"",readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??MR,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??go,translation:e.translation??AR,trim:e.trim??!0,lexicalTheme:e.lexicalTheme,..."editorState"in e?{editorState:e.editorState}:{},suppressSharedHistory:e.suppressSharedHistory??!1,additionalLexicalNodes:e.additionalLexicalNodes??[],lexicalEditorNamespace:e.lexicalEditorNamespace??"MDXEditor"}),...e.plugins??[]]},m.createElement(IR,{className:e.className,overlayContainer:e.overlayContainer},m.createElement(TR,null,m.createElement(wR,null))),m.createElement(OR,{onReady:c,onDispose:u}))}),NS=typeof window<"u"&&typeof window.document.createElement<"u",OS=NS&&(()=>{var e;const t=(e=navigator.userAgentData)==null?void 0:e.platform;return t?/mac/i.test(t):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function RR(e,t){return OS?e:t}s(RR,"controlOrMeta");var LR={testLexicalNode:Md,visitLexicalNode:s(({lexicalNode:e,actions:t})=>{const n=parseInt(e.getTag()[1],10);t.addAndStepInto("heading",{depth:n})},"visitLexicalNode")},$R={testNode:"heading",visitNode:s(function({mdastNode:e,actions:t}){t.addAndStepInto(Ar(`h${e.depth}`))},"visitNode")},PR=["Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6"],ig=[1,2,3,4,5,6],FR={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},ku=he(ig,e=>{e.pub(Od,t=>t.registerCommand(mb,n=>{const{code:r,ctrlKey:i,metaKey:o,altKey:l}=n;return PR.includes(r)&&RR(o,i)&&l?(n.preventDefault(),t.update(()=>{if(r==="Digit0")e.pub(rg,()=>Xe());else{const a=e.getValue(ku),c=FR[r];a.includes(c)&&e.pub(rg,()=>Ar(`h${c}`))}}),!0):!1},st))}),VR=En({init(e,t){e.pubIn({[Hs]:"headings",[$r]:$R,[hi]:Ra,[gi]:LR}),e.pub(ku,t?.allowedHeadingLevels??ig)},update(e,t){e.pub(ku,t?.allowedHeadingLevels??ig)}});function wv(e,t){return e.read("latest",()=>{const n=yn(t);return n!==null&&n.isSelected()})}s(wv,"s$2");function DS(e){const[t]=fn(),[n,r]=(0,m.useState)(()=>wv(t,e));return(0,m.useEffect)(()=>{let i=!0;const o=t.registerUpdateListener(()=>{i&&r(wv(t,e))});return()=>{i=!1,o()}},[t,e]),[n,(0,m.useCallback)(i=>{t.update(()=>{let o=re();He(o)||(o=cu(),Xn(o)),He(o)&&(i?o.add(e):o.delete(e))})},[t,e]),(0,m.useCallback)(()=>{t.update(()=>{const i=re();He(i)&&i.clear()})},[t])]}s(DS,"u$1");function BR({nodeKey:e}){const[t]=fn(),[n,r,i]=DS(e);return(0,m.useEffect)(()=>At(t.registerCommand(im,o=>{const l=t.getElementByKey(e);return k7(o)===l&&(o.shiftKey||i(),r(!n),!0)},st)),[i,t,n,e,r]),(0,m.useEffect)(()=>{const o=t.getElementByKey(e),l=t._config.theme.hrSelected??"selected";o!==null&&(n?mr(o,l):bd(o,l))},[t,n,e]),null}s(BR,"p");var Dd=class RS extends Da{static{s(this,"x")}static getType(){return"horizontalrule"}static clone(t){return new RS(t.__key)}static importJSON(t){return $a().updateFromJSON(t)}static importDOM(){return{hr:s(()=>({conversion:HR,priority:0}),"hr")}}decorate(){return(0,ee.jsx)(BR,{nodeKey:this.__key})}};function HR(){return{node:$a()}}s(HR,"d");function $a(){return ci(new Dd)}s($a,"f");function KR(){const[e]=fn();return(0,m.useEffect)(()=>e.registerCommand(qb,t=>{const n=re();if(!ie(n))return!1;if(n.focus.getNode()!==null){const r=$a();Vb(r)}return!0},Ae),[e]),null}s(KR,"n$2");var UR={testLexicalNode:s(e=>e instanceof Dd,"testLexicalNode"),visitLexicalNode({actions:e}){e.addAndStepInto("thematicBreak")}},WR={testNode:"thematicBreak",visitNode({actions:e}){e.addAndStepInto($a())}},zR=Ji(e=>{e.sub(e.pipe(zR,mt(gt)),([,t])=>{t?.dispatchCommand(qb,void 0)})}),jR=En({init(e){e.pubIn({[Hs]:"thematicBreak",[$r]:WR,[hi]:Dd,[gi]:UR,[Bs]:KR})}});function Si(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(Si,"ht");function ra(e){let t=1,n=e.getParent();for(;n!=null;){if(Me(n)){const r=n.getParent();if(Se(r)){t++,n=r.getParent();continue}Si(40)}return t}return t}s(ra,"ft$1");function og(e){const t=e.getParent();Se(t)||Si(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),Se(r)&&(n=r);return n}s(og,"dt$1");function LS(e){let t=[];const n=e.getChildren().filter(Me);for(let r=0;r<n.length;r++){const i=n[r],o=i.getFirstChild();Se(o)?t=t.concat(LS(o)):t.push(i)}return t}s(LS,"pt");function Hn(e){return Me(e)&&Se(e.getFirstChild())}s(Hn,"mt$2");function $S(e,t){return Me(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}s($S,"_t$2");function sg(e){const t=re();if(t!==null){let n=t.getNodes();if(ie(t)){const[i]=t.getStartEndPoints(),o=i.getNode(),l=o.getParent();if(xn(o)){const a=o.getFirstChild();if(a)n=a.selectStart().getNodes();else{const c=Xe();o.append(c),n=c.select().getNodes()}}else if($S(o,n)){const a=Zn(e);if(xn(l)){o.replace(a);const c=Qn();xe(o)&&(c.setFormat(o.getFormatType()),c.setIndent(o.getIndent())),a.append(c)}else if(Me(o)){const c=o.getParentOrThrow();wo(a,c.getChildren()),c.replace(a)}return}}const r=new Set;for(let i=0;i<n.length;i++){const o=n[i];if(xe(o)&&o.isEmpty()&&!Me(o)&&!r.has(o.getKey())){kv(o,e);continue}let l=tb(o)?o.getParent():Me(o)&&o.isEmpty()?o:null;for(;l!=null;){const a=l.getKey();if(Se(l)){if(!r.has(a)){const c=Zn(e);wo(c,l.getChildren()),l.replace(c),r.add(a)}break}{const c=l.getParent();if(xn(c)&&!r.has(a)){r.add(a),kv(l,e);break}l=c}}}}}s(sg,"yt$1");function wo(e,t){e.splice(e.getChildrenSize(),0,t)}s(wo,"Ct$2");function kv(e,t){if(Se(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=Qn();let o;if(wo(i,e.getChildren()),Se(n)&&t===n.getListType())n.append(i),Se(r)&&t===r.getListType()&&(wo(n,r.getChildren()),r.remove()),o=n;else if(Se(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const a=Zn(t);a.append(i),e.replace(a),o=a}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const l=re();return ie(l)&&(o.getKey()===l.anchor.key&&l.anchor.set(i.getKey(),l.anchor.offset,"element"),o.getKey()===l.focus.key&&l.focus.set(i.getKey(),l.focus.offset,"element")),e.remove(),o}s(kv,"kt$2");function Om(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Hn(n)&&Hn(r)&&(Om(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}s(Om,"bt$2");function JR(){const e=re();if(ie(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if($S(r,n))t.add(og(r));else for(let i=0;i<n.length;i++){const o=n[i];if(tb(o)){const l=Pb(o,_i);l!=null&&t.add(og(l))}}for(const i of t){let o=i;const l=LS(i);for(const a of l){const c=Xe().setTextStyle(e.style).setTextFormat(e.format);wo(c,a.getChildren()),o.insertAfter(c),o=c,a.__key===e.anchor.key&&Ih(e.anchor,zi(Wi(c,"next"))),a.__key===e.focus.key&&Ih(e.focus,zi(Wi(c,"next"))),a.remove()}i.remove()}}}s(JR,"St$2");function PS(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())Me(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),Se(r.getFirstChild())||n++)}s(PS,"vt$2");function GR(e){const t=new Set;if(Hn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Hn(r)&&Hn(i)){const o=i.getFirstChild();if(Se(o)){o.append(e);const l=r.getFirstChild();Se(l)&&(wo(o,l.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Hn(r)){const o=r.getFirstChild();if(Se(o)){const l=o.getFirstChild();l!==null&&l.insertBefore(e)}}else if(Hn(i)){const o=i.getFirstChild();Se(o)&&o.append(e)}else if(Se(n)){const o=tn(e),l=tn(n);o.append(l),l.append(e),i?i.insertAfter(o):r?r.insertBefore(o):n.append(o)}}s(GR,"Tt$2");function Mv(e){if(Hn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(Se(n?n.getParent():void 0)&&Me(n)&&Se(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const o=tn(e),l=tn(t);o.append(l),e.getPreviousSiblings().forEach(u=>l.append(u));const a=tn(e),c=tn(t);a.append(c),wo(c,e.getNextSiblings()),n.insertBefore(o),n.insertAfter(a),n.replace(e)}}}s(Mv,"xt$2");function qR(e=!1){const t=re();if(!ie(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(Me(n)&&n.getChildrenSize()===0)r=n;else if(Ie(n)){const u=n.getParent();Me(u)&&u.getChildren().every(d=>Ie(d)&&d.getTextContent().trim()==="")&&(r=u)}if(r===null)return!1;const i=og(r),o=r.getParent();Se(o)||Si(40);const l=o.getParent();let a;if(xn(l))a=Xe(),i.insertAfter(a);else{if(!Me(l))return!1;a=tn(l),l.insertAfter(a)}a.setTextStyle(t.style).setTextFormat(t.format).select();const c=r.getNextSiblings();if(c.length>0){const u=e?(function(f,h){return f.getStart()+h.getIndexWithinParent()})(o,r):1,d=tn(o).setStart(u);if(Me(a)){const f=tn(a);f.append(d),a.insertAfter(f)}else a.insertAfter(d);d.append(...c)}return(function(u){let d=u;for(;d.getNextSibling()==null&&d.getPreviousSibling()==null;){const f=d.getParent();if(f==null||!Me(f)&&!Se(f))break;d=f}d.remove()})(r),!0}s(qR,"Nt$2");var _i=class extends Lr{static{s(this,"Pt$2")}__value;__checked;$config(){return this.config("listitem",{$transform:s(e=>{const t=e.getParent();if(Se(t))t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();Se(n)||Si(340);const r=[e];for(const i of["previous","next"]){r.reverse();for(const{origin:o}of qn(e,i)){if(!Me(o))break;r.push(o)}}e.insertBefore(n),n.splice(0,0,r),xn(t)||(tm(n,Cl(qn(n,"next")),{$shouldSplit:s(()=>!1,"$shouldSplit"),removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},"$transform"),extends:Lr,importDOM:Eb({li:s(()=>({conversion:ZR,priority:0}),"li")})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=bn().createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(o,l){const a=l.getParent();!Se(a)||a.getListType()!=="check"||Se(l.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),o.setAttribute("aria-checked",l.getChecked()?"true":"false"))})(t,this),t.value=this.__value,(function(o,l,a){const c=l.list;if(!c)return;const u=c.listitem,d=c.nested&&c.nested.listitem,f=a.getParent(),h=Se(f)&&f.getListType()==="check",g=a.getChecked(),p=a.getChildren().some(v=>Se(v)),_=[];c.listitemChecked!==void 0&&_.push(c.listitemChecked),c.listitemUnchecked!==void 0&&_.push(c.listitemUnchecked),d!==void 0&&_.push(...bl(d)),_.length>0&&bd(o,..._);const y=[];if(u!==void 0&&y.push(...bl(u)),h){const v=g?c.listitemChecked:c.listitemUnchecked;v!==void 0&&y.push(v)}d!==void 0&&p&&y.push(...bl(d)),y.length>0&&mr(o,...y)})(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&Tc(t.style,i,r),(function(o,l,a){const c=l.__textStyle,u=a?a.__textStyle:"";if(a!==null&&u===c)return;const d=y_(c);for(const f in d)o.style.setProperty(`--listitem-marker-${f}`,d[f]);if(u!=="")for(const f in y_(u))f in d||o.style.removeProperty(`--listitem-marker-${f}`)})(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),Hn(this)?{after(i){if(Ke(i)){const o=i.previousElementSibling;if(Ke(o)&&o.nodeName==="LI"){for(;i.firstChild;)o.append(i.firstChild);i.remove()}}return i},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(xe(n)&&this.canMergeWith(n)){const r=n.getChildren();this.append(...r),n.remove()}else super.append(n)}return this}replace(e,t){if(Me(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!Se(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const o=tn(n);let l=this.getNextSibling();for(;l;){const a=l;l=l.getNextSibling(),o.append(a)}n.insertAfter(e),e.insertAfter(o)}const r=this.__key;let i=0;if(t&&(xe(e)||Si(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&xe(e)){const o=re();if(ie(o))for(const l of o.getStartEndPoints())l.key===r&&l.type==="element"&&l.set(e.getKey(),i+l.offset,"element")}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(Se(n)||Si(39),Me(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){const i=tn(n);r.forEach(o=>i.append(o)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Hn(t)&&Hn(n)&&(Om(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=tn(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(Hn(this))return!1;const t=this.getParentOrThrow();if(Me(t.getParentOrThrow()))return Mv(this),!0;const n=Xe().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){const i=tn(t);i.append(...r),t.insertAfter(i)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return Se(n)&&(t=n.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;Me(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!="number"&&Si(117),(e=Math.floor(e))>=0||Si(199);let t=this.getIndent();for(;t!==e;)t<e?(GR(this),t++):(Mv(this),t--);return this}canInsertAfter(e){return Me(e)}canReplaceWith(e){return Me(e)}canMergeWith(e){return Me(e)||wa(e)}extractWithChild(e,t){if(!ie(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Zn("bullet")}canMergeWhenEmpty(){return!0}};function ZR(e){if(e.classList.contains("task-list-item")){for(const r of e.children)if(r.tagName==="INPUT")return Av(r)}if(e.classList.contains("joplin-checkbox")){for(const r of e.children)if(r.classList.contains("checkbox-wrapper")&&r.children.length>0&&r.children[0].tagName==="INPUT")return Av(r.children[0])}const t=e.getAttribute("aria-checked"),n=Qn(t==="true"||t!=="false"&&void 0);return ui(n,e),{after:FS.bind(null,n),node:Cr(n,e)}}s(ZR,"Ft$1");function Av(e){if(e.getAttribute("type")!=="checkbox")return{node:null};const t=Qn(e.hasAttribute("checked"));return{after:FS.bind(null,t),node:t}}s(Av,"Lt$2");function FS(e,t){const n=t[0];return t.length===1&&wa(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}s(FS,"At$2");function Qn(e){return ci(new _i(void 0,e))}s(Qn,"Ot$2");function Me(e){return e instanceof _i}s(Me,"It$1");var vi=class extends Lr{static{s(this,"Et$1")}__tag;__start;__listType;$config(){return this.config("list",{$transform:s(e=>{(function(t){const n=t.getNextSibling();Se(n)&&t.getListType()===n.getListType()&&Om(t,n)})(e),PS(e)},"$transform"),extends:Lr,importDOM:Eb({ol:s(()=>({conversion:Nv,priority:0}),"ol"),ul:s(()=>({conversion:Nv,priority:0}),"ul")})})}constructor(e="number",t=1,n){super(n);const r=YR[e]||e;this.__listType=r,this.__tag=r==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=bn().createElement(n);return this.__start!==1&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,Iv(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Iv(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ke(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let i=0;i<n.length;i++){const o=n[i];Me(o)||(r===n&&(r=[...n]),r[i]=this.createListItemNode().append(!xe(o)||Se(o)||o.isInline()?o:pr(o.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return Me(e)}createListItemNode(){return Qn()}};function Iv(e,t,n){const r=[],i=[],o=t.list;if(o!==void 0){const l=o[`${n.__tag}Depth`]||[],a=ra(n)-1,c=a%l.length,u=l[c],d=o[n.__tag];let f;const h=o.nested,g=o.checklist;if(h!==void 0&&h.list&&(f=h.list),d!==void 0&&r.push(d),g!==void 0&&n.__listType==="check"&&r.push(g),u!==void 0){r.push(...bl(u));for(let p=0;p<l.length;p++)p!==c&&i.push(n.__tag+p)}if(f!==void 0){const p=bl(f);a>1?r.push(...p):i.push(...p)}}i.length>0&&bd(e,...i),r.length>0&&mr(e,...r)}s(Iv,"Dt$1");function Nv(e){let t;if((function(n){return Ke(n)&&n.nodeName.toLowerCase()==="ol"})(e)){const n=e.start;t=Zn("number",n)}else t=(function(n){if(n.getAttribute("__lexicallisttype")==="check"||n.classList.contains("contains-task-list")||n.getAttribute("data-is-checklist")==="1")return!0;for(const r of n.childNodes)if(Ke(r)&&r.hasAttribute("aria-checked"))return!0;return!1})(e)?Zn("check"):Zn("bullet");return Cr(t,e),{after:s(n=>(function(r,i){const o=i.createListItemNode.bind(i),l=[];for(let a=0;a<r.length;a++){const c=r[a];if(Me(c)){l.push(c);const u=c.getChildren();u.length>1&&u.forEach(d=>{Se(d)&&l.push(o().append(d))})}else l.push(o().append(c))}return l})(n,t),"after"),node:t}}s(Nv,"wt$1");var YR={ol:"number",ul:"bullet"};function Zn(e="number",t=1){return ci(new vi(e,t))}s(Zn,"$t$1");function Se(e){return e instanceof vi}s(Se,"Rt$1");var VS=br("INSERT_CHECK_LIST_COMMAND");function XR(e,t){const n=t&&t.disableTakeFocusOnClick||!1,r=typeof n=="boolean"?()=>n:n.peek.bind(n),i=s(u=>{const d=u.target;if(!Ke(d))return!1;const f=d.__lexicalCheckListLastHandled;return f!==void 0&&u.timeStamp-f<500},"o"),o=s(u=>{const d=u.target;Ke(d)&&(d.__lexicalCheckListLastHandled=u.timeStamp)},"l"),l=s(u=>{i(u)||(o(u),Ov(u,r()))},"a"),a=s(u=>{u.pointerType==="touch"&&(i(u)||(o(u),Ov(u,r())))},"u"),c=s(u=>{(function(d,f){BS(d,()=>{d.preventDefault(),f&&d.stopPropagation()})})(u,r())},"g");return At(e.registerCommand(VS,()=>(sg("check"),!0),st),e.registerCommand(hb,u=>Dv(u,e,!1),st),e.registerCommand(pb,u=>Dv(u,e,!0),st),e.registerCommand(xd,()=>lg(e)!=null?(e.getRootElement()?.focus(),!0):!1,st),e.registerCommand(_b,u=>{const d=lg(e);return!(d==null||!e.isEditable())&&(e.update(()=>{const f=si(d);Me(f)&&(u.preventDefault(),f.toggleChecked())}),!0)},st),e.registerCommand(gb,u=>e.read("latest",()=>{const d=re();if(ie(d)&&d.isCollapsed()){const{anchor:f}=d,h=f.type==="element";if(h||f.offset===0){const g=f.getNode(),p=dt(g,_=>xe(_)&&!_.isInline());if(Me(p)){const _=p.getParent();if(Se(_)&&_.getListType()==="check"&&(h||p.getFirstDescendant()===g)){const y=e.getElementByKey(p.__key);if(y!=null&&Tb(y)!==y)return y.focus(),u.preventDefault(),!0}}}}return!1}),st),e.registerRootListener(u=>{if(u!==null)return At(Rh(u,{click:l,pointerup:a}),Rh(u,{mousedown:c,pointerdown:c},{capture:!0}),P7(u,"touchstart",c,{capture:!0,passive:!1}))}))}s(XR,"Bt$1");function BS(e,t){const n=e.target;if(!Ke(n))return;const r=n.firstChild;if(Ke(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=n.parentNode;if(!i||i.__lexicalListType!=="check")return;let o=null,l=null;if("clientX"in e)o=e.clientX;else if("touches"in e){const g=e.touches;g.length>0&&(o=g[0].clientX,l="touch")}if(o==null)return;const a=n.getBoundingClientRect(),c=o/z7(n),u=n.ownerDocument.defaultView,d=u?u.getComputedStyle(n,"::before"):{width:"0px"},f=parseFloat(d.width),h=l==="touch"||"pointerType"in e&&e.pointerType==="touch"?32:0;(n.dir==="rtl"?c<a.right+h&&c>a.right-f-h:c>a.left-h&&c<a.left+f+h)&&t()}s(BS,"Wt$1");function Ov(e,t){BS(e,()=>{if(Ke(e.target)){const n=e.target,r=I7(n);r!=null&&r.isEditable()&&r.update(()=>{const i=si(n);Me(i)&&(t?(kh(Cb),kh(y7)):n.focus(),i.toggleChecked())})}})}s(Ov,"Ut$2");function lg(e){const t=e.getRootElement(),n=t?Tb(t):null;return Ke(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}s(lg,"Jt");function Dv(e,t,n){const r=lg(t);return r!=null&&t.update(()=>{const i=si(r);if(!Me(i))return;const o=(function(l,a){let c=a?l.getPreviousSibling():l.getNextSibling(),u=l;for(;c==null&&Me(u);)u=u.getParentOrThrow().getParent(),u!=null&&(c=a?u.getPreviousSibling():u.getNextSibling());for(;Me(c);){const d=a?c.getLastChild():c.getFirstChild();if(!Se(d))return c;c=a?d.getLastChild():d.getFirstChild()}return null})(i,n);if(o!=null){o.selectStart();const l=t.getElementByKey(o.__key);l!=null&&(e.preventDefault(),setTimeout(()=>{l.focus()},0))}}),!1}s(Dv,"Vt");function QR(e){const t=[];for(const n of e)if(Me(n)){t.push(n);const r=n.getChildren();if(r.length>1)for(const i of r)Se(i)&&t.push(Qn().append(i))}else t.push(Qn().append(n));return t}s(QR,"qt");var eL={$import:s((e,t)=>{let n;var r;return aE(t,"ol")?n=Zn("number",t.start):n=(r=t).matches('[__lexicallisttype="check"], .contains-task-list, [data-is-checklist="1"]')||r.querySelector(":scope > [aria-checked]")!==null?Zn("check"):Zn("bullet"),Cr(n,t),[n.splice(0,0,dE(QR(e.$importChildren(t)),t))]},"$import"),match:zt.tag("ol","ul"),name:"@lexical/list/list"};function HS(e,t){if(t.length!==1)return t;const n=t[0];return wa(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}s(HS,"jt$1");function KS(e){const t=s(l=>mm(l)&&!Se(l),"e");if(!e.some(t))return e;const n=[];let r=[];const i=s(()=>{r.length>0&&(n.push(r),r=[])},"i");for(const l of e)t(l)?(i(),n.push(xe(l)?l.getChildren():[l])):r.push(l);i();const o=[];for(const l of n)o.length>0&&o.push(Or()),o.push(...l);return o}s(KS,"Ht$1");var tL={$import:s((e,t)=>{const n=t.getAttribute("aria-checked"),r=Qn(n==="true"||n!=="false"&&void 0);return ui(r,t),Cr(r,t),[r.splice(0,0,KS(HS(r,e.$importChildren(t))))]},"$import"),match:zt.tag("li"),name:"@lexical/list/li"};function Rv(e,t,n){const r=aE(n,"input")?n:n.querySelector('input[type="checkbox"]');if(!r||r.getAttribute("type")!=="checkbox")return[];const i=Qn(r.hasAttribute("checked"));return ui(i,t),Cr(i,t),[i.splice(0,0,KS(HS(i,e.$importChildren(t))))]}s(Rv,"Gt");var Tz=[{$import:s((e,t,n)=>{const r=t.querySelector(':scope > input[type="checkbox"]');return r?Rv(e,t,r):n()},"$import"),match:zt.tag("li").classAll("task-list-item"),name:"@lexical/list/li-task-list-item"},{$import:s((e,t,n)=>{const r=t.querySelector(":scope > .checkbox-wrapper");if(!r)return n();const i=r.querySelector(':scope > input[type="checkbox"]');return i?Rv(e,t,i):n()},"$import"),match:zt.tag("li").classAll("joplin-checkbox"),name:"@lexical/list/li-joplin-checkbox"},eL,tL],nL=br("UPDATE_LIST_START_COMMAND"),US=br("INSERT_UNORDERED_LIST_COMMAND"),WS=br("INSERT_ORDERED_LIST_COMMAND"),zS=br("REMOVE_LIST_COMMAND");function Lv(e,t){return At(e.registerCommand(WS,()=>(sg("number"),!0),st),e.registerCommand(nL,n=>{const{listNodeKey:r,newStart:i}=n,o=yn(r);return!!Se(o)&&(o.getListType()==="number"&&(o.setStart(i),PS(o)),!0)},st),e.registerCommand(US,()=>(sg("bullet"),!0),st),e.registerCommand(zS,()=>(JR(),!0),st),e.registerCommand(Nh,()=>qR(!!(t&&t.restoreNumbering)),st),e.registerCommand(vd,n=>{if((function(){const l=re();if(!ie(l)||!l.isCollapsed()||l.anchor.offset!==0)return!1;const a=l.anchor.getNode(),c=dt(a,Me);if(!Me(c))return!1;const u=c.getFirstDescendant();if(u===null||!c.is(a)&&!u.is(a))return!1;const d=c.getParent();if(!Se(d)||!c.is(d.getFirstChild()))return!1;const f=d.getPreviousSibling();if(!Un(f)||f.isIsolated()||!f.isKeyboardSelectable()&&f.isInline())return!1;const h=Xe().append(...c.getChildren());return d.insertBefore(h),c.remove(),d.isEmpty()&&d.remove(),h.selectStart(),!0})())return n.preventDefault(),!0;const r=re();if(!ie(r)||!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;let o=i.getNode();for(;!Me(o);){if(o.getPreviousSibling()!==null)return!1;const l=o.getParent();if(l===null)return!1;o=l}return!(!Me(o)||!o.collapseAtStart(r))&&(n.preventDefault(),!0)},QA),e.registerNodeTransform(_i,n=>{const r=n.getFirstChild();if(r){if(Ie(r)){const i=r.getStyle(),o=r.getFormat();n.getTextStyle()!==i&&n.setTextStyle(i),n.getTextFormat()!==o&&n.setTextFormat(o)}}else{const i=re();ie(i)&&(i.style!==n.getTextStyle()||i.format!==n.getTextFormat())&&i.isCollapsed()&&n.is(i.anchor.getNode())&&n.setTextStyle(i.style).setTextFormat(i.format)}}),e.registerNodeTransform($s,n=>{const r=n.getParent();if(Me(r)&&n.is(r.getFirstChild())){const i=n.getStyle(),o=n.getFormat();i===r.getTextStyle()&&o===r.getTextFormat()||r.setTextStyle(i).setTextFormat(o)}}))}s(Lv,"re");function rL(e){const t=s(n=>{const r=n.getParent();if(Se(n.getFirstChild())||!Se(r))return;const i=dt(n,o=>Me(o)&&Se(o.getParent())&&Me(o.getPreviousSibling()));if(i===null&&n.getIndent()>0)n.setIndent(0);else if(Me(i)){const o=i.getPreviousSibling();if(Me(o)){const l=(function(a){let c=a,u=c.getFirstChild();for(;Se(u);){const d=u.getLastChild();if(!Me(d))break;c=d,u=c.getFirstChild()}return c})(o).getParent();if(Se(l)){const a=ra(l);a+1<ra(r)&&n.setIndent(a)}}}},"e");return e.registerNodeTransform(vi,n=>{const r=[n];for(;r.length>0;){const i=r.shift();if(Se(i)){for(const o of i.getChildren())if(Me(o)){t(o);const l=o.getFirstChild();Se(l)&&r.push(l)}}}})}s(rL,"ie");var iL={testNode:"list",visitNode:s(function({mdastNode:e,lexicalParent:t,actions:n}){const r=e.children.some(o=>typeof o.checked=="boolean")?"check":e.ordered?"number":"bullet",i=Zn(r);if(Me(t)){const o=Qn();o.append(i),t.insertAfter(o)}else t.append(i);n.visitChildren(e,i)},"visitNode")},oL={testNode:"listItem",visitNode({mdastNode:e,actions:t,lexicalParent:n}){const r=n.getListType()==="check"?e.checked??!1:void 0;t.addAndStepInto(Qn(r))}},sL={testLexicalNode:Se,visitLexicalNode:s(({lexicalNode:e,actions:t})=>{t.addAndStepInto("list",{ordered:e.getListType()==="number",spread:!1})},"visitLexicalNode")},lL={testLexicalNode:Me,visitLexicalNode:s(({lexicalNode:e,mdastParent:t,actions:n})=>{const r=e.getChildren(),i=r[0];if(r.length===1&&Se(i)){const o=t.children.at(-1);o?n.visitChildren(e,o):n.visitChildren(i,t)}else{const o=e.getParent(),l=n.appendToParent(t,{type:"listItem",checked:o.getListType()==="check"?!!e.getChecked():void 0,spread:!1,children:[]});let a=null;for(const c of e.getChildren())Ie(c)||Dr(c)||c.isInline()&&(xe(c)||Un(c))?(a??(a=n.appendToParent(l,{type:"paragraph",children:[]})),n.visit(c,a)):(a=null,n.visit(c,l))}},"visitLexicalNode")};function $v({maxIndent:e,$canIndent:t}){const[n]=fn();return(0,m.useEffect)(()=>dI(n,e,t),[n,e,t]),null}s($v,"o$2");function Pv({disableTakeFocusOnClick:e=!1}){const[t]=fn();return(0,m.useEffect)(()=>XR(t,{disableTakeFocusOnClick:e}),[t,e]),null}s(Pv,"l$3");function Fv({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){const[n]=fn();return(0,m.useEffect)(()=>{if(!n.hasNodes([vi,_i]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[n]),(0,m.useEffect)(()=>At(Lv(n,{restoreNumbering:t}),e?rL(n):()=>{}),[n,e,t]),(function(r){(0,m.useEffect)(()=>Lv(r),[r])})(n),null}s(Fv,"l$2");var aL=new Map([["number",WS],["bullet",US],["check",VS],["",zS]]),Vv=he("",e=>{e.sub(e.pipe(bs,mt(gt)),([t,n])=>{if(!t||!n)return;const r=t.anchor.getNode();let i=r.getKey()==="root"?r:dt(r,l=>{const a=l.getParent();return a!==null&&xn(a)});i??(i=r.getTopLevelElementOrThrow());const o=i.getKey();if(n.getElementByKey(o)!==null)if(Se(i)){const l=Pb(r,vi),a=l?l.getListType():i.getListType();e.pub(Vv,a)}else e.pub(Vv,"")})}),cL=wt(e=>{e.sub(e.pipe(cL,mt(gt)),([t,n])=>{n?.dispatchCommand(aL.get(t),void 0)})}),uL=En({init(e){var t;(t=e.getValue(fi))==null||t.registerCommand(fu,()=>!fL(7),Rr),e.pubIn({[Hs]:"lists",[wu]:Ik(),[Tu]:Pk(),[$r]:[iL,oL],[hi]:[_i,vi],[gi]:[sL,lL],[wm]:Ok(),[Bs]:[$v,Fv,Pv],[Am]:[$v,Fv,Pv]})}});function dL(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>xe(n)?n:n.getParentOrThrow()))}s(dL,"getElementNodesInSelection");function fL(e){const t=re();if(!ie(t))return!1;const n=dL(t);let r=0;for(const i of n)if(Se(i))r=Math.max(ra(i)+1,r);else if(Me(i)){const o=i.getParent();if(o?.getChildren().length===1){const l=o.getParent();if(Me(l)&&l.getChildren().length===1)return!1}if(!Se(o))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ra(o)+1,r)}return r<=e}s(fL,"isIndentPermitted");function jS(e,t){return e===null||e===t?!1:e.dataset.editorDialog!==void 0||e.dataset.toolbarItem!==void 0||e.dataset.editorDropdown?!0:jS(e.parentElement,t)}s(jS,"isPartOftheEditorUI");function hL(){const e=[...Array(256).keys()].map(n=>n.toString(16).padStart(2,"0")),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([n,r])=>[4,6,8,10].includes(n)?`-${e[r]}`:e[r]).join("")}s(hL,"uuidv4");var JS=s(e=>e===0?"th":"td","getCellType"),GS={center:J.centeredCell,left:J.leftAlignedCell,right:J.rightAlignedCell};function lr(e){const t=yn(e);return ZS(t)?t:null}s(lr,"$getTableNodeByKey");var gL=s(({mdastNode:e,parentEditor:t,lexicalTable:n})=>{const r=n.getKey(),[i,o]=m.useState(null),[l,a]=vr(pi,_r),c=m.useMemo(()=>y=>(y.__cacheKey??(y.__cacheKey=hL()),y.__cacheKey),[]),u=m.useCallback(y=>{const v=n.getColCount();if(y===null){o(null);return}let[x,C]=y;if(x>v-1&&(x=0,C++),x<0&&(x=v-1,C-=1),C>n.getRowCount()-1){o(null),t.update(()=>{const b=lr(r);if(b)if(b.getNextSibling())b.selectNext();else{const S=Xe();b.insertAfter(S),S.select()}});return}if(C<0){o(null),t.update(()=>{var b;(b=lr(r))==null||b.selectPrevious()});return}o([x,C])},[n,t,r]);m.useEffect(()=>{n.focusEmitter.subscribe(u)},[n,u]);const d=m.useCallback(y=>{y.preventDefault(),t.update(()=>{const v=lr(r);v&&(v.addRowToBottom(),o([0,v.getRowCount()]))})},[t,r]),f=m.useCallback(y=>{y.preventDefault(),t.update(()=>{const v=lr(r);v&&(v.addColumnToRight(),o([v.getColCount(),0]))})},[t,r]),[h,g]=m.useState([-1,-1]),p=m.useCallback(y=>{let v=y.target;for(;v&&!["TH","TD"].includes(v.tagName);){if(v===y.currentTarget)return;v=v.parentElement}if(v===null)return;const x=v.parentElement,C=x.parentElement.tagName==="TFOOT"?-1:Array.from(x.children).indexOf(v),b=v.tagName==="TH"?-1:Array.from(x.parentElement.children).indexOf(x);g([C,b])},[]),_=mi();return m.createElement("table",{className:J.tableEditor,onMouseOver:p,onMouseLeave:s(()=>{g([-1,-1])},"onMouseLeave")},m.createElement("colgroup",null,a?null:m.createElement("col",null),Array.from({length:e.children[0].children.length},(y,v)=>{const x=(e.align??[])[v]??"left",C=GS[x];return m.createElement("col",{key:v,className:C})}),a?null:m.createElement("col",null)),a||m.createElement("thead",null,m.createElement("tr",null,m.createElement("th",{className:J.tableToolsColumn}),Array.from({length:e.children[0].children.length},(y,v)=>m.createElement("th",{key:v,"data-tool-cell":!0},m.createElement(_L,{setActiveCellWithBoundaries:u,parentEditor:t,colIndex:v,highlightedCoordinates:h,lexicalTable:n,align:(e.align??[])[v]}))),m.createElement("th",{className:J.tableToolsColumn,"data-tool-cell":!0},m.createElement("button",{className:J.iconButton,type:"button",title:_("table.deleteTable","Delete table"),onClick:s(y=>{y.preventDefault(),t.update(()=>{const v=lr(r);v&&(v.selectNext(),v.remove())})},"onClick")},l("delete_small"))))),m.createElement("tbody",null,e.children.map((y,v)=>{const x=JS(v);return m.createElement("tr",{key:v},a||m.createElement(x,{className:J.toolCell,"data-tool-cell":!0},m.createElement(vL,{setActiveCellWithBoundaries:u,parentEditor:t,rowIndex:v,highlightedCoordinates:h,lexicalTable:n})),y.children.map((C,b)=>{var S;return m.createElement(pL,{align:(S=e.align)==null?void 0:S[b],key:c(C),contents:C.children,setActiveCell:u,rowIndex:v,colIndex:b,lexicalTable:n,parentEditor:t,activeCell:a?[-1,-1]:i})}),a||v===0&&m.createElement("th",{rowSpan:n.getRowCount(),"data-tool-cell":!0},m.createElement("button",{type:"button",className:J.addColumnButton,onClick:f},l("add_column"))))})),a||m.createElement("tfoot",null,m.createElement("tr",null,m.createElement("th",null),m.createElement("th",{colSpan:n.getColCount(),"data-tool-cell":!0},m.createElement("button",{type:"button",className:J.addRowButton,onClick:d},l("add_row"))),m.createElement("th",null))))},"TableEditor"),pL=s(({align:e,...t})=>{const{activeCell:n,setActiveCell:r}=t,i=n?.[0]===t.colIndex&&n[1]===t.rowIndex,o=GS[e??"left"],l=JS(t.rowIndex);return m.createElement(l,{className:o,"data-active":i,onClick:s(()=>{r([t.colIndex,t.rowIndex])},"onClick")},m.createElement(mL,{...t,focus:i}))},"Cell"),mL=s(({focus:e,setActiveCell:t,parentEditor:n,lexicalTable:r,contents:i,colIndex:o,rowIndex:l})=>{const a=r.getKey(),[c,u,d,f,h,g,p,_,y,v]=vr(bm,Id,Em,Nd,lS,La,Es,Tm,fi,xS),[x,C]=m.useState(null);m.useEffect(()=>{const S=rS({name:"@mdxeditor/table-cell",nodes:d,namespace:"TableCellEditor",parentEditor:n,historyMode:"table-local",initialEditorState:s(()=>{qE({root:Lt(),mdastRoot:{type:"root",children:[{type:"paragraph",children:i}]},visitors:c,jsxComponentDescriptors:f,directiveDescriptors:h,codeBlockEditorDescriptors:g,defaultCodeBlockLanguage:p})},"initialEditorState")});return C(S),()=>{S.dispose()}},[]);const b=m.useCallback(S=>{x&&(x.getEditorState().read(()=>{const M=UE({root:Lt(),jsxComponentDescriptors:f,visitors:u,jsxIsAvailable:_});n.update(()=>{const T=lr(a);T&&T.updateCellContents(o,l,M.children[0].children)},{discrete:!0}),n.dispatchCommand(Xl,void 0)}),t(S))},[o,x,u,f,_,n,l,t,a]);return m.useEffect(()=>{if(x)return At(x.registerCommand(am,S=>{S.preventDefault();const M=S.shiftKey?[o-1,l]:[o+1,l];return b(M),!0},Rr),x.registerCommand(sm,()=>(t([o,l]),!1),st),x.registerCommand(yd,S=>{S?.preventDefault();const M=S?.shiftKey?[o,l-1]:[o,l+1];return b(M),!0},Rr),x.registerCommand(rb,S=>{const M=S.relatedTarget;return jS(M,y.getRootElement())?!1:(b(null),!0)},Ae),x.registerCommand(Xl,()=>(b(null),!0),Ae))},[o,x,y,l,b,t]),m.useEffect(()=>{e&&x&&x.focus()},[e,x]),x?m.createElement(SS,{initialEditor:x},m.createElement(TS,{contentEditable:m.createElement(xm,null),placeholder:m.createElement("div",null),ErrorBoundary:Cm}),v.map((S,M)=>m.createElement(S,{key:M}))):null},"CellEditor"),_L=s(({parentEditor:e,highlightedCoordinates:t,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:o})=>{const l=r.getKey(),[a,c]=vr(Po,pi),u=m.useCallback(g=>{e.update(()=>{const p=lr(l);p&&(p.insertColumnAt(g),o([g,0]))})},[e,o,l]),d=m.useCallback(g=>{e.update(()=>{var p;(p=lr(l))==null||p.deleteColumnAt(g)})},[e,l]),f=m.useCallback((g,p)=>{e.update(()=>{var _;(_=lr(l))==null||_.setColumnAlign(g,p)})},[e,l]),h=mi();return m.createElement(Jg,null,m.createElement(Ex,{className:J.tableColumnEditorTrigger,"data-active":t[0]===i+1,title:h("table.columnMenu","Column menu")},c("more_horiz")),m.createElement(zg,{container:a?.current},m.createElement(bx,{className:(0,tt.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:s(g=>{g.preventDefault()},"onOpenAutoFocus"),sideOffset:5,side:"top"},m.createElement(iC,{className:J.tableColumnEditorToolbar},m.createElement(nM,{className:J.toggleGroupRoot,onValueChange:s(g=>{f(i,g)},"onValueChange"),value:n??"left",type:"single","aria-label":h("table.textAlignment","Text alignment")},m.createElement(Gd,{value:"left",title:h("table.alignLeft","Align left")},c("format_align_left")),m.createElement(Gd,{value:"center",title:h("table.alignCenter","Align center")},c("format_align_center")),m.createElement(Gd,{value:"right",title:h("table.alignRight","Align right")},c("format_align_right"))),m.createElement(tM,null),m.createElement(os,{onClick:u.bind(null,i),title:h("table.insertColumnLeft","Insert a column to the left of this one")},c("insert_col_left")),m.createElement(os,{onClick:u.bind(null,i+1),title:h("table.insertColumnRight","Insert a column to the right of this one")},c("insert_col_right")),m.createElement(os,{onClick:d.bind(null,i),title:h("table.deleteColumn","Delete this column")},c("delete_small"))),m.createElement(jg,{className:J.popoverArrow}))))},"ColumnEditor"),vL=s(({parentEditor:e,highlightedCoordinates:t,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{const o=n.getKey(),[l,a]=vr(Po,pi),c=m.useCallback(f=>{e.update(()=>{const h=lr(o);h&&(h.insertRowAt(f),i([0,f]))})},[e,i,o]),u=m.useCallback(f=>{e.update(()=>{var h;(h=lr(o))==null||h.deleteRowAt(f)})},[e,o]),d=mi();return m.createElement(Jg,null,m.createElement(Ex,{className:J.tableColumnEditorTrigger,"data-active":t[1]===r,title:d("table.rowMenu","Row menu")},a("more_horiz")),m.createElement(zg,{container:l?.current},m.createElement(bx,{className:(0,tt.default)(J.tableColumnEditorPopoverContent),onOpenAutoFocus:s(f=>{f.preventDefault()},"onOpenAutoFocus"),sideOffset:5,side:"bottom"},m.createElement(iC,{className:J.tableColumnEditorToolbar},m.createElement(os,{onClick:c.bind(null,r),title:d("table.insertRowAbove","Insert a row above this one")},a("insert_row_above")),m.createElement(os,{onClick:c.bind(null,r+1),title:d("table.insertRowBelow","Insert a row below this one")},a("insert_row_below")),m.createElement(os,{onClick:u.bind(null,r),title:d("table.deleteRow","Delete this row")},a("delete_small"))),m.createElement(jg,{className:J.popoverArrow}))))},"RowEditor"),yL=Object.defineProperty,xL=s((e,t,n)=>t in e?yL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),Bv=s((e,t,n)=>xL(e,typeof t!="symbol"?t+"":t,n),"__publicField$2"),Hv={type:"tableCell",children:[]};function CL(){let e=go;return{publish:s(t=>{e(t)},"publish"),subscribe:s(t=>{e=t},"subscribe")}}s(CL,"coordinatesEmitter");var Rd=class qS extends Ma{static{s(this,"TableNode")}constructor(t,n){super(n),Bv(this,"__mdastNode"),Bv(this,"focusEmitter",CL()),this.__mdastNode=t??{type:"table",children:[]}}static getType(){return"table"}static clone(t){return new qS(structuredClone(t.__mdastNode),t.__key)}static importJSON(t){return Dm(t.mdastNode)}static importDOM(){return{table:s(()=>({conversion:bL,priority:3}),"table")}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:"table",version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){var t;return((t=this.__mdastNode.children[0])==null?void 0:t.children.length)||0}createDOM(){return document.createElement("div")}updateDOM(){return!1}updateCellContents(t,n,r){const i=this.getWritable().__mdastNode,o=i.children[n],l=o.children,a=l[t],c=Array.from(l),u={...a,children:r},d={...o,children:c};c[t]=u,i.children[n]=d}insertColumnAt(t){const n=this.getWritable().__mdastNode;for(let r=0;r<n.children.length;r++){const i=n.children[r],o=i.children,l=Array.from(o),a={...i,children:l};l.splice(t,0,structuredClone(Hv)),n.children[r]=a}n.align&&n.align.length>0&&n.align.splice(t,0,"left")}deleteColumnAt(t){const n=this.getWritable().__mdastNode;for(let r=0;r<n.children.length;r++){const i=n.children[r],o=i.children,l=Array.from(o),a={...i,children:l};l.splice(t,1),n.children[r]=a}}insertRowAt(t){const n=this.getWritable().__mdastNode,r={type:"tableRow",children:Array.from({length:this.getColCount()},()=>structuredClone(Hv))};n.children.splice(t,0,r)}deleteRowAt(t){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(t,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(t,n){const r=this.getWritable().__mdastNode;r.align??(r.align=[]),r.align[t]=n}decorate(t){return m.createElement(gL,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:t})}select(t){this.focusEmitter.publish(t??[0,0])}isInline(){return!1}};function ZS(e){return e instanceof Rd}s(ZS,"$isTableNode");function Dm(e){return new Rd(e)}s(Dm,"$createTableNode");function bL(e){const t=e.querySelectorAll("tr"),n=Array.from(t).map(r=>({type:"tableRow",children:Array.from(r.querySelectorAll("td, th")).map(i=>({type:"tableCell",children:[{type:"text",value:i.textContent}]}))}));return{node:new Rd({type:"table",children:n})}}s(bL,"$convertTableElement");var EL={testLexicalNode:ZS,visitLexicalNode({actions:e,mdastParent:t,lexicalNode:n}){e.appendToParent(t,n.getMdastNode())}},SL={testNode:"table",visitNode({mdastNode:e,lexicalParent:t}){t.append(Dm(e))}};function TL(e=1,t=1){const n={type:"table",children:[]};for(let r=0;r<e;r++){const i={type:"tableRow",children:[]};for(let o=0;o<t;o++)i.children.push({type:"tableCell",children:[]});n.children.push(i)}return n}s(TL,"seedTable");var wL=wt(e=>{e.link(e.pipe(wL,$i(({rows:t,columns:n})=>()=>Dm(TL(t,n)))),Im)}),kL=En({init(e,t){e.pubIn({[wu]:Rk(),[Tu]:Ak(),[$r]:SL,[hi]:Rd,[gi]:EL,[wm]:Bk({tableCellPadding:t?.tableCellPadding??!0,tablePipeAlign:t?.tablePipeAlign??!0})})}}),Kv=new Set(["http:","https:","mailto:","sms:","tel:"]),Vr=class YS extends Lr{static{s(this,"Z")}__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new YS(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:i=null,rel:o=null,title:l=null}=n;this.__url=t,this.__target=i,this.__rel=o,this.__title=l}afterCloneFrom(t){super.afterCloneFrom(t),this.__url=t.__url,this.__rel=t.__rel,this.__target=t.__target,this.__title=t.__title}createDOM(t){const n=bn().createElement("a");return this.updateLinkDOM(null,n,t),mr(n,t.theme.link),n}updateLinkDOM(t,n,r){if(Ab(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const o=`__${i}`,l=this[o];t&&t[o]===l||(l?n[i]=l:n.removeAttribute(i))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:s(t=>({conversion:AL,priority:1}),"a")}}static importJSON(t){return ai().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){const n=t;t=jv(t);try{const r=new URL(jv(t));if(!Kv.has(r.protocol))return"about:blank"}catch{const i=n.replace(/[\u0000-\u001F\u007F\s]/g,"").match(/^([a-z][a-z0-9+.-]*):/i);if(i!=null&&!Kv.has(`${i[1].toLowerCase()}:`))return"about:blank"}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=tn(this);return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!ie(n))return!1;const i=n.anchor.getNode(),o=n.focus.getNode();return(this.is(i)||this.isParentOf(i))&&(this.is(o)||this.isParentOf(o))&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}shouldMergeAdjacentLink(t){return this.getType()===t.getType()&&this.__url===t.__url&&this.__target===t.__target&&this.__rel===t.__rel&&this.__title===t.__title}};function Uv(e){const t=Ui(e,"next");return[t,t.getFlipped()]}s(Uv,"H");function Wv(e,t){for(const n of t)if(n.origin.isAttached()){const r=zi(n);Ih(e,r);return}}s(Wv,"G");function ML(e){const t=re();let n=null,r=null;function i(){ie(t)&&(Wv(t.anchor,n),Wv(t.focus,r),jl(t))}s(i,"i"),ie(t)&&(n=Uv(t.anchor),r=Uv(t.focus));let o=!1;for(const a of Wi(e,"next")){const c=a.origin;if(xe(c)&&!c.isInline()){const u=c.getChildren();if(u.length>0){const d=tn(e);d.append(...u),c.append(d),o=!0}tm(c,Cl(a),{$shouldSplit:s(()=>!1,"$shouldSplit")})}}function l(a,c,u){const[d,f]=a,h=s(p=>uu(p)&&p.origin.is(c),"l");if(!h(d)&&!h(f))return a;const g=zi(Wi(u,"next"));return[g,g.getFlipped()]}if(s(l,"u"),e.isAttached()){const a=e.getPreviousSibling();if(St(a)&&a.shouldMergeAdjacentLink(e))return n&&(n=l(n,a,e)),r&&(r=l(r,a,e)),a.append(...e.getChildren()),e.remove(),void i();const c=e.getNextSibling();St(c)&&e.shouldMergeAdjacentLink(c)&&(n&&(n=l(n,e,c)),r&&(r=l(r,e,c)),e.append(...c.getChildren()),c.remove(),o=!0)}if(o){if(!e.canBeEmpty()&&e.isEmpty()){const a=e.getParent();e.remove(),a&&a.isEmpty()&&a.remove()}i()}}s(ML,"q");function AL(e){let t=null;if(Ab(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=ai(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}s(AL,"Q$1");function ai(e="",t){return ci(new Vr(e,t))}s(ai,"V$1");function St(e){return e instanceof Vr}s(St,"X$1");var Ld=class XS extends Vr{static{s(this,"Y")}__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}afterCloneFrom(t){super.afterCloneFrom(t),this.__isUnlinked=t.__isUnlinked}static getType(){return"autolink"}static clone(t){return new XS(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(t){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?bn().createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return ag().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=ag(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}};function ag(e="",t){return ci(new Ld(e,t))}s(ag,"tt");function ln(e){return e instanceof Ld}s(ln,"et");var ki=br("TOGGLE_LINK_COMMAND");function zv(e,t){if(e.type==="element"){const n=e.getNode();return xe(n)||(function(r,...i){const o=new URL("https://lexical.dev/docs/error"),l=new URLSearchParams;l.append("code",r);for(const a of i)l.append("v",a);throw o.search=l.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),n.getChildren()[e.offset+t]||null}return null}s(zv,"rt$1");function Sf(e,t={}){let n;if(e&&typeof e=="object"){const{url:d,...f}=e;n=d,t={...f,...t}}else n=e;const{target:r,title:i}=t,o=t.rel===void 0?"noreferrer":t.rel,l=re();if(l===null||!ie(l)&&!He(l))return;if(He(l)){const d=l.getNodes();if(d.length===0)return;d.forEach(f=>{if(n===null){const h=dt(f,g=>!ln(g)&&St(g));h&&(h.insertBefore(f),h.getChildren().length===0&&h.remove())}else{const h=dt(f,g=>!ln(g)&&St(g));if(h)h.setURL(n),r!==void 0&&h.setTarget(r),o!==void 0&&h.setRel(o);else{const g=ai(n,{rel:o,target:r});f.insertBefore(g),g.append(f)}}});return}if(l.isCollapsed()&&n===null)for(const d of l.getNodes()){const f=dt(d,h=>!ln(h)&&St(h));f!==null&&(f.getParentOrThrow().splice(f.getIndexWithinParent(),0,f.getChildren()),f.remove());return}const a=l.extract();if(n===null){const d=new Set;a.forEach(f=>{const h=dt(f,g=>!ln(g)&&St(g));if(h!==null){const g=h.getKey();if(d.has(g))return;(function(p,_){const y=new Set(_.filter(E=>p.isParentOf(E)).map(E=>E.getKey())),v=p.getChildren(),x=s(E=>y.has(E.getKey())||xe(E)&&_.some(A=>p.isParentOf(A)&&E.isParentOf(A)),"i"),C=v.filter(x);if(C.length===v.length)return v.forEach(E=>p.insertBefore(E)),void p.remove();const b=v.findIndex(x),S=v.findLastIndex(x),M=b===0,T=S===v.length-1;if(M)C.forEach(E=>p.insertBefore(E));else if(T)for(let E=C.length-1;E>=0;E--)p.insertAfter(C[E]);else{for(let A=C.length-1;A>=0;A--)p.insertAfter(C[A]);const E=v.slice(S+1);if(E.length>0){const A=tn(p);C[C.length-1].insertAfter(A),E.forEach(D=>A.append(D))}}})(h,a),d.add(g)}});return}const c=new Set,u=s(d=>{c.has(d.getKey())||(c.add(d.getKey()),d.setURL(n),r!==void 0&&d.setTarget(r),o!==void 0&&d.setRel(o),i!==void 0&&d.setTitle(i))},"m");if(a.length===1){const d=a[0],f=dt(d,St);if(f!==null)return u(f)}(function(d){const f=re();if(!ie(f))return d();const h=jl(f),g=h.isBackward(),p=zv(h.anchor,g?-1:0),_=zv(h.focus,g?0:-1);if(d(),p||_){const y=re();if(ie(y)){const v=y.clone();if(p){const x=p.getParent();x&&v.anchor.set(x.getKey(),p.getIndexWithinParent()+(g?1:0),"element")}if(_){const x=_.getParent();x&&v.focus.set(x.getKey(),_.getIndexWithinParent()+(g?0:1),"element")}Xn(jl(v))}}})(()=>{let d=null;for(const f of a){if(!f.isAttached())continue;const h=dt(f,St);if(h){u(h);continue}if(xe(f)){if(!f.isInline())continue;if(St(f)){if(!(ln(f)||d!==null&&d.getParentOrThrow().isParentOf(f))){u(f),d=f;continue}for(const p of f.getChildren())f.insertBefore(p);f.remove();continue}}const g=f.getPreviousSibling();St(g)&&g.is(d)?g.append(f):(d=ai(n,{rel:o,target:r,title:i}),f.insertAfter(d),d.append(f))}})}s(Sf,"it$1");var IL=/^\+?[0-9\s()-]{5,}$/;function jv(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:IL.test(e)?`tel:${e}`:`https://${e}`}s(jv,"st$1");var wz=[{$import:s((e,t)=>{if(!t.textContent&&t.children.length===0)return[];const n=t.getAttribute("href")||"",r={rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")};return uE(e.$importChildren(t),()=>ai(n,r))},"$import"),match:zt.tag("a"),name:"@lexical/link/a"}];function NL(e,t){return At(e.registerNodeTransform(Vr,ML),e.registerCommand(ki,n=>{const r=t.validateUrl.peek(),i=t.attributes.peek();if(n===null)return Sf(null),!0;if(typeof n=="string")return!(r!==void 0&&!r(n))&&(Sf(n,i),!0);{const{url:o,target:l,rel:a,title:c}=n;return Sf(o,{...i,rel:a,target:l,title:c}),!0}},Ae),Lo(()=>{const n=t.validateUrl.value;if(!n)return;const r=t.attributes.value;return e.registerCommand(Gl,i=>{const o=re();if(!ie(o)||o.isCollapsed()||!Zr(i,ClipboardEvent)||i.clipboardData===null)return!1;const l=i.clipboardData.getData("text");return n(l)?!o.getNodes().some(a=>xe(a)||Ie(a)&&!a.isSimpleText())&&(e.dispatchCommand(ki,{...r,url:l}),i.preventDefault(),!0):!1},st)}))}s(NL,"ut");function cg(e,t=n=>n){return n=>{const r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}s(cg,"dt");var kz=cg(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/,e=>`mailto:${e}`);function ug(e,t){for(let n=0;n<t.length;n++){const r=t[n](e);if(r)return r}return null}s(ug,"mt$1");var QS=/[.,;\s]/;function Mu(e,t){return t.test(e)}s(Mu,"bt$1");function eT(e,t){return Mu(e[e.length-1],t)}s(eT,"kt$1");function dg(e,t){return Mu(e[0],t)}s(dg,"Ut$1");function tT(e,t){let n=e.getPreviousSibling();return xe(n)&&(n=n.getLastDescendant()),n===null||Dr(n)||Ie(n)&&eT(n.getTextContent(),t)}s(tT,"vt$1");function nT(e,t){let n=e.getNextSibling();return xe(n)&&(n=n.getFirstDescendant()),n===null||Dr(n)||Ie(n)&&dg(n.getTextContent(),t)}s(nT,"Tt$1");function OL(e,t,n,r,i){return(e>0?Mu(r[e-1],n):tT(i[0],n))?t<r.length?Mu(r[t],n):nT(i[i.length-1],n):!1}s(OL,"Ct$1");function DL(e,t,n){const r=[],i=[],o=[];let l=0,a=0;const c=[...e];for(;c.length>0;){const u=c[0],d=u.getTextContent().length,f=a;a+d<=t?(r.push(u),l+=d):f>=n?o.push(u):i.push(u),a+=d,c.shift()}return[l,r,i,o]}s(DL,"Lt$1");function RL(e,t,n,r){const i=ag(r.url,r.attributes);if(e.length===1){let o,l=e[0];t===0?[o,l]=l.splitText(n):[,o,l]=l.splitText(t,n);const a=pr(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),i.append(a),o.replace(i),l}if(e.length>1){const o=e[0];let l,a=o.getTextContent().length;t===0?l=o:[,l]=o.splitText(t);const c=[];let u;for(let g=1;g<e.length;g++){const p=e[g],_=p.getTextContent().length,y=a;if(y<n)if(a+_<=n)c.push(p);else{const[v,x]=p.splitText(n-y);c.push(v),u=x}a+=_}const d=re(),f=d?d.getNodes().find(Ie):void 0,h=pr(l.getTextContent());return h.setFormat(l.getFormat()),h.setDetail(l.getDetail()),h.setStyle(l.getStyle()),i.append(h,...c),f&&f===l&&(ie(d)?h.select(d.anchor.offset,d.focus.offset):He(d)&&h.select(0,h.getTextContent().length)),l.replace(i),u}}s(RL,"St$1");function Jv(e,t,n,r){const i=e.getChildren(),o=i.length;for(let u=0;u<o;u++){const d=i[u];if(!Ie(d)||!d.isSimpleText())return Tl(e),void n(null,e.getURL())}const l=e.getTextContent(),a=ug(l,t);if(a===null||a.text!==l||!tT(e,r)||!nT(e,r))return Tl(e),void n(null,e.getURL());const c=e.getURL();if(c!==a.url&&(e.setURL(a.url),n(a.url,c)),a.attributes){const u=e.getRel();u!==a.attributes.rel&&(e.setRel(a.attributes.rel||null),n(a.attributes.rel||null,u));const d=e.getTarget();d!==a.attributes.target&&(e.setTarget(a.attributes.target||null),n(a.attributes.target||null,d))}}s(Jv,"Nt$1");function Tl(e){const t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(n=>n.getLatest())}s(Tl,"Ot$1");var LL={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:QS};function $L(e,t=LL){const{matchers:n,changeHandlers:r,excludeParents:i,separatorRegex:o=QS}=t,l=s((a,c)=>{for(const u of r)u(a,c)},"s");return At(e.registerNodeTransform($s,a=>{const c=a.getParentOrThrow(),u=a.getPreviousSibling();ln(c)?Jv(c,n,l,o):!St(c)&&!i.some(d=>d(c))&&(a.isSimpleText()&&(dg(a.getTextContent(),o)||!ln(u))&&(function(d,f,h,g){for(const C of d){const b=C.getParent();if(ln(b)&&!b.getIsUnlinked())return}let p=[...d];const _=p.map(C=>C.getTextContent()).join("");let y,v=_,x=0;for(;(y=ug(v,f))&&y!==null;){const C=y.index,b=C+y.length;if(OL(x+C,x+b,g,_,p)){const[S,,M,T]=DL(p,x+C,x+b);let E=!1;for(const D of M){const L=D.getParent();if(ln(L)&&!L.getIsUnlinked()){E=!0;break}}if(E){x+=b,v=v.substring(b);continue}const A=RL(M,x+C-S,x+b-S,y);p=A?[A,...T]:T,h(y.url,null),x=0}else x+=b;v=v.substring(b)}})((function(d){const f=[d];let h=d.getNextSibling();for(;h!==null&&Ie(h)&&h.isSimpleText()&&(f.push(h),!/[\s]/.test(h.getTextContent()));)h=h.getNextSibling();return f})(a),n,l,o),(function(d,f,h,g){const p=d.getParent(),_=d.getPreviousSibling(),y=d.getNextSibling(),v=d.getTextContent();if(!ln(p)||p.getIsUnlinked()){if(ln(_)&&!_.getIsUnlinked()&&_.is(d.getPreviousSibling())&&d.getParent()===_.getParent()){if(!dg(v,g))return Tl(_),void h(null,_.getURL());if(x=v,_.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(x):/^\.[a-zA-Z0-9]{1,}/.test(x)){const C=_.getTextContent()+v,b=ug(C,f);b!==null&&b.text===C&&(_.append(d),Jv(_,f,h,g),h(null,_.getURL()))}}var x;!ln(y)||y.getIsUnlinked()||eT(v,g)||y.is(d.getNextSibling())&&d.getParent()===y.getParent()&&(Tl(y),h(null,y.getURL()))}})(a,n,l,o))}),e.registerCommand(ki,a=>{const c=re();return a!==null||!ie(c)||c.extract().forEach(u=>{const d=u.getParent();ln(d)&&(d.setIsUnlinked(!d.getIsUnlinked()),d.markDirty())}),!1},st))}s($L,"Pt$1");var PL={testNode:"link",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(ai(e.url,{title:e.title}))}},FL={testLexicalNode:St,visitLexicalNode:s(({lexicalNode:e,actions:t})=>{t.addAndStepInto("link",{url:e.getURL(),title:e.getTitle()})},"visitLexicalNode")};function VL({validateUrl:e,attributes:t}){const[n]=fn();return(0,m.useEffect)(()=>{if(!n.hasNodes([Vr]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),(0,m.useEffect)(()=>NL(n,Na({attributes:t,validateUrl:e})),[n,e,t]),null}s(VL,"l$1");function BL(e,t,n,r){(0,m.useEffect)(()=>{e.hasNodes([Ld])||(function(i,...o){const l=new URL("https://lexical.dev/docs/error"),a=new URLSearchParams;a.append("code",i);for(const c of o)a.append("v",c);throw l.search=a.toString(),Error(`Minified Lexical error #${i}; visit ${l.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),(0,m.useEffect)(()=>$L(e,{changeHandlers:n?[n]:[],excludeParents:r??[],matchers:t}),[e,t,n,r])}s(BL,"t$1");function HL({matchers:e,onChange:t,excludeParents:n}){const[r]=fn();return BL(r,e,t,n),null}s(HL,"i$2");var KL=[cg(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith("http")?e:`https://${e}`),cg(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>`mailto:${e}`)],UL=s(()=>m.createElement(HL,{matchers:KL}),"LexicalAutoLinkPlugin"),WL=he(!1),zL=En({init(e,t){const n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{},i=s(()=>m.createElement(m.Fragment,null,m.createElement(VL,{...r}),n?null:m.createElement(UL,null)),"EditorChild");e.pubIn({[Hs]:"link",[$r]:PL,[hi]:[Vr,Ld],[gi]:FL,[WL]:n,[Am]:i,[CS]:i,[Bs]:i})}});function jL(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}s(jL,"_objectWithoutPropertiesLoose$1");var JL=["color"],GL=(0,m.forwardRef)(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=jL(e,JL);return(0,m.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),(0,m.createElement)("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Gv=s(()=>m.createElement("div",{className:J.imagePlaceholder},m.createElement(GL,null)),"ImagePlaceholder");function fg(e){const{nodeKey:t,imageSource:n,initialImagePath:r,title:i,alt:o,width:l,height:a}=e,[c,u,d]=vr(tw,pi,_r),[f]=fn(),h=Mn(QT),g=mi();return m.createElement("div",{className:J.editImageToolbar},m.createElement("button",{className:J.iconButton,type:"button",title:g("imageEditor.deleteImage","Delete image"),disabled:d,onClick:s(p=>{p.preventDefault(),f.update(()=>{var _;(_=yn(t))==null||_.remove()})},"onClick")},u("delete_small")),!c&&m.createElement("button",{type:"button",className:(0,tt.default)(J.iconButton,J.editImageButton),title:g("imageEditor.editImage","Edit image"),disabled:d,onClick:s(()=>{h({nodeKey:t,initialValues:{src:r??n,title:i,altText:o,width:Ss(l),height:Ss(a)}})},"onClick")},u("settings")))}s(fg,"EditImageToolbar");var Pa=s(e=>e.type==="checkbox","isCheckBoxInput"),$d=s(e=>e.type==="file","isFileInput"),Mi=s(e=>e instanceof Date,"isDateObject"),Vt=s(e=>e==null,"isNullOrUndefined"),Rm=s(e=>typeof e=="object","isObjectType"),bt=s(e=>!Vt(e)&&!Array.isArray(e)&&Rm(e)&&!Mi(e),"isObject"),hg=s(e=>bt(e)&&e.target?Pa(e.target)?e.target.checked:$d(e.target)?e.target.files:e.target.value:e,"getEventValue"),qL=/[.[\]'"]/,ko=s(e=>e.split(qL).filter(Boolean),"stringToPath");function ZL(e,t){const n=ko(t);let r=e._formValues,i=e._defaultValues;for(let o=0;o<n.length-1;o++){const l=n[o];if(r=r==null?r:r[l],i=i==null?i:i[l],r===null||i===null)return null}}s(ZL,"getNullAncestorValue");var rT=s((e,t)=>t.split(".").some((n,r,i)=>!isNaN(Number(n))&&e.has(i.slice(0,r).join("."))),"isNameInFieldArray"),Pd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function at(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Pd&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&e.constructor!==Object)return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=at(e[i]));return r}s(at,"cloneObject");var Ei={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ar={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},sr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},iT="root",Lm=["__proto__","constructor","prototype"],YL=/^\w*$/,Mo=s(e=>YL.test(e),"isKey"),je=s(e=>e===void 0,"isUndefined"),te=s((e,t,n)=>{if(!t||!bt(e))return n;const r=Mo(t)?[t]:ko(t);if(r.some(o=>Lm.includes(o)))return n;const i=r.reduce((o,l)=>Vt(o)?void 0:o[l],e);return je(i)||i===e?je(e[t])?n:e[t]:i},"get"),wn=s(e=>typeof e=="boolean","isBoolean"),en=s(e=>typeof e=="function","isFunction"),Qe=s((e,t,n)=>{let r=-1;const i=Mo(t)?[t]:ko(t),o=i.length,l=o-1;for(;++r<o;){const a=i[r];let c=n;if(r!==l){const u=e[a];c=bt(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(Lm.includes(a))return;e[a]=c,e=e[a]}},"set"),oT=m.createContext(null);oT.displayName="HookFormControlContext";var $m=s(()=>m.useContext(oT),"useFormControlContext"),sT=s((e,t,n,r=!0)=>{const i={};for(const o in e)Object.defineProperty(i,o,{get:s(()=>{const l=o;return t._proxyFormState[l]!==ar.all&&(t._proxyFormState[l]=!r||ar.all),n&&(n[l]=!0),e[l]},"get")});return i},"getProxyFormState"),Pm=Pd?m.useLayoutEffect:m.useEffect,XL=s(e=>{const t=e.constructor&&e.constructor.prototype;return bt(t)&&t.hasOwnProperty("isPrototypeOf")},"isPlainObject"),gg=s(e=>Vt(e)||!Rm(e),"isPrimitive"),qv=s((e,t)=>t.length===0&&!Array.isArray(e)&&!XL(e),"isEmptyObjectWithCustomPrototype");function gn(e,t,n=new WeakMap){if(e===t)return!0;if(gg(e)||gg(t))return Object.is(e,t);if(Mi(e)&&Mi(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(qv(e,r)||qv(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;const o=n.get(e);if(o&&o.has(t))return!0;if(o)o.add(t);else{const l=new WeakSet;l.add(t),n.set(e,l)}for(const l of r){const a=e[l];if(!(l in t))return!1;if(l!=="ref"){const c=t[l];if(Mi(a)&&Mi(c)||(bt(a)||Array.isArray(a))&&(bt(c)||Array.isArray(c))?!gn(a,c,n):!Object.is(a,c))return!1}}return!0}s(gn,"deepEqual");function Fm(e){const t=m.useRef(!1),n=m.useRef(!1),r=m.useRef(void 0),i=m.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=at(e())),{resyncIfNeeded:m.useCallback((o,l,a)=>{if(o&&(t.current||n.current&&i.current>1)){const c=l();gn(r.current,c)||a(c)}t.current=!0},[]),snapshot:m.useCallback((o,l)=>{o&&(r.current=at(l()))},[])}}s(Fm,"useResyncOnReconnect");function QL(e){const t=$m(),{control:n=t,disabled:r,name:i,exact:o}=e||{},l=s(()=>({...n._formState,defaultValues:n._defaultValues}),"getCurrentFormState"),[a,c]=m.useState(l),u=m.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:f}=Fm(l);return Pm(()=>{d(!r,l,c);const h=n._subscribe({name:i,formState:u.current,exact:o,callback:s(g=>{!r&&c({...n._formState,...g,defaultValues:n._defaultValues})},"callback")});return()=>{h(),f(!r,l)}},[i,r,o,d,f]),m.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),m.useMemo(()=>sT(a,n,u.current,!1),[a,n])}s(QL,"useFormState");var Bt=s(e=>typeof e=="string","isString"),pg=s((e,t,n,r,i)=>Bt(e)?(r&&t.watch.add(e),te(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),te(n,o,te(i,o)))):(r&&(t.watchAll=!0),n),"generateWatchOutput");function e$(e){const t=$m(),{control:n=t,name:r,defaultValue:i,disabled:o,exact:l,compute:a}=e||{},c=m.useRef(i),u=m.useRef(a),d=m.useRef(void 0),f=m.useRef(n),h=m.useRef(r);u.current=a;const g=s(()=>{const E=n._getWatch(r,c.current);return u.current?u.current(E):E},"getInitialOutput"),[p,_]=m.useState(g),y=m.useCallback(E=>{const A=pg(r,n._names,E||n._formValues,!1,c.current);return u.current?u.current(A):A},[n._formValues,n._names,r]),v=m.useCallback(E=>{if(!o){const A=pg(r,n._names,E||n._formValues,!1,c.current);if(u.current){const D=u.current(A);gn(D,d.current)||(_(D),d.current=D)}else _(A)}},[n._formValues,n._names,o,r]),{resyncIfNeeded:x,snapshot:C}=Fm(g),b=m.useRef(v);b.current=v;const S=m.useRef(y);S.current=y,Pm(()=>{f.current!==n||!gn(h.current,r)?(f.current=n,h.current=r,b.current()):x(!o,()=>S.current(),A=>{_(A),d.current=A});const E=n._subscribe({name:r,formState:{values:!0},exact:l,callback:s(A=>{b.current(A.values)},"callback")});return()=>{E(),C(!o,()=>S.current())}},[n,l,r,o,x,C]),m.useEffect(()=>n._removeUnmounted());const M=f.current!==n,T=h.current;return m.useMemo(()=>{if(o)return!1;const E=!M&&!gn(T,r);return M||E},[o,M,r,T])?y():p}s(e$,"useWatch");function t$(e){const t=$m(),{name:n,disabled:r,control:i=t,shouldUnregister:o,defaultValue:l,exact:a=!0}=e,c=rT(i._names.array,n),u=e$({control:i,name:n,defaultValue:m.useMemo(()=>{const C=te(i._formValues,n,te(i._defaultValues,n,l));return je(C)?ZL(i,n):C},[i,n,l]),exact:a}),d=QL({control:i,name:n,exact:a}),f=m.useRef(e),h=m.useRef(null),g=m.useRef(i.register(n,{...e.rules,value:u,...wn(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const p=m.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:s(()=>!!te(d.errors,n),"get")},isDirty:{enumerable:!0,get:s(()=>!!te(d.dirtyFields,n),"get")},isTouched:{enumerable:!0,get:s(()=>!!te(d.touchedFields,n),"get")},isValidating:{enumerable:!0,get:s(()=>!!te(d.validatingFields,n),"get")},error:{enumerable:!0,get:s(()=>te(d.errors,n),"get")}}),[d,n]),_=m.useCallback(C=>{const b=hg(C);return te(i._fields,n)||(g.current=i.register(n,{...f.current.rules,value:b})),g.current.onChange({target:{value:hg(C),name:n},type:Ei.CHANGE})},[n,i]),y=m.useCallback(()=>g.current.onBlur({target:{value:te(i._formValues,n),name:n},type:Ei.BLUR}),[n,i._formValues]),v=m.useCallback(C=>{C&&(h.current={focus:s(()=>en(C.focus)&&C.focus(),"focus"),select:s(()=>en(C.select)&&C.select(),"select"),setCustomValidity:s(S=>en(C.setCustomValidity)&&C.setCustomValidity(S),"setCustomValidity"),reportValidity:s(()=>en(C.reportValidity)&&C.reportValidity(),"reportValidity")});const b=te(i._fields,n);b&&b._f&&C&&(b._f.ref=h.current)},[i._fields,n]),x=m.useMemo(()=>({name:n,value:u,...wn(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:_,onBlur:y,ref:v}),[n,r,d.disabled,_,y,v,u]);return m.useEffect(()=>{const C=i._options.shouldUnregister||o;g.current=i.register(n,{...f.current.rules,...wn(f.current.disabled)?{disabled:f.current.disabled}:{}});const b=s((S,M)=>{const T=te(i._fields,S);T&&T._f&&(T._f.mount=M)},"updateMounted");if(b(n,!0),C){const S=at(te(o?i._defaultValues:i._options.values||i._defaultValues,n,te(i._options.defaultValues,n,f.current.defaultValue)));Qe(i._defaultValues,n,S),je(te(i._formValues,n))&&Qe(i._formValues,n,S)}if(!c&&i.register(n),h.current){const S=te(i._fields,n);S&&S._f&&(S._f.ref=h.current)}return()=>{(c?C&&!i._state.action:C)?i.unregister(n):b(n,!1)}},[n,i,c,o]),m.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),m.useMemo(()=>({field:x,formState:d,fieldState:p}),[x,d,p])}s(t$,"useController");var n$=s(e=>e.render(t$(e)),"Controller"),rc=s(e=>({isOnSubmit:!e||e===ar.onSubmit,isOnBlur:e===ar.onBlur,isOnChange:e===ar.onChange,isOnAll:e===ar.all,isOnTouch:e===ar.onTouched}),"getValidationModes"),Tf=s((e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1},"isWatched"),wl=s((e,t,n,r)=>{for(const i of n||Object.keys(e)){if(i==="_f")continue;const o=n?te(e,i):e[i];if(o){const{_f:l}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],i)&&!r)return!0;if(l.ref&&t(l.ref,l.name)&&!r)return!0;if(wl(o,t))break}else if((bt(o)||Array.isArray(o))&&wl(o,t))break}}},"iterateFieldsByAction"),Zv=s((e,t,n)=>{const r=te(e,n),i=Array.isArray(r)?r:[];return Qe(i,iT,t[n]),Qe(e,n,i),e},"updateFieldArrayRootError"),Jt=s(e=>bt(e)&&!Object.keys(e).length,"isEmptyObject"),Au=s(e=>{if(!Pd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},"isHTMLElement"),Vm=s(e=>e.type==="radio","isRadioInput"),Iu=s(e=>e instanceof RegExp,"isRegex"),r$=s((e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},"appendErrors"),Yv={value:!1,isValid:!1},Xv={value:!0,isValid:!0},lT=s(e=>{if(!Array.isArray(e))return Yv;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Yv:!t.attributes||!("value"in t.attributes)||je(t.value)||t.value===""?Xv:{value:t.value,isValid:!0}},"getCheckboxValue"),Qv={isValid:!1,value:null},aT=s(e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Qv):Qv,"getRadioValue");function ey(e,t,n="validate"){if(Bt(e)||Array.isArray(e)&&e.every(Bt)||wn(e)&&!e)return{type:n,message:Bt(e)?e:"",ref:t}}s(ey,"getValidateError");var Wo=s(e=>bt(e)&&!Iu(e)?e:{value:e,message:""},"getValueAndMessage"),ty=s(async(e,t,n,r,i,o)=>{const{ref:l,refs:a,required:c,maxLength:u,minLength:d,min:f,max:h,pattern:g,validate:p,name:_,valueAsNumber:y,mount:v}=e._f,x=te(n,_);if(!v||t.has(_))return{};const C=a?a[0]:l,b=s($=>{if(i&&C.reportValidity){const z=wn($)?"":$||"";a?a.forEach(W=>W.setCustomValidity(z)):C.setCustomValidity(z),C.reportValidity()}},"setCustomValidity"),S={},M=Vm(l),T=Pa(l),E=M||T,A=(y||$d(l))&&je(l.value)&&je(x)||Au(l)&&l.value===""||x===""||Array.isArray(x)&&!x.length,D=r$.bind(null,_,r,S),L=s(($,z,W,ye=sr.maxLength,q=sr.minLength)=>{const ge=$?z:W;S[_]={type:$?ye:q,message:ge,ref:l,...D($?ye:q,ge)}},"getMinMaxMessage");if(o?!Array.isArray(x)||!x.length:c&&(!E&&(A||Vt(x))||wn(x)&&!x||T&&!lT(a).isValid||M&&!aT(a).isValid)){const{value:$,message:z}=Bt(c)?{value:!!c,message:c}:Wo(c);if($&&(S[_]={type:sr.required,message:z,ref:C,...D(sr.required,z)},!r))return b(z),S}if(!A&&(!Vt(f)||!Vt(h))){let $,z;const W=Wo(h),ye=Wo(f);if(!Vt(x)&&!Mi(x)&&!isNaN(x)){const q=l.valueAsNumber||x&&+x;Vt(W.value)||($=q>W.value),Vt(ye.value)||(z=q<ye.value)}else{const q=l.valueAsDate||new Date(x),ge=s(Z=>new Date(new Date().toDateString()+" "+Z),"convertTimeToDate"),me=l.type=="time",oe=l.type=="week";Bt(W.value)&&x&&($=me?ge(x)>ge(W.value):oe?x>W.value:q>new Date(W.value)),Bt(ye.value)&&x&&(z=me?ge(x)<ge(ye.value):oe?x<ye.value:q<new Date(ye.value))}if(($||z)&&(L(!!$,W.message,ye.message,sr.max,sr.min),!r))return b(S[_].message),S}if((u||d)&&!A&&(Bt(x)||o&&Array.isArray(x))){const $=Wo(u),z=Wo(d),W=!Vt($.value)&&x.length>+$.value,ye=!Vt(z.value)&&x.length<+z.value;if((W||ye)&&(L(W,$.message,z.message),!r))return b(S[_].message),S}if(g&&!A&&Bt(x)){const{value:$,message:z}=Wo(g);if(Iu($)&&!x.match($)&&(S[_]={type:sr.pattern,message:z,ref:l,...D(sr.pattern,z)},!r))return b(z),S}if(p){if(en(p)){const $=ey(await p(x,n),C);if($&&(S[_]={...$,...D(sr.validate,$.message)},!r))return b($.message),S}else if(bt(p)){let $={};for(const z in p){if(!Jt($)&&!r)break;const W=ey(await p[z](x,n),C,z);W&&($={...W,...D(z,W.message)},b(W.message),r&&(S[_]=$))}if(!Jt($)&&(S[_]={ref:C,...$},!r))return S}}const G=S[_];return b(G?G.message:!0),S},"validateField"),Dc=s(e=>Array.isArray(e)?e:[e],"convertToArrayPayload"),cT=s(e=>Array.isArray(e)?e.filter(Boolean):[],"compact");function i$(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Vt(e)){e=void 0;break}e=e[t[r]],r++}return e}s(i$,"baseGet");function o$(e){for(const t in e)if(e.hasOwnProperty(t)&&!je(e[t]))return!1;return!0}s(o$,"isEmptyArray");function Et(e,t){if(Bt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:Mo(t)?[t]:ko(t);if(n.some(l=>Lm.includes(String(l))))return e;const r=n.length===1?e:i$(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(bt(r)&&Jt(r)||Array.isArray(r)&&o$(r))&&Et(e,n.slice(0,-1)),e}s(Et,"unset");var s$=m.createContext(null);s$.displayName="HookFormContext";var ny=s(()=>{let e=[];return{get observers(){return e},next:s(i=>{for(const o of e)o.next&&o.next(i)},"next"),subscribe:s(i=>(e.push(i),{unsubscribe:s(()=>{e=e.filter(o=>o!==i)},"unsubscribe")}),"subscribe"),unsubscribe:s(()=>{e=[]},"unsubscribe")}},"createSubject");function uT(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&bt(i)&&o){const l=uT(i,o);bt(l)&&(n[r]=l)}else e[r]&&(n[r]=o)}return n}s(uT,"extractFormValues");var ry=s((e,t)=>e!==null&&Rm(e)&&Object.prototype.hasOwnProperty.call(e,t),"hasOwn"),l$=s((e,t)=>{if(!t)return!1;let n=e;for(const r of Mo(t)?[t]:ko(t)){if(!ry(n,r))return ry(e,t);n=n[r]}return!0},"has"),dT=s(e=>e.type==="select-multiple","isMultipleSelect"),a$=s(e=>Vm(e)||Pa(e),"isRadioOrCheckbox"),wf=s(e=>Au(e)&&e.isConnected,"live");function iy(e){return Array.isArray(e)||bt(e)}s(iy,"isDirtyContainer");function fT(e,t,n="",r=[]){for(const i in e){const o=n?`${n}.${i}`:i,l=e[i];iy(l)&&iy(te(t,o))?fT(l,t,o,r):r.push(o)}return r}s(fT,"collectDirtyFieldNames");var c$=s(e=>{for(const t in e)if(en(e[t]))return!0;return!1},"objectHasFunction");function hT(e){return Array.isArray(e)||bt(e)&&!c$(e)}s(hT,"isTraversable");function gT(e){return!!(e&&"_f"in e)}s(gT,"isRegisteredLeaf");function pT(e){return Array.isArray(e)?!e.some(t=>!je(t)):!Object.keys(e).length}s(pT,"isEmptyDirtyContainer");function mg(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}s(mg,"clearDirtyField");function _g(e,t={},n){for(const r in e){const i=e[r],o=n&&n[r];hT(i)&&(!Array.isArray(i)||!gT(o))?(t[r]=Array.isArray(i)?[]:{},_g(i,t[r],o),pT(t[r])&&mg(t,r)):je(i)||(t[r]=!0)}return t}s(_g,"markFieldsDirty");function io(e,t,n,r){n||(n=_g(t,{},r));for(const i in e){const o=e[i],l=r&&r[i];hT(o)&&(!Array.isArray(o)||!gT(l))?(je(t)||gg(n[i])?n[i]=_g(o,Array.isArray(o)?[]:{},l):io(o,Vt(t)?{}:t[i],n[i],l),pT(n[i])&&mg(n,i)):gn(o,t[i])?mg(n,i):n[i]=!0}return n}s(io,"getDirtyFields");var u$=s((e,t)=>{const n=t.split("."),r=[];let i=n[0];for(let o=1;o<n.length;i+="."+n[o++])!isNaN(+n[o])&&e.has(i)&&r.push(`${i}.${n[o]}`);return r},"getFieldArrayItemNames"),mT=s((e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>je(e)?e:t?e===""?NaN:e&&+e:n&&Bt(e)?new Date(e):r?r(e):e,"getFieldValueAs");function oy(e){const t=e.ref;return $d(t)?t.files:Vm(t)?aT(e.refs).value:dT(t)?[...t.selectedOptions].map(({value:n})=>n):Pa(t)?lT(e.refs).value:mT(t.value,e)}s(oy,"getFieldValue");var d$=s((e,t,n,r)=>{const i={};for(const o of e){const l=te(t,o);l&&Qe(i,o,l._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},"getResolverOptions"),tl=s(e=>je(e)?e:Iu(e)?e.source:bt(e)?Iu(e.value)?e.value.source:e.value:e,"getRuleValue"),sy="AsyncFunction",f$=s(e=>{if(!e||!e.validate)return!1;if(en(e.validate))return e.validate.constructor.name===sy;if(bt(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===sy)return!0}return!1},"hasPromiseValidation"),h$=s(e=>e.mount&&(e.required||!je(e.required)&&e.required!==!1||!je(e.min)||!je(e.max)||!je(e.maxLength)||!je(e.minLength)||e.pattern||e.validate),"hasValidation");function ly(e,t,n){const r=te(e,n);if(r||Mo(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),l=te(t,o),a=te(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};i.pop()}return{name:n}}s(ly,"schemaErrorLookup");var g$=s((e,t,n,r)=>{n(e);const i=Object.keys(e).filter(o=>o!=="name");return!i.length||r&&i.length>=Object.keys(t).length||i.find(o=>t[o]===(!r||ar.all))},"shouldRenderFormState"),p$=s((e,t,n)=>!e||!t||e===t||Dc(e).some(r=>r&&(n?r===t||r.startsWith(t+"."):r.startsWith(t)||t.startsWith(r))),"shouldSubscribeByName"),m$=s((e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,"skipValidation"),_$=s((e,t)=>{const n=te(e,t);!cT(n).length&&!(n!=null&&n.root)&&Et(e,t)},"unsetEmptyArray"),v$={mode:ar.onSubmit,reValidateMode:ar.onChange,shouldFocusError:!0},kf="form",y$=s((e,t)=>{for(const n in e)n in t||delete e[n];Object.assign(e,t)},"updateDirtyFields"),_T={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function x$(e={}){let t={...v$,...e},n={...at(_T),isLoading:en(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=bt(t.defaultValues)||bt(t.values)?at(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:at(i),l={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const c={},u={};let d=0,f=rc(t.mode),h=rc(t.reValidateMode);const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={...g};let _={...p};const y={array:ny(),state:ny()};let v=0;const x=t.criteriaMode===ar.all,C=s((k,N)=>O=>{clearTimeout(u[k]),u[k]=setTimeout(N,O)},"debounce"),b=s(async k=>{if(!l.keepIsValid&&!t.disabled&&(p.isValid||_.isValid||k)){const N=++v;let O;t.resolver?(O=Jt((await W()).errors),N===v&&S()):O=await ge({fields:r,onlyCheckValid:!0,eventType:Ei.VALID}),N===v&&O!==n.isValid&&y.state.next({isValid:O})}},"_setValid"),S=s((k,N)=>{!t.disabled&&(p.isValidating||p.validatingFields||_.isValidating||_.validatingFields)&&((k||a.mount).forEach(O=>{O&&(N?Qe(n.validatingFields,O,N):Et(n.validatingFields,O))}),y.state.next({validatingFields:n.validatingFields,isValidating:!Jt(n.validatingFields)}))},"_updateIsValidating"),M=s(()=>{n.dirtyFields=io(i,o,void 0,r)},"_updateDirtyFields"),T=s((k,N=[],O,H,U=!0,se=!0)=>{if(H&&O&&!t.disabled){l.action=!0;const le=te(r,k);if(l.actionArrayLengths.has(k)||l.actionArrayLengths.set(k,Array.isArray(le)?le.length:0),se&&Array.isArray(le)){const we=O(le,H.argA,H.argB);U&&Qe(r,k,we)}const ae=te(n.errors,k);if(se&&Array.isArray(ae)){const we=ae.root,ft=O(ae,H.argA,H.argB)||ae;we&&(ft.root=we),U&&Qe(n.errors,k,ft),_$(n.errors,k)}const Ee=te(n.touchedFields,k);if((p.touchedFields||_.touchedFields)&&se&&Array.isArray(Ee)){const we=O(Ee,H.argA,H.argB);U&&Qe(n.touchedFields,k,we)}(p.dirtyFields||_.dirtyFields)&&M(),y.state.next({name:k,isDirty:oe(k,N),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qe(o,k,N)},"_setFieldArray"),E=s((k,N)=>{Qe(n.errors,k,N),n.errors={...n.errors},y.state.next({errors:n.errors})},"updateErrors"),A=s(k=>{n.errors=k,y.state.next({errors:n.errors,isValid:!1})},"_setErrors"),D=s(k=>{const N=Mo(k)?[k]:ko(k);let O=o,H=i;for(let U=0;U<N.length-1;U++){const se=N[U];if(O=Vt(O)?O:O[se],H=Vt(H)?H:H[se],O===null&&H!==null)return!0}return!1},"hasExplicitNullIntermediate"),L=s(k=>{if(!l.actionArrayLengths.size)return!1;const N=Mo(k)?[k]:ko(k);let O=o,H="",U=-1,se=0;for(let le=0;le<N.length;le++){if(Vt(O))return!1;const ae=N[le];if(H=H?`${H}.${ae}`:ae,Array.isArray(O)&&+ae>=O.length)return U===-1?!1:le===U?+ae<se:!0;l.actionArrayLengths.has(H)&&(U=le+1,se=l.actionArrayLengths.get(H)),O=O[ae]}return!1},"isStaleArrayIndex"),G=s((k,N,O,H)=>{const U=te(r,k);if(U){if(D(k)||L(k))return;const se=je(te(o,k)),le=te(o,k,je(O)?te(i,k):O);je(le)||H&&H.defaultChecked||N?Qe(o,k,N?le:oy(U._f)):de(k,le),l.mount&&!l.action&&(b(),se&&n.isDirty&&(p.isDirty||_.isDirty)&&(oe()||(n.isDirty=!1,y.state.next({...n}))),e.shouldUnregister&&se&&!je(te(o,k))&&Tf(k,a)&&(l.watch=!0))}},"updateValidAndValue"),$=s((k,N,O,H,U)=>{let se=!1,le=!1;const ae={name:k};if(!t.disabled||H===!0){if(!O||H){const Ee=gn(te(i,k),N);(p.isDirty||_.isDirty)&&(le=n.isDirty,n.isDirty=ae.isDirty=!Ee||oe(),se=le!==ae.isDirty),le=!!te(n.dirtyFields,k),Ee!==n.isDirty?y$(n.dirtyFields,io(i,o,void 0,r)):Ee?Et(n.dirtyFields,k):Qe(n.dirtyFields,k,!0),ae.dirtyFields=n.dirtyFields,se=se||(p.dirtyFields||_.dirtyFields)&&le!==!Ee}if(O){const Ee=te(n.touchedFields,k);Ee||(Qe(n.touchedFields,k,O),ae.touchedFields=n.touchedFields,se=se||(p.touchedFields||_.touchedFields)&&Ee!==O)}se&&U&&y.state.next(ae)}return se?ae:{}},"updateTouchAndDirty"),z=s((k,N,O,H)=>{const U=te(n.errors,k),se=(p.isValid||_.isValid)&&wn(N)&&n.isValid!==N;if(t.delayError&&O?(c[k]=C(k,()=>E(k,O)),c[k](t.delayError)):(clearTimeout(u[k]),delete c[k],O?Qe(n.errors,k,O):Et(n.errors,k),n.errors={...n.errors}),(O?!gn(U,O):U)||!Jt(H)||se){const le={...H,...se&&wn(N)?{isValid:N}:{},errors:n.errors,name:k};y.state.next(le)}},"shouldRenderByError"),W=s(async k=>(S(k,!0),await t.resolver(o,t.context,d$(k||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),"_runSchema"),ye=s(async k=>{const{errors:N}=await W(k);if(S(k),k){for(const O of k){const H=te(N,O);H?a.array.has(O)&&bt(H)&&!Object.keys(H).some(U=>!Number.isNaN(Number(U)))?Zv(n.errors,{[O]:H},O):Qe(n.errors,O,H):Et(n.errors,O)}n.errors={...n.errors}}else n.errors=N;return N},"executeSchemaAndUpdateState"),q=s(async({name:k,eventType:N})=>{if(e.validate){const O=await e.validate({formValues:o,formState:n,name:k,eventType:N});if(bt(O))for(const H in O){const U=O[H];U&&It(`${kf}.${H}`,{message:Bt(U.message)?U.message:"",type:U.type||sr.validate})}else Bt(O)||!O?It(kf,{message:O||"",type:sr.validate}):pt(kf);return O}return!0},"validateForm"),ge=s(async({fields:k,onlyCheckValid:N,name:O,eventType:H,context:U={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(U.runRootValidation=!0,!await q({name:O,eventType:H})&&(U.valid=!1,N)))return U.valid;for(const se in k){const le=k[se];if(le){const{_f:ae,...Ee}=le;if(ae){const we=a.array.has(ae.name),ft=le._f&&f$(le._f),Br=p.validatingFields||p.isValidating||_.validatingFields||_.isValidating;ft&&Br&&S([ae.name],!0);const Hr=await ty(le,a.disabled,o,x,t.shouldUseNativeValidation&&!N,we);if(ft&&Br&&S([ae.name]),Hr[ae.name]&&(U.valid=!1,N)||(!N&&(te(Hr,ae.name)?we?Zv(n.errors,Hr,ae.name):Qe(n.errors,ae.name,Hr[ae.name]):Et(n.errors,ae.name)),e.shouldUseNativeValidation&&Hr[ae.name]))break}!Jt(Ee)&&await ge({context:U,onlyCheckValid:N,fields:Ee,name:se,eventType:H})}}return U.valid},"executeBuiltInValidation"),me=s(()=>{for(const k of a.unMount){const N=te(r,k);N&&(N._f.refs?N._f.refs.every(O=>!wf(O)):!wf(N._f.ref))&&yt(k)}a.unMount=new Set},"_removeUnmounted"),oe=s((k,N)=>(k&&N&&Qe(o,k,N),!gn(l.mount?o:i,i)),"_getDirty"),Z=s((k,N,O)=>pg(k,a,{...l.mount?o:je(N)||Bt(k)?i:N},O,N),"_getWatch"),pe=s(k=>cT(te(l.mount?o:i,k,t.shouldUnregister?te(i,k,[]):[])),"_getFieldArray"),de=s((k,N,O={},H=!1,U=!1,se=!1)=>{const le=te(r,k);let ae=N;if(le){const Ee=le._f;Ee&&(!Ee.disabled&&Qe(o,k,mT(N,Ee)),ae=Au(Ee.ref)&&Vt(N)?"":N,dT(Ee.ref)?[...Ee.ref.options].forEach(we=>we.selected=ae.includes(we.value)):Ee.refs?Pa(Ee.ref)?Ee.refs.forEach(we=>{(!we.defaultChecked||!we.disabled)&&(Array.isArray(ae)?we.checked=!!ae.find(ft=>ft===we.value):we.checked=ae===we.value||!!ae)}):Ee.refs.forEach(we=>we.checked=we.value===ae):$d(Ee.ref)?Ee.ref.value="":(Ee.ref.value=ae,!Ee.ref.type&&!U&&!se&&y.state.next({name:k,values:H?o:at(o)})))}(O.shouldDirty||O.shouldTouch)&&$(k,ae,O.shouldTouch,O.shouldDirty,!U),O.shouldValidate&&Re(k,{delayError:O.delayError})},"setFieldValue"),ce=s((k,N,O,H=!1,U=!1,se=!1)=>{a.array.has(k)&&y.array.next({name:k,values:H?o:at(o)});for(const le in N){if(!N.hasOwnProperty(le))continue;const ae=N[le],Ee=k+"."+le,we=te(r,Ee);(a.array.has(k)||bt(ae)||we&&!we._f)&&!Mi(ae)?ce(Ee,ae,O,H,U,se):de(Ee,ae,O,H,U,se)}},"setFieldValues"),j=s((k,N,O,H,U=!1)=>{const se=te(r,k),le=a.array.has(k),ae=H?N:at(N),Ee=gn(te(o,k),ae);if(Ee||Qe(o,k,ae),le)y.array.next({name:k,values:H?o:at(o)}),(p.isDirty||p.dirtyFields||_.isDirty||_.dirtyFields)&&O.shouldDirty&&(M(),U||y.state.next({name:k,dirtyFields:n.dirtyFields,isDirty:oe(k,ae)}));else{const we=Array.isArray(ae)&&!ae.length||Jt(ae),ft=!Ee&&!U;!se||se._f||Vt(ae)||we?de(k,ae,O,H,U,ft):ce(k,ae,O,H,U,ft)}if(!Ee&&!U){const we=Tf(k,a),ft=H?o:at(o);if(y.state.next({...we&&n,name:l.mount||we?k:void 0,values:ft}),!le)for(const Br of u$(a.array,k))y.state.next({name:Br,values:ft})}},"_setValue"),ne=s((k,N,O={})=>j(k,N,O,!1),"setValue"),ue=s((k,N={})=>{const O=en(k)?k(o):k;if(!gn(o,O)){o={...o,...O};for(const H of a.mount)l$(O,H)&&j(H,te(O,H),N,!0,!0);y.state.next({...n,name:void 0,type:void 0,...d?{values:o}:{}}),N.shouldValidate&&b()}},"setValues"),Ne=s(async k=>{l.mount=!0;const N=k.target;let O=N.name,H=!0;const U=te(r,O),se=s(le=>{H=Number.isNaN(le)||Mi(le)&&isNaN(le.getTime())||gn(le,te(o,O,le))},"_updateIsFieldValueUpdated");if(U){let le,ae;const Ee=N.type?oy(U._f):hg(k),we=k.type===Ei.BLUR||k.type===Ei.FOCUS_OUT,ft=!h$(U._f)&&!e.validate&&!t.resolver&&!te(n.errors,O)&&!U._f.deps,Br=ft||m$(we,te(n.touchedFields,O),n.isSubmitted,h,f),Hr=Tf(O,a,we);if(Qe(o,O,at(Ee)),we){if(!N||!N.readOnly){U._f.onBlur&&U._f.onBlur(k);const zs=c[O];zs&&zs(0)}}else U._f.onChange&&U._f.onChange(k);const Ws=$(O,Ee,we),dk=!Jt(Ws)||Hr;if(!we&&y.state.next({name:O,type:k.type,...d?{values:at(o)}:{}}),Br)return(!ft||!n.isValid)&&(p.isValid||_.isValid)&&(t.mode==="onBlur"?we&&b():we||b()),dk&&y.state.next({name:O,...Hr?{}:Ws});if(!t.resolver&&e.validate&&await q({name:O,eventType:k.type}),!we&&Hr&&y.state.next({...n}),t.resolver){const{errors:zs}=await W([O]);if(S([O]),se(Ee),!H){!Jt(Ws)&&y.state.next(Ws);return}const fk=ly(n.errors,r,O),q1=ly(zs,r,fk.name||O);le=q1.error,O=q1.name,ae=Jt(zs)}else S([O],!0),le=(await ty(U,a.disabled,o,x,t.shouldUseNativeValidation))[O],S([O]),se(Ee),H&&(le?ae=!1:(p.isValid||_.isValid)&&(ae=await ge({fields:r,onlyCheckValid:!0,name:O,eventType:k.type})));H&&(U._f.deps&&(!Array.isArray(U._f.deps)||U._f.deps.length>0)&&Re(U._f.deps),z(O,ae,le,Ws))}},"onChange"),$e=s((k,N)=>{if(te(n.errors,N)&&k.focus)return k.focus(),1},"_focusInput"),Re=s(async(k,N={})=>{let O,H;const U=Dc(k);if(t.resolver){const se=await ye(je(k)?k:U);O=Jt(se),H=k?!U.some(le=>te(se,le)):O}else k?(H=(await Promise.all(U.map(async se=>{const le=te(r,se);return await ge({fields:le&&le._f?{[se]:le}:le,eventType:Ei.TRIGGER})}))).every(Boolean),!(!H&&!n.isValid)&&b()):H=O=await ge({fields:r,name:k,eventType:Ei.TRIGGER});if(N.delayError&&t.delayError&&Bt(k)){const se=te(n.errors,k);se?(Et(n.errors,k),c[k]=C(k,()=>E(k,se)),c[k](t.delayError)):(clearTimeout(u[k]),delete c[k])}if(N.shouldTouch)for(const se of k?U:a.mount)!a.array.has(se)&&Qe(n.touchedFields,se,!0);return y.state.next({...!Bt(k)||(p.isValid||_.isValid)&&O!==n.isValid?{}:{name:k},...t.resolver||!k?{isValid:O}:{},...N.shouldTouch&&(p.touchedFields||_.touchedFields)?{touchedFields:n.touchedFields}:{},errors:n.errors}),N.shouldFocus&&!H&&wl(r,$e,k?U:a.mount),H},"trigger"),Pe=s((k,N)=>{let O={...l.mount?o:i};return N&&(O=uT(N.dirtyFields?n.dirtyFields:n.touchedFields,O)),je(k)?O:Bt(k)?te(O,k):k.map(H=>te(O,H))},"getValues"),rt=s(k=>je(k)?{...n.errors}:Bt(k)?te(n.errors,k):k.map(N=>te(n.errors,N)),"getErrors"),Je=s((k,N)=>{const O=N||n,H=te(O.errors,k);return{invalid:!!H,isDirty:!!te(O.dirtyFields,k),error:H,isValidating:!!te(n.validatingFields,k),isTouched:!!te(O.touchedFields,k)}},"getFieldState"),pt=s(k=>{const N=k?Dc(k):void 0;N?.forEach(O=>Et(n.errors,O)),N?N.forEach(O=>{y.state.next({name:O,errors:n.errors})}):(n.errors={},y.state.next({errors:n.errors}))},"clearErrors"),It=s((k,N,O)=>{const H=(te(r,k,{_f:{}})._f||{}).ref,{ref:U,message:se,type:le,...ae}=te(n.errors,k)||{};Qe(n.errors,k,{...ae,...N,ref:H}),y.state.next({name:k,errors:n.errors,isValid:!1}),O&&O.shouldFocus&&H&&H.focus&&H.focus()},"setError"),ut=s((k,N)=>{if(en(k)){d++;const{unsubscribe:O}=y.state.subscribe({next:s(U=>"values"in U&&k(U.values||Z(void 0,N),U),"next")});let H=!1;return{unsubscribe:s(()=>{H||(H=!0,d--,O())},"unsubscribe")}}return Z(k,N,!0)},"watch"),jt=s(k=>{var N;const O=!!(!((N=k.formState)===null||N===void 0)&&N.values);O&&d++;const{unsubscribe:H}=y.state.subscribe({next:s(se=>{if(p$(k.name,se.name,k.exact)&&g$(se,k.formState||p,Pn,k.reRenderRoot)){const le={...o};k.callback({values:le,...n,...se,defaultValues:i})}},"next")});if(!O)return H;let U=!1;return()=>{U||(U=!0,d--,H())}},"_subscribe"),Ge=s(k=>(l.mount=!0,_={..._,...k.formState},jt({...k,formState:{...g,...k.formState}})),"subscribe"),yt=s((k,N={})=>{for(const O of k?Dc(k):a.mount)a.mount.delete(O),a.array.delete(O),N.keepValue||(Et(r,O),Et(o,O)),!N.keepError&&Et(n.errors,O),!N.keepDirty&&Et(n.dirtyFields,O),!N.keepTouched&&Et(n.touchedFields,O),!N.keepIsValidating&&Et(n.validatingFields,O),!t.shouldUnregister&&!N.keepDefaultValue&&Et(i,O);d&&y.state.next({values:at(o)}),y.state.next({...n,...N.keepDirty?{}:{isDirty:oe()}}),!N.keepIsValid&&b()},"unregister"),Nt=s(({disabled:k,name:N})=>{if(wn(k)&&l.mount||k||a.disabled.has(N)){const O=a.disabled.has(N)!==!!k;k?a.disabled.add(N):a.disabled.delete(N),O&&l.mount&&!l.action&&b()}},"_setDisabledField"),it=s((k,N={})=>{let O=te(r,k);const H=wn(N.disabled)||wn(t.disabled),U=!a.registerName.has(k)&&O&&O._f&&!O._f.mount;return Qe(r,k,{...O||{},_f:{...O&&O._f?O._f:{ref:{name:k}},name:k,mount:!0,...N}}),a.mount.add(k),O&&!U?Nt({disabled:wn(N.disabled)?N.disabled:t.disabled,name:k}):G(k,!0,N.value),{...H?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:tl(N.min),max:tl(N.max),minLength:tl(N.minLength),maxLength:tl(N.maxLength),pattern:tl(N.pattern)}:{},name:k,onChange:Ne,onBlur:Ne,ref:s(se=>{if(se){a.registerName.add(k),it(k,N),a.registerName.delete(k),O=te(r,k);const le=je(se.value)&&se.querySelectorAll&&se.querySelectorAll("input,select,textarea")[0]||se,ae=a$(le),Ee=O._f.refs||[];if(ae?Ee.find(ft=>ft===le):le===O._f.ref)return;const we={...O._f};ae?(we.refs=[...Ee.filter(wf),le,...Array.isArray(te(i,k))?[{}]:[]],we.ref={type:le.type,name:k}):(we.ref=le,delete we.refs),Qe(r,k,{_f:we}),G(k,!1,void 0,le)}else O=te(r,k,{}),O._f&&(O._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(rT(a.array,k)&&l.action)&&a.unMount.add(k)},"ref")}},"register"),Yt=s(()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&wl(r,$e,a.mount),"_focusError"),Ln=s(k=>{wn(k)&&(y.state.next({disabled:k}),wl(r,(N,O)=>{const H=te(r,O);H&&(N.disabled=H._f.disabled||k,Array.isArray(H._f.refs)&&H._f.refs.forEach(U=>{U.disabled=H._f.disabled||k}))},0,!1))},"_disableForm"),Fe=s((k,N)=>async O=>{let H,U;O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let se=at(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:le,values:ae}=await W();S(),n.errors=le,se=at(ae)}else await ge({fields:r,eventType:Ei.SUBMIT});if(a.disabled.size)for(const le of a.disabled)Et(se,le);if(Et(n.errors,iT),Jt(n.errors)){y.state.next({errors:{}});try{H=await k(se,O)}catch(le){U=le}}else N&&await N({...n.errors},O),Yt(),setTimeout(Yt);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jt(n.errors)&&!U,submitCount:n.submitCount+1,errors:n.errors}),U)throw U;return H},"handleSubmit"),$t=s((k,N={})=>{te(r,k)&&(je(N.defaultValue)?ne(k,at(te(i,k))):(ne(k,N.defaultValue),Qe(i,k,at(N.defaultValue))),N.keepTouched||Et(n.touchedFields,k),N.keepDirty||(Et(n.dirtyFields,k),n.isDirty=N.defaultValue?oe(k,at(te(i,k))):oe()),N.keepError||(Et(n.errors,k),b()),y.state.next({...n}))},"resetField"),$n=s((k,N={})=>{const O=k?at(k):i,H=at(O),U=Jt(k),se=H,le=r;if(N.keepDefaultValues||(i=O),!N.keepValues){if(N.keepDirtyValues){const ae=new Set([...a.mount,...fT(io(i,o,void 0,le),n.dirtyFields)]);for(const Ee of ae){const we=te(n.dirtyFields,Ee),ft=te(o,Ee),Br=te(se,Ee);we&&!je(ft)?Qe(se,Ee,ft):!we&&!je(Br)&&ne(Ee,Br)}}else{if(Pd&&je(k))for(const ae of a.mount){const Ee=te(r,ae);if(Ee&&Ee._f){const we=Array.isArray(Ee._f.refs)?Ee._f.refs[0]:Ee._f.ref;if(Au(we)){const ft=we.closest("form");if(ft){ft.reset();break}}}}if(N.keepFieldsRef)for(const ae of a.mount)ne(ae,te(se,ae));else r={}}if(t.shouldUnregister){if(o=N.keepDefaultValues?at(i):{},N.keepFieldsRef)for(const ae of a.mount)Qe(o,ae,te(se,ae))}else o=at(se);y.array.next({values:{...se}}),y.state.next({name:void 0,type:void 0,values:{...se}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!Jt(se),l.watch=!!t.shouldUnregister,l.keepIsValid=!!N.keepIsValid,l.action=!1,l.actionArrayLengths.clear(),N.keepErrors||(n.errors={}),y.state.next({submitCount:N.keepSubmitCount?n.submitCount:0,isDirty:U?!1:N.keepDirty?n.isDirty:N.keepValues?oe():!!(N.keepDefaultValues&&!gn(k,i)),isSubmitted:N.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:U?{}:N.keepDirtyValues?N.keepDefaultValues&&o?io(i,o,void 0,le):n.dirtyFields:N.keepDefaultValues&&k?io(i,k,void 0,le):N.keepDirty?n.dirtyFields:{},touchedFields:N.keepTouched?n.touchedFields:{},errors:N.keepErrors?n.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},"_reset"),ze=s((k,N)=>$n(en(k)?k(o):k,{...t.resetOptions,...N}),"reset"),I=s((k,N={})=>{const O=te(r,k),H=O&&O._f;if(H){const U=H.refs?H.refs[0]:H.ref;U.focus&&setTimeout(()=>{U.focus(),N.shouldSelect&&en(U.select)&&U.select()})}},"setFocus"),Pn=s(k=>{const{name:N,type:O,values:H,...U}=k;n={...n,...U}},"_setFormState");y.state.subscribe({next:Pn});const be={control:{register:it,unregister:yt,getFieldState:Je,handleSubmit:Fe,setError:It,_subscribe:jt,_runSchema:W,_updateIsValidating:S,_focusError:Yt,_getWatch:Z,_getDirty:oe,_setValid:b,_setFieldArray:T,_setDisabledField:Nt,_setErrors:A,_getFieldArray:pe,_reset:$n,_resetDefaultValues:s(()=>en(t.defaultValues)&&t.defaultValues().then(k=>{ze(k,t.resetOptions),y.state.next({isLoading:!1})}),"_resetDefaultValues"),_removeUnmounted:me,_disableForm:Ln,_subjects:y,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return l},set _state(k){l=k},get _defaultValues(){return i},get _names(){return a},set _names(k){a=k},get _formState(){return n},get _options(){return t},set _options(k){t={...t,...k},f=rc(t.mode),h=rc(t.reValidateMode)}},subscribe:Ge,trigger:Re,register:it,handleSubmit:Fe,watch:ut,setValue:ne,setValues:ue,getValues:Pe,getErrors:rt,reset:ze,resetField:$t,resetDefaultValues:s((k,N={})=>{if(i=at(k),!N.keepDirty){const O=io(i,o,void 0,r);n.dirtyFields=O,n.isDirty=!Jt(O)}N.keepIsValid||b(),y.state.next({...n,defaultValues:i})},"resetDefaultValues"),clearErrors:pt,unregister:yt,setError:It,setFocus:I,getFieldState:Je};return{...be,formControl:be}}s(x$,"createFormControl");function vT(e={}){const t=m.useRef(void 0),n=m.useRef(void 0),r=m.useRef(e.formControl),[i,o]=m.useState(()=>({...at(_T),isLoading:en(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:en(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!en(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...d}=x$(e);t.current={...d,formState:i}}const l=t.current.control;l._options=e;const{resyncIfNeeded:a,snapshot:c}=Fm();return Pm(()=>{const u=s(()=>({...l._formState,defaultValues:l._defaultValues}),"getCurrentFormState");a(!0,u,o);const d=l._subscribe({formState:l._proxyFormState,callback:s(()=>o({...l._formState,defaultValues:l._defaultValues}),"callback"),reRenderRoot:!0});return o(f=>({...f,isReady:!0})),l._formState.isReady=!0,()=>{d(),c(!0,u)}},[l,a,c]),m.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),m.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),m.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),m.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),m.useEffect(()=>{if(l._proxyFormState.isDirty){const u=l._getDirty();u!==i.isDirty&&l._subjects.state.next({isDirty:u})}},[l,i.isDirty]),m.useEffect(()=>{var u;e.values&&!gn(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((u=l._options.resetOptions)===null||u===void 0)&&u.keepIsValid||l._setValid(),n.current=e.values,o(d=>({...d}))):l._resetDefaultValues()},[l,e.values]),m.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=m.useMemo(()=>sT(i,l),[l,i]),t.current}s(vT,"useForm");function kr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}s(kr,"_objectWithoutPropertiesLoose");function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Le.apply(null,arguments)}s(Le,"_extends");var C$=ws(((e,t)=>{var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=n})),b$=ws(((e,t)=>{var n=C$();function r(){}s(r,"emptyFunction");function i(){}s(i,"emptyFunctionWithReset"),i.resetWarningCache=r,t.exports=function(){function o(c,u,d,f,h,g){if(g!==n){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}s(o,"shim"),o.isRequired=o;function l(){return o}s(l,"getShim");var a={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:l,element:o,elementType:o,instanceOf:l,node:o,objectOf:l,oneOf:l,oneOfType:l,shape:l,exact:l,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),E$=ws(((e,t)=>{t.exports=b$()()})),S$=ws((e=>{var t=60103,n=60106,r=60107,i=60108,o=60114,l=60109,a=60110,c=60112,u=60113,d=60120,f=60115,h=60116,g=60121,p=60122,_=60117,y=60129,v=60131;if(typeof Symbol=="function"&&Symbol.for){var x=Symbol.for;t=x("react.element"),n=x("react.portal"),r=x("react.fragment"),i=x("react.strict_mode"),o=x("react.profiler"),l=x("react.provider"),a=x("react.context"),c=x("react.forward_ref"),u=x("react.suspense"),d=x("react.suspense_list"),f=x("react.memo"),h=x("react.lazy"),g=x("react.block"),p=x("react.server.block"),_=x("react.fundamental"),y=x("react.debug_trace_mode"),v=x("react.legacy_hidden")}})),T$=ws(((e,t)=>{t.exports=S$()})),ay=s(e=>typeof e=="object"&&e!=null&&e.nodeType===1,"e"),cy=s((e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip","t"),Mf=s((e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return cy(n.overflowY,t)||cy(n.overflowX,t)||(r=>{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeight<r.scrollHeight||i.clientWidth<r.scrollWidth)})(e)}return!1},"n"),ic=s((e,t,n,r,i,o,l,a)=>o<e&&l>t||o>e&&l<t?0:o<=e&&a<=n||l>=t&&a>=n?o-e-r:l>t&&a<n||o<e&&a>n?l-t+i:0,"l"),w$=s(e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},"i$1"),k$=s((e,t)=>{var n,r,i,o,l,a;if(typeof document>"u")return[];let{scrollMode:c,block:u,inline:d,boundary:f,skipOverflowHiddenElements:h}=t,g=typeof f=="function"?f:z=>z!==f;if(!ay(e))throw new TypeError("Invalid target");let p=document.scrollingElement||document.documentElement,_=[],y=e;for(;ay(y)&&g(y);){if(y=w$(y),y===p){_.push(y);break}y!=null&&y===document.body&&Mf(y)&&!Mf(document.documentElement)||y!=null&&Mf(y,h)&&_.push(y)}let v=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,x=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,C=(l=window.scrollX)!=null?l:pageXOffset,b=(a=window.scrollY)!=null?a:pageYOffset,{height:S,width:M,top:T,right:E,bottom:A,left:D}=e.getBoundingClientRect(),L=u==="start"||u==="nearest"?T:u==="end"?A:T+S/2,G=d==="center"?D+M/2:d==="end"?E:D,$=[];for(let z=0;z<_.length;z++){let W=_[z],{height:ye,width:q,top:ge,right:me,bottom:oe,left:Z}=W.getBoundingClientRect();if(c==="if-needed"&&T>=0&&D>=0&&A<=x&&E<=v&&T>=ge&&A<=oe&&D>=Z&&E<=me)return $;let pe=getComputedStyle(W),de=parseInt(pe.borderLeftWidth,10),ce=parseInt(pe.borderTopWidth,10),j=parseInt(pe.borderRightWidth,10),ne=parseInt(pe.borderBottomWidth,10),ue=0,Ne=0,$e="offsetWidth"in W?W.offsetWidth-W.clientWidth-de-j:0,Re="offsetHeight"in W?W.offsetHeight-W.clientHeight-ce-ne:0,Pe="offsetWidth"in W?W.offsetWidth===0?0:q/W.offsetWidth:0,rt="offsetHeight"in W?W.offsetHeight===0?0:ye/W.offsetHeight:0;if(p===W)ue=u==="start"?L:u==="end"?L-x:u==="nearest"?ic(b,b+x,x,ce,ne,b+L,b+L+S,S):L-x/2,Ne=d==="start"?G:d==="center"?G-v/2:d==="end"?G-v:ic(C,C+v,v,de,j,C+G,C+G+M,M),ue=Math.max(0,ue+b),Ne=Math.max(0,Ne+C);else{ue=u==="start"?L-ge-ce:u==="end"?L-oe+ne+Re:u==="nearest"?ic(ge,oe,ye,ce,ne+Re,L,L+S,S):L-(ge+ye/2)+Re/2,Ne=d==="start"?G-Z-de:d==="center"?G-(Z+q/2)+$e/2:d==="end"?G-me+j+$e:ic(Z,me,q,de,j+$e,G,G+M,M);let{scrollLeft:Je,scrollTop:pt}=W;ue=Math.max(0,Math.min(pt+ue/rt,W.scrollHeight-ye/rt+Re)),Ne=Math.max(0,Math.min(Je+Ne/Pe,W.scrollWidth-q/Pe+$e)),L+=pt-ue,G+=Je-Ne}$.push({el:W,top:ue,left:Ne})}return $},"o"),Q=da(E$()),Mz=T$(),M$=0;function Fa(){}s(Fa,"noop");function A$(e,t){e&&k$(e,{boundary:t,block:"nearest",scrollMode:"if-needed"}).forEach(function(n){var r=n.el,i=n.top,o=n.left;r.scrollTop=i,r.scrollLeft=o})}s(A$,"scrollIntoView$1");function uy(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}s(uy,"isOrContainsNode");function Bm(e,t){var n;function r(){n&&clearTimeout(n)}s(r,"cancel");function i(){for(var o=arguments.length,l=new Array(o),a=0;a<o;a++)l[a]=arguments[a];r(),n=setTimeout(function(){n=null,e.apply(void 0,l)},t)}return s(i,"wrapper"),i.cancel=r,i}s(Bm,"debounce");function Ot(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return t.some(function(a){return a&&a.apply(void 0,[r].concat(o)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}s(Ot,"callAllEventHandlers");function Yr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(i){typeof i=="function"?i(r):i&&(i.current=r)})}}s(Yr,"handleRefs");function I$(){return String(M$++)}s(I$,"generateId");function N$(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}s(N$,"getA11yStatusMessage$1");function Nu(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=yT(t,r)?t[r]:e[r],n},{})}s(Nu,"getState");function yT(e,t){return e[t]!==void 0}s(yT,"isControlledProp");function Ou(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}s(Ou,"normalizeArrowKey");function Ai(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var o=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:o+1);var l=t+e;l<0?l=i?o:0:l>o&&(l=i?0:o);var a=Ao(e,l,n,r,i);return a===-1?t>=n?-1:t:a}s(Ai,"getNextWrappingIndex");function Ao(e,t,n,r,i){var o=r(t);if(!o||!o.hasAttribute("disabled"))return t;if(e>0){for(var l=t+1;l<n;l++)if(!r(l).hasAttribute("disabled"))return l}else for(var a=t-1;a>=0;a--)if(!r(a).hasAttribute("disabled"))return a;return i?e>0?Ao(1,0,n,r,!1):Ao(-1,n-1,n,r,!1):-1}s(Ao,"getNextNonDisabledIndex");function dy(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(uy(i,e,n)||r&&uy(i,n.document.activeElement,n))})}s(dy,"targetWithinDownshift");var O$=Bm(function(e){CT(e).textContent=""},500);function xT(e,t){var n=CT(t);e&&(n.textContent=e,O$(t))}s(xT,"setStatus");function CT(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}s(CT,"getStatusDiv");var D$=["isInitialMount","highlightedIndex","items","environment"],bT={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function R$(e,t,n){var r=e.props,i=e.type,o={};Object.keys(t).forEach(function(l){L$(l,e,t,n),n[l]!==t[l]&&(o[l]=n[l])}),r.onStateChange&&Object.keys(o).length&&r.onStateChange(Le({type:i},o))}s(R$,"callOnChangeProps");function L$(e,t,n,r){var i=t.props,o=t.type,l="on"+Km(e)+"Change";i[l]&&r[e]!==void 0&&r[e]!==n[e]&&i[l](Le({type:o},r))}s(L$,"invokeOnChangeHandler");function $$(e,t){return t.changes}s($$,"stateReducer");function P$(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}s(P$,"getA11ySelectionMessage");var F$=Bm(function(e,t){xT(e(),t)},200),V$=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?m.useLayoutEffect:m.useEffect;function ET(e){var t=e.id,n=t===void 0?"downshift-"+I$():t,r=e.labelId,i=e.menuId,o=e.getItemId,l=e.toggleButtonId,a=e.inputId;return(0,m.useRef)({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:o||function(c){return n+"-item-"+c},toggleButtonId:l||n+"-toggle-button",inputId:a||n+"-input"}).current}s(ET,"useElementIds");function Hm(e,t,n,r){var i,o;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],o=t}else o=t===void 0?n.indexOf(e):t,i=e;return[i,o]}s(Hm,"getItemAndIndex");function B$(e){return e?String(e):""}s(B$,"itemToString");function H$(e){return/^\S{1}$/.test(e)}s(H$,"isAcceptedCharacterKey");function Km(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}s(Km,"capitalizeString");function Fd(e){var t=(0,m.useRef)(e);return t.current=e,t}s(Fd,"useLatestRef");function ST(e,t,n){var r=(0,m.useRef)(),i=(0,m.useRef)(),o=(0,m.useCallback)(function(h,g){i.current=g,h=Nu(h,g.props);var p=e(h,g);return g.props.stateReducer(h,Le({},g,{changes:p}))},[e]),l=(0,m.useReducer)(o,t),a=l[0],c=l[1],u=Fd(n),d=(0,m.useCallback)(function(h){return c(Le({props:u.current},h))},[u]),f=i.current;return(0,m.useEffect)(function(){f&&r.current&&r.current!==a&&R$(f,Nu(r.current,f.props),a),r.current=a},[a,n,f]),[a,d]}s(ST,"useEnhancedReducer");function TT(e,t,n){var r=ST(e,t,n),i=r[0],o=r[1];return[Nu(i,n),o]}s(TT,"useControlledReducer$1");var kl={itemToString:B$,stateReducer:$$,getA11ySelectionMessage:P$,scrollIntoView:A$,environment:typeof window>"u"?{}:window};function In(e,t,n){n===void 0&&(n=bT);var r=e["default"+Km(t)];return r!==void 0?r:n[t]}s(In,"getDefaultValue$1");function sl(e,t,n){n===void 0&&(n=bT);var r=e[t];if(r!==void 0)return r;var i=e["initial"+Km(t)];return i!==void 0?i:In(e,t,n)}s(sl,"getInitialValue$1");function wT(e){var t=sl(e,"selectedItem"),n=sl(e,"isOpen"),r=sl(e,"highlightedIndex"),i=sl(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}s(wT,"getInitialState$2");function po(e,t,n){var r=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,l=t.selectedItem,a=t.highlightedIndex;return r.length===0?-1:i!==void 0&&a===i?i:o!==void 0?o:l?r.indexOf(l):n===0?-1:n<0?r.length-1:0}s(po,"getHighlightedIndexOnOpen");function kT(e,t,n,r){var i=(0,m.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,m.useEffect)(function(){if(n?.addEventListener!=null){var o=s(function(){i.current.isMouseDown=!0},"onMouseDown"),l=s(function(f){i.current.isMouseDown=!1,e&&!dy(f.target,t.map(function(h){return h.current}),n)&&r()},"onMouseUp"),a=s(function(){i.current.isTouchMove=!1},"onTouchStart"),c=s(function(){i.current.isTouchMove=!0},"onTouchMove"),u=s(function(f){e&&!i.current.isTouchMove&&!dy(f.target,t.map(function(h){return h.current}),n,!1)&&r()},"onTouchEnd");return n.addEventListener("mousedown",o),n.addEventListener("mouseup",l),n.addEventListener("touchstart",a),n.addEventListener("touchmove",c),n.addEventListener("touchend",u),s(function(){n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",l),n.removeEventListener("touchstart",a),n.removeEventListener("touchmove",c),n.removeEventListener("touchend",u)},"cleanup")}},[e,n]),i}s(kT,"useMouseAndTouchTracker");var Um=s(function(){return Fa},"useGetterPropsCalledChecker");function Du(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,o=n.items,l=n.environment,a=kr(n,D$);(0,m.useEffect)(function(){r||F$(function(){return e(Le({highlightedIndex:i,highlightedItem:o[i],resultCount:o.length},a))},l.document)},t)}s(Du,"useA11yMessageSetter");function MT(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,l=e.scrollIntoView,a=(0,m.useRef)(!0);return V$(function(){t<0||!n||!Object.keys(r.current).length||(a.current===!1?a.current=!0:l(i(t),o))},[t]),a}s(MT,"useScrollIntoView");var Wm=Fa;function Ru(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return Le({isOpen:!1,highlightedIndex:-1},i&&Le({selectedItem:e.items[t],isOpen:In(e,"isOpen"),highlightedIndex:In(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}s(Ru,"getChangesOnSelection");function AT(e,t,n){var r=t.type,i=t.props,o;switch(r){case n.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:o={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:po(i,e,0)};break;case n.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:po(i,e,0)};break;case n.FunctionCloseMenu:o={isOpen:!1};break;case n.FunctionSetHighlightedIndex:o={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:o={inputValue:t.inputValue};break;case n.FunctionReset:o={highlightedIndex:In(i,"highlightedIndex"),isOpen:In(i,"isOpen"),selectedItem:In(i,"selectedItem"),inputValue:In(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Le({},e,o)}s(AT,"downshiftCommonReducer");function K$(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,o=e.getItemNodeFromIndex,l=t.toLowerCase(),a=0;a<r.length;a++){var c=(a+n+(t.length<2?1:0))%r.length,u=r[c];if(u!==void 0&&i(u).toLowerCase().startsWith(l)){var d=o(c);if(!d?.hasAttribute("disabled"))return c}}return n}s(K$,"getItemIndexByCharacterKey");Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function U$(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}s(U$,"getA11yStatusMessage");var W$=X1(X1({},kl),{getA11yStatusMessage:U$}),z$=Fa,Rc=0,zm=1,jm=2,Lu=3,Jm=4,Gm=5,qm=6,Zm=7,Ym=8,Xm=9,Qm=10,$u=11,IT=12,NT=13,e1=14,OT=15,DT=16,RT=17,LT=18,t1=19,vg=20,$T=21,PT=Object.freeze({__proto__:null,ToggleButtonClick:Rc,ToggleButtonKeyDownArrowDown:zm,ToggleButtonKeyDownArrowUp:jm,ToggleButtonKeyDownCharacter:Lu,ToggleButtonKeyDownEscape:Jm,ToggleButtonKeyDownHome:Gm,ToggleButtonKeyDownEnd:qm,ToggleButtonKeyDownEnter:Zm,ToggleButtonKeyDownSpaceButton:Ym,ToggleButtonKeyDownPageUp:Xm,ToggleButtonKeyDownPageDown:Qm,ToggleButtonBlur:$u,MenuMouseLeave:IT,ItemMouseMove:NT,ItemClick:e1,FunctionToggleMenu:OT,FunctionOpenMenu:DT,FunctionCloseMenu:RT,FunctionSetHighlightedIndex:LT,FunctionSelectItem:t1,FunctionSetInputValue:vg,FunctionReset:$T});function j$(e,t){var n,r=t.type,i=t.props,o=t.altKey,l;switch(r){case e1:l={isOpen:In(i,"isOpen"),highlightedIndex:In(i,"highlightedIndex"),selectedItem:i.items[t.index]};break;case Lu:var a=t.key,c=""+e.inputValue+a;l={inputValue:c,highlightedIndex:K$({keysSoFar:c,highlightedIndex:!e.isOpen&&e.selectedItem?i.items.indexOf(e.selectedItem):e.highlightedIndex,items:i.items,itemToString:i.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex}),isOpen:!0};break;case zm:l={highlightedIndex:e.isOpen?Ai(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1):o&&e.selectedItem==null?-1:po(i,e,1),isOpen:!0};break;case jm:e.isOpen&&o?l=Ru(i,e.highlightedIndex,!1):l={highlightedIndex:e.isOpen?Ai(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1):po(i,e,-1),isOpen:!0};break;case Zm:case Ym:l=Ru(i,e.highlightedIndex,!1);break;case Gm:l={highlightedIndex:Ao(1,0,i.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case qm:l={highlightedIndex:Ao(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case Xm:l={highlightedIndex:Ai(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Qm:l={highlightedIndex:Ai(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case Jm:l={isOpen:!1,highlightedIndex:-1};break;case $u:l=Le({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&{selectedItem:i.items[e.highlightedIndex]});break;case t1:l={selectedItem:t.selectedItem};break;default:return AT(e,t,PT)}return Le({},e,l)}s(j$,"downshiftSelectReducer");var J$=["onMouseLeave","refKey","onKeyDown","onBlur","ref"],G$=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],q$=["item","index","onMouseMove","onClick","onPress","refKey","ref","disabled"];FT.stateChangeTypes=PT;function FT(e){e===void 0&&(e={}),z$(e,FT);var t=Le({},W$,e),n=t.items,r=t.scrollIntoView,i=t.environment,o=t.itemToString,l=t.getA11ySelectionMessage,a=t.getA11yStatusMessage,c=TT(j$,wT(t),t),u=c[0],d=c[1],f=u.isOpen,h=u.highlightedIndex,g=u.selectedItem,p=u.inputValue,_=(0,m.useRef)(null),y=(0,m.useRef)(null),v=(0,m.useRef)({}),x=(0,m.useRef)(null),C=ET(t),b=(0,m.useRef)(),S=(0,m.useRef)(!0),M=Fd({state:u,props:t}),T=(0,m.useCallback)(function(Z){return v.current[C.getItemId(Z)]},[C]);Du(a,[f,h,p,n],Le({isInitialMount:S.current,previousResultCount:b.current,items:n,environment:i,itemToString:o},u)),Du(l,[g],Le({isInitialMount:S.current,previousResultCount:b.current,items:n,environment:i,itemToString:o},u));var E=MT({menuElement:y.current,highlightedIndex:h,isOpen:f,itemRefs:v,scrollIntoView:r,getItemNodeFromIndex:T});(0,m.useEffect)(function(){return x.current=Bm(function(Z){Z({type:vg,inputValue:""})},500),function(){x.current.cancel()}},[]),(0,m.useEffect)(function(){p&&x.current(d)},[d,p]),Wm({isInitialMount:S.current,props:t,state:u}),(0,m.useEffect)(function(){S.current||(b.current=n.length)});var A=kT(f,[y,_],i,function(){d({type:$u})}),D=Um("getMenuProps","getToggleButtonProps");(0,m.useEffect)(function(){return S.current=!1,function(){S.current=!0}},[]),(0,m.useEffect)(function(){f||(v.current={})},[f]);var L=(0,m.useMemo)(function(){return{ArrowDown:s(function(pe){pe.preventDefault(),d({type:zm,getItemNodeFromIndex:T,altKey:pe.altKey})},"ArrowDown"),ArrowUp:s(function(pe){pe.preventDefault(),d({type:jm,getItemNodeFromIndex:T,altKey:pe.altKey})},"ArrowUp"),Home:s(function(pe){pe.preventDefault(),d({type:Gm,getItemNodeFromIndex:T})},"Home"),End:s(function(pe){pe.preventDefault(),d({type:qm,getItemNodeFromIndex:T})},"End"),Escape:s(function(){M.current.state.isOpen&&d({type:Jm})},"Escape"),Enter:s(function(pe){pe.preventDefault(),d({type:M.current.state.isOpen?Zm:Rc})},"Enter"),PageUp:s(function(pe){M.current.state.isOpen&&(pe.preventDefault(),d({type:Xm,getItemNodeFromIndex:T}))},"PageUp"),PageDown:s(function(pe){M.current.state.isOpen&&(pe.preventDefault(),d({type:Qm,getItemNodeFromIndex:T}))},"PageDown")," ":s(function(pe){pe.preventDefault();var de=M.current.state;if(!de.isOpen){d({type:Rc});return}de.inputValue?d({type:Lu,key:" ",getItemNodeFromIndex:T}):d({type:Ym})},"_")}},[d,T,M]),G=(0,m.useCallback)(function(){d({type:OT})},[d]),$=(0,m.useCallback)(function(){d({type:RT})},[d]),z=(0,m.useCallback)(function(){d({type:DT})},[d]),W=(0,m.useCallback)(function(Z){d({type:LT,highlightedIndex:Z})},[d]),ye=(0,m.useCallback)(function(Z){d({type:t1,selectedItem:Z})},[d]),q=(0,m.useCallback)(function(){d({type:$T})},[d]),ge=(0,m.useCallback)(function(Z){d({type:vg,inputValue:Z})},[d]),me=(0,m.useCallback)(function(Z){return Le({id:C.labelId,htmlFor:C.toggleButtonId},Z)},[C]),oe=(0,m.useCallback)(function(Z,pe){var de,ce=Z===void 0?{}:Z,j=ce.onMouseLeave,ne=ce.refKey,ue=ne===void 0?"ref":ne;ce.onKeyDown,ce.onBlur;var Ne=ce.ref,$e=kr(ce,J$),Re=(pe===void 0?{}:pe).suppressRefError,Pe=Re===void 0?!1:Re,rt=s(function(){d({type:IT})},"menuHandleMouseLeave");return D("getMenuProps",Pe,ue,y),Le((de={},de[ue]=Yr(Ne,function(Je){y.current=Je}),de.id=C.menuId,de.role="listbox",de["aria-labelledby"]=$e&&$e["aria-label"]?void 0:""+C.labelId,de.onMouseLeave=Ot(j,rt),de),$e)},[d,D,C]);return{getToggleButtonProps:(0,m.useCallback)(function(Z,pe){var de,ce=Z===void 0?{}:Z,j=ce.onBlur,ne=ce.onClick;ce.onPress;var ue=ce.onKeyDown,Ne=ce.refKey,$e=Ne===void 0?"ref":Ne,Re=ce.ref,Pe=kr(ce,G$),rt=(pe===void 0?{}:pe).suppressRefError,Je=rt===void 0?!1:rt,pt=M.current.state,It=s(function(){d({type:Rc})},"toggleButtonHandleClick"),ut=s(function(){pt.isOpen&&!A.current.isMouseDown&&d({type:$u})},"toggleButtonHandleBlur"),jt=s(function(Nt){var it=Ou(Nt);it&&L[it]?L[it](Nt):H$(it)&&d({type:Lu,key:it,getItemNodeFromIndex:T})},"toggleButtonHandleKeyDown"),Ge=Le((de={},de[$e]=Yr(Re,function(yt){_.current=yt}),de["aria-activedescendant"]=pt.isOpen&&pt.highlightedIndex>-1?C.getItemId(pt.highlightedIndex):"",de["aria-controls"]=C.menuId,de["aria-expanded"]=M.current.state.isOpen,de["aria-haspopup"]="listbox",de["aria-labelledby"]=Pe&&Pe["aria-label"]?void 0:""+C.labelId,de.id=C.toggleButtonId,de.role="combobox",de.tabIndex=0,de.onBlur=Ot(j,ut),de),Pe);return Pe.disabled||(Ge.onClick=Ot(ne,It),Ge.onKeyDown=Ot(ue,jt)),D("getToggleButtonProps",Je,$e,_),Ge},[M,C,D,d,A,L,T]),getLabelProps:me,getMenuProps:oe,getItemProps:(0,m.useCallback)(function(Z){var pe,de=Z===void 0?{}:Z,ce=de.item,j=de.index,ne=de.onMouseMove,ue=de.onClick;de.onPress;var Ne=de.refKey,$e=Ne===void 0?"ref":Ne,Re=de.ref,Pe=de.disabled,rt=kr(de,q$),Je=M.current,pt=Je.state,It=Je.props,ut=Hm(ce,j,It.items,"Pass either item or index to getItemProps!"),jt=ut[0],Ge=ut[1],yt=s(function(){Ge!==pt.highlightedIndex&&(E.current=!1,d({type:NT,index:Ge,disabled:Pe}))},"itemHandleMouseMove"),Nt=s(function(){d({type:e1,index:Ge})},"itemHandleClick"),it=Le((pe={disabled:Pe,role:"option","aria-selected":""+(jt===g),id:C.getItemId(Ge)},pe[$e]=Yr(Re,function(Yt){Yt&&(v.current[C.getItemId(Ge)]=Yt)}),pe),rt);return Pe||(it.onClick=Ot(ue,Nt)),it.onMouseMove=Ot(ne,yt),it},[M,g,C,E,d]),toggleMenu:G,openMenu:z,closeMenu:$,setHighlightedIndex:W,selectItem:ye,reset:q,setInputValue:ge,highlightedIndex:h,isOpen:f,selectedItem:g,inputValue:p}}s(FT,"useSelect");var n1=0,r1=1,i1=2,o1=3,s1=4,l1=5,a1=6,c1=7,u1=8,Pu=9,d1=10,VT=11,BT=12,f1=13,HT=14,KT=15,UT=16,WT=17,zT=18,h1=19,jT=20,JT=21,g1=22,GT=Object.freeze({__proto__:null,InputKeyDownArrowDown:n1,InputKeyDownArrowUp:r1,InputKeyDownEscape:i1,InputKeyDownHome:o1,InputKeyDownEnd:s1,InputKeyDownPageUp:l1,InputKeyDownPageDown:a1,InputKeyDownEnter:c1,InputChange:u1,InputBlur:Pu,InputFocus:d1,MenuMouseLeave:VT,ItemMouseMove:BT,ItemClick:f1,ToggleButtonClick:HT,FunctionToggleMenu:KT,FunctionOpenMenu:UT,FunctionCloseMenu:WT,FunctionSetHighlightedIndex:zT,FunctionSelectItem:h1,FunctionSetInputValue:jT,FunctionReset:JT,ControlledPropUpdatedSelectedItem:g1});function Z$(e){var t=wT(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),Le({},t,{inputValue:r})}s(Z$,"getInitialState$1");Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function Y$(e,t,n){var r=(0,m.useRef)(),i=ST(e,t,n),o=i[0],l=i[1];return(0,m.useEffect)(function(){yT(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&l({type:g1,inputValue:n.itemToString(n.selectedItem)}),r.current=o.selectedItem===r.current?n.selectedItem:o.selectedItem)},[o.selectedItem,n.selectedItem]),[Nu(o,n),l]}s(Y$,"useControlledReducer");var X$=Fa,Q$=Le({},kl,{selectedItemChanged:s(function(t,n){return t!==n},"selectedItemChanged"),getA11yStatusMessage:N$});function eP(e,t){var n,r=t.type,i=t.props,o=t.altKey,l;switch(r){case f1:l={isOpen:In(i,"isOpen"),highlightedIndex:In(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case n1:e.isOpen?l={highlightedIndex:Ai(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:l={highlightedIndex:o&&e.selectedItem==null?-1:po(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case r1:e.isOpen?o?l=Ru(i,e.highlightedIndex):l={highlightedIndex:Ai(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:l={highlightedIndex:po(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case c1:l=Ru(i,e.highlightedIndex);break;case i1:l=Le({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case l1:l={highlightedIndex:Ai(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case a1:l={highlightedIndex:Ai(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case o1:l={highlightedIndex:Ao(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case s1:l={highlightedIndex:Ao(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case Pu:l=Le({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case u1:l={isOpen:!0,highlightedIndex:In(i,"highlightedIndex"),inputValue:t.inputValue};break;case d1:l={isOpen:!0,highlightedIndex:po(i,e,0)};break;case h1:l={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case g1:l={inputValue:t.inputValue};break;default:return AT(e,t,GT)}return Le({},e,l)}s(eP,"downshiftUseComboboxReducer");var tP=["onMouseLeave","refKey","ref"],nP=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],rP=["onClick","onPress","refKey","ref"],iP=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];p1.stateChangeTypes=GT;function p1(e){e===void 0&&(e={}),X$(e,p1);var t=Le({},Q$,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,o=t.scrollIntoView,l=t.environment,a=t.getA11yStatusMessage,c=t.getA11ySelectionMessage,u=t.itemToString,d=Y$(eP,Z$(t),t),f=d[0],h=d[1],g=f.isOpen,p=f.highlightedIndex,_=f.selectedItem,y=f.inputValue,v=(0,m.useRef)(null),x=(0,m.useRef)({}),C=(0,m.useRef)(null),b=(0,m.useRef)(null),S=(0,m.useRef)(!0),M=ET(t),T=(0,m.useRef)(),E=Fd({state:f,props:t}),A=(0,m.useCallback)(function(ce){return x.current[M.getItemId(ce)]},[M]);Du(a,[g,p,y,i],Le({isInitialMount:S.current,previousResultCount:T.current,items:i,environment:l,itemToString:u},f)),Du(c,[_],Le({isInitialMount:S.current,previousResultCount:T.current,items:i,environment:l,itemToString:u},f));var D=MT({menuElement:v.current,highlightedIndex:p,isOpen:g,itemRefs:x,scrollIntoView:o,getItemNodeFromIndex:A});Wm({isInitialMount:S.current,props:t,state:f}),(0,m.useEffect)(function(){(n||r||g)&&C.current&&C.current.focus()},[]),(0,m.useEffect)(function(){S.current||(T.current=i.length)});var L=kT(g,[C,v,b],l,function(){h({type:Pu,selectItem:!1})}),G=Um("getInputProps","getMenuProps");(0,m.useEffect)(function(){return S.current=!1,function(){S.current=!0}},[]),(0,m.useEffect)(function(){var ce;if(!g)x.current={};else if(((ce=l.document)==null?void 0:ce.activeElement)!==C.current){var j;C==null||(j=C.current)==null||j.focus()}},[g,l]);var $=(0,m.useMemo)(function(){return{ArrowDown:s(function(j){j.preventDefault(),h({type:n1,altKey:j.altKey,getItemNodeFromIndex:A})},"ArrowDown"),ArrowUp:s(function(j){j.preventDefault(),h({type:r1,altKey:j.altKey,getItemNodeFromIndex:A})},"ArrowUp"),Home:s(function(j){E.current.state.isOpen&&(j.preventDefault(),h({type:o1,getItemNodeFromIndex:A}))},"Home"),End:s(function(j){E.current.state.isOpen&&(j.preventDefault(),h({type:s1,getItemNodeFromIndex:A}))},"End"),Escape:s(function(j){var ne=E.current.state;(ne.isOpen||ne.inputValue||ne.selectedItem||ne.highlightedIndex>-1)&&(j.preventDefault(),h({type:i1}))},"Escape"),Enter:s(function(j){!E.current.state.isOpen||j.which===229||(j.preventDefault(),h({type:c1,getItemNodeFromIndex:A}))},"Enter"),PageUp:s(function(j){E.current.state.isOpen&&(j.preventDefault(),h({type:l1,getItemNodeFromIndex:A}))},"PageUp"),PageDown:s(function(j){E.current.state.isOpen&&(j.preventDefault(),h({type:a1,getItemNodeFromIndex:A}))},"PageDown")}},[h,E,A]),z=(0,m.useCallback)(function(ce){return Le({id:M.labelId,htmlFor:M.inputId},ce)},[M]),W=(0,m.useCallback)(function(ce,j){var ne,ue=ce===void 0?{}:ce,Ne=ue.onMouseLeave,$e=ue.refKey,Re=$e===void 0?"ref":$e,Pe=ue.ref,rt=kr(ue,tP),Je=(j===void 0?{}:j).suppressRefError;return G("getMenuProps",Je===void 0?!1:Je,Re,v),Le((ne={},ne[Re]=Yr(Pe,function(pt){v.current=pt}),ne.id=M.menuId,ne.role="listbox",ne["aria-labelledby"]=rt&&rt["aria-label"]?void 0:""+M.labelId,ne.onMouseLeave=Ot(Ne,function(){h({type:VT})}),ne),rt)},[h,G,M]),ye=(0,m.useCallback)(function(ce){var j,ne,ue=ce===void 0?{}:ce,Ne=ue.item,$e=ue.index,Re=ue.refKey,Pe=Re===void 0?"ref":Re,rt=ue.ref,Je=ue.onMouseMove,pt=ue.onMouseDown,It=ue.onClick;ue.onPress;var ut=ue.disabled,jt=kr(ue,nP),Ge=E.current,yt=Ge.props,Nt=Ge.state,it=Hm(Ne,$e,yt.items,"Pass either item or index to getItemProps!")[1],Yt="onClick",Ln=It;return Le((j={},j[Pe]=Yr(rt,function(Fe){Fe&&(x.current[M.getItemId(it)]=Fe)}),j.disabled=ut,j.role="option",j["aria-selected"]=""+(it===Nt.highlightedIndex),j.id=M.getItemId(it),j),!ut&&(ne={},ne[Yt]=Ot(Ln,s(function(){h({type:f1,index:it})},"itemHandleClick")),ne),{onMouseMove:Ot(Je,s(function(){it!==Nt.highlightedIndex&&(D.current=!1,h({type:BT,index:it,disabled:ut}))},"itemHandleMouseMove")),onMouseDown:Ot(pt,s(function($t){return $t.preventDefault()},"itemHandleMouseDown"))},jt)},[h,E,D,M]),q=(0,m.useCallback)(function(ce){var j,ne=ce===void 0?{}:ce,ue=ne.onClick;ne.onPress;var Ne=ne.refKey,$e=Ne===void 0?"ref":Ne,Re=ne.ref,Pe=kr(ne,rP),rt=E.current.state;return Le((j={},j[$e]=Yr(Re,function(Je){b.current=Je}),j["aria-controls"]=M.menuId,j["aria-expanded"]=rt.isOpen,j.id=M.toggleButtonId,j.tabIndex=-1,j),!Pe.disabled&&Le({},{onClick:Ot(ue,s(function(){h({type:HT})},"toggleButtonHandleClick"))}),Pe)},[h,E,M]),ge=(0,m.useCallback)(function(ce,j){var ne,ue=ce===void 0?{}:ce,Ne=ue.onKeyDown,$e=ue.onChange,Re=ue.onInput,Pe=ue.onFocus,rt=ue.onBlur;ue.onChangeText;var Je=ue.refKey,pt=Je===void 0?"ref":Je,It=ue.ref,ut=kr(ue,iP),jt=(j===void 0?{}:j).suppressRefError;G("getInputProps",jt===void 0?!1:jt,pt,C);var Ge=E.current.state,yt=s(function(ze){var I=Ou(ze);I&&$[I]&&$[I](ze)},"inputHandleKeyDown"),Nt=s(function(ze){h({type:u1,inputValue:ze.target.value})},"inputHandleChange"),it=s(function(ze){Ge.isOpen&&!L.current.isMouseDown&&h({type:Pu,selectItem:!(ze.relatedTarget===null&&l.document.activeElement!==l.document.body)})},"inputHandleBlur"),Yt=s(function(){Ge.isOpen||h({type:d1})},"inputHandleFocus"),Ln="onChange",Fe={};if(!ut.disabled){var $t;Fe=($t={},$t[Ln]=Ot($e,Re,Nt),$t.onKeyDown=Ot(Ne,yt),$t.onBlur=Ot(rt,it),$t.onFocus=Ot(Pe,Yt),$t)}return Le((ne={},ne[pt]=Yr(It,function($n){C.current=$n}),ne["aria-activedescendant"]=Ge.isOpen&&Ge.highlightedIndex>-1?M.getItemId(Ge.highlightedIndex):"",ne["aria-autocomplete"]="list",ne["aria-controls"]=M.menuId,ne["aria-expanded"]=Ge.isOpen,ne["aria-labelledby"]=ut&&ut["aria-label"]?void 0:""+M.labelId,ne.autoComplete="off",ne.id=M.inputId,ne.role="combobox",ne.value=Ge.inputValue,ne),Fe,ut)},[G,E,M,$,h,L,l]),me=(0,m.useCallback)(function(){h({type:KT})},[h]),oe=(0,m.useCallback)(function(){h({type:WT})},[h]),Z=(0,m.useCallback)(function(){h({type:UT})},[h]),pe=(0,m.useCallback)(function(ce){h({type:zT,highlightedIndex:ce})},[h]),de=(0,m.useCallback)(function(ce){h({type:h1,selectedItem:ce})},[h]);return{getItemProps:ye,getLabelProps:z,getMenuProps:W,getInputProps:ge,getToggleButtonProps:q,toggleMenu:me,openMenu:Z,closeMenu:oe,setHighlightedIndex:pe,setInputValue:(0,m.useCallback)(function(ce){h({type:jT,inputValue:ce})},[h]),selectItem:de,reset:(0,m.useCallback)(function(){h({type:JT})},[h]),highlightedIndex:p,isOpen:g,selectedItem:_,inputValue:y}}s(p1,"useCombobox");var qT={activeIndex:-1,selectedItems:[]};function fy(e,t){return sl(e,t,qT)}s(fy,"getInitialValue");function hy(e,t){return In(e,t,qT)}s(hy,"getDefaultValue");function oP(e){return{activeIndex:fy(e,"activeIndex"),selectedItems:fy(e,"selectedItems")}}s(oP,"getInitialState");function gy(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}s(gy,"isKeyDownOperationPermitted");function sP(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}s(sP,"getA11yRemovalMessage");Q.default.array,Q.default.array,Q.default.array,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.func,Q.default.func,Q.default.string,Q.default.string,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});var lP={itemToString:kl.itemToString,stateReducer:kl.stateReducer,environment:kl.environment,getA11yRemovalMessage:sP,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},aP=Fa,m1=0,_1=1,v1=2,y1=3,x1=4,C1=5,b1=6,E1=7,S1=8,T1=9,w1=10,k1=11,M1=12,cP=Object.freeze({__proto__:null,SelectedItemClick:m1,SelectedItemKeyDownDelete:_1,SelectedItemKeyDownBackspace:v1,SelectedItemKeyDownNavigationNext:y1,SelectedItemKeyDownNavigationPrevious:x1,DropdownKeyDownNavigationPrevious:C1,DropdownKeyDownBackspace:b1,DropdownClick:E1,FunctionAddSelectedItem:S1,FunctionRemoveSelectedItem:T1,FunctionSetSelectedItems:w1,FunctionSetActiveIndex:k1,FunctionReset:M1});function uP(e,t){var n=t.type,r=t.index,i=t.props,o=t.selectedItem,l=e.activeIndex,a=e.selectedItems,c;switch(n){case m1:c={activeIndex:r};break;case x1:c={activeIndex:l-1<0?0:l-1};break;case y1:c={activeIndex:l+1>=a.length?-1:l+1};break;case v1:case _1:if(l<0)break;var u=l;a.length===1?u=-1:l===a.length-1&&(u=a.length-2),c=Le({selectedItems:[].concat(a.slice(0,l),a.slice(l+1))},{activeIndex:u});break;case C1:c={activeIndex:a.length-1};break;case b1:c={selectedItems:a.slice(0,a.length-1)};break;case S1:c={selectedItems:[].concat(a,[o])};break;case E1:c={activeIndex:-1};break;case T1:var d=l,f=a.indexOf(o);if(f<0)break;a.length===1?d=-1:f===a.length-1&&(d=a.length-2),c={selectedItems:[].concat(a.slice(0,f),a.slice(f+1)),activeIndex:d};break;case w1:c={selectedItems:t.selectedItems};break;case k1:c={activeIndex:t.activeIndex};break;case M1:c={activeIndex:hy(i,"activeIndex"),selectedItems:hy(i,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return Le({},e,c)}s(uP,"downshiftMultipleSelectionReducer");var dP=["refKey","ref","onClick","onKeyDown","selectedItem","index"],fP=["refKey","ref","onKeyDown","onClick","preventKeyAction"];ZT.stateChangeTypes=cP;function ZT(e){e===void 0&&(e={}),aP(e,ZT);var t=Le({},lP,e),n=t.getA11yRemovalMessage,r=t.itemToString,i=t.environment,o=t.keyNavigationNext,l=t.keyNavigationPrevious,a=TT(uP,oP(t),t),c=a[0],u=a[1],d=c.activeIndex,f=c.selectedItems,h=(0,m.useRef)(!0),g=(0,m.useRef)(null),p=(0,m.useRef)(f),_=(0,m.useRef)();_.current=[];var y=Fd({state:c,props:t});(0,m.useEffect)(function(){if(!h.current){if(f.length<p.current.length){var b=p.current.find(function(S){return f.indexOf(S)<0});xT(n({itemToString:r,resultCount:f.length,removedSelectedItem:b,activeIndex:d,activeSelectedItem:f[d]}),i.document)}p.current=f}},[f.length]),(0,m.useEffect)(function(){h.current||(d===-1&&g.current?g.current.focus():_.current[d]&&_.current[d].focus())},[d]),Wm({isInitialMount:h.current,props:t,state:c});var v=Um("getDropdownProps");(0,m.useEffect)(function(){return h.current=!1,function(){h.current=!0}},[]);var x=(0,m.useMemo)(function(){var b;return b={},b[l]=function(){u({type:x1})},b[o]=function(){u({type:y1})},b.Delete=s(function(){u({type:_1})},"Delete"),b.Backspace=s(function(){u({type:v1})},"Backspace"),b},[u,o,l]),C=(0,m.useMemo)(function(){var b;return b={},b[l]=function(S){gy(S)&&u({type:C1})},b.Backspace=s(function(M){gy(M)&&u({type:b1})},"Backspace"),b},[u,l]);return{getSelectedItemProps:(0,m.useCallback)(function(b){var S,M=b===void 0?{}:b,T=M.refKey,E=T===void 0?"ref":T,A=M.ref,D=M.onClick,L=M.onKeyDown,G=M.selectedItem,$=M.index,z=kr(M,dP),W=y.current.state,ye=Hm(G,$,W.selectedItems,"Pass either item or index to getSelectedItemProps!")[1],q=ye>-1&&ye===W.activeIndex;return Le((S={},S[E]=Yr(A,function(ge){ge&&_.current.push(ge)}),S.tabIndex=q?0:-1,S.onClick=Ot(D,s(function(){u({type:m1,index:ye})},"selectedItemHandleClick")),S.onKeyDown=Ot(L,s(function(me){var oe=Ou(me);oe&&x[oe]&&x[oe](me)},"selectedItemHandleKeyDown")),S),z)},[u,y,x]),getDropdownProps:(0,m.useCallback)(function(b,S){var M,T=b===void 0?{}:b,E=T.refKey,A=E===void 0?"ref":E,D=T.ref,L=T.onKeyDown,G=T.onClick,$=T.preventKeyAction,z=$===void 0?!1:$,W=kr(T,fP),ye=(S===void 0?{}:S).suppressRefError;return v("getDropdownProps",ye===void 0?!1:ye,A,g),Le((M={},M[A]=Yr(D,function(q){q&&(g.current=q)}),M),!z&&{onKeyDown:Ot(L,s(function(ge){var me=Ou(ge);me&&C[me]&&C[me](ge)},"dropdownHandleKeyDown")),onClick:Ot(G,s(function(){u({type:E1})},"dropdownHandleClick"))},W)},[u,C,v]),addSelectedItem:(0,m.useCallback)(function(b){u({type:S1,selectedItem:b})},[u]),removeSelectedItem:(0,m.useCallback)(function(b){u({type:T1,selectedItem:b})},[u]),setSelectedItems:(0,m.useCallback)(function(b){u({type:w1,selectedItems:b})},[u]),setActiveIndex:(0,m.useCallback)(function(b){u({type:k1,activeIndex:b})},[u]),reset:(0,m.useCallback)(function(){u({type:M1})},[u]),selectedItems:f,activeIndex:d}}s(ZT,"useMultipleSelection");var py=20,YT=s(e=>e.suggestions.length>0?m.createElement(hP,{...e}):m.createElement("input",{className:J.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),"DownshiftAutoComplete"),hP=s(({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:o,setValue:l})=>{const[a,c]=m.useState(t.slice(0,py)),u=ni(pi),d=t.length>0,{isOpen:f,getToggleButtonProps:h,getMenuProps:g,getInputProps:p,highlightedIndex:_,getItemProps:y,selectedItem:v}=p1({initialInputValue:o,onInputValueChange({inputValue:C=""}){l(r,C),C=C.toLowerCase()||"";const b=[];for(const S of t)if(S.toLowerCase().includes(C)&&(b.push(S),b.length>=py))break;c(b)},items:a,itemToString(C){return C??""}}),x=f&&a.length>0;return m.createElement("div",{className:J.downshiftAutocompleteContainer},m.createElement("div",{"data-visible-dropdown":x,className:J.downshiftInputWrapper},m.createElement(n$,{name:r,control:n,render:s(({field:C})=>{const b=p();return m.createElement("input",{...b,name:C.name,placeholder:i,className:J.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})},"render")}),d&&m.createElement("button",{"aria-label":"toggle menu",type:"button",...h()},u("arrow_drop_down"))),m.createElement("div",{className:J.downshiftAutocompleteContainer},m.createElement("ul",{...g(),"data-visible":x},a.map((C,b)=>m.createElement("li",{"data-selected":v===C,"data-highlighted":_===b,key:`${C}${b}`,...y({item:C,index:b})},C)))))},"DownshiftAutoCompleteWithSuggestions"),gP=s(()=>{const[e,t,n,r,i]=vr(yg,mo,Po,Ii,ia),o=Mn(nw),l=Mn(ew),a=mi(),{register:c,handleSubmit:u,control:d,setValue:f,reset:h}=vT({values:t.type==="editing"?t.initialValues:{}}),g=s(()=>{h({src:"",title:"",altText:"",width:void 0,height:void 0})},"resetFormState");return t.type==="inactive"?null:m.createElement(qk,{open:!0,onOpenChange:s(p=>{p||(l(),g())},"onOpenChange")},m.createElement(jk,{container:n?.current},m.createElement(zk,{className:J.dialogOverlay}),m.createElement(Jk,{className:J.dialogContent,onOpenAutoFocus:s(p=>{p.preventDefault()},"onOpenAutoFocus")},m.createElement(Gk,null,a("uploadImage.dialogTitle","Upload an image")),m.createElement("form",{onSubmit:s(async p=>{p.preventDefault(),p.stopPropagation(),await u(o)(p),g()},"onSubmit"),className:J.multiFieldForm},r===null?m.createElement("input",{type:"hidden",accept:"image/*",...c("file")}):m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"file"},a("uploadImage.uploadInstructions","Upload an image from your device:")),m.createElement("input",{type:"file",accept:"image/*",...c("file")})),m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"src"},r!==null?a("uploadImage.addViaUrlInstructions","Or add an image from an URL:"):a("uploadImage.addViaUrlInstructionsNoUpload","Add an image from an URL:")),m.createElement(YT,{register:c,initialInputValue:t.type==="editing"?t.initialValues.src??"":"",inputName:"src",suggestions:e,setValue:f,control:d,placeholder:a("uploadImage.autoCompletePlaceholder","Select or paste an image src")})),m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"alt"},a("uploadImage.alt","Alt:")),m.createElement("input",{type:"text",...c("altText"),className:J.textInput})),m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"title"},a("uploadImage.title","Title:")),m.createElement("input",{type:"text",...c("title"),className:J.textInput})),i&&m.createElement("div",{className:J.imageDimensionsContainer},m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"width"},a("uploadImage.width","Width:")),m.createElement("input",{type:"number",min:0,...c("width"),className:J.textInput})),m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"height"},a("uploadImage.height","Height:")),m.createElement("input",{type:"number",min:0,...c("height"),className:J.textInput}))),m.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},m.createElement("button",{type:"submit",title:a("dialogControls.save","Save"),"aria-label":a("dialogControls.save","Save"),className:(0,tt.default)(J.primaryButton)},a("dialogControls.save","Save")),m.createElement(Wk,{asChild:!0},m.createElement("button",{type:"reset",title:a("dialogControls.cancel","Cancel"),"aria-label":a("dialogControls.cancel","Cancel"),className:(0,tt.default)(J.secondaryButton)},a("dialogControls.cancel","Cancel"))))))))},"ImageDialog");function Af(e,t,n){return Math.min(Math.max(e,t),n)}s(Af,"clamp");var ot={east:1,north:8,south:2,west:4};function pP({onResizeStart:e,onResizeEnd:t,imageRef:n,maxWidth:r,editor:i}){const o=(0,m.useRef)(null),l=(0,m.useRef)({priority:"",value:"default"}),a=(0,m.useRef)({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),c=i.getRootElement(),u=r??(c!==null?c.getBoundingClientRect().width-20:100),d=c!==null?c.getBoundingClientRect().height-20:100,f=100,h=100,g=s(x=>{const C=x===ot.east||x===ot.west,b=x===ot.north||x===ot.south,S=x&ot.north&&x&ot.west||x&ot.south&&x&ot.east,M=C?"ew":b?"ns":S?"nwse":"nesw";c!==null&&c.style.setProperty("cursor",`${M}-resize`,"important"),document.body!==null&&(document.body.style.setProperty("cursor",`${M}-resize`,"important"),l.current.value=document.body.style.getPropertyValue("-webkit-user-select"),l.current.priority=document.body.style.getPropertyPriority("-webkit-user-select"),document.body.style.setProperty("-webkit-user-select","none","important"))},"setStartCursor"),p=s(()=>{c!==null&&c.style.setProperty("cursor","text"),document.body!==null&&(document.body.style.setProperty("cursor","default"),document.body.style.setProperty("-webkit-user-select",l.current.value,l.current.priority))},"setEndCursor"),_=s((x,C)=>{if(!i.isEditable())return;const b=n.current,S=o.current;if(b!==null&&S!==null){x.preventDefault();const{width:M,height:T}=b.getBoundingClientRect(),E=a.current;E.startWidth=M,E.startHeight=T,E.ratio=M/T,E.currentWidth=M,E.currentHeight=T,E.startX=x.clientX,E.startY=x.clientY,E.isResizing=!0,E.direction=C,g(C),e(),S.classList.add(J.imageControlWrapperResizing),b.style.height=`${T}px`,b.style.width=`${M}px`,document.addEventListener("pointermove",y),document.addEventListener("pointerup",v)}},"handlePointerDown"),y=s(x=>{const C=n.current,b=a.current,S=b.direction&(ot.east|ot.west),M=b.direction&(ot.south|ot.north);if(C!==null&&b.isResizing)if(S&&M){let T=Math.floor(b.startX-x.clientX);T=b.direction&ot.east?-T:T;const E=Af(b.startWidth+T,f,u),A=E/b.ratio;C.style.width=`${E}px`,C.style.height=`${A}px`,b.currentHeight=A,b.currentWidth=E}else if(M){let T=Math.floor(b.startY-x.clientY);T=b.direction&ot.south?-T:T;const E=Af(b.startHeight+T,h,d);C.style.height=`${E}px`,b.currentHeight=E}else{let T=Math.floor(b.startX-x.clientX);T=b.direction&ot.east?-T:T;const E=Af(b.startWidth+T,f,u);C.style.width=`${E}px`,b.currentWidth=E}},"handlePointerMove"),v=s(()=>{const x=n.current,C=a.current,b=o.current;if(x!==null&&b!==null&&C.isResizing){const S=C.currentWidth,M=C.currentHeight;C.startWidth=0,C.startHeight=0,C.ratio=0,C.startX=0,C.startY=0,C.currentWidth=0,C.currentHeight=0,C.isResizing=!1,b.classList.remove(J.imageControlWrapperResizing),p(),t(S,M),document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",v)}},"handlePointerUp");return m.createElement("div",{ref:o},m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerN),onPointerDown:s(x=>{_(x,ot.north)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerNe),onPointerDown:s(x=>{_(x,ot.north|ot.east)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerE),onPointerDown:s(x=>{_(x,ot.east)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerSe),onPointerDown:s(x=>{_(x,ot.south|ot.east)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerS),onPointerDown:s(x=>{_(x,ot.south)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerSw),onPointerDown:s(x=>{_(x,ot.south|ot.west)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerW),onPointerDown:s(x=>{_(x,ot.west)},"onPointerDown")}),m.createElement("div",{className:(0,tt.default)(J.imageResizer,J.imageResizerNw),onPointerDown:s(x=>{_(x,ot.north|ot.west)},"onPointerDown")}))}s(pP,"ImageResizer");var mP="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
57
+ <svg id="imgLoadError" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
58
+ <rect x="0" y="0" width="100" height="100" fill="none" stroke="red" stroke-width="4" stroke-dasharray="4" />
59
+ <text x="50" y="55" text-anchor="middle" font-size="20" fill="red">⚠️</text>
60
+ </svg>
61
+ `),_P={__cache:{},read(e){if(this.__cache[e]||(this.__cache[e]=new Promise(t=>{const n=new Image;n.onerror=()=>{this.__cache[e]=mP,t()},n.onload=()=>{this.__cache[e]=e,t()},n.src=e})),this.__cache[e]instanceof Promise)throw this.__cache[e];return this.__cache[e]}};function vP({title:e,alt:t,className:n,imageRef:r,src:i,width:o,height:l}){return m.createElement("img",{className:n??void 0,alt:t,src:_P.read(i),title:e,ref:r,draggable:"false",width:o,height:l})}s(vP,"LazyImage");function yP({src:e,title:t,alt:n,nodeKey:r,width:i,height:o,rest:l}){const[a,c,u,d,f,h]=vr(bg,xg,ia,Cg,_r,Eg),g=m.useRef(null),p=m.useRef(null),[_,y,v]=DS(r),[x]=fn(),[C,b]=m.useState(null),S=m.useRef(null),[M,T]=m.useState(!1),[E,A]=m.useState(null),[D,L]=m.useState(null),G=m.useCallback(oe=>{if(_&&He(re())){oe.preventDefault();const Z=yn(r);Fu(Z)&&Z.remove()}return!1},[_,r]),$=m.useCallback(oe=>{const Z=re(),pe=p.current;return _&&He(Z)&&Z.getNodes().length===1&&pe!==null&&pe!==document.activeElement?(oe.preventDefault(),pe.focus(),!0):!1},[_]),z=m.useCallback(oe=>p.current===oe.target?(Xn(null),x.update(()=>{y(!0);const Z=x.getRootElement();Z!==null&&Z.focus()}),!0):!1,[x,y]);m.useEffect(()=>{d?s(async()=>{D||L(e);const Z=await d(e);A(Z)},"callPreviewHandler")().catch(Z=>{}):A(e)},[e,d,D]),m.useEffect(()=>{if(u&&g.current){const{current:oe}=g;my(oe,"width",i),my(oe,"height",o)}},[u,i,o]),m.useEffect(()=>{let oe=!0;const Z=At(x.registerUpdateListener(({editorState:pe})=>{oe&&b(pe.read(()=>re()))}),x.registerCommand(um,(pe,de)=>(S.current=de,!1),st),x.registerCommand(im,pe=>{const de=pe;return M?!0:de.target===g.current?(de.shiftKey?y(!_):(v(),y(!0)),!0):!1},st),x.registerCommand(om,pe=>pe.target===g.current?(pe.preventDefault(),!0):!1,st),x.registerCommand(lm,G,st),x.registerCommand(vd,G,st),x.registerCommand(yd,$,st),x.registerCommand(xd,z,st));return()=>{oe=!1,Z()}},[v,x,M,_,r,G,$,z,y]);const W=s((oe,Z)=>{setTimeout(()=>{T(!1)},200),x.update(()=>{const pe=yn(r);Fu(pe)&&pe.setWidthAndHeight(oe,Z)})},"onResizeEnd"),ye=s(()=>{T(!0)},"onResizeStart"),q=He(C),ge=_,me=m.useMemo(()=>{if(l.length===0)return null;const oe=l.find(Z=>Z.type==="mdxJsxAttribute"&&(Z.name==="class"||Z.name==="className"));return oe?oe.value:null},[l]);return E!==null?m.createElement(m.Suspense,{fallback:a?m.createElement(a,null):null},m.createElement("div",{className:J.imageWrapper,"data-editor-block-type":"image"},m.createElement("div",{draggable:q},m.createElement(vP,{width:i,height:o,className:(0,tt.default)({[J.focusedImage]:ge},me),src:E,title:t??"",alt:n??"",imageRef:g})),q&&ge&&!c&&m.createElement(pP,{editor:x,imageRef:g,onResizeStart:ye,onResizeEnd:W}),f||m.createElement(h,{nodeKey:r,imageSource:E,initialImagePath:D,title:t??"",alt:n??"",width:i,height:o}))):null}s(yP,"ImageEditor");var my=s((e,t,n)=>{typeof n=="number"?e.style[t]=`${n}px`:e.style.removeProperty(t)},"syncDimensionWithImageResizer"),xP=Object.defineProperty,CP=s((e,t,n)=>t in e?xP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),zo=s((e,t,n)=>CP(e,typeof t!="symbol"?t+"":t,n),"__publicField$1");function bP(e){if(e instanceof HTMLImageElement){const{alt:t,src:n,title:r,width:i,height:o}=e;return{node:Fo({altText:t,src:n,title:r,width:i||void 0,height:o||void 0})}}return null}s(bP,"convertImageElement");var A1=class XT extends Ma{static{s(this,"ImageNode")}constructor(t,n,r,i,o,l,a){super(a),zo(this,"__src"),zo(this,"__altText"),zo(this,"__title"),zo(this,"__width"),zo(this,"__height"),zo(this,"__rest"),this.__src=t,this.__title=r,this.__altText=n,this.__width=i??"inherit",this.__height=o??"inherit",this.__rest=l??[]}static getType(){return"image"}static clone(t){return new XT(t.__src,t.__altText,t.__title,t.__width,t.__height,t.__rest,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__src=t.__src,this.__altText=t.__altText,this.__title=t.__title,this.__width=t.__width,this.__height=t.__height,this.__rest=t.__rest}static importJSON(t){const{altText:n,title:r,src:i,width:o,rest:l,height:a}=t;return Fo({altText:n,title:r,src:i,height:a,width:o,rest:l})}exportDOM(){const t=document.createElement("img");return t.setAttribute("src",this.__src),t.setAttribute("alt",this.__altText),this.__title&&t.setAttribute("title",this.__title),this.__width!=="inherit"&&this.__width&&t.setAttribute("width",this.__width.toString()),this.__height!=="inherit"&&this.__height&&t.setAttribute("height",this.__height.toString()),{element:t}}static importDOM(){return{img:s(()=>({conversion:bP,priority:0}),"img")}}exportJSON(){return{altText:this.getAltText(),title:this.getTitle(),height:this.__height==="inherit"?void 0:this.__height,width:this.__width==="inherit"?void 0:this.__width,src:this.getSrc(),rest:this.__rest,type:"image",version:1}}setWidthAndHeight(t,n){const r=this.getWritable();r.__width=t,r.__height=n}createDOM(t,n){const r=document.createElement("span"),i=t.theme.image;return i!==void 0&&(r.className=i),r}updateDOM(){return!1}getSrc(){return this.__src}getAltText(){return this.__altText}getTitle(){return this.__title}getHeight(){return this.__height}getWidth(){return this.__width}getRest(){return this.__rest}setTitle(t){this.getWritable().__title=t}setSrc(t){this.getWritable().__src=t}setAltText(t){this.getWritable().__altText=t??""}shouldBeSerializedAsElement(){return this.__width!=="inherit"||this.__height!=="inherit"||this.__rest.length>0}decorate(t){return m.createElement(yP,{src:this.getSrc(),title:this.getTitle(),nodeKey:this.getKey(),width:this.__width,height:this.__height,alt:this.__altText,rest:this.__rest})}};function Fo(e){const{altText:t,title:n,src:r,key:i,width:o,height:l,rest:a}=e;return new A1(r,t,n,o,l,a,i)}s(Fo,"$createImageNode");function Fu(e){return e instanceof A1}s(Fu,"$isImageNode");var EP={testLexicalNode:Fu,visitLexicalNode({mdastParent:e,lexicalNode:t,actions:n}){if(t.shouldBeSerializedAsElement()){const r=new Image;t.getHeight()!=="inherit"&&(r.height=t.getHeight()),t.getWidth()!=="inherit"&&(r.width=t.getWidth()),t.getAltText()&&(r.alt=t.getAltText()),t.getTitle()&&(r.title=t.getTitle());for(const i of t.getRest())i.type==="mdxJsxAttribute"&&typeof i.value=="string"&&r.setAttribute(i.name,i.value);n.appendToParent(e,{type:"html",value:r.outerHTML.replace(/>$/,` src="${t.getSrc()}" />`)})}else n.appendToParent(e,{type:"image",url:t.getSrc(),alt:t.getAltText(),title:t.getTitle()})}},SP={testNode:"image",visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Fo({src:e.url,altText:e.alt??"",title:e.title??""}))}},TP={testNode:s(e=>e.type==="html"&&e.value.trim().startsWith("<img"),"testNode"),visitNode({mdastNode:e,lexicalParent:t}){const n=document.createElement("div");n.innerHTML=e.value;const r=n.querySelector("img");if(!r)throw new Error("Invalid HTML image");const i=r.src,o=r.alt,l=r.title,a=r.width,c=r.height,u=Fo({src:i||"",altText:o,title:l,width:a||void 0,height:c||void 0});if(t.getType()==="root"){const d=Xe();d.append(u),t.append(d)}else t.append(u)}};function nl(e,t){const n=e.attributes.find(r=>r.type==="mdxJsxAttribute"&&r.name===t);if(n)return n.value}s(nl,"getAttributeValue");var wP={testNode:s(e=>(e.type==="mdxJsxTextElement"||e.type==="mdxJsxFlowElement")&&e.name==="img","testNode"),visitNode({mdastNode:e,lexicalParent:t}){const n=nl(e,"src");if(!n)return;const r=nl(e,"alt")??"",i=nl(e,"title"),o=nl(e,"height"),l=nl(e,"width"),a=e.attributes.filter(u=>u.type==="mdxJsxAttribute"&&!["src","alt","title","height","width"].includes(u.name)),c=Fo({src:n,altText:r,title:i,width:l?parseInt(l,10):void 0,height:o?parseInt(o,10):void 0,rest:a});if(t.getType()==="root"){const u=Xe();u.append(c),t.append(u)}else t.append(c)}},I1=wt(e=>{e.sub(e.pipe(I1,mt(gt)),([t,n])=>{n?.update(()=>{const r=Fo({altText:t.altText??"",src:t.src,title:t.title??"",width:Ss(t.width),height:Ss(t.height)});Ls([r]),xn(r.getParentOrThrow())&&dm(r,Xe).selectEnd()})})}),kP=wt(e=>{e.sub(e.pipe(kP,mt(Ii)),([t,n])=>{const r=s(i=>{e.pub(I1,{...t,src:i})},"handler");"file"in t?n?.(t.file).then(r).catch(i=>{throw i}):r(t.src)})}),yg=he([]),xg=he(!1),Ii=he(null),Cg=he(null),bg=he(null),mo=he({type:"inactive"},e=>{e.sub(e.pipe(nw,mt(gt,Ii,mo,ia)),([t,n,r,i,o])=>{const l=i.type==="editing"?a=>{n?.update(()=>{const{nodeKey:c}=i,u=yn(c);if(u.setTitle(t.title),u.setAltText(t.altText),u.setSrc(a),o){const d=Ss(t.width),f=Ss(t.height);u.setWidthAndHeight(d??"inherit",f??"inherit")}}),e.pub(mo,{type:"inactive"})}:a=>{e.pub(I1,{...t,src:a}),e.pub(mo,{type:"inactive"})};t.file&&t.file.length>0?r?.(t.file.item(0)).then(l).catch(a=>{throw a}):t.src&&l(t.src)}),e.pub(ea,t=>{const n=e.getValue(Ii);return At(t.registerCommand(Vu,r=>{const i=Fo(r);return Ls([i]),xn(i.getParentOrThrow())&&dm(i,Xe).selectEnd(),!0},Ae),t.registerCommand(om,r=>OP(r),Jl),t.registerCommand(lb,r=>DP(r,!!n),st),t.registerCommand(ab,r=>RP(r,t,e.getValue(Ii)),Jl),t.registerCommand(Gl,r=>{var i,o;if(!n){let c=Array.from(((i=r.clipboardData)==null?void 0:i.items)??[]);return c=c.filter(u=>u.type.includes("text")),!c.length||c.length===0}const l=Array.from(((o=r.clipboardData)==null?void 0:o.items)??[]);if(l.some(c=>!c.type.includes("image"))||!l.length||l.length===0)return!1;const a=e.getValue(Ii);return Promise.all(l.map(c=>a(c.getAsFile()))).then(c=>{c.forEach(u=>{t.dispatchCommand(Vu,{src:u,altText:""})})}).catch(c=>{throw c}),!0},Rr))})}),MP=Ji(e=>{e.link(e.pipe(MP,fC({type:"new"})),mo)}),QT=wt(e=>{e.link(e.pipe(QT,$i(t=>({type:"editing",...t}))),mo)}),ew=Ji(e=>{e.link(e.pipe(ew,fC({type:"inactive"})),mo)}),tw=he(!1),ia=he(!1),nw=wt(),Eg=he(fg),Ss=s(e=>{if(typeof e>"u")return;const t=parseInt(String(e),10);return Number.isNaN(t)?void 0:t},"parseImageDimension"),AP=En({init(e,t){e.pubIn({[$r]:[SP,TP,wP],[hi]:A1,[gi]:EP,[Bs]:t?.ImageDialog??gP,[Ii]:t?.imageUploadHandler??null,[yg]:t?.imageAutocompleteSuggestions??[],[xg]:!!t?.disableImageResize,[tw]:!!t?.disableImageSettingsButton,[ia]:!!t?.allowSetImageDimensions,[Cg]:t?.imagePreviewHandler??null,[Eg]:t?.EditImageToolbar??fg,[bg]:t?.imagePlaceholder??Gv})},update(e,t){e.pubIn({[Ii]:t?.imageUploadHandler??null,[yg]:t?.imageAutocompleteSuggestions??[],[xg]:!!t?.disableImageResize,[Cg]:t?.imagePreviewHandler??null,[ia]:!!t?.allowSetImageDimensions,[Eg]:t?.EditImageToolbar??fg,[bg]:t?.imagePlaceholder??Gv})}}),IP=s(e=>NS?(e??window).getSelection():null,"getDOMSelection"),Vu=br("INSERT_IMAGE_COMMAND"),NP="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function OP(e){const t=N1();if(!t)return!1;const n=e.dataTransfer;if(!n)return!1;n.setData("text/plain","_");const r=document.createElement("img");return r.src=NP,n.setDragImage(r,0,0),n.setData("application/x-lexical-drag",JSON.stringify({data:{altText:t.__altText,title:t.__title,key:t.getKey(),src:t.__src},type:"image"})),!0}s(OP,"onDragStart");function DP(e,t){var n;if(t){let r=Array.from(((n=e.dataTransfer)==null?void 0:n.items)??[]);if(r=r.filter(i=>i.type.includes("image")),r.length>0)return e.preventDefault(),!0}return N1()?(rw(e)||e.preventDefault(),!0):!1}s(DP,"onDragover");function RP(e,t,n){var r;let i=Array.from(((r=e.dataTransfer)==null?void 0:r.items)??[]);if(i=i.filter(a=>a.type.includes("image")),i.length>0&&n!==null)return e.preventDefault(),Promise.all(i.map(a=>a.kind==="string"?new Promise(c=>{a.getAsString(c)}):n(a.getAsFile()))).then(a=>{a.forEach(c=>{t.dispatchCommand(Vu,{src:c,altText:""})})}).catch(a=>{throw a}),!0;const o=N1();if(!o)return!1;const l=LP(e);if(!l)return!1;if(e.preventDefault(),rw(e)){const a=$P(e);o.remove();const c=pd();a!=null&&c.applyDOMRange(a),Xn(c),t.dispatchCommand(Vu,l)}return!0}s(RP,"onDrop");function N1(){const e=re();if(!He(e))return null;const t=e.getNodes()[0];return Fu(t)?t:null}s(N1,"getImageNodeInSelection");function LP(e){var t;const n=(t=e.dataTransfer)==null?void 0:t.getData("application/x-lexical-drag");if(!n)return null;const{type:r,data:i}=JSON.parse(n);return r!=="image"?null:i}s(LP,"getDragImageData");function rw(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&t.parentElement)}s(rw,"canDropImage");function $P(e){let t;const n=e.target,r=n==null?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,i=IP(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset??0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}s($P,"getDragSelection");var PP={testNode:"blockquote",visitNode({actions:e}){e.addAndStepInto(Vs())}},FP={testLexicalNode:Wh,visitLexicalNode:s(({actions:e})=>{e.addAndStepInto("blockquote")},"visitLexicalNode")},VP=En({init(e){e.pubIn({[Hs]:"quote",[$r]:PP,[hi]:kd,[gi]:FP})}});function _y(){let e=go;return{publish:s(()=>{e()},"publish"),subscribe:s(t=>{e=t},"subscribe")}}s(_y,"voidEmitter");function iw(e,t,n,r){const i=[...e].sort((l,a)=>a.priority-l.priority),o=n??"";return i.find(l=>l.match(t??"",o))??i.find(l=>l.match(r??"",o))}s(iw,"findCodeBlockDescriptor");var BP=Object.defineProperty,HP=s((e,t,n)=>t in e?BP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp"),xi=s((e,t,n)=>HP(e,typeof t!="symbol"?t+"":t,n),"__publicField"),Vd=class ow extends Ma{static{s(this,"CodeBlockNode")}constructor(t,n,r,i){super(i),xi(this,"__code"),xi(this,"__meta"),xi(this,"__language"),xi(this,"__focusEmitter",_y()),xi(this,"setCode",o=>{o!==this.__code&&(this.getWritable().__code=o)}),xi(this,"setMeta",o=>{o!==this.__meta&&(this.getWritable().__meta=o)}),xi(this,"setLanguage",o=>{o!==this.__language&&(this.getWritable().__language=o)}),xi(this,"select",()=>{this.__focusEmitter.publish()}),this.__code=t,this.__meta=r,this.__language=n}static getType(){return"codeblock"}static clone(t){return new ow(t.__code,t.__language,t.__meta,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__code=t.__code,this.__meta=t.__meta,this.__language=t.__language,this.__focusEmitter=_y()}static importJSON(t){return Va({code:typeof t.code=="string"?t.code:"",language:typeof t.language=="string"?t.language:"",meta:typeof t.meta=="string"?t.meta:""})}static importDOM(){return{pre:s(()=>({conversion:zP,priority:3}),"pre")}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:"codeblock",version:1}}createDOM(t,n){return document.createElement("div")}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(t){return m.createElement(UP,{parentEditor:t,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}},sw=m.createContext(null),KP=s(({parentEditor:e,lexicalNode:t,children:n})=>{const r=m.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:s(i=>{e.update(()=>{t.setCode(i),setTimeout(()=>{e.dispatchCommand(Xl,void 0)},0)})},"setCode"),setLanguage:s(i=>{e.update(()=>{t.setLanguage(i)})},"setLanguage"),setMeta:s(i=>{e.update(()=>{t.setMeta(i)})},"setMeta")}),[t,e]);return m.createElement(sw.Provider,{value:r},n)},"CodeBlockEditorContextProvider");function Sg(){const e=m.useContext(sw);if(!e)throw new Error("useCodeBlockEditor must be used within a CodeBlockEditor");return e}s(Sg,"useCodeBlockEditorContext");var UP=s(e=>{const t=ni(La),n=ni(Es),r=iw(t,e.language,e.meta,n);if(!r)throw new Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);const i=r.Editor,{codeBlockNode:o,parentEditor:l,...a}=e;return m.createElement(KP,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},m.createElement(i,{...a}))},"CodeBlockEditorContainer");function Va(e){const{code:t="",language:n="",meta:r=""}=e;return new Vd(t,n,r)}s(Va,"$createCodeBlockNode");function WP(e){return e instanceof Vd}s(WP,"$isCodeBlockNode");function zP(e){const t=e,n=t.textContent,r=e.getAttribute("class")??"",i=e.getAttribute("data-language")??"",o=/language-(\w+)/.exec(r);return{node:Va({code:n,language:o?o[1]:i,meta:t.getAttribute("data-meta")??""})}}s(zP,"$convertPreElement");var jP={testLexicalNode:WP,visitLexicalNode:s(({lexicalNode:e,actions:t})=>{t.addAndStepInto("code",{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})},"visitLexicalNode")},JP={testNode:s((e,{codeBlockEditorDescriptors:t,defaultCodeBlockLanguage:n})=>e.type==="code"?iw(t,e.lang,e.meta,n)!==void 0:!1,"testNode"),visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Va({code:e.value,language:e.lang??"",meta:e.meta??""}))}},lw=wt(e=>{e.link(e.pipe(lw,mt(Es),$i(([t,n])=>()=>Va({language:n,...t}))),Im)}),GP=rn(La),qP=En({update(e,t){e.pub(Es,t?.defaultCodeBlockLanguage??"")},init(e,t){e.pubIn({[Hs]:"codeblock",[Es]:t?.defaultCodeBlockLanguage??"",[La]:t?.codeBlockEditorDescriptors??[],[$r]:JP,[hi]:Vd,[gi]:jP})}});function K(e){return new S9(m9.define(e))}s(K,"legacy");function Ci(e){return V(()=>import("./dist-BEo-uoE2.js").then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2,3]))}s(Ci,"sql");var ZP=[P.of({name:"C",extensions:["c","h","ino"],load(){return V(()=>import("./dist-DTj_cM7l.js").then(e=>e.cpp()),__vite__mapDeps([4,1,3]))}}),P.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return V(()=>import("./dist-DTj_cM7l.js").then(e=>e.cpp()),__vite__mapDeps([4,1,3]))}}),P.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ci("Cassandra")}}),P.of({name:"CSS",extensions:["css"],load(){return V(()=>import("./dist-D4qkWMdz.js").then(e=>e.i).then(e=>e.css()),__vite__mapDeps([5,6,1,3]))}}),P.of({name:"Go",extensions:["go"],load(){return V(()=>import("./dist-DTwCbVsv.js").then(e=>e.go()),__vite__mapDeps([7,1,2,3]))}}),P.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return V(()=>import("./dist-Bp5Y-deP.js").then(e=>e.html()),__vite__mapDeps([8,1,3,5,6,9,2]))}}),P.of({name:"Java",extensions:["java"],load(){return V(()=>import("./dist-BAtkULn4.js").then(e=>e.java()),__vite__mapDeps([10,1,3]))}}),P.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return V(()=>import("./dist-ds5P5TFe.js").then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([9,6,1,2,3]))}}),P.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return V(()=>import("./dist-DrXWoUSy.js").then(e=>e.jinja()),__vite__mapDeps([11,1,3,8,5,6,9,2]))}}),P.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return V(()=>import("./dist-Uvf9OORN.js").then(e=>e.json()),__vite__mapDeps([12,1,3]))}}),P.of({name:"JSX",extensions:["jsx"],load(){return V(()=>import("./dist-ds5P5TFe.js").then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([9,6,1,2,3]))}}),P.of({name:"LESS",extensions:["less"],load(){return V(()=>import("./dist-CcBZFMdg.js").then(e=>e.less()),__vite__mapDeps([13,1,3,5,6]))}}),P.of({name:"Liquid",extensions:["liquid"],load(){return V(()=>import("./dist-D61jI6QA.js").then(e=>e.liquid()),__vite__mapDeps([14,1,3,8,5,6,9,2]))}}),P.of({name:"MariaDB SQL",load(){return Ci("MariaSQL")}}),P.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return V(()=>import("./dist-CN5Rg9XU.js").then(e=>e.markdown()),__vite__mapDeps([15,1,2,8,3,5,6,9]))}}),P.of({name:"MS SQL",load(){return Ci("MSSQL")}}),P.of({name:"MySQL",load(){return Ci("MySQL")}}),P.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return V(()=>import("./dist-DY5RRJBY.js").then(e=>e.php()),__vite__mapDeps([16,1,3,8,5,6,9,2]))}}),P.of({name:"PLSQL",extensions:["pls"],load(){return Ci("PLSQL")}}),P.of({name:"PostgreSQL",load(){return Ci("PostgreSQL")}}),P.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return V(()=>import("./dist-Bc6S4vv3.js").then(e=>e.python()),__vite__mapDeps([17,1,2,3]))}}),P.of({name:"Rust",extensions:["rs"],load(){return V(()=>import("./dist-CD47N__7.js").then(e=>e.rust()),__vite__mapDeps([18,1,3]))}}),P.of({name:"Sass",extensions:["sass"],load(){return V(()=>import("./dist-yKrp-Qew.js").then(e=>e.sass({indented:!0})),__vite__mapDeps([19,1,3,5,6]))}}),P.of({name:"SCSS",extensions:["scss"],load(){return V(()=>import("./dist-yKrp-Qew.js").then(e=>e.sass()),__vite__mapDeps([19,1,3,5,6]))}}),P.of({name:"SQL",extensions:["sql"],load(){return Ci("StandardSQL")}}),P.of({name:"SQLite",load(){return Ci("SQLite")}}),P.of({name:"TSX",extensions:["tsx"],load(){return V(()=>import("./dist-ds5P5TFe.js").then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([9,6,1,2,3]))}}),P.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return V(()=>import("./dist-ds5P5TFe.js").then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([9,6,1,2,3]))}}),P.of({name:"WebAssembly",extensions:["wat","wast"],load(){return V(()=>import("./dist-CdFTLNcc.js").then(e=>e.wast()),__vite__mapDeps([20,1,3]))}}),P.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return V(()=>import("./dist-Cv1Aw0YM.js").then(e=>e.xml()),__vite__mapDeps([21,1,3]))}}),P.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return V(()=>import("./dist-B6TpBrd3.js").then(e=>e.yaml()),__vite__mapDeps([22,1,3]))}}),P.of({name:"APL",extensions:["dyalog","apl"],load(){return V(()=>import("./apl-MHzTCvfx.js").then(e=>K(e.apl)),[])}}),P.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return V(()=>import("./asciiarmor-DFLNSgns.js").then(e=>K(e.asciiArmor)),[])}}),P.of({name:"ASN.1",extensions:["asn","asn1"],load(){return V(()=>import("./asn1-CfPVWRYE.js").then(e=>K(e.asn1({}))),[])}}),P.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return V(()=>import("./asterisk-CJ4OeA7Y.js").then(e=>K(e.asterisk)),[])}}),P.of({name:"Brainfuck",extensions:["b","bf"],load(){return V(()=>import("./brainfuck-NEHkmXMc.js").then(e=>K(e.brainfuck)),[])}}),P.of({name:"Cobol",extensions:["cob","cpy"],load(){return V(()=>import("./cobol-Bo8Zw9gB.js").then(e=>K(e.cobol)),[])}}),P.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.csharp)),[])}}),P.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return V(()=>import("./clojure-DFaIEz5O.js").then(e=>K(e.clojure)),[])}}),P.of({name:"ClojureScript",extensions:["cljs"],load(){return V(()=>import("./clojure-DFaIEz5O.js").then(e=>K(e.clojure)),[])}}),P.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return V(()=>import("./css-DEZwfVpY.js").then(e=>K(e.gss)),[])}}),P.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return V(()=>import("./cmake-koz-qBlo.js").then(e=>K(e.cmake)),[])}}),P.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return V(()=>import("./coffeescript-CXYzYf-Y.js").then(e=>K(e.coffeeScript)),[])}}),P.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return V(()=>import("./commonlisp-C4OOCwkD.js").then(e=>K(e.commonLisp)),[])}}),P.of({name:"Cypher",extensions:["cyp","cypher"],load(){return V(()=>import("./cypher-z2oFsVv2.js").then(e=>K(e.cypher)),[])}}),P.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return V(()=>import("./python-C2DOnsac.js").then(e=>K(e.cython)),[])}}),P.of({name:"Crystal",extensions:["cr"],load(){return V(()=>import("./crystal-BlJXQDvy.js").then(e=>K(e.crystal)),[])}}),P.of({name:"D",extensions:["d"],load(){return V(()=>import("./d-Dkt6y7AQ.js").then(e=>K(e.d)),[])}}),P.of({name:"Dart",extensions:["dart"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.dart)),[])}}),P.of({name:"diff",extensions:["diff","patch"],load(){return V(()=>import("./diff-C60bAYOU.js").then(e=>K(e.diff)),[])}}),P.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return V(()=>import("./dockerfile-BttNdtK0.js").then(e=>K(e.dockerFile)),__vite__mapDeps([23,24]))}}),P.of({name:"DTD",extensions:["dtd"],load(){return V(()=>import("./dtd-CCVZU5Da.js").then(e=>K(e.dtd)),[])}}),P.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return V(()=>import("./dylan-3pmV5wzs.js").then(e=>K(e.dylan)),[])}}),P.of({name:"EBNF",load(){return V(()=>import("./ebnf-bm-I2WIh.js").then(e=>K(e.ebnf)),[])}}),P.of({name:"ECL",extensions:["ecl"],load(){return V(()=>import("./ecl-BIv3PrZb.js").then(e=>K(e.ecl)),[])}}),P.of({name:"edn",extensions:["edn"],load(){return V(()=>import("./clojure-DFaIEz5O.js").then(e=>K(e.clojure)),[])}}),P.of({name:"Eiffel",extensions:["e"],load(){return V(()=>import("./eiffel-DuLnr4-r.js").then(e=>K(e.eiffel)),[])}}),P.of({name:"Elm",extensions:["elm"],load(){return V(()=>import("./elm-njbaCU-L.js").then(e=>K(e.elm)),[])}}),P.of({name:"Erlang",extensions:["erl"],load(){return V(()=>import("./erlang-CuhOC2I8.js").then(e=>K(e.erlang)),[])}}),P.of({name:"Esper",load(){return V(()=>import("./sql-C3kWxFGw.js").then(e=>K(e.esper)),[])}}),P.of({name:"Factor",extensions:["factor"],load(){return V(()=>import("./factor-CM3-9V3b.js").then(e=>K(e.factor)),__vite__mapDeps([25,24]))}}),P.of({name:"FCL",load(){return V(()=>import("./fcl-nWsMJ92o.js").then(e=>K(e.fcl)),[])}}),P.of({name:"Forth",extensions:["forth","fth","4th"],load(){return V(()=>import("./forth-BQ9HrCVY.js").then(e=>K(e.forth)),[])}}),P.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return V(()=>import("./fortran-DHJe28ev.js").then(e=>K(e.fortran)),[])}}),P.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return V(()=>import("./mllike-DuNQsEw8.js").then(e=>K(e.fSharp)),[])}}),P.of({name:"Gas",extensions:["s"],load(){return V(()=>import("./gas-ByO0qYMr.js").then(e=>K(e.gas)),[])}}),P.of({name:"Gherkin",extensions:["feature"],load(){return V(()=>import("./gherkin-CwOmHL5K.js").then(e=>K(e.gherkin)),[])}}),P.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return V(()=>import("./groovy-ByXGF8cx.js").then(e=>K(e.groovy)),[])}}),P.of({name:"Haskell",extensions:["hs"],load(){return V(()=>import("./haskell-CHSpCNOy.js").then(e=>K(e.haskell)),[])}}),P.of({name:"Haxe",extensions:["hx"],load(){return V(()=>import("./haxe-P2jh68ck.js").then(e=>K(e.haxe)),[])}}),P.of({name:"HXML",extensions:["hxml"],load(){return V(()=>import("./haxe-P2jh68ck.js").then(e=>K(e.hxml)),[])}}),P.of({name:"HTTP",load(){return V(()=>import("./http-0jwMmfWP.js").then(e=>K(e.http)),[])}}),P.of({name:"IDL",extensions:["pro"],load(){return V(()=>import("./idl-DTVVj6r5.js").then(e=>K(e.idl)),[])}}),P.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return V(()=>import("./javascript-Cblpdx44.js").then(e=>K(e.jsonld)),[])}}),P.of({name:"Julia",extensions:["jl"],load(){return V(()=>import("./julia-KVJvUu_F.js").then(e=>K(e.julia)),[])}}),P.of({name:"Kotlin",extensions:["kt","kts"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.kotlin)),[])}}),P.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return V(()=>import("./livescript-DSHsJPcD.js").then(e=>K(e.liveScript)),[])}}),P.of({name:"Lua",extensions:["lua"],load(){return V(()=>import("./lua-Vher-70I.js").then(e=>K(e.lua)),[])}}),P.of({name:"mIRC",extensions:["mrc"],load(){return V(()=>import("./mirc-BGWbO906.js").then(e=>K(e.mirc)),[])}}),P.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return V(()=>import("./mathematica-CE9SaVsW.js").then(e=>K(e.mathematica)),[])}}),P.of({name:"Modelica",extensions:["mo"],load(){return V(()=>import("./modelica-5XCgKQt8.js").then(e=>K(e.modelica)),[])}}),P.of({name:"MUMPS",extensions:["mps"],load(){return V(()=>import("./mumps-C7oS353s.js").then(e=>K(e.mumps)),[])}}),P.of({name:"Mbox",extensions:["mbox"],load(){return V(()=>import("./mbox-JGl1Fgvq.js").then(e=>K(e.mbox)),[])}}),P.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return V(()=>import("./nginx-DXVlpyCz.js").then(e=>K(e.nginx)),[])}}),P.of({name:"NSIS",extensions:["nsh","nsi"],load(){return V(()=>import("./nsis-KFC6hioG.js").then(e=>K(e.nsis)),__vite__mapDeps([26,24]))}}),P.of({name:"NTriples",extensions:["nt","nq"],load(){return V(()=>import("./ntriples-5ckCopnn.js").then(e=>K(e.ntriples)),[])}}),P.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.objectiveC)),[])}}),P.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.objectiveCpp)),[])}}),P.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return V(()=>import("./mllike-DuNQsEw8.js").then(e=>K(e.oCaml)),[])}}),P.of({name:"Octave",extensions:["m"],load(){return V(()=>import("./octave-D1J2QQNt.js").then(e=>K(e.octave)),[])}}),P.of({name:"Oz",extensions:["oz"],load(){return V(()=>import("./oz-CPsllMDD.js").then(e=>K(e.oz)),[])}}),P.of({name:"Pascal",extensions:["p","pas"],load(){return V(()=>import("./pascal-B-I6JP0Y.js").then(e=>K(e.pascal)),[])}}),P.of({name:"Perl",extensions:["pl","pm"],load(){return V(()=>import("./perl-CI8WIWBi.js").then(e=>K(e.perl)),[])}}),P.of({name:"Pig",extensions:["pig"],load(){return V(()=>import("./pig-FQI0W3S3.js").then(e=>K(e.pig)),[])}}),P.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return V(()=>import("./powershell-BAu6x78A.js").then(e=>K(e.powerShell)),[])}}),P.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return V(()=>import("./properties-BKTTDgau.js").then(e=>K(e.properties)),[])}}),P.of({name:"ProtoBuf",extensions:["proto"],load(){return V(()=>import("./protobuf-UWh8gh_j.js").then(e=>K(e.protobuf)),[])}}),P.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return V(()=>import("./pug-C20tNwmy.js").then(e=>K(e.pug)),__vite__mapDeps([27,28]))}}),P.of({name:"Puppet",extensions:["pp"],load(){return V(()=>import("./puppet-BAHVzCkO.js").then(e=>K(e.puppet)),[])}}),P.of({name:"Q",extensions:["q"],load(){return V(()=>import("./q-Cooe-Nh8.js").then(e=>K(e.q)),[])}}),P.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return V(()=>import("./r-CktBKya9.js").then(e=>K(e.r)),[])}}),P.of({name:"RPM Changes",load(){return V(()=>import("./rpm-Csj9nLHl.js").then(e=>K(e.rpmChanges)),[])}}),P.of({name:"RPM Spec",extensions:["spec"],load(){return V(()=>import("./rpm-Csj9nLHl.js").then(e=>K(e.rpmSpec)),[])}}),P.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return V(()=>import("./ruby-bGx9eo-K.js").then(e=>K(e.ruby)),[])}}),P.of({name:"SAS",extensions:["sas"],load(){return V(()=>import("./sas-Drou_EQ9.js").then(e=>K(e.sas)),[])}}),P.of({name:"Scala",extensions:["scala"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.scala)),[])}}),P.of({name:"Scheme",extensions:["scm","ss"],load(){return V(()=>import("./scheme-DcjG9bAf.js").then(e=>K(e.scheme)),[])}}),P.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return V(()=>import("./shell-BSKClwid.js").then(e=>K(e.shell)),[])}}),P.of({name:"Sieve",extensions:["siv","sieve"],load(){return V(()=>import("./sieve-CcvsXPZo.js").then(e=>K(e.sieve)),[])}}),P.of({name:"Smalltalk",extensions:["st"],load(){return V(()=>import("./smalltalk-Cmg-4mjQ.js").then(e=>K(e.smalltalk)),[])}}),P.of({name:"Solr",load(){return V(()=>import("./solr-Dj8ahEwG.js").then(e=>K(e.solr)),[])}}),P.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return V(()=>import("./mllike-DuNQsEw8.js").then(e=>K(e.sml)),[])}}),P.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return V(()=>import("./sparql-LAJYmgfk.js").then(e=>K(e.sparql)),[])}}),P.of({name:"Spreadsheet",alias:["excel","formula"],load(){return V(()=>import("./spreadsheet-B8doD_pL.js").then(e=>K(e.spreadsheet)),[])}}),P.of({name:"Squirrel",extensions:["nut"],load(){return V(()=>import("./clike-CIx9nZSv.js").then(e=>K(e.squirrel)),[])}}),P.of({name:"Stylus",extensions:["styl"],load(){return V(()=>import("./stylus-BS-Ienrc.js").then(e=>K(e.stylus)),[])}}),P.of({name:"Swift",extensions:["swift"],load(){return V(()=>import("./swift-BD82LMDK.js").then(e=>K(e.swift)),[])}}),P.of({name:"sTeX",load(){return V(()=>import("./stex-CW6K5Nmu.js").then(e=>K(e.stex)),[])}}),P.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return V(()=>import("./stex-CW6K5Nmu.js").then(e=>K(e.stex)),[])}}),P.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return V(()=>import("./verilog-BVYlmXGg.js").then(e=>K(e.verilog)),[])}}),P.of({name:"Tcl",extensions:["tcl"],load(){return V(()=>import("./tcl-RZa1cqc-.js").then(e=>K(e.tcl)),[])}}),P.of({name:"Textile",extensions:["textile"],load(){return V(()=>import("./textile-C-BY_OGF.js").then(e=>K(e.textile)),[])}}),P.of({name:"TiddlyWiki",load(){return V(()=>import("./tiddlywiki-C9bm_Oju.js").then(e=>K(e.tiddlyWiki)),[])}}),P.of({name:"Tiki wiki",load(){return V(()=>import("./tiki-DJOT-rFT.js").then(e=>K(e.tiki)),[])}}),P.of({name:"TOML",extensions:["toml"],load(){return V(()=>import("./toml-Civ2fTsu.js").then(e=>K(e.toml)),[])}}),P.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return V(()=>import("./troff-Lns35Xcq.js").then(e=>K(e.troff)),[])}}),P.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return V(()=>import("./ttcn-7vlxVTUK.js").then(e=>K(e.ttcn)),[])}}),P.of({name:"TTCN_CFG",extensions:["cfg"],load(){return V(()=>import("./ttcn-cfg-B8qhhp6o.js").then(e=>K(e.ttcnCfg)),[])}}),P.of({name:"Turtle",extensions:["ttl"],load(){return V(()=>import("./turtle-DTIS1YQ7.js").then(e=>K(e.turtle)),[])}}),P.of({name:"Web IDL",extensions:["webidl"],load(){return V(()=>import("./webidl-ChvzbZ5-.js").then(e=>K(e.webIDL)),[])}}),P.of({name:"VB.NET",extensions:["vb"],load(){return V(()=>import("./vb-BO8UacKu.js").then(e=>K(e.vb)),[])}}),P.of({name:"VBScript",extensions:["vbs"],load(){return V(()=>import("./vbscript-DWLru3lT.js").then(e=>K(e.vbScript)),[])}}),P.of({name:"Velocity",extensions:["vtl"],load(){return V(()=>import("./velocity-BIIn-Nl2.js").then(e=>K(e.velocity)),[])}}),P.of({name:"Verilog",extensions:["v"],load(){return V(()=>import("./verilog-BVYlmXGg.js").then(e=>K(e.verilog)),[])}}),P.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return V(()=>import("./vhdl-Cn8cC8Yb.js").then(e=>K(e.vhdl)),[])}}),P.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return V(()=>import("./xquery-BKN7qEbU.js").then(e=>K(e.xQuery)),[])}}),P.of({name:"Yacas",extensions:["ys"],load(){return V(()=>import("./yacas-BG9ha7tU.js").then(e=>K(e.yacas)),[])}}),P.of({name:"Z80",extensions:["z80"],load(){return V(()=>import("./z80-CB2cGLew.js").then(e=>K(e.z80)),[])}}),P.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return V(()=>import("./mscgen-mVFg19ri.js").then(e=>K(e.mscgen)),[])}}),P.of({name:"Xù",extensions:["xu"],load(){return V(()=>import("./mscgen-mVFg19ri.js").then(e=>K(e.xu)),[])}}),P.of({name:"MsGenny",extensions:["msgenny"],load(){return V(()=>import("./mscgen-mVFg19ri.js").then(e=>K(e.msgenny)),[])}}),P.of({name:"Vue",extensions:["vue"],load(){return V(()=>import("./dist-BPuuaNc6.js").then(e=>e.vue()),__vite__mapDeps([29,1,3,9,6,2,8,5]))}}),P.of({name:"Angular Template",load(){return V(()=>import("./dist-BY93_d3Z.js").then(e=>e.angular()),__vite__mapDeps([30,1,3,9,6,2,8,5]))}})],vy=Yu.define(),YP=Io.define(),oa=class ll{static{s(this,"HistEvent$1")}constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new ll(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new ll(t.changes&&Kx.fromJSON(t.changes),[],t.mapped&&Vx.fromJSON(t.mapped),t.startSelection&&Te.fromJSON(t.startSelection),t.selectionsAfter.map(Te.fromJSON))}static fromTransaction(t,n){let r=Wn;for(let i of t.startState.facet(YP)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new ll(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Wn)}static selection(t){return new ll(void 0,Wn,void 0,void 0,t)}};function Tg(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}s(Tg,"updateBranch$1");function XP(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,l,a)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];a>=u&&l<=d&&(r=!0)}}),r}s(XP,"isAdjacent$1");function QP(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}s(QP,"eqSelectionShape$1");function aw(e,t){return e.length?t.length?e.concat(t):e:t}s(aw,"conc$1");var Wn=[],eF=200;function tF(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-eF));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Tg(e,e.length-1,1e9,n.setSelAfter(r)))}else return[oa.selection([t])]}s(tF,"addSelection$1");function nF(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}s(nF,"popSelection$1");function If(e,t){if(!e.length)return e;let n=e.length,r=Wn;for(;n;){let i=rF(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[oa.selection(r)]:Wn}s(If,"addMappingToBranch$1");function rF(e,t,n){let r=aw(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Wn,n);if(!e.changes)return oa.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(o):o;return new oa(i,nn.mapEffects(e.effects,t),l,e.startSelection.map(o),r)}s(rF,"mapEvent$1");var iF=/^(input\.type|delete)($|\.)/,yy=class al{static{s(this,"HistoryState$1")}constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new al(this.done,this.undone):this}addChanges(t,n,r,i,o){let l=this.done,a=l[l.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||iF.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,XP(a.changes,t.changes))||r=="input.type.compose")?l=Tg(l,l.length-1,i.minDepth,new oa(t.changes.compose(a.changes),aw(nn.mapEffects(t.effects,a.changes),a.effects),a.mapped,a.startSelection,Wn)):l=Tg(l,l.length,i.minDepth,t),new al(l,Wn,n,r)}addSelection(t,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Wn;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&QP(o[o.length-1],t)?this:new al(tF(this.done,t),this.undone,n,r)}addMapping(t){return new al(If(this.done,t),If(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],l=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:vy.of({side:t,rest:nF(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?Wn:i.slice(0,i.length-1);return o.mapped&&(a=If(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:vy.of({side:t,rest:a,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}};yy.empty=new yy(Wn,Wn);var Az=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function cw(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let a=e.doc.lineAt(l);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),l=a.to+1}let o=e.changes(i);return{changes:i,range:Te.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}s(cw,"changeBySelectedLine$1");var oF=s(({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(cw(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Rx)})}),{userEvent:"input.indent"})),!0),"indentMore$1"),sF=s(({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(cw(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Zu(i,e.tabSize),l=0,a=Il(e,Math.max(0,o-Vc(e)));for(;l<i.length&&l<a.length&&i.charCodeAt(l)==a.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:a.slice(l)})}),{userEvent:"delete.dedent"})),!0),"indentLess$1"),lF={key:"Tab",run:oF,shift:sF},xy="#2e3440",O1="#3b4252",Cy="#434c5e",oc="#4c566a",by="#e5e9f0",wg="#eceff4",Nf="#8fbcbb",Ey="#88c0d0",aF="#81a1c1",or="#5e81ac",cF="#bf616a",jo="#d08770",Of="#ebcb8b",Sy="#a3be8c",uF="#b48ead",Ty="#d30102",D1=wg,Df=D1,dF="#ffffff",Rf=O1,fF=D1,wy=O1,hF=ct.theme({"&":{color:xy,backgroundColor:dF},".cm-content":{caretColor:wy},".cm-cursor, .cm-dropCursor":{borderLeftColor:wy},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fF},".cm-panels":{backgroundColor:D1,color:oc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:`1px solid ${oc}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:by},".cm-activeLine":{backgroundColor:Df},".cm-selectionMatch":{backgroundColor:by},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${oc}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:wg},".cm-gutters":{backgroundColor:wg,color:xy,border:"none"},".cm-activeLineGutter":{backgroundColor:Df},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Rf},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Rf,borderBottomColor:Rf},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Df,color:oc}}},{dark:!1}),gF=k9.define([{tag:_e.keyword,color:or},{tag:[_e.name,_e.deleted,_e.character,_e.propertyName,_e.macroName],color:jo},{tag:[_e.variableName],color:jo},{tag:[_e.function(_e.variableName)],color:or},{tag:[_e.labelName],color:aF},{tag:[_e.color,_e.constant(_e.name),_e.standard(_e.name)],color:or},{tag:[_e.definition(_e.name),_e.separator],color:Sy},{tag:[_e.brace],color:Nf},{tag:[_e.annotation],color:Ty},{tag:[_e.number,_e.changed,_e.annotation,_e.modifier,_e.self,_e.namespace],color:Ey},{tag:[_e.typeName,_e.className],color:Of},{tag:[_e.operator,_e.operatorKeyword],color:Sy},{tag:[_e.tagName],color:uF},{tag:[_e.squareBracket],color:cF},{tag:[_e.angleBracket],color:jo},{tag:[_e.attributeName],color:Of},{tag:[_e.regexp],color:or},{tag:[_e.quote],color:O1},{tag:[_e.string],color:jo},{tag:_e.link,color:Nf,textDecoration:"underline",textUnderlinePosition:"under"},{tag:[_e.url,_e.escape,_e.special(_e.string)],color:jo},{tag:[_e.meta],color:Ey},{tag:[_e.comment],color:Cy,fontStyle:"italic"},{tag:_e.strong,fontWeight:"bold",color:or},{tag:_e.emphasis,fontStyle:"italic",color:or},{tag:_e.strikethrough,textDecoration:"line-through"},{tag:_e.heading,fontWeight:"bold",color:or},{tag:_e.special(_e.heading1),fontWeight:"bold",color:or},{tag:_e.heading1,fontWeight:"bold",color:or},{tag:[_e.heading2,_e.heading3,_e.heading4],fontWeight:"bold",color:or},{tag:[_e.heading5,_e.heading6],color:or},{tag:[_e.atom,_e.bool,_e.special(_e.variableName)],color:jo},{tag:[_e.processingInstruction,_e.inserted],color:Nf},{tag:[_e.contentSeparator],color:Of},{tag:_e.invalid,color:Cy,borderBottom:`1px dotted ${Ty}`}]),pF=[hF,Dx(gF)],mF=s(e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=L1(e.state,n.from);return r.line?_F(e):r.block?yF(e):!1},"toggleComment");function R1(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}s(R1,"command");var _F=R1(bF,0),vF=R1(uw,0),yF=R1((e,t)=>uw(e,t,CF(t)),0);function L1(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}s(L1,"getConfig");var sc=50;function xF(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-sc,r),l=e.sliceDoc(i,i+sc),a=/\s*$/.exec(o)[0].length,c=/^\s*/.exec(l)[0].length,u=o.length-a;if(o.slice(u-t.length,u)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+c,margin:c&&1}};let d,f;i-r<=100?d=f=e.sliceDoc(r,i):(d=e.sliceDoc(r,r+sc),f=e.sliceDoc(i-sc,i));let h=/^\s*/.exec(d)[0].length,g=/\s*$/.exec(f)[0].length,p=f.length-g-n.length;return d.slice(h,h+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+h+t.length,margin:/\s/.test(d.charAt(h+t.length))?1:0},close:{pos:i-g-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}s(xF,"findBlockComment");function CF(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}s(CF,"selectedLineRanges");function uw(e,t,n=t.selection.ranges){let r=n.map(o=>L1(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,l)=>xF(t,r[l],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,l)=>i[l]?[]:[{from:o.from,insert:r[l].open+" "},{from:o.to,insert:" "+r[l].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let l=0,a;l<i.length;l++)if(a=i[l]){let c=r[l],{open:u,close:d}=a;o.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:o}}return null}s(uw,"changeBlockComment");function bF(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:o,to:l}of n){let a=r.length,c=1e9,u;for(let d=o;d<=l;){let f=t.doc.lineAt(d);if(u==null&&(u=L1(t,f.from).line,!u))continue e;if(f.from>i&&(o==l||l>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,g=h==f.length,p=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<c&&(c=h),r.push({line:f,comment:p,token:u,indent:h,empty:g,single:!1})}d=f.to+1}if(c<1e9)for(let d=a;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==a+1&&(r[a].single=!0)}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:c,indent:u,empty:d,single:f}of r)(f||!d)&&o.push({from:a.from+u,insert:c+" "});let l=t.changes(o);return{changes:l,selection:t.selection.map(l,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:l,comment:a,token:c}of r)if(a>=0){let u=l.from+a,d=u+c.length;l.text[d-l.from]==" "&&d++,o.push({from:u,to:d})}return{changes:o}}return null}s(bF,"changeLineComment");var kg=Yu.define(),EF=Yu.define(),SF=Io.define(),dw=Io.define({combine(e){return fa(e,{minDepth:100,newGroupDelay:500,joinToEvent:s((t,n)=>n,"joinToEvent")},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:s((t,n)=>(r,i)=>t(r,i)||n(r,i),"joinToEvent")})}}),fw=ha.define({create(){return Ml.empty},update(e,t){let n=t.state.facet(dw),r=t.annotation(kg);if(r){let c=Xr.fromTransaction(t,r.selection),u=r.side,d=u==0?e.undone:e.done;return c?d=Bu(d,d.length,n.minDepth,c):d=pw(d,t.startState.selection),new Ml(u==0?r.rest:d,u==0?d:r.rest)}let i=t.annotation(EF);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Jd.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=Xr.fromTransaction(t),l=t.annotation(Jd.time),a=t.annotation(Jd.userEvent);return o?e=e.addChanges(o,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Ml(e.done.map(Xr.fromJSON),e.undone.map(Xr.fromJSON))}});function TF(e={}){return[fw,dw.of(e),ct.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?hw:t.inputType=="historyRedo"?Mg:null;return r?(t.preventDefault(),r(n)):!1}})]}s(TF,"history");function Bd(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(fw,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}s(Bd,"cmd");var hw=Bd(0,!1),Mg=Bd(1,!1),wF=Bd(0,!0),kF=Bd(1,!0),Xr=class cl{static{s(this,"HistEvent")}constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new cl(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new cl(t.changes&&Kx.fromJSON(t.changes),[],t.mapped&&Vx.fromJSON(t.mapped),t.startSelection&&Te.fromJSON(t.startSelection),t.selectionsAfter.map(Te.fromJSON))}static fromTransaction(t,n){let r=zn;for(let i of t.startState.facet(SF)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new cl(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,zn)}static selection(t){return new cl(void 0,zn,void 0,void 0,t)}};function Bu(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}s(Bu,"updateBranch");function MF(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,l,a)=>{for(let c=0;c<n.length;){let u=n[c++],d=n[c++];a>=u&&l<=d&&(r=!0)}}),r}s(MF,"isAdjacent");function AF(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}s(AF,"eqSelectionShape");function gw(e,t){return e.length?t.length?e.concat(t):e:t}s(gw,"conc");var zn=[],IF=200;function pw(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-IF));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),Bu(e,e.length-1,1e9,n.setSelAfter(r)))}else return[Xr.selection([t])]}s(pw,"addSelection");function NF(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}s(NF,"popSelection");function Lf(e,t){if(!e.length)return e;let n=e.length,r=zn;for(;n;){let i=OF(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[Xr.selection(r)]:zn}s(Lf,"addMappingToBranch");function OF(e,t,n){let r=gw(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):zn,n);if(!e.changes)return Xr.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(o):o;return new Xr(i,nn.mapEffects(e.effects,t),l,e.startSelection.map(o),r)}s(OF,"mapEvent");var DF=/^(input\.type|delete)($|\.)/,Ml=class ul{static{s(this,"HistoryState")}constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new ul(this.done,this.undone):this}addChanges(t,n,r,i,o){let l=this.done,a=l[l.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||DF.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,MF(a.changes,t.changes))||r=="input.type.compose")?l=Bu(l,l.length-1,i.minDepth,new Xr(t.changes.compose(a.changes),gw(nn.mapEffects(t.effects,a.changes),a.effects),a.mapped,a.startSelection,zn)):l=Bu(l,l.length,i.minDepth,t),new ul(l,zn,n,r)}addSelection(t,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:zn;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&AF(o[o.length-1],t)?this:new ul(pw(this.done,t),this.undone,n,r)}addMapping(t){return new ul(Lf(this.done,t),Lf(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],l=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):n.selection);if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:kg.of({side:t,rest:NF(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?zn:i.slice(0,i.length-1);return o.mapped&&(a=Lf(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:kg.of({side:t,rest:a,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}};Ml.empty=new Ml(zn,zn);var RF=[{key:"Mod-z",run:hw,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Mg,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Mg,preventDefault:!0},{key:"Mod-u",run:wF,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:kF,preventDefault:!0}];function Ks(e,t){return Te.create(e.ranges.map(t),e.mainIndex)}s(Ks,"updateSel");function Er(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}s(Er,"setSel");function Sr({state:e,dispatch:t},n){let r=Ks(e.selection,n);return r.eq(e.selection,!0)?!1:(t(Er(e,r)),!0)}s(Sr,"moveSel");function Hd(e,t){return Te.cursor(t?e.to:e.from)}s(Hd,"rangeEnd");function mw(e,t){return Sr(e,n=>n.empty?e.moveByChar(n,t):Hd(n,t))}s(mw,"cursorByChar");function on(e){return e.textDirectionAt(e.state.selection.main.head)==Lx.LTR}s(on,"ltrAtCursor");var _w=s(e=>mw(e,!on(e)),"cursorCharLeft"),vw=s(e=>mw(e,on(e)),"cursorCharRight");function yw(e,t){return Sr(e,n=>n.empty?e.moveByGroup(n,t):Hd(n,t))}s(yw,"cursorByGroup");var LF=s(e=>yw(e,!on(e)),"cursorGroupLeft"),$F=s(e=>yw(e,on(e)),"cursorGroupRight"),Iz=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function PF(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}s(PF,"interestingNode");function Kd(e,t,n){let r=ks(e).resolveInner(t.head),i=n?Gf.closedBy:Gf.openedBy;for(let c=t.head;;){let u=n?r.childAfter(c):r.childBefore(c);if(!u)break;PF(e,u,i)?r=u:c=n?u.to:u.from}let o=r.type.prop(i),l,a;return o&&(l=n?Zo(e,r.from,1):Zo(e,r.to,-1))&&l.matched?a=n?l.end.to:l.end.from:a=n?r.to:r.from,Te.cursor(a,n?-1:1)}s(Kd,"moveBySyntax");var FF=s(e=>Sr(e,t=>Kd(e.state,t,!on(e))),"cursorSyntaxLeft"),VF=s(e=>Sr(e,t=>Kd(e.state,t,on(e))),"cursorSyntaxRight");function xw(e,t){return Sr(e,n=>{if(!n.empty)return Hd(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}s(xw,"cursorByLine");var Cw=s(e=>xw(e,!1),"cursorLineUp"),bw=s(e=>xw(e,!0),"cursorLineDown");function Ew(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let o of e.state.facet(ct.scrollMargins)){let l=o(e);l?.top&&(n=Math.max(l?.top,n)),l?.bottom&&(r=Math.max(l?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}s(Ew,"pageInfo");function Sw(e,t){let n=Ew(e),{state:r}=e,i=Ks(r.selection,l=>l.empty?e.moveVertically(l,t,n.height):Hd(l,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let l=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),c=a.top+n.marginTop,u=a.bottom-n.marginBottom;l&&l.top>c&&l.bottom<u&&(o=ct.scrollIntoView(i.main.head,{y:"start",yMargin:l.top-c}))}return e.dispatch(Er(r,i),{effects:o}),!0}s(Sw,"cursorByPage");var ky=s(e=>Sw(e,!1),"cursorPageUp"),Ag=s(e=>Sw(e,!0),"cursorPageDown");function Zi(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=Te.cursor(r.from+o))}return i}s(Zi,"moveByLineBoundary");var BF=s(e=>Sr(e,t=>Zi(e,t,!0)),"cursorLineBoundaryForward"),HF=s(e=>Sr(e,t=>Zi(e,t,!1)),"cursorLineBoundaryBackward"),KF=s(e=>Sr(e,t=>Zi(e,t,!on(e))),"cursorLineBoundaryLeft"),UF=s(e=>Sr(e,t=>Zi(e,t,on(e))),"cursorLineBoundaryRight"),WF=s(e=>Sr(e,t=>Te.cursor(e.lineBlockAt(t.head).from,1)),"cursorLineStart"),zF=s(e=>Sr(e,t=>Te.cursor(e.lineBlockAt(t.head).to,-1)),"cursorLineEnd");function jF(e,t,n){let r=!1,i=Ks(e.selection,o=>{let l=Zo(e,o.head,-1)||Zo(e,o.head,1)||o.head>0&&Zo(e,o.head-1,1)||o.head<e.doc.length&&Zo(e,o.head+1,-1);if(!l||!l.end)return o;r=!0;let a=l.start.from==o.head?l.end.to:l.end.from;return n?Te.range(o.anchor,a):Te.cursor(a)});return r?(t(Er(e,i)),!0):!1}s(jF,"toMatchingBracket");var JF=s(({state:e,dispatch:t})=>jF(e,t,!1),"cursorMatchingBracket");function nr(e,t){let n=Ks(e.state.selection,r=>{let i=t(r);return Te.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(Er(e.state,n)),!0)}s(nr,"extendSel");function Tw(e,t){return nr(e,n=>e.moveByChar(n,t))}s(Tw,"selectByChar");var ww=s(e=>Tw(e,!on(e)),"selectCharLeft"),kw=s(e=>Tw(e,on(e)),"selectCharRight");function Mw(e,t){return nr(e,n=>e.moveByGroup(n,t))}s(Mw,"selectByGroup");var GF=s(e=>Mw(e,!on(e)),"selectGroupLeft"),qF=s(e=>Mw(e,on(e)),"selectGroupRight"),ZF=s(e=>nr(e,t=>Kd(e.state,t,!on(e))),"selectSyntaxLeft"),YF=s(e=>nr(e,t=>Kd(e.state,t,on(e))),"selectSyntaxRight");function Aw(e,t){return nr(e,n=>e.moveVertically(n,t))}s(Aw,"selectByLine");var Iw=s(e=>Aw(e,!1),"selectLineUp"),Nw=s(e=>Aw(e,!0),"selectLineDown");function Ow(e,t){return nr(e,n=>e.moveVertically(n,t,Ew(e).height))}s(Ow,"selectByPage");var My=s(e=>Ow(e,!1),"selectPageUp"),Ay=s(e=>Ow(e,!0),"selectPageDown"),XF=s(e=>nr(e,t=>Zi(e,t,!0)),"selectLineBoundaryForward"),QF=s(e=>nr(e,t=>Zi(e,t,!1)),"selectLineBoundaryBackward"),eV=s(e=>nr(e,t=>Zi(e,t,!on(e))),"selectLineBoundaryLeft"),tV=s(e=>nr(e,t=>Zi(e,t,on(e))),"selectLineBoundaryRight"),nV=s(e=>nr(e,t=>Te.cursor(e.lineBlockAt(t.head).from)),"selectLineStart"),rV=s(e=>nr(e,t=>Te.cursor(e.lineBlockAt(t.head).to)),"selectLineEnd"),Iy=s(({state:e,dispatch:t})=>(t(Er(e,{anchor:0})),!0),"cursorDocStart"),Ny=s(({state:e,dispatch:t})=>(t(Er(e,{anchor:e.doc.length})),!0),"cursorDocEnd"),Oy=s(({state:e,dispatch:t})=>(t(Er(e,{anchor:e.selection.main.anchor,head:0})),!0),"selectDocStart"),Dy=s(({state:e,dispatch:t})=>(t(Er(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),"selectDocEnd"),iV=s(({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),"selectAll"),oV=s(({state:e,dispatch:t})=>{let n=Ud(e).map(({from:r,to:i})=>Te.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:Te.create(n),userEvent:"select"})),!0},"selectLine"),sV=s(({state:e,dispatch:t})=>{let n=Ks(e.selection,r=>{let i=ks(e),o=i.resolveStack(r.from,1);if(r.empty){let l=i.resolveStack(r.from,-1);l.node.from>=o.node.from&&l.node.to<=o.node.to&&(o=l)}for(let l=o;l;l=l.next){let{node:a}=l;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&l.next)return Te.range(a.to,a.from)}return r});return n.eq(e.selection)?!1:(t(Er(e,n)),!0)},"selectParentSyntax");function Dw(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let o of n.selection.ranges){let l=n.doc.lineAt(o.head);if(t?l.to<e.state.doc.length:l.from>0)for(let a=o;;){let c=e.moveVertically(a,t);if(c.head<l.from||c.head>l.to){i.some(u=>u.head==c.head)||i.push(c);break}else{if(c.head==a.head)break;a=c}}}return i.length==r.ranges.length?!1:(e.dispatch(Er(n,Te.create(i,i.length-1))),!0)}s(Dw,"addCursorVertically");var lV=s(e=>Dw(e,!1),"addCursorAbove"),aV=s(e=>Dw(e,!0),"addCursorBelow"),cV=s(({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Te.create([n.main]):n.main.empty||(r=Te.create([Te.cursor(n.main.head)])),r?(t(Er(e,r)),!0):!1},"simplifySelection");function Ba(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:l,to:a}=o;if(l==a){let c=t(o);c<l?(n="delete.backward",c=lc(e,c,!1)):c>l&&(n="delete.forward",c=lc(e,c,!0)),l=Math.min(l,c),a=Math.max(a,c)}else l=lc(e,l,!1),a=lc(e,a,!0);return l==a?{range:o}:{changes:{from:l,to:a},range:Te.cursor(l,l<o.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ct.announce.of(r.phrase("Selection deleted")):void 0})),!0)}s(Ba,"deleteBy");function lc(e,t,n){if(e instanceof ct)for(let r of e.state.facet(ct.atomicRanges).map(i=>i(e)))r.between(t,t,(i,o)=>{i<t&&o>t&&(t=n?o:i)});return t}s(lc,"skipAtomic");var Rw=s((e,t,n)=>Ba(e,r=>{let i=r.from,{state:o}=e,l=o.doc.lineAt(i),a,c;if(n&&!t&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(a=l.text.slice(0,i-l.from))){if(a[a.length-1]==" ")return i-1;let u=Zu(a,o.tabSize)%Vc(o)||Vc(o);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)i--;c=i}else c=vo(l.text,i-l.from,t,t)+l.from,c==i&&l.number!=(t?o.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,i-l.from))&&(c=vo(l.text,c-l.from,!1,!1)+l.from);return c}),"deleteByChar"),Ig=s(e=>Rw(e,!1,!0),"deleteCharBackward"),Lw=s(e=>Rw(e,!0,!1),"deleteCharForward"),$w=s((e,t)=>Ba(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),l=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let c=vo(o.text,r-o.from,t)+o.from,u=o.text.slice(Math.min(r,c)-o.from,Math.max(r,c)-o.from),d=l(u);if(a!=null&&d!=a)break;(u!=" "||r!=n.head)&&(a=d),r=c}return r}),"deleteByGroup"),Pw=s(e=>$w(e,!1),"deleteGroupBackward"),uV=s(e=>$w(e,!0),"deleteGroupForward"),dV=s(e=>Ba(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),"deleteToLineEnd"),fV=s(e=>Ba(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),"deleteLineBoundaryBackward"),hV=s(e=>Ba(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),"deleteLineBoundaryForward"),gV=s(({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Wx.of(["",""])},range:Te.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},"splitLine"),pV=s(({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),l=i==o.from?i-1:vo(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:vo(o.text,i-o.from,!0)+o.from;return{changes:{from:l,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(l,i))},range:Te.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)},"transposeChars");function Ud(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let l=t[t.length-1];l.to=o.to,l.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}s(Ud,"selectedLineBlocks");function Fw(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of Ud(e)){if(n?o.to==e.doc.length:o.from==0)continue;let l=e.doc.lineAt(n?o.to+1:o.from-1),a=l.length+1;if(n){r.push({from:o.to,to:l.to},{from:o.from,insert:l.text+e.lineBreak});for(let c of o.ranges)i.push(Te.range(Math.min(e.doc.length,c.anchor+a),Math.min(e.doc.length,c.head+a)))}else{r.push({from:l.from,to:o.from},{from:o.to,insert:e.lineBreak+l.text});for(let c of o.ranges)i.push(Te.range(c.anchor-a,c.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Te.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}s(Fw,"moveLine");var mV=s(({state:e,dispatch:t})=>Fw(e,t,!1),"moveLineUp"),_V=s(({state:e,dispatch:t})=>Fw(e,t,!0),"moveLineDown");function Vw(e,t,n){if(e.readOnly)return!1;let r=[];for(let o of Ud(e))n?r.push({from:o.from,insert:e.doc.slice(o.from,o.to)+e.lineBreak}):r.push({from:o.to,insert:e.lineBreak+e.doc.slice(o.from,o.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}s(Vw,"copyLine");var vV=s(({state:e,dispatch:t})=>Vw(e,t,!1),"copyLineUp"),yV=s(({state:e,dispatch:t})=>Vw(e,t,!0),"copyLineDown"),xV=s(e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Ud(t).map(({from:i,to:o})=>(i>0?i--:o<t.doc.length&&o++,{from:i,to:o}))),r=Ks(t.selection,i=>{let o;if(e.lineWrapping){let l=e.lineBlockAt(i.head),a=e.coordsAtPos(i.head,i.assoc||1);a&&(o=l.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,o)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0},"deleteLine");function CV(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ks(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Gf.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}s(CV,"isBetweenBrackets");var Ry=Bw(!1),bV=Bw(!0);function Bw(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:l}=i,a=t.doc.lineAt(o),c=!e&&o==l&&CV(t,o);e&&(o=l=(l<=a.to?a:t.doc.lineAt(l)).to);let u=new Hx(t,{simulateBreak:o,simulateDoubleBreak:!!c}),d=$x(u,o);for(d==null&&(d=Zu(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));l<a.to&&/\s/.test(a.text[l-a.from]);)l++;c?{from:o,to:l}=c:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let f=["",Il(t,d)];return c&&f.push(Il(t,u.lineIndent(a.from,-1))),{changes:{from:o,to:l,insert:Wx.of(f)},range:Te.cursor(o+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}s(Bw,"newlineAndIndent");function $1(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let a=e.doc.lineAt(l);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),l=a.to+1}let o=e.changes(i);return{changes:i,range:Te.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}s($1,"changeBySelectedLine");var EV=s(({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Hx(e,{overrideIndentation:s(o=>{let l=n[o];return l??-1},"overrideIndentation")}),i=$1(e,(o,l,a)=>{let c=$x(r,o.from);if(c==null)return;/\S/.test(o.text)||(c=0);let u=/^\s*/.exec(o.text)[0],d=Il(e,c);(u!=d||a.from<o.from+u.length)&&(n[o.from]=c,l.push({from:o.from,to:o.from+u.length,insert:d}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},"indentSelection"),SV=s(({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($1(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Rx)})}),{userEvent:"input.indent"})),!0),"indentMore"),TV=s(({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update($1(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Zu(i,e.tabSize),l=0,a=Il(e,Math.max(0,o-Vc(e)));for(;l<i.length&&l<a.length&&i.charCodeAt(l)==a.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:a.slice(l)})}),{userEvent:"delete.dedent"})),!0),"indentLess"),wV=s(e=>(e.setTabFocusMode(),!0),"toggleTabFocusMode"),kV=[{key:"Ctrl-b",run:_w,shift:ww,preventDefault:!0},{key:"Ctrl-f",run:vw,shift:kw},{key:"Ctrl-p",run:Cw,shift:Iw},{key:"Ctrl-n",run:bw,shift:Nw},{key:"Ctrl-a",run:WF,shift:nV},{key:"Ctrl-e",run:zF,shift:rV},{key:"Ctrl-d",run:Lw},{key:"Ctrl-h",run:Ig},{key:"Ctrl-k",run:dV},{key:"Ctrl-Alt-h",run:Pw},{key:"Ctrl-o",run:gV},{key:"Ctrl-t",run:pV},{key:"Ctrl-v",run:Ag}],MV=[{key:"ArrowLeft",run:_w,shift:ww,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:LF,shift:GF,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:KF,shift:eV,preventDefault:!0},{key:"ArrowRight",run:vw,shift:kw,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:$F,shift:qF,preventDefault:!0},{mac:"Cmd-ArrowRight",run:UF,shift:tV,preventDefault:!0},{key:"ArrowUp",run:Cw,shift:Iw,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Iy,shift:Oy},{mac:"Ctrl-ArrowUp",run:ky,shift:My},{key:"ArrowDown",run:bw,shift:Nw,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ny,shift:Dy},{mac:"Ctrl-ArrowDown",run:Ag,shift:Ay},{key:"PageUp",run:ky,shift:My},{key:"PageDown",run:Ag,shift:Ay},{key:"Home",run:HF,shift:QF,preventDefault:!0},{key:"Mod-Home",run:Iy,shift:Oy},{key:"End",run:BF,shift:XF,preventDefault:!0},{key:"Mod-End",run:Ny,shift:Dy},{key:"Enter",run:Ry,shift:Ry},{key:"Mod-a",run:iV},{key:"Backspace",run:Ig,shift:Ig,preventDefault:!0},{key:"Delete",run:Lw,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Pw,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:uV,preventDefault:!0},{mac:"Mod-Backspace",run:fV,preventDefault:!0},{mac:"Mod-Delete",run:hV,preventDefault:!0}].concat(kV.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),AV=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:FF,shift:ZF},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:VF,shift:YF},{key:"Alt-ArrowUp",run:mV},{key:"Shift-Alt-ArrowUp",run:vV},{key:"Alt-ArrowDown",run:_V},{key:"Shift-Alt-ArrowDown",run:yV},{key:"Mod-Alt-ArrowUp",run:lV},{key:"Mod-Alt-ArrowDown",run:aV},{key:"Escape",run:cV},{key:"Mod-Enter",run:bV},{key:"Alt-l",mac:"Ctrl-l",run:oV},{key:"Mod-i",run:sV,preventDefault:!0},{key:"Mod-[",run:TV},{key:"Mod-]",run:SV},{key:"Mod-Alt-\\",run:EV},{key:"Shift-Mod-k",run:xV},{key:"Shift-Mod-\\",run:JF},{key:"Mod-/",run:mF},{key:"Alt-A",run:vF},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wV}].concat(MV),Ly=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e,Ts=class{static{s(this,"SearchCursor")}constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?l=>i(Ly(l)):Ly,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Fn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Yg(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Jr(e);let r=this.normalize(t);if(r.length)for(let i=0,o=n;;i++){let l=r.charCodeAt(i),a=this.match(l,o,this.bufferPos+this.bufferStart);if(i==r.length-1){if(a)return this.value=a,this;break}o==n&&i<t.length&&t.charCodeAt(i)==l&&o++}}}match(e,t,n){let r=null;for(let i=0;i<this.matches.length;i+=2){let o=this.matches[i],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[i+1],to:n}:(this.matches[i]++,l=!0)),l||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<"u"&&(Ts.prototype[Symbol.iterator]=function(){return this});var Hw={from:-1,to:-1,match:/.*/.exec("")},P1="gm"+(/x/.unicode==null?"":"u"),Kw=class{static{s(this,"RegExpCursor")}constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Hw,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Uw(e,t,n,r,i);this.re=new RegExp(t,P1+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=Hu(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Hu(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},$f=new WeakMap,$y=class Lc{static{s(this,"FlattenedDoc")}constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=$f.get(t);if(!i||i.from>=r||i.to<=n){let a=new Lc(n,t.sliceString(n,r));return $f.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:l}=i;return l>n&&(o=t.sliceString(n,l)+o,l=n),i.to<r&&(o+=t.sliceString(i.to,r)),$f.set(t,new Lc(l,o)),new Lc(n,o.slice(n-l,r-l))}},Uw=class{static{s(this,"MultilineRegExpCursor")}constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Hw,this.matchPos=Hu(e,r),this.re=new RegExp(t,P1+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=$y.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=Hu(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=$y.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(Kw.prototype[Symbol.iterator]=Uw.prototype[Symbol.iterator]=function(){return this});function IV(e){try{return new RegExp(e,P1),!0}catch{return!1}}s(IV,"validRegExp");function Hu(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}s(Hu,"toCharEnd");var NV=s(e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=v9(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(o=>{let l=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!l){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,c,u,d,f]=l,h=d?+d.slice(1):0,g=u?+u:a.number;if(u&&f){let y=g/100;c&&(y=y*(c=="-"?-1:1)+a.number/t.doc.lines),g=Math.round(t.doc.lines*y)}else u&&c&&(g=g*(c=="-"?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,g))),_=Te.cursor(p.from+Math.max(0,Math.min(h,p.length)));e.dispatch({effects:[r,ct.scrollIntoView(_.from,{y:"center"})],selection:_})}),!0},"gotoLine"),OV={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ww=Io.define({combine(e){return fa(e,OV,{highlightWordAroundCursor:s((t,n)=>t||n,"highlightWordAroundCursor"),minSelectionLength:Math.min,maxMatches:Math.min})}});function DV(e){let t=[FV,PV];return e&&t.push(Ww.of(e)),t}s(DV,"highlightSelectionMatches");var RV=Dt.mark({class:"cm-selectionMatch"}),LV=Dt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Py(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=cn.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=cn.Word)}s(Py,"insideWordBoundaries");function $V(e,t,n,r){return e(t.sliceDoc(n,n+1))==cn.Word&&e(t.sliceDoc(r-1,r))==cn.Word}s($V,"insideWord");var PV=Zg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Ww),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Dt.none;let i=r.main,o,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return Dt.none;let c=n.wordAt(i.head);if(!c)return Dt.none;l=n.charCategorizer(i.head),o=n.sliceDoc(c.from,c.to)}else{let c=i.to-i.from;if(c<t.minSelectionLength||c>200)return Dt.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!(Py(l,n,i.from,i.to)&&$V(l,n,i.from,i.to)))return Dt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Dt.none}let a=[];for(let c of e.visibleRanges){let u=new Ts(n.doc,o,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!l||Py(l,n,d,f))&&(i.empty&&d<=i.from&&f>=i.to?a.push(LV.range(d,f)):(d>=i.to||f<=i.from)&&a.push(RV.range(d,f)),a.length>t.maxMatches))return Dt.none}}return Dt.set(a)}},{decorations:s(e=>e.decorations,"decorations")}),FV=ct.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),VV=s(({state:e,dispatch:t})=>{let{selection:n}=e,r=Te.create(n.ranges.map(i=>e.wordAt(i.head)||Te.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)},"selectWord");function BV(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let l=!1,a=new Ts(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(l)return null;a=new Ts(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(c=>c.from==a.value.from))continue;if(o){let c=e.wordAt(a.value.from);if(!c||c.from!=a.value.from||c.to!=a.value.to)continue}return a.value}}s(BV,"findNextOccurrence");var HV=s(({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return VV({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=BV(e,r);return i?(t(e.update({selection:e.selection.addRange(Te.range(i.from,i.to),!1),effects:ct.scrollIntoView(i.to)})),!0):!1},"selectNextOccurrence"),Us=Io.define({combine(e){return fa(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:s(t=>new tB(t),"createPanel"),scrollToMatch:s(t=>ct.scrollIntoView(t),"scrollToMatch")})}}),zw=class{static{s(this,"SearchQuery")}constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||IV(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
62
+ `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new JV(this):new WV(this)}getCursor(e,t=0,n){let r=e.doc?e:Fc.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?qo(this,r,t,n):Go(this,r,t,n)}},jw=class{static{s(this,"QueryType")}constructor(e){this.spec=e}};function KV(e,t,n){return(r,i,o,l)=>n&&!n(r,i,o,l)?!1:e(r>=l&&i<=l+o.length?o.slice(r-l,i-l):t.doc.sliceString(r,i),t,r,i)}s(KV,"wrapStringTest");function Go(e,t,n,r){let i;return e.wholeWord&&(i=UV(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=KV(e.test,t,i)),new Ts(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:o=>o.toLowerCase(),i)}s(Go,"stringCursor");function UV(e,t){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=e.sliceString(o,Math.min(e.length,r+2))),(t(Ku(i,n-o))!=cn.Word||t(Uu(i,n-o))!=cn.Word)&&(t(Uu(i,r-o))!=cn.Word||t(Ku(i,r-o))!=cn.Word))}s(UV,"stringWordTest");var WV=class extends jw{static{s(this,"StringQuery")}constructor(e){super(e)}nextMatch(e,t,n){let r=Go(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let i=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Go(this.spec,e,0,i).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let i=Math.max(t,r-1e4-this.spec.unquoted.length),o=Go(this.spec,e,i,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(i==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Go(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Go(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function zV(e,t,n){return(r,i,o)=>(!n||n(r,i,o))&&e(o[0],t,r,i)}s(zV,"wrapRegexpTest");function qo(e,t,n,r){let i;return e.wholeWord&&(i=jV(t.charCategorizer(t.selection.main.head))),e.test&&(i=zV(e.test,t,i)),new Kw(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}s(qo,"regexpCursor");function Ku(e,t){return e.slice(vo(e,t,!1),t)}s(Ku,"charBefore");function Uu(e,t){return e.slice(t,vo(e,t))}s(Uu,"charAfter");function jV(e){return(t,n,r)=>!r[0].length||(e(Ku(r.input,r.index))!=cn.Word||e(Uu(r.input,r.index))!=cn.Word)&&(e(Uu(r.input,r.index+r[0].length))!=cn.Word||e(Ku(r.input,r.index+r[0].length))!=cn.Word)}s(jV,"regexpWordTest");var JV=class extends jw{static{s(this,"RegExpQuery")}nextMatch(e,t,n){let r=qo(this.spec,e,n,e.doc.length).next();return r.done&&(r=qo(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),o=qo(this.spec,e,i,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(i==t||l.from>i+10))return l;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let i=+n.slice(0,r);if(i>0&&i<e.match.length)return e.match[i]+n.slice(r)}return t})}matchAll(e,t){let n=qo(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=qo(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},sa=nn.define(),F1=nn.define(),Ri=ha.define({create(e){return new Pf(Ng(e).create(),null)},update(e,t){for(let n of t.effects)n.is(sa)?e=new Pf(n.value.create(),e.panel):n.is(F1)&&(e=new Pf(e.query,n.value?V1:null));return e},provide:s(e=>Ux.from(e,t=>t.panel),"provide")}),Pf=class{static{s(this,"SearchState")}constructor(e,t){this.query=e,this.panel=t}},GV=Dt.mark({class:"cm-searchMatch"}),qV=Dt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ZV=Zg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Ri))}update(e){let t=e.state.field(Ri);(t!=e.startState.field(Ri)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Dt.none;let{view:n}=this,r=new Bx;for(let i=0,o=n.visibleRanges,l=o.length;i<l;i++){let{from:a,to:c}=o[i];for(;i<l-1&&c>o[i+1].from-500;)c=o[++i].to;e.highlight(n.state,a,c,(u,d)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==d);r.add(u,d,f?qV:GV)})}return r.finish()}},{decorations:s(e=>e.decorations,"decorations")});function Ha(e){return t=>{let n=t.state.field(Ri,!1);return n&&n.query.spec.valid?e(t,n):qw(t)}}s(Ha,"searchCommand");var Wu=Ha((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Te.single(r.from,r.to),o=e.state.facet(Us);return e.dispatch({selection:i,effects:[B1(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),Gw(e),!0}),zu=Ha((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=Te.single(i.from,i.to),l=e.state.facet(Us);return e.dispatch({selection:o,effects:[B1(e,i),l.scrollToMatch(o.main,e)],userEvent:"select.search"}),Gw(e),!0}),YV=Ha((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Te.create(n.map(r=>Te.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),XV=s(({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],l=0;for(let a=new Ts(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(l=o.length),o.push(Te.range(a.value.from,a.value.to))}return t(e.update({selection:Te.create(o,l),userEvent:"select.search.matches"})),!0},"selectSelectionMatches"),Fy=Ha((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let l=o,a=[],c,u,d=[];l.from==r&&l.to==i&&(u=n.toText(t.getReplacement(l)),a.push({from:l.from,to:l.to,insert:u}),l=t.nextMatch(n,l.from,l.to),d.push(ct.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let f=e.state.changes(a);return l&&(c=Te.single(l.from,l.to).map(f),d.push(B1(e,l)),d.push(n.facet(Us).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),QV=Ha((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(i=>{let{from:o,to:l}=i;return{from:o,to:l,insert:t.getReplacement(i)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:ct.announce.of(r),userEvent:"input.replace.all"}),!0});function V1(e){return e.state.facet(Us).createPanel(e)}s(V1,"createSearchPanel");function Ng(e,t){var n,r,i,o,l;let a=e.selection.main,c=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!c)return t;let u=e.facet(Us);return new zw({search:((n=t?.literal)!==null&&n!==void 0?n:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=t?.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(l=t?.wholeWord)!==null&&l!==void 0?l:u.wholeWord})}s(Ng,"defaultQuery");function Jw(e){let t=Xg(e,V1);return t&&t.dom.querySelector("[main-field]")}s(Jw,"getSearchInput");function Gw(e){let t=Jw(e);t&&t==e.root.activeElement&&t.select()}s(Gw,"selectSearchInput");var qw=s(e=>{let t=e.state.field(Ri,!1);if(t&&t.panel){let n=Jw(e);if(n&&n!=e.root.activeElement){let r=Ng(e.state,t.query.spec);r.valid&&e.dispatch({effects:sa.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[F1.of(!0),t?sa.of(Ng(e.state,t.query.spec)):nn.appendConfig.of(rB)]});return!0},"openSearchPanel"),Zw=s(e=>{let t=e.state.field(Ri,!1);if(!t||!t.panel)return!1;let n=Xg(e,V1);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:F1.of(!1)}),!0},"closeSearchPanel"),eB=[{key:"Mod-f",run:qw,scope:"editor search-panel"},{key:"F3",run:Wu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Wu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Zw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:XV},{key:"Mod-Alt-g",run:NV},{key:"Mod-d",run:HV,preventDefault:!0}],tB=class{static{s(this,"SearchPanel")}constructor(e){this.view=e;let t=this.query=e.state.field(Ri).query.spec;this.commit=this.commit.bind(this),this.searchField=Ct("input",{value:t.search,placeholder:Tn(e,"Find"),"aria-label":Tn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ct("input",{value:t.replace,placeholder:Tn(e,"Replace"),"aria-label":Tn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ct("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ct("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ct("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,i,o){return Ct("button",{class:"cm-button",name:r,onclick:i,type:"button"},o)}s(n,"button"),this.dom=Ct("div",{onkeydown:s(r=>this.keydown(r),"onkeydown"),class:"cm-search"},[this.searchField,n("next",()=>Wu(e),[Tn(e,"next")]),n("prev",()=>zu(e),[Tn(e,"previous")]),n("select",()=>YV(e),[Tn(e,"all")]),Ct("label",null,[this.caseField,Tn(e,"match case")]),Ct("label",null,[this.reField,Tn(e,"regexp")]),Ct("label",null,[this.wordField,Tn(e,"by word")]),...e.state.readOnly?[]:[Ct("br"),this.replaceField,n("replace",()=>Fy(e),[Tn(e,"replace")]),n("replaceAll",()=>QV(e),[Tn(e,"replace all")])],Ct("button",{name:"close",onclick:s(()=>Zw(e),"onclick"),"aria-label":Tn(e,"close"),type:"button"},["×"])])}commit(){let e=new zw({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:sa.of(e)}))}keydown(e){a9(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zu:Wu)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Fy(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(sa)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Us).top}};function Tn(e,t){return e.state.phrase(t)}s(Tn,"phrase");var ac=30,cc=/[\s\.,:;?!]/;function B1(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-ac),l=Math.min(i,n+ac),a=e.state.sliceDoc(o,l);if(o!=r.from){for(let c=0;c<ac;c++)if(!cc.test(a[c+1])&&cc.test(a[c])){a=a.slice(c);break}}if(l!=i){for(let c=a.length-1;c>a.length-ac;c--)if(!cc.test(a[c-1])&&cc.test(a[c])){a=a.slice(0,c);break}}return ct.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}s(B1,"announceMatch");var nB=ct.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),rB=[Ri,ep.low(ZV),nB],Yw=class{static{s(this,"CompletionContext")}constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ks(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(Xw(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function Vy(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}s(Vy,"toSet");function iB(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=Vy(t)+Vy(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}s(iB,"prefixMatch");function oB(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:iB(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}s(oB,"completeFromList");var By=class{static{s(this,"Option")}constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}};function _o(e){return e.selection.main.from}s(_o,"cur");function Xw(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}s(Xw,"ensureAnchor");var Qw=Yu.define();function sB(e,t,n,r){let{main:i}=e.selection,o=n-i.from,l=r-i.from;return{...e.changeByRange(a=>{if(a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+l)!=e.sliceDoc(n,r))return{range:a};let c=e.toText(t);return{changes:{from:a.from+o,to:r==i.from?a.to:a.from+l,insert:c},range:Te.cursor(a.from+o+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}s(sB,"insertCompletionText");var Hy=new WeakMap;function lB(e){if(!Array.isArray(e))return e;let t=Hy.get(e);return t||Hy.set(e,t=oB(e)),t}s(lB,"asSource");var ju=nn.define(),la=nn.define(),aB=class{static{s(this,"FuzzyMatcher")}constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Fn(e,t),r=Jr(n);this.chars.push(n);let i=e.slice(t,t+r),o=i.toUpperCase();this.folded.push(Fn(o==i?i.toLowerCase():o,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:o}=this;if(t.length==1){let v=Fn(e,0),x=Jr(v),C=x==e.length?0:-100;if(v!=t[0])if(v==n[0])C+=-200;else return null;return this.ret(C,[0,x])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,c=0;if(l<0){for(let v=0,x=Math.min(e.length,200);v<x&&c<a;){let C=Fn(e,v);(C==t[c]||C==n[c])&&(r[c++]=v),v+=Jr(C)}if(c<a)return null}let u=0,d=0,f=!1,h=0,g=-1,p=-1,_=/[a-z]/.test(e),y=!0;for(let v=0,x=Math.min(e.length,200),C=0;v<x&&d<a;){let b=Fn(e,v);l<0&&(u<a&&b==t[u]&&(i[u++]=v),h<a&&(b==t[h]||b==n[h]?(h==0&&(g=v),p=v+1,h++):h=0));let S,M=b<255?b>=48&&b<=57||b>=97&&b<=122?2:b>=65&&b<=90?1:0:(S=Yg(b))!=S.toLowerCase()?1:S!=S.toUpperCase()?2:0;(!v||M==1&&_||C==0&&M!=0)&&(t[d]==b||n[d]==b&&(f=!0)?o[d++]=v:o.length&&(y=!1)),C=M,v+=Jr(b)}return d==a&&o[0]==0&&y?this.result(-100+(f?-200:0),o,e):h==a&&g==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):h==a?this.ret(-900-e.length,[g,p]):d==a?this.result(-100+(f?-200:0)+-700+(y?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let o of t){let l=o+(this.astral?Jr(Fn(n,o)):1);i&&r[i-1]==o?r[i-1]=l:(r[i++]=o,r[i++]=l)}return this.ret(e-n.length,r)}},cB=class{static{s(this,"StrictMatcher")}constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},Ut=Io.define({combine(e){return fa(e,{activateOnTyping:!0,activateOnCompletion:s(()=>!1,"activateOnCompletion"),activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:s(()=>"","tooltipClass"),optionClass:s(()=>"","optionClass"),aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:uB,filterStrict:!1,compareCompletions:s((t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),"compareCompletions"),interactionDelay:75,updateSyncTime:100},{defaultKeymap:s((t,n)=>t&&n,"defaultKeymap"),closeOnBlur:s((t,n)=>t&&n,"closeOnBlur"),icons:s((t,n)=>t&&n,"icons"),tooltipClass:s((t,n)=>r=>Ky(t(r),n(r)),"tooltipClass"),optionClass:s((t,n)=>r=>Ky(t(r),n(r)),"optionClass"),addToOptions:s((t,n)=>t.concat(n),"addToOptions"),filterStrict:s((t,n)=>t||n,"filterStrict")})}});function Ky(e,t){return e?t?e+" "+t:e:t}s(Ky,"joinClass");function uB(e,t,n,r,i,o){let l=e.textDirection==Lx.RTL,a=l,c=!1,u="top",d,f,h=t.left-i.left,g=i.right-t.right,p=r.right-r.left,_=r.bottom-r.top;if(a&&h<Math.min(p,g)?a=!1:!a&&g<Math.min(p,h)&&(a=!0),p<=(a?h:g))d=Math.max(i.top,Math.min(n.top,i.bottom-_))-t.top,f=Math.min(400,a?h:g);else{c=!0,f=Math.min(400,(l?t.right:i.right-t.left)-30);let x=i.bottom-t.bottom;x>=_||x>t.top?d=n.bottom-t.top:(u="bottom",d=t.bottom-n.top)}let y=(t.bottom-t.top)/o.offsetHeight,v=(t.right-t.left)/o.offsetWidth;return{style:`${u}: ${d/y}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":a?"left":"right")}}s(uB,"defaultPositionInfo");function dB(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let l=document.createElement("span");l.className="cm-completionLabel";let a=n.displayLabel||n.label,c=0;for(let u=0;u<o.length;){let d=o[u++],f=o[u++];d>c&&l.appendChild(document.createTextNode(a.slice(c,d)));let h=l.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(a.slice(d,f))),h.className="cm-completionMatchedText",c=f}return c<a.length&&l.appendChild(document.createTextNode(a.slice(c))),l},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}s(dB,"optionContent");function Ff(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}s(Ff,"rangeAroundSelected");var fB=class{static{s(this,"CompletionTooltip")}constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:s(()=>this.measureInfo(),"read"),write:s(a=>this.placeInfo(a),"write"),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:i,selected:o}=r.open,l=e.state.facet(Ut);this.optionContent=dB(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Ff(i.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let u=a.target,d;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(d=/-(\d+)$/.exec(u.id))&&+d[1]<c.length){this.applyCompletion(e,c[+d[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ut).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:la.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=i)&&(this.range=Ff(i.length,o,e.state.facet(Ut).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Ff(t.options.length,t.selected,this.view.state.facet(Ut).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>qf(this.view.state,l,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:i}=e;n.appendChild(r),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return t&&gB(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let o=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(Ut).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",o=>{o.target==r&&o.preventDefault()});let i=null;for(let o=n.from;o<n.to;o++){let{completion:l,match:a}=e[o],{section:c}=l;if(c){let f=typeof c=="string"?c:c.name;if(f!=i&&(o>n.from||n.from==0))if(i=f,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let h=r.appendChild(document.createElement("completion-section"));h.textContent=f}}const u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let d=this.optionClass(l);d&&(u.className=d);for(let f of this.optionContent){let h=f(l,this.view.state,this.view,a);h&&u.appendChild(h)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function hB(e,t){return n=>new fB(n,e,t)}s(hB,"completionTooltip");function gB(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}s(gB,"scrollIntoView");function Uy(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}s(Uy,"score");function pB(e,t){let n=[],r=null,i=null,o=s(d=>{n.push(d);let{section:f}=d.completion;if(f){r||(r=[]);let h=typeof f=="string"?f:f.name;r.some(g=>g.name==h)||r.push(typeof f=="string"?{name:h}:f)}},"addOption"),l=t.facet(Ut);for(let d of e)if(d.hasResult()){let f=d.result.getMatch;if(d.result.filter===!1)for(let h of d.result.options)o(new By(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),g,p=l.filterStrict?new cB(h):new aB(h);for(let _ of d.result.options)if(g=p.match(_.label)){let y=_.displayLabel?f?f(_,g.matched):[]:g.matched,v=g.score+(_.boost||0);if(o(new By(_,d.source,y,v)),typeof _.section=="object"&&_.section.rank==="dynamic"){let{name:x}=_.section;i||(i=Object.create(null)),i[x]=Math.max(v,i[x]||-1e9)}}}}if(r){let d=Object.create(null),f=0,h=s((g,p)=>(g.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[g.name]:0)||(typeof g.rank=="number"?g.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(g.name<p.name?-1:1),"cmp");for(let g of r.sort(h))f-=1e5,d[g.name]=f;for(let g of n){let{section:p}=g.completion;p&&(g.score+=d[typeof p=="string"?p:p.name])}}let a=[],c=null,u=l.compareCompletions;for(let d of n.sort((f,h)=>h.score-f.score||u(f.completion,h.completion))){let f=d.completion;!c||c.label!=f.label||c.detail!=f.detail||c.type!=null&&f.type!=null&&c.type!=f.type||c.apply!=f.apply||c.boost!=f.boost?a.push(d):Uy(d.completion)>Uy(c)&&(a[a.length-1]=d),c=d.completion}return a}s(pB,"sortOptions");var mB=class dl{static{s(this,"CompletionDialog")}constructor(t,n,r,i,o,l){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=l}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new dl(this.options,Wy(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o,l){if(i&&!l&&t.some(u=>u.isPending))return i.setDisabled();let a=pB(t,n);if(!a.length)return i&&t.some(u=>u.isPending)?i.setDisabled():null;let c=n.facet(Ut).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let u=i.options[i.selected].completion;for(let d=0;d<a.length;d++)if(a[d].completion==u){c=d;break}}return new dl(a,Wy(r,c),{pos:t.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:EB,above:o.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new dl(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new dl(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},_B=class Og{static{s(this,"CompletionState")}constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new Og(CB,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(Ut),i=(r.override||n.languageDataAt("autocomplete",_o(n)).map(lB)).map(a=>(this.active.find(c=>c.source==a)||new ao(a,this.active.some(c=>c.state!=0)?1:0)).update(t,r));i.length==this.active.length&&i.every((a,c)=>a==this.active[c])&&(i=this.active);let o=this.open,l=t.effects.some(a=>a.is(H1));o&&t.docChanged&&(o=o.map(t.changes)),t.selection||i.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!vB(i,this.active)||l?o=mB.build(i,n,this.id,o,r,l):o&&o.disabled&&!i.some(a=>a.isPending)&&(o=null),!o&&i.every(a=>!a.isPending)&&i.some(a=>a.hasResult())&&(i=i.map(a=>a.hasResult()?new ao(a.source,0):a));for(let a of t.effects)a.is(n3)&&(o=o&&o.setSelected(a.value,this.id));return i==this.active&&o==this.open?this:new Og(i,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?yB:xB}};function vB(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}s(vB,"sameResults");var yB={"aria-autocomplete":"list"},xB={};function Wy(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}s(Wy,"makeAttrs");var CB=[];function e3(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(Qw);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}s(e3,"getUpdateType");var ao=class fl{static{s(this,"ActiveSource")}constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=e3(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new fl(i.source,0)),r&4&&i.state==0&&(i=new fl(this.source,1)),i=i.updateFor(t,r);for(let o of t.effects)if(o.is(ju))i=new fl(i.source,1,o.value);else if(o.is(la))i=new fl(i.source,0);else if(o.is(H1))for(let l of o.value)l.source==i.source&&(i=l);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(_o(t.state))}},t3=class $c extends ao{static{s(this,"ActiveResult")}constructor(t,n,r,i,o,l){super(t,3,n),this.limit=r,this.result=i,this.from=o,this.to=l}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let o=t.changes.mapPos(this.from),l=t.changes.mapPos(this.to,1),a=_o(t.state);if(a>l||!i||n&2&&(_o(t.startState)==this.from||a<this.limit))return new ao(this.source,n&4?1:0);let c=t.changes.mapPos(this.limit);return bB(i.validFor,t.state,o,l)?new $c(this.source,this.explicit,c,i,o,l):i.update&&(i=i.update(i,o,l,new Yw(t.state,a,!1)))?new $c(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:_o(t.state)):new ao(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new $c(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new ao(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}};function bB(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):Xw(e,!0).test(i)}s(bB,"checkValid");var H1=nn.define({map(e,t){return e.map(n=>n.map(t))}}),n3=nn.define(),pn=ha.define({create(){return _B.start()},update(e,t){return e.update(t)},provide:s(e=>[E9.from(e,t=>t.tooltip),ct.contentAttributes.from(e,t=>t.attrs)],"provide")});function K1(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(pn).active.find(i=>i.source==t.source);return r instanceof t3?(typeof n=="string"?e.dispatch({...sB(e.state,n,r.from,r.to),annotations:Qw.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}s(K1,"applyCompletion");var EB=hB(pn,K1);function uc(e,t="option"){return n=>{let r=n.state.field(pn,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Ut).interactionDelay)return!1;let i=1,o;t=="page"&&(o=Px(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a=t=="page"?0:l-1:a>=l&&(a=t=="page"?l-1:0),n.dispatch({effects:n3.of(a)}),!0}}s(uc,"moveCompletionSelection");var SB=s(e=>{let t=e.state.field(pn,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Ut).interactionDelay?!1:K1(e,t.open.options[t.open.selected])},"acceptCompletion"),Vf=s(e=>e.state.field(pn,!1)?(e.dispatch({effects:ju.of(!0)}),!0):!1,"startCompletion"),TB=s(e=>{let t=e.state.field(pn,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:la.of(null)}),!0)},"closeCompletion"),wB=class{static{s(this,"RunningQuery")}constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},kB=50,MB=1e3,AB=Zg.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(pn).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(pn),n=e.state.facet(Ut);if(!e.selectionSet&&!e.docChanged&&e.startState.field(pn)==t)return;let r=e.transactions.some(o=>{let l=e3(o,n);return l&8||(o.selection||o.docChanged)&&!(l&3)});for(let o=0;o<this.running.length;o++){let l=this.running[o];if(r||l.context.abortOnDocChange&&e.docChanged||l.updates.length+e.transactions.length>kB&&Date.now()-l.time>MB){for(let a of l.context.abortListeners)try{a()}catch(c){qf(this.view.state,c)}l.context.abortListeners=null,this.running.splice(o--,1)}else l.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(o=>o.effects.some(l=>l.is(ju)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(o=>o.isPending&&!this.running.some(l=>l.active.source==o.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let o of e.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(pn);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ut).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=_o(t),r=new Yw(t,n,e.explicit,this.view),i=new wB(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:la.of(null)}),qf(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ut).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Ut),r=this.view.state.field(pn);for(let i=0;i<this.running.length;i++){let o=this.running[i];if(o.done===void 0)continue;if(this.running.splice(i--,1),o.done){let a=_o(o.updates.length?o.updates[0].startState:this.view.state),c=Math.min(a,o.done.from+(o.active.explicit?0:1)),u=new t3(o.active.source,o.active.explicit,c,o.done,o.done.from,(e=o.done.to)!==null&&e!==void 0?e:a);for(let d of o.updates)u=u.update(d,n);if(u.hasResult()){t.push(u);continue}}let l=r.active.find(a=>a.source==o.active.source);if(l&&l.isPending)if(o.done==null){let a=new ao(o.active.source,0);for(let c of o.updates)a=a.update(c,n);a.isPending||t.push(a)}else this.startQuery(l)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:H1.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(pn,!1);if(t&&t.tooltip&&this.view.state.facet(Ut).closeOnBlur){let n=t.open&&Px(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:la.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:ju.of(!1)}),20),this.composing=0}}}),IB=typeof navigator=="object"&&/Win/.test(navigator.platform),NB=ep.highest(ct.domEventHandlers({keydown(e,t){let n=t.state.field(pn,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(IB&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(l=>l.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&K1(t,r),!1}})),OB=ct.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),aa={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},co=nn.define({map(e,t){let n=t.mapPos(e,-1,_9.TrackAfter);return n??void 0}}),U1=new class extends C9{};U1.startSide=1;U1.endSide=-1;var r3=ha.define({create(){return T9.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:s(r=>r>=n.from&&r<=n.to,"filter")})}for(let n of t.effects)n.is(co)&&(e=e.update({add:[U1.range(n.value,n.value+1)]}));return e}});function DB(){return[LB,r3]}s(DB,"closeBrackets");var zy="()[]{}<>«»»«[]{}";function i3(e){for(let t=0;t<16;t+=2)if(zy.charCodeAt(t)==e)return zy.charAt(t+1);return Yg(e<128?e:e+1)}s(i3,"closing");function o3(e,t){return e.languageDataAt("closeBrackets",t)[0]||aa}s(o3,"config");var RB=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),LB=ct.inputHandler.of((e,t,n,r)=>{if((RB?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Jr(Fn(r,0))==1||t!=i.from||n!=i.to)return!1;let o=FB(e.state,r);return o?(e.dispatch(o),!0):!1}),$B=s(({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=o3(e,e.selection.main.head).brackets||aa.brackets,r=null,i=e.changeByRange(o=>{if(o.empty){let l=VB(e.doc,o.head);for(let a of n)if(a==l&&Wd(e.doc,o.head)==i3(Fn(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:Te.cursor(o.head-a.length)}}return{range:r=o}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},"deleteBracketPair"),PB=[{key:"Backspace",run:$B}];function FB(e,t){let n=o3(e,e.selection.main.head),r=n.brackets||aa.brackets;for(let i of r){let o=i3(Fn(i,0));if(t==i)return o==i?KB(e,i,r.indexOf(i+i+i)>-1,n):BB(e,i,o,n.before||aa.before);if(t==o&&s3(e,e.selection.main.from))return HB(e,i,o)}return null}s(FB,"insertBracket");function s3(e,t){let n=!1;return e.field(r3).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}s(s3,"closedBracketAt");function Wd(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Jr(Fn(n,0)))}s(Wd,"nextChar");function VB(e,t){let n=e.sliceString(t-2,t);return Jr(Fn(n,0))==n.length?n:n.slice(1)}s(VB,"prevChar");function BB(e,t,n,r){let i=null,o=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:n,from:l.to}],effects:co.of(l.to+t.length),range:Te.range(l.anchor+t.length,l.head+t.length)};let a=Wd(e.doc,l.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:l.head},effects:co.of(l.head+t.length),range:Te.cursor(l.head+t.length)}:{range:i=l}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}s(BB,"handleOpen");function HB(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&Wd(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Te.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}s(HB,"handleClose");function KB(e,t,n,r){let i=r.stringPrefixes||aa.stringPrefixes,o=null,l=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:co.of(a.to+t.length),range:Te.range(a.anchor+t.length,a.head+t.length)};let c=a.head,u=Wd(e.doc,c),d;if(u==t){if(jy(e,c))return{changes:{insert:t+t,from:c},effects:co.of(c+t.length),range:Te.cursor(c+t.length)};if(s3(e,c)){let f=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+f.length,insert:f},range:Te.cursor(c+f.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=Jy(e,c-2*t.length,i))>-1&&jy(e,d))return{changes:{insert:t+t+t+t,from:c},effects:co.of(c+t.length),range:Te.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=cn.Word&&Jy(e,c,i)>-1&&!UB(e,c,t,i))return{changes:{insert:t+t,from:c},effects:co.of(c+t.length),range:Te.cursor(c+t.length)}}return{range:o=a}});return o?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}s(KB,"handleSame");function jy(e,t){let n=ks(e).resolveInner(t+1);return n.parent&&n.from==t}s(jy,"nodeStart");function UB(e,t,n,r){let i=ks(e).resolveInner(t,-1),o=r.reduce((l,a)=>Math.max(l,a.length),0);for(let l=0;l<5;l++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),c=a.indexOf(n);if(!c||c>-1&&r.indexOf(a.slice(0,c))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let u=i.to==t&&i.parent;if(!u)break;i=u}return!1}s(UB,"probablyInString");function Jy(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=cn.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=cn.Word)return o}return-1}s(Jy,"canStartStringAt");function WB(e={}){return[NB,pn,Ut.of(e),AB,zB,OB]}s(WB,"autocompletion");var l3=[{key:"Ctrl-Space",run:Vf},{mac:"Alt-`",run:Vf},{mac:"Alt-i",run:Vf},{key:"Escape",run:TB},{key:"ArrowDown",run:uc(!0)},{key:"ArrowUp",run:uc(!1)},{key:"PageDown",run:uc(!0,"page")},{key:"PageUp",run:uc(!1,"page")},{key:"Enter",run:SB}],zB=ep.highest(Qg.computeN([Ut],e=>e.facet(Ut).defaultKeymap?[l3]:[])),Gy=class{static{s(this,"SelectedDiagnostic")}constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},rl=class a3{static{s(this,"LintState")}constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(ca).markerFilter;i&&(t=i(t,r));let o=t.slice().sort((g,p)=>g.from-p.from||g.to-p.to),l=new Bx,a=[],c=0,u=r.doc.iter(),d=0,f=r.doc.length;for(let g=0;;){let p=g==o.length?null:o[g];if(!p&&!a.length)break;let _,y;if(a.length)_=c,y=a.reduce((C,b)=>Math.min(C,b.to),p&&p.from>_?p.from:1e8);else{if(_=p.from,_>f)break;y=p.to,a.push(p),g++}for(;g<o.length;){let C=o[g];if(C.from==_&&(C.to>C.from||C.to==_))a.push(C),g++,y=Math.min(C.to,y);else{y=Math.min(C.from,y);break}}y=Math.min(y,f);let v=!1;if(a.some(C=>C.from==_&&(C.to==y||y==f))&&(v=_==y,!v&&y-_<10)){let C=_-(d+u.value.length);C>0&&(u.next(C),d=_);for(let b=_;;){if(b>=y){v=!0;break}if(!u.lineBreak&&d+u.value.length>b)break;b=d+u.value.length,d+=u.value.length,u.next()}}let x=iH(a);if(v)l.add(_,_,Dt.widget({widget:new eH(x),diagnostics:a.slice()}));else{let C=a.reduce((b,S)=>S.markClass?b+" "+S.markClass:b,"");l.add(_,y,Dt.mark({class:"cm-lintRange cm-lintRange-"+x+C,diagnostics:a.slice(),inclusiveEnd:a.some(b=>b.to>y)}))}if(c=y,c==f)break;for(let C=0;C<a.length;C++)a[C].to<=c&&a.splice(C--,1)}let h=l.finish();return new a3(h,n,ji(h))}};function ji(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,o,{spec:l})=>{if(!(t&&l.diagnostics.indexOf(t)<0))if(!r)r=new Gy(i,o,t||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new Gy(r.from,o,r.diagnostic)}}),r}s(ji,"findDiagnostic");function jB(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(ca).hideOn(e,n,r);if(i!=null)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(l=>l.is(c3))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}s(jB,"hideTooltip");function JB(e,t){return e.field(Nn,!1)?t:t.concat(nn.appendConfig.of(oH))}s(JB,"maybeEnableLint");var c3=nn.define(),W1=nn.define(),u3=nn.define(),Nn=ha.define({create(){return new rl(Dt.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=ji(n,e.selected.diagnostic,o)||ji(n,null,o)}!n.size&&i&&t.state.facet(ca).autoPanel&&(i=null),e=new rl(n,i,r)}for(let n of t.effects)if(n.is(c3)){let r=t.state.facet(ca).autoPanel?n.value.length?Dg.open:null:e.panel;e=rl.init(n.value,r,t.state)}else n.is(W1)?e=new rl(e.diagnostics,n.value?Dg.open:null,e.selected):n.is(u3)&&(e=new rl(e.diagnostics,e.panel,n.value));return e},provide:s(e=>[Ux.from(e,t=>t.panel),ct.decorations.from(e,t=>t.diagnostics)],"provide")}),GB=Dt.mark({class:"cm-lintRange cm-lintRange-active"});function qB(e,t,n){let{diagnostics:r}=e.state.field(Nn),i,o=-1,l=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,u,{spec:d})=>{if(t>=c&&t<=u&&(c==u||(t>c||n>0)&&(t<u||n<0)))return i=d.diagnostics,o=c,l=u,!1});let a=e.state.facet(ca).tooltipFilter;return i&&a&&(i=a(i,e.state)),i?{pos:o,end:l,above:e.state.doc.lineAt(o).to<l,create(){return{dom:ZB(e,i)}}}:null}s(qB,"lintTooltip");function ZB(e,t){return Ct("ul",{class:"cm-tooltip-lint"},t.map(n=>f3(e,n,!1)))}s(ZB,"diagnosticsTooltip");var YB=s(e=>{let t=e.state.field(Nn,!1);(!t||!t.panel)&&e.dispatch({effects:JB(e.state,[W1.of(!0)])});let n=Xg(e,Dg.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},"openLintPanel"),qy=s(e=>{let t=e.state.field(Nn,!1);return!t||!t.panel?!1:(e.dispatch({effects:W1.of(!1)}),!0)},"closeLintPanel"),XB=s(e=>{let t=e.state.field(Nn,!1);if(!t)return!1;let n=e.state.selection.main,r=ji(t.diagnostics,null,n.to+1);return!r&&(r=ji(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},"nextDiagnostic"),QB=[{key:"Mod-Shift-m",run:YB,preventDefault:!0},{key:"F8",run:XB}],ca=Io.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...fa(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:s(()=>null,"hideOn")},{delay:Math.max,markerFilter:Zy,tooltipFilter:Zy,needsRefresh:s((t,n)=>t?n?r=>t(r)||n(r):t:n,"needsRefresh"),hideOn:s((t,n)=>t?n?(r,i,o)=>t(r,i,o)||n(r,i,o):t:n,"hideOn"),autoPanel:s((t,n)=>t||n,"autoPanel")})}}});function Zy(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}s(Zy,"combineFilter");function d3(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(o=>o.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}s(d3,"assignKeys");function f3(e,t,n){var r;let i=n?d3(t.actions):[];return Ct("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Ct("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,l)=>{let a=!1,c=s(g=>{if(g.preventDefault(),a)return;a=!0;let p=ji(e.state.field(Nn).diagnostics,t);p&&o.apply(e,p.from,p.to)},"click"),{name:u}=o,d=i[l]?u.indexOf(i[l]):-1,f=d<0?u:[u.slice(0,d),Ct("u",u.slice(d,d+1)),u.slice(d+1)],h=o.markClass?" "+o.markClass:"";return Ct("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${i[l]})"`}.`},f)}),t.source&&Ct("div",{class:"cm-diagnosticSource"},t.source))}s(f3,"renderDiagnostic");var eH=class extends I9{static{s(this,"DiagnosticWidget")}constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Ct("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},Yy=class{static{s(this,"PanelItem")}constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=f3(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Dg=class h3{static{s(this,"LintPanel")}constructor(t){this.view=t,this.items=[];let n=s(i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)qy(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],l=d3(o.actions);for(let a=0;a<l.length;a++)if(l[a].toUpperCase().charCodeAt(0)==i.keyCode){let c=ji(this.view.state.field(Nn).diagnostics,o);c&&o.actions[a].apply(t,c.from,c.to)}}else return;i.preventDefault()}},"onkeydown"),r=s(i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)},"onclick");this.list=Ct("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Ct("div",{class:"cm-panel-lint"},this.list,Ct("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:s(()=>qy(this.view),"onclick")},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Nn).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(Nn),r=0,i=!1,o=null,l=new Set;for(t.between(0,this.view.state.doc.length,(a,c,{spec:u})=>{for(let d of u.diagnostics){if(l.has(d))continue;l.add(d);let f=-1,h;for(let g=r;g<this.items.length;g++)if(this.items[g].diagnostic==d){f=g;break}f<0?(h=new Yy(this.view,d),this.items.splice(r,0,h),i=!0):(h=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),o=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new Yy(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:s(()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),"read"),write:s(({sel:a,panel:c})=>{let u=c.height/this.list.offsetHeight;a.top<c.top?this.list.scrollTop-=(c.top-a.top)/u:a.bottom>c.bottom&&(this.list.scrollTop+=(a.bottom-c.bottom)/u)},"write")})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}s(n,"rm");for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=ji(this.view.state.field(Nn).diagnostics,this.items[t].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:u3.of(n)})}static open(t){return new h3(t)}};function tH(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}s(tH,"svg");function dc(e){return tH(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}s(dc,"underline");var nH=ct.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:dc("#d11")},".cm-lintRange-warning":{backgroundImage:dc("orange")},".cm-lintRange-info":{backgroundImage:dc("#999")},".cm-lintRange-hint":{backgroundImage:dc("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function rH(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}s(rH,"severityWeight");function iH(e){let t="hint",n=1;for(let r of e){let i=rH(r.severity);i>n&&(n=i,t=r.severity)}return t}s(iH,"maxSeverity");var oH=[Nn,ct.decorations.compute([Nn],e=>{let{selected:t,panel:n}=e.field(Nn);return!t||!n||t.from==t.to?Dt.none:Dt.set([GB.range(t.from,t.to)])}),f9(qB,{hideOn:jB}),nH],sH=[Fx(),h9(),w9(),TF(),x9(),p9(),d9(),Fc.allowMultipleSelections.of(!0),A9(),Dx(y9,{fallback:!0}),b9(),DB(),WB(),g9(),c9(),u9(),DV(),Qg.of([...PB,...AV,...eB,...RF,...M9,...l3,...QB])];function lH(e,t,n){const r=ni(gt),i=Mn(gS),o=m.useRef(null),{lexicalNode:l}=Sg(),a=m.useRef(!1),c=m.useRef(!1),u=m.useCallback(()=>{i({editorType:"codeblock",rootNode:l,editorRef:o.current})},[l,i]),d=m.useCallback(f=>{var h,g,p,_,y,v;if(f.key==="ArrowDown"){const x=(g=(h=o.current)==null?void 0:h.getCodemirror())==null?void 0:g.state;x&&x.doc.length===x.selection.ranges[0].to&&(a.current?(r?.update(()=>{var C,b;const S=yn(e);S.getNextSibling()?((b=(C=o.current)==null?void 0:C.getCodemirror())==null||b.contentDOM.blur(),S.selectNext()):S.insertAfter(Xe())}),a.current=!1):a.current=!0)}else if(f.key==="ArrowUp"){const x=(_=(p=o.current)==null?void 0:p.getCodemirror())==null?void 0:_.state;x&&x.selection.ranges[0].from===0&&(c.current?(r?.update(()=>{var C,b;const S=yn(e);S.getPreviousSibling()&&((b=(C=o.current)==null?void 0:C.getCodemirror())==null||b.contentDOM.blur(),S.selectPrevious())}),c.current=!1):c.current=!0)}else if(f.key==="Enter")f.stopPropagation();else if(f.key==="Backspace"||f.key==="Delete"){const x=(v=(y=o.current)==null?void 0:y.getCodemirror())==null?void 0:v.state;x?.doc.length===0&&r?.update(()=>{yn(e).remove()})}},[r,e]);return m.useEffect(()=>{const f=o.current;return setTimeout(()=>{var h,g;(h=f?.getCodemirror())==null||h.contentDOM.addEventListener("focus",u),(g=f?.getCodemirror())==null||g.contentDOM.addEventListener("keydown",d)},300),()=>{var h,g;(h=f?.getCodemirror())==null||h.contentDOM.removeEventListener("focus",u),(g=f?.getCodemirror())==null||g.contentDOM.removeEventListener("keydown",d)}},[o,u,d,t]),m.useEffect(()=>{n.subscribe(()=>{var f,h;(h=(f=o.current)==null?void 0:f.getCodemirror())==null||h.focus(),u()})},[n,o,e,u]),o}s(lH,"useCodeMirrorRef");var aH=m.forwardRef(({title:e,children:t},n)=>{const r=ni(Po);return m.createElement(Ax,{delayDuration:100},m.createElement(Mx,null,m.createElement(Nx,{ref:n,asChild:!0},m.createElement("span",{className:J.tooltipTrigger},t)),m.createElement(Ox,{container:r?.current},m.createElement(Ix,{className:(0,tt.default)(J.tooltipContent),sideOffset:10},e))))}),cH=m.forwardRef(({children:e,className:t,...n},r)=>m.createElement(Xk,{...n,ref:r,className:(0,tt.default)(t,J.selectItem)},m.createElement(s9,null,e))),uH=s(({title:e,placeholder:t,className:n})=>{const[r,i]=vr(_r,pi);return m.createElement(aH,{title:e},m.createElement(o9,{"aria-label":t,className:(0,tt.default)(J.selectTrigger,n),"data-toolbar-item":!0,disabled:r},m.createElement(r9,{placeholder:t}),m.createElement(t9,{className:J.selectDropdownArrow},i("arrow_drop_down"))))},"SelectTrigger"),dH=s(({children:e,className:t=J.selectContainer})=>{const n=ni(Po);return m.createElement(n9,{container:n?.current},m.createElement(i9,{className:(0,tt.default)(t,"mdxeditor-select-content"),onCloseAutoFocus:s(r=>{r.preventDefault()},"onCloseAutoFocus"),position:"popper"},m.createElement(e9,{"data-editor-dropdown":!0,style:{maxHeight:"var(--radix-select-content-available-height)"}},e)))},"SelectContent"),fH=s(e=>m.createElement(l9,{value:e.value||"",onValueChange:e.onChange,disabled:e.disabled},m.createElement(uH,{title:e.triggerTitle,placeholder:e.placeholder}),m.createElement(dH,null,e.items.map((t,n)=>t==="separator"?m.createElement(Qk,{key:n}):m.createElement(cH,{key:n,value:t.value},t.label)))),"Select"),g3=s(({language:e,nodeKey:t,code:n,focusEmitter:r})=>{const i=mi(),{parentEditor:o,lexicalNode:l}=Sg(),[a,c,u,d,f]=vr(_r,$g,Pg,pi,Lg),h=lH(t,e,r),{setCode:g}=Sg(),p=m.useRef(null),_=m.useRef(null),{value:y,items:v}=m.useMemo(()=>hH(f,e),[f,e]),x=m.useRef(g);return x.current=g,h.current={getCodemirror:s(()=>p.current,"getCodemirror")},m.useEffect(()=>{const C=_.current;return(async()=>{const b=[...c,sH,pF,Fx(),Qg.of([lF]),ct.lineWrapping,ct.updateListener.of(({state:S})=>{x.current(S.doc.toString())}),ct.domEventHandlers({focus:s(()=>{o.update(()=>{Xn(null)})},"focus")})];if(a&&b.push(Fc.readOnly.of(!0)),e!==""){const S=f.keyMap[e]??e,M=f.supportMap[S];if(M)b.push(M.extension);else if(u){const T=ZP.find(E=>E.name===e||E.alias.includes(e)||E.extensions.includes(e));if(T)try{const E=await T.load();b.push(E.extension)}catch{}}}C.innerHTML="",p.current=new ct({parent:C,state:Fc.create({doc:n,extensions:b})}),C.addEventListener("keydown",Xy)})(),()=>{var b;(b=p.current)==null||b.destroy(),p.current=null,C.removeEventListener("keydown",Xy)}},[a,e,...c]),m.createElement("div",{className:J.codeMirrorWrapper},m.createElement("div",{className:J.codeMirrorToolbar},m.createElement(fH,{disabled:a,value:y,onChange:s(C=>{o.update(()=>{l.setLanguage(C==="__EMPTY_VALUE__"?"":C),setTimeout(()=>{o.update(()=>{l.getLatest().select()})})})},"onChange"),triggerTitle:i("codeBlock.selectLanguage","Select code block language"),placeholder:i("codeBlock.inlineLanguage","Language"),items:v}),m.createElement("button",{className:J.iconButton,type:"button",disabled:a,title:i("codeblock.delete","Delete code block"),onClick:s(C=>{C.preventDefault(),o.update(()=>{l.remove()})},"onClick")},d("delete_small"))),m.createElement("div",{ref:_}))},"CodeMirrorEditor");function Xy(e){e.stopPropagation()}s(Xy,"stopPropagationHandler");function Rg(e){var t;const n=[],r={},i={};if(Array.isArray(e))for(const o of e){const l=((t=o.alias)==null?void 0:t[0])??o.name.toLowerCase(),a=l||"__EMPTY_VALUE__";if(n.push({value:a,label:o.name}),r[l]=a,o.alias)for(const c of o.alias)r[c]=a;if(o.extensions)for(const c of o.extensions)r[c]=a;r[o.name.toLowerCase()]=a,o.support&&(i[a]=o.support)}else{const o={};for(const[l,a]of Object.entries(e))a in o||(o[a]=l,n.push({value:l||"__EMPTY_VALUE__",label:a})),r[l]=o[a]||"__EMPTY_VALUE__"}return{items:n,keyMap:r,supportMap:i}}s(Rg,"normalizeCodeBlockLanguages");function hH(e,t){const n=e.keyMap[t]??t;return!n||e.items.some(r=>r.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}s(hH,"getCodeBlockLanguageSelectData");var Lg=he(Rg({js:"JavaScript",ts:"TypeScript",tsx:"TypeScript (React)",jsx:"JavaScript (React)",css:"CSS"})),gH=wt(e=>{e.link(e.pipe(gH,$i(({language:t,code:n})=>({code:n,language:t,meta:""}))),lw)}),$g=he([]),Pg=he(!0),pH=En({update(e,t){e.pubIn({[Lg]:Rg(t?.codeBlockLanguages??{}),[$g]:t?.codeMirrorExtensions??[],[Pg]:t?.autoLoadLanguageSupport??!0})},init(e,t){const n=Rg(t?.codeBlockLanguages??{});e.pubIn({[Lg]:n,[$g]:t?.codeMirrorExtensions??[],[GP]:mH(n),[Pg]:t?.autoLoadLanguageSupport??!0})}});function mH(e){return{match(t,n){return!n||Object.hasOwn(e.keyMap,t??"")},priority:1,Editor:g3}}s(mH,"buildCodeBlockDescriptor");br();function _H({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:o,showLinkTitleField:l,showAnchorTextField:a}){const{register:c,handleSubmit:u,control:d,setValue:f,reset:h}=vT({values:{url:e,title:t,text:n}}),g=mi();return m.createElement("form",{onSubmit:s(p=>{u(r)(p),p.stopPropagation(),p.preventDefault()},"onSubmit"),onReset:s(p=>{p.stopPropagation(),i()},"onReset"),onKeyDown:s(p=>{p.key==="Escape"&&(p.stopPropagation(),i())},"onKeyDown"),className:(0,tt.default)(J.multiFieldForm,J.linkDialogEditForm)},m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"link-url"},g("createLink.url","URL")),m.createElement(YT,{register:c,initialInputValue:e,inputName:"url",suggestions:o,setValue:f,control:d,placeholder:g("createLink.urlPlaceholder","Select or paste an URL"),autofocus:!0})),a?m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"link-text",title:g("createLink.textTooltip","The text to be displayed for the link")},g("createLink.text","Anchor text")),m.createElement("input",{id:"link-text",className:J.textInput,size:40,...c("text")})):null,l?m.createElement("div",{className:J.formField},m.createElement("label",{htmlFor:"link-title",title:g("createLink.titleTooltip","The link's title attribute, shown on hover")},g("createLink.title","Link title")),m.createElement("input",{id:"link-title",className:J.textInput,size:40,...c("title")})):null,m.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:"var(--spacing-2)"}},m.createElement("button",{type:"submit",title:g("createLink.saveTooltip","Set URL"),"aria-label":g("createLink.saveTooltip","Set URL"),className:(0,tt.default)(J.primaryButton)},g("dialogControls.save","Save")),m.createElement("button",{type:"reset",title:g("createLink.cancelTooltip","Cancel change"),"aria-label":g("createLink.cancelTooltip","Cancel change"),className:(0,tt.default)(J.secondaryButton)},g("dialogControls.cancel","Cancel"))))}s(_H,"LinkEditForm");var vH=s(()=>{const[e,t,n,r,i,o,l,a]=vr(Po,dS,gt,pi,Xt,b3,E3,T3),c=Mn(m3),u=Mn(_3),d=Mn(v3),f=Mn(y3),h=Mn(x3);m.useEffect(()=>{const x=t?.closest(".mdxeditor-root-contenteditable"),C=s(()=>{n?.getEditorState().read(()=>{c(!0)})},"update");return window.addEventListener("resize",C),window.addEventListener("scroll",C),x?.addEventListener("scroll",C),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C),x?.removeEventListener("scroll",C)}},[n,t,c]);const[g,p]=m.useState(!1),_=mi();if(i.type==="inactive")return null;const y=i.rectangle,v=i.type==="preview"&&i.url.startsWith("http");return m.createElement(Jg,{open:!0},m.createElement(xk,{"data-visible":i.type==="edit",className:J.linkDialogAnchor,style:{top:`${y.top}px`,left:`${y.left}px`,width:`${y.width}px`,height:`${y.height}px`}}),m.createElement(zg,{container:e?.current},m.createElement(vk,{className:(0,tt.default)(J.linkDialogPopoverContent),sideOffset:5,updatePositionStrategy:"always",onOpenAutoFocus:s(x=>{x.preventDefault()},"onOpenAutoFocus"),key:i.linkNodeKey},i.type==="edit"&&m.createElement(_H,{url:i.url,title:i.title,text:i.text,onSubmit:u,onCancel:d.bind(null),linkAutocompleteSuggestions:o,showLinkTitleField:a,showAnchorTextField:i.withAnchorText}),i.type==="preview"&&m.createElement(m.Fragment,null,m.createElement("a",{className:J.linkDialogPreviewAnchor,"data-testid":"link-dialog-preview",href:i.href??"about:blank",...v?{target:"_blank",rel:"noreferrer"}:{},onClick:s(x=>{l!==null&&(x.preventDefault(),l(i.url))},"onClick"),title:v?_("linkPreview.open","Open {{url}} in new window",{url:i.url}):i.url},m.createElement("span",null,i.url),v&&r("open_in_new")),m.createElement(Bf,{onClick:s(()=>{f()},"onClick"),title:_("linkPreview.edit","Edit link URL"),"aria-label":_("linkPreview.edit","Edit link URL")},r("edit")),m.createElement(Ax,null,m.createElement(Mx,{open:g},m.createElement(Nx,{asChild:!0},m.createElement(Bf,{title:_("linkPreview.copyToClipboard","Copy to clipboard"),"aria-label":_("linkPreview.copyToClipboard","Copy to clipboard"),onClick:s(()=>{window.navigator.clipboard.writeText(i.url).then(()=>{p(!0),setTimeout(()=>{p(!1)},1e3)})},"onClick")},r(g?"check":"content_copy"))),m.createElement(Ox,{container:e?.current},m.createElement(Ix,{className:(0,tt.default)(J.tooltipContent),sideOffset:5},_("linkPreview.copied","Copied!"),m.createElement(Zk,null))))),m.createElement(Bf,{title:_("linkPreview.remove","Remove link"),"aria-label":_("linkPreview.remove","Remove link"),onClick:s(()=>{h()},"onClick")},r("link_off"))),m.createElement(jg,{className:J.popoverArrow}))))},"LinkDialog"),Bf=m.forwardRef(({className:e,...t},n)=>m.createElement("button",{className:(0,tt.default)(J.actionButton,e),ref:n,...t}));function Ju(e){if(!e)return null;const t=xR(e);if(t===null)return null;const n=t.getParent();return St(n)?n:St(t)?t:null}s(Ju,"getLinkNodeInSelection");function p3(e=re()){if(!He(e))return null;const t=e.getNodes(),n=t.length===1?t[0]:null;return Un(n)&&n.isInline()?n:null}s(p3,"getSelectedInlineDecorator");function Hf(e,t,n){return e?e.getEditorState().read(()=>{const r=t===""?null:yn(t),i=re(),o=ie(i)?Ju(i):null,l=St(r)?r:o;return l?.sanitizeUrl(n)??"about:blank"}):"about:blank"}s(Hf,"getPreviewHref");var m3=wt(),Xt=he({type:"inactive"},e=>{e.pub(ea,t=>t.registerCommand(xd,()=>e.getValue(Xt).type==="preview"?(e.pub(Xt,{type:"inactive"}),!0):!1,st)),e.sub(e.pipe(ta),t=>{t!=="rich-text"&&e.pub(Xt,{type:"inactive"})}),e.pub(ea,t=>t.registerCommand(mb,n=>{if(n.key==="k"&&(OS?n.metaKey:n.ctrlKey)&&!e.getValue(_r)){const r=re();return ie(r)||p3(r)!==null?(e.pub(C3),n.stopPropagation(),n.preventDefault(),!0):!1}return!1},Jl)),e.sub(e.pipe(y3,mt(Xt,gt)),([,t,n])=>{if(t.type==="preview")setTimeout(()=>{n?.getEditorState().read(()=>{const r=yn(t.linkNodeKey),i=St(r)?r.getTextContent().length>0&&r.getChildrenSize()<=1:!1,o=i&&r?r.getTextContent():"";e.pub(Xt,{type:"edit",initialUrl:t.url,url:t.url,title:t.title,text:o,withAnchorText:i,linkNodeKey:t.linkNodeKey,decoratorNodeKey:t.decoratorNodeKey,rectangle:t.rectangle})})});else throw new Error("Cannot switch to edit mode when not in preview mode")}),e.sub(e.pipe(_3,mt(gt,Xt,bs)),([t,n,r,i])=>{var o,l,a;const c=((o=t.text)==null?void 0:o.trim())??"",u=((l=t.url)==null?void 0:l.trim())??"",d=((a=t.title)==null?void 0:a.trim())??"";if(u!==""){if(r.decoratorNodeKey!==void 0){let f="",h=!1;if(n?.update(()=>{const g=yn(r.decoratorNodeKey);if(g===null)return;const p=cu();if(p.add(g.getKey()),Xn(p),h=n.dispatchCommand(ki,u),!h)return;const _=g.getParent();St(_)&&(_.setTitle(d),f=_.getKey())},{discrete:!0}),f==="")return;e.pub(Xt,{type:"preview",linkNodeKey:f,decoratorNodeKey:r.decoratorNodeKey,rectangle:r.rectangle,title:d,url:u,href:Hf(n,f,u)});return}if(i?.isCollapsed()){const f=c||d||u;n?.update(()=>{const h=Ju(i);if(h)if(ln(h)){const g=ai(u,{title:d});g.append(pr(c)),h.replace(g),g.select()}else h.setURL(u),h.setTitle(d),Qy(h.getFirstChild(),c);else{const g=ai(u,{title:d});g.append(pr(f)),Ls([g]),g.select()}},{discrete:!0})}else n?.update(()=>{Qy(i?.anchor.getNode(),c)}),n?.dispatchCommand(ki,{url:u,title:d});e.pub(Xt,{type:"preview",linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:d,url:u,href:Hf(n,r.linkNodeKey??"",u)})}else r.type==="edit"&&r.initialUrl!==""&&(r.decoratorNodeKey!==void 0?n?.update(()=>{const f=yn(r.decoratorNodeKey);if(f===null)return;const h=cu();h.add(f.getKey()),Xn(h),n.dispatchCommand(ki,null)}):n?.dispatchCommand(ki,null)),e.pub(Xt,{type:"inactive"})}),e.link(e.pipe(v3,mt(Xt,gt),$i(([,t,n])=>{if(t.type==="edit")return n?.focus(),t.initialUrl===""?{type:"inactive"}:{type:"preview",url:t.initialUrl,href:Hf(n,t.linkNodeKey,t.initialUrl),linkNodeKey:t.linkNodeKey,decoratorNodeKey:t.decoratorNodeKey,rectangle:t.rectangle};throw new Error("Cannot cancel edit when not in edit mode")})),Xt),e.link(e.pipe(e.combine(bs,m3),mt(gt,Xt,_r),$i(([[t],n,r,i])=>{if(r.decoratorNodeKey!==void 0&&n&&!i){if(n.getEditorState().read(()=>{const l=re();if(!He(l))return null;const a=l.getNodes();return a.length===1?a[0].getKey():null})!==r.decoratorNodeKey)return{type:"inactive"};const o=MS(n,r.decoratorNodeKey);return o===null?{type:"inactive"}:{...r,rectangle:o}}if(ie(t)&&n&&!i){const o=Ju(t);if(!t.isCollapsed())return{type:"inactive"};if(o){const l=AS(n);return l?{type:"preview",url:o.getURL(),href:o.sanitizeUrl(o.getURL()),linkNodeKey:o.getKey(),title:o.getTitle(),rectangle:l}:{type:"inactive"}}else return{type:"inactive"}}else return{type:"inactive"}})),Xt)}),_3=wt(),v3=Ji(),Nz=Ji(),y3=Ji(),x3=Ji(e=>{e.sub(e.pipe(x3,mt(gt)),([,t])=>{t?.dispatchCommand(ki,null)})}),C3=Ji(e=>{e.sub(e.pipe(C3,mt(bs,gt)),([,t,n])=>{if(!n)return;const r=n.getEditorState().read(()=>{const i=p3();if(i===null)return null;const o=i.getParent(),l=St(o)?o:null;return{nodeKey:i.getKey(),url:l?.getURL()??"",title:l?.getTitle()??"",linkNodeKey:l?.getKey()??""}});if(r!==null){const i=MS(n,r.nodeKey);if(i===null)return;e.pub(Xt,{type:"edit",initialUrl:r.url,url:r.url,title:r.title,text:"",withAnchorText:!1,linkNodeKey:r.linkNodeKey,decoratorNodeKey:r.nodeKey,rectangle:i});return}ie(t)&&n.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{const i=Ju(t),o=AS(n);if(o===null)return;const l=i?.getURL()??"",a=i?.getURL()??"",c=i?.getTitle()??"",u=i?.getKey()??"",d=i?i.getTextContent().length>0&&i.getChildrenSize()<=1:t.isCollapsed(),f=d&&i?i.getTextContent():"";e.pub(Xt,{type:"edit",initialUrl:l,url:a,title:c,text:f,withAnchorText:d,linkNodeKey:u,rectangle:o})})})})})}),b3=he([]),E3=he(null),S3=he(null,e=>{e.pub(ea,t=>{function n(r){const[i,o]=e.getValues([_r,S3]);!i||o===null||t.update(()=>{const l=si(r.target);if(l!==null){const a=dt(l,c=>c instanceof Vr);a!==null&&o(r,a,a.getURL())}})}return s(n,"onClick"),t.registerRootListener((r,i)=>{r&&r.addEventListener("click",n),i&&i.removeEventListener("click",n)})})});function Qy(e,t){Ie(e)&&t&&(e.setTextContent(t),e.selectStart())}s(Qy,"updateLinkText");var T3=he(!0),yH=En({init(e,t){e.pub(Bs,t?.LinkDialog??vH),e.pub(E3,t?.onClickLinkCallback??null),e.pub(S3,t?.onReadOnlyClickLinkCallback??null),e.pub(T3,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(b3,t.linkAutocompleteSuggestions??[])}});function xH(e,t){let n=e;for(let r=qn(e,t);r&&(N3(r.origin)||du(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}s(xH,"le");function CH(e){return xH(e,"previous")}s(CH,"ue$1");function w3(e,t){for(const n of e.childNodes)if(Ke(n)&&n.tagName===t||w3(n,t))return!0;return!1}s(w3,"xe$1");var hl="data-language",il="data-highlight-language",fc="data-theme",z1=class k3 extends Lr{static{s(this,"ve")}__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new k3(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=bn().createElement("code");mr(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(il,r));const i=this.getTheme();i&&n.setAttribute(fc,i);const o=this.getStyle();return o&&Tc(n.style,o),n}updateDOM(t,n,r){const i=this.__language,o=t.__language;i?i!==o&&n.setAttribute(hl,i):o&&n.removeAttribute(hl);const l=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&o?l&&i?i!==o&&n.setAttribute(il,i):n.removeAttribute(il):l&&i&&n.setAttribute(il,i);const a=this.__theme,c=t.__theme;a?a!==c&&n.setAttribute(fc,a):c&&n.removeAttribute(fc);const u=this.__style,d=t.__style;return u!==d&&Tc(n.style,u,d),!1}exportDOM(t){const n=bn().createElement("pre");mr(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(hl,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(il,r));const i=this.getTheme();i&&n.setAttribute(fc,i);const o=this.getStyle();return o&&Tc(n.style,o),{element:n}}static importDOM(){return{code:s(t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||w3(t,"BR"))?{conversion:ex,priority:1}:null,"code"),div:s(()=>({conversion:bH,priority:1}),"div"),pre:s(()=>({conversion:ex,priority:0}),"pre"),table:s(t=>Kf(t)?{conversion:EH,priority:3}:null,"table"),td:s(t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&Kf(r)?{conversion:tx,priority:3}:null},"td"),tr:s(t=>{const n=t.closest("table");return n&&Kf(n)?{conversion:tx,priority:3}:null},"tr")}}static importJSON(t){return un().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){if(!qi(Wt(),"@lexical/code")){const l=SH(t);if(l)return l}const{anchor:r,focus:i}=t,o=(r.isBefore(i)?r:i).getNode();if(Ie(o)){let l=CH(o);const a=[];for(;;)if(du(l))a.push(Xp()),l=l.getNextSibling();else{if(!N3(l))break;{let p=0;const _=l.getTextContent(),y=l.getTextContentSize();for(;p<y&&_[p]===" ";)p++;if(p!==0&&a.push(I3(" ".repeat(p))),p!==y)break;l=l.getNextSibling()}}const c=o.splitText(r.offset)[0],u=r.offset===0?0:1,d=c.getIndexWithinParent()+u,f=o.getParentOrThrow(),h=[Or(),...a];f.splice(d,0,h);const g=a[a.length-1];g?g.select():r.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(ua(o)){const{offset:l}=t.anchor;o.splice(l,0,[Or()]),o.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=Xe();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function un(e,t){return G2(z1).setLanguage(e).setTheme(t)}s(un,"Ce");function ua(e){return e instanceof z1}s(ua,"Ne");function ex(e){return{node:un(e.getAttribute(hl))}}s(ex,"Te");function bH(e){const t=e,n=nx(t);return n||(function(r){let i=r.parentElement;for(;i!==null;){if(nx(i))return!0;i=i.parentElement}return!1})(t)?{node:n?un():null}:{node:null}}s(bH,"Ae");function EH(){return{node:un()}}s(EH,"Oe");function tx(){return{node:null}}s(tx,"Pe");function nx(e){return e.style.fontFamily.match("monospace")!==null}s(nx,"we");function Kf(e){return e.classList.contains("js-file-line-container")}s(Kf,"He");function SH(e){const{anchor:t}=e;if(e.isCollapsed()&&t.type==="element"){const n=t.getNode();if(ua(n)){const r=n.getChildrenSize();if(r>=2&&t.offset===r){const i=n.getLastChild();if(Dr(i)&&Dr(i.getPreviousSibling())){const o=Xe();return n.splice(r-2,2,[]).insertAfter(o,!1),o.select(),o}}}}return null}s(SH,"De");var M3=class A3 extends $s{static{s(this,"ke")}__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new A3(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__highlightType=t.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=Uf(t.theme,this.__highlightType);return mr(n,r),n}updateDOM(t,n,r){const i=super.updateDOM(t,n,r),o=Uf(r.theme,t.__highlightType),l=Uf(r.theme,this.__highlightType);return o!==l&&(o&&bd(n,o),l&&mr(n,l)),i}static importJSON(t){return I3().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return un()}};function Uf(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}s(Uf,"Be");function I3(e="",t){return ci(new M3(e,t))}s(I3,"Fe");function N3(e){return e instanceof M3}s(N3,"Le");var O3="data-language";function D3(e){return e.style.fontFamily.match("monospace")!==null}s(D3,"Ee");function Fg(e){let t=e.parentElement;for(;t!==null;){if(D3(t))return!0;t=t.parentElement}return!1}s(Fg,"Me");var TH=hE([{$import:s((e,t)=>e.$importChildren(t),"$import"),match:zt.tag("tr","td"),name:"@lexical/code/github-code-table/unwrap"}]),wH={$import:s((e,t)=>[un(t.getAttribute(O3)).splice(0,0,e.$importChildren(t))],"$import"),match:zt.tag("pre"),name:"@lexical/code/pre"},kH={$import:s((e,t,n)=>{const r=t.textContent||"";return/\r?\n/.test(r)||t.querySelector("br")!==null?[un(t.getAttribute(O3)).splice(0,0,e.$importChildren(t))]:n()},"$import"),match:zt.tag("code"),name:"@lexical/code/code-multiline"};function hc(e){if(!Ke(e))return!1;const t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t=="string"&&/monospace/i.test(t)&&typeof n=="string"&&n.startsWith("pre")}s(hc,"Ie");function MH(e){let t=!1;const n=[];let r="",i=!1;const o=s(()=>{i&&(n.push(r),r="",i=!1)},"o");for(const l of Array.from(e.childNodes))if(Ke(l))l.tagName==="DIV"?(o(),n.push(l.textContent||""),t=!0):l.tagName==="BR"?(o(),n.push(""),t=!0):(r+=l.textContent||"",i=!0);else if(Cd(l)){const a=l.textContent||"";a.length>0&&(r+=a,i=!0)}return o(),t?n:null}s(MH,"je");var Oz=hE([{$import:s((e,t,n)=>{if(!hc(t)||Fg(t))return n();const r=MH(t);return r===null||r.length===0?n():[un().splice(0,0,Ah(r.join(`
63
+ `)))]},"$import"),match:zt.tag("div"),name:"@lexical/code/vscode-wrapper"},{$import:s((e,t,n)=>{if(!hc(t)||Fg(t))return n();const r=t.previousElementSibling;if(r&&hc(r))return[];const i=[];let o=t;for(;o&&hc(o);)i.push(o.tagName==="BR"?"":o.textContent||""),o=o.nextElementSibling;return i.length<2?n():[un().splice(0,0,Ah(i.join(`
64
+ `)))]},"$import"),match:zt.tag("div","br"),name:"@lexical/code/vscode-line-run"}]),AH={$import:s((e,t,n)=>D3(t)?[un().splice(0,0,e.$importChildren(t))]:Fg(t)?e.$importChildren(t):n(),"$import"),match:zt.tag("div"),name:"@lexical/code/div"},Dz=[{$import:s((e,t)=>[un().splice(0,0,e.$importChildren(t,{rules:TH}))],"$import"),match:zt.tag("table").classAll("js-file-line-container"),name:"@lexical/code/github-code-table"},{$import:s((e,t)=>e.$importChildren(t),"$import"),match:zt.tag("td").classAll("js-file-line"),name:"@lexical/code/github-code-cell-by-class"},kH,wH,AH];function Vg(e,t){const n={};for(const r of e){const i=t(r);i&&(n[i]?n[i].push(r):n[i]=[r])}return n}s(Vg,"Q");function IH(e){const t=Vg(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}s(IH,"V");var rx=/[!-/:-@[-`{-~\s]/;function ix(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,(t,n)=>String.fromCodePoint(Number(n)))}s(ix,"nt");var NH=/^(\s*)(\d{1,})\.\s/,OH=/^(\s*)[-*+]\s/,DH=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,RH=/^(#{1,6})\s/,LH=/^>\s/,$H=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,PH=/^[ \t]*`{3,}$/,gl=Aa("mdListMarker",{parse:s(e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-","parse"),resetOnCopyNode:!0}),ox=Aa("mdCodeFence",{parse:s(e=>typeof e=="string"&&/^`{3,}$/.test(e)?e:"```","parse"),resetOnCopyNode:!0}),FH=Aa("mdHardLineBreak",{parse:s(e=>typeof e=="string"&&/^(\\| {2,})$/.test(e)?e:"","parse"),resetOnCopyNode:!0});function VH(e){if(e.endsWith("\\"))return[e.slice(0,-1),"\\"];const t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}s(VH,"It");function BH(e){const t=e.getChildren(),n=t.length-1,r=t[n];if(!Ie(r))return null;const i=r.getTextContent(),o=VH(i);if(o!==null){const[l,a]=o;return r.setTextContent(l),a}return/^ {2,}$/.test(i)&&(function(l,a){for(let c=a-1;c>=0;c--){if(Dr(l[c]))return!1;if(/\S/.test(l[c].getTextContent()))return!0}return!1})(t,n)?(r.setTextContent(""),i):null}s(BH,"Tt");function HH(e){const t=Or(),n=BH(e);return n!==null&&us(t,FH,n),t}s(HH,"$t");var R3=s(e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},"Et"),j1=s(e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),l=t.getNextSibling(),a=Qn(e==="check"?r[3]==="x":void 0),c=r[0].trim()[0],u=e!=="bullet"&&e!=="check"||c!==gl.parse(c)?void 0:c;if(Se(l)&&l.getListType()===e){u&&us(l,gl,u);const f=l.getFirstChild();f!==null?f.insertBefore(a):l.append(a),e==="number"&&l.setStart(Number(r[2])),t.remove()}else if(Se(o)&&o.getListType()===e)u&&us(o,gl,u),o.append(a),t.remove();else{const f=Zn(e,e==="number"?Number(r[2]):void 0);u&&us(f,gl,u),f.append(a),t.replace(f)}a.append(...n),i||a.select(0,0);const d=(function(f){const h=f.match(/\t/g),g=f.match(/ /g);let p=0;return h&&(p+=h.length),g&&(p+=Math.floor(g.length/4)),p})(r[1]);d&&a.setIndent(d)},"vt"),zd=s((e,t,n,r)=>{const i=[],o=e.getChildren();let l=0;for(const a of o)if(Me(a)){if(a.getChildrenSize()===1){const g=a.getFirstChild();if(Se(g)){const p=zd(g,t,n+1,r);p&&i.push(p);continue}}if(r&&!a.getChildren().some(g=>g.isSelected(r)))continue;const c=" ".repeat(4*n),u=e.getListType(),d=em(e,gl),f=u==="number"?`${e.getStart()+l}. `:u==="check"?`${d} [${a.getChecked()?"x":" "}] `:d+" ";let h=t(a);u!=="number"&&(h=h.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),i.push(c+f+h),l++}return i.join(`
65
+ `)},"yt"),KH={dependencies:[Ra],export:s((e,t)=>{if(!Md(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},"export"),regExp:RH,replace:R3(e=>{const t="h"+e[1].length;return Ar(t)}),triggerOnEnter:!0,type:"element"},L3={dependencies:[kd],export:s((e,t)=>{if(!Wh(e))return null;const n=t(e).split(`
66
+ `),r=[];for(const i of n)r.push("> "+i);return r.join(`
67
+ `)},"export"),regExp:LH,replace:s((e,t,n,r)=>{if(r){const o=e.getPreviousSibling();if(Wh(o))return o.splice(o.getChildrenSize(),0,[HH(o),...t]),void e.remove()}const i=Vs();i.append(...t),e.replace(i),r||i.select(0,0)},"replace"),triggerOnEnter:!0,type:"element"},Al={dependencies:[z1],export:s(e=>{if(!ua(e))return null;const t=e.getTextContent();let n=em(e,ox);if(t.indexOf(n)>-1){const r=t.match(/`{3,}/g);if(r){const i=Math.max(...r.map(o=>o.length));n="`".repeat(i+1)}}return n+(e.getLanguage()||"")+(t?`
68
+ `+t:"")+`
69
+ `+n},"export"),handleImportAfterStartMatch:s(({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{const i=r[1],o=i.trim().length,l=e[n],a=r.index+i.length,c=l.slice(a),u=new RegExp(`\`{${o},}$`);if(u.test(c)){const g=c.match(u),p=c.slice(0,c.lastIndexOf(g[0])),_=[...r];return _[2]="",Al.replace(t,null,_,g,[p],!0),[!0,n]}const d=new RegExp(`^[ \\t]*\`{${o},}$`);for(let g=n+1;g<e.length;g++){const p=e[g];if(d.test(p)){const _=p.match(d),y=e.slice(n+1,g),v=l.slice(r[0].length);return v.length>0&&y.unshift(v),Al.replace(t,null,r,_,y,!0),[!0,g]}}const f=e.slice(n+1),h=l.slice(r[0].length);return h.length>0&&f.unshift(h),Al.replace(t,null,r,null,f,!0),[!0,e.length-1]},"handleImportAfterStartMatch"),regExpEnd:{optional:!0,regExp:PH},regExpStart:$H,replace:s((e,t,n,r,i,o)=>{let l,a;const c=n[1]?n[1].trim():"```",u=n[2]||void 0;if(!t&&i){if(i.length===1)r?(l=un(u),a=i[0]):(l=un(u),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(l=un(u),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();a=i.join(`
70
+ `)}us(l,ox,c);const d=pr(a);l.append(d),e.append(l)}else t&&R3(d=>un(d?d[2]:void 0))(e,t,n,o)},"replace"),type:"multiline-element"},J1={dependencies:[vi,_i],export:s((e,t,n)=>Se(e)?zd(e,t,0,n):null,"export"),regExp:OH,replace:j1("bullet"),triggerOnEnter:!0,type:"element"},$3={dependencies:[vi,_i],export:s((e,t,n)=>Se(e)?zd(e,t,0,n):null,"export"),regExp:DH,replace:j1("check"),triggerOnEnter:!0,type:"element"},G1={dependencies:[vi,_i],export:s((e,t,n)=>Se(e)?zd(e,t,0,n):null,"export"),regExp:NH,replace:j1("number"),triggerOnEnter:!0,type:"element"},P3={format:["code"],tag:"`",type:"text-format"},UH={format:["highlight"],tag:"==",type:"text-format"},F3={format:["bold","italic"],tag:"***",type:"text-format"},V3={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},B3={format:["bold"],tag:"**",type:"text-format"},H3={format:["bold"],intraword:!1,tag:"__",type:"text-format"},WH={format:["strikethrough"],tag:"~~",type:"text-format"},K3={format:["italic"],tag:"*",type:"text-format"},U3={format:["italic"],intraword:!1,tag:"_",type:"text-format"},W3={dependencies:[Vr],export:s((e,t,n)=>{if(!St(e)||ln(e))return null;const r=t(e);let i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,"\\$1")),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},"export"),importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:s((e,t)=>{if(dt(e,St))return;const[,n,r,i]=t,o=r!=null?ix(r):void 0,l=i!=null?ix(i):void 0,a=ai(o,{title:l}),c=n.split("[").length-1,u=n.split("]").length-1;let d=n,f="";if(c<u)return;if(c>u){const g=n.split("[");f="["+g[0],d=g.slice(1).join("[")}const h=pr(d);return h.setFormat(e.getFormat()),a.append(h),e.replace(a),f&&a.insertBefore(pr(f)),h},"replace"),trigger:")",type:"text-match"},zH=[KH,L3,J1,G1],jH=[Al],JH=[P3,F3,V3,B3,H3,UH,K3,U3,WH],GH=[W3],z3=[...zH,...jH,...JH,...GH];function sx(e){return Ie(e)&&!e.hasFormat("code")}s(sx,"se");function qH(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const i of t)r.append("v",i);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}s(qH,"ue");function lx(e,t,n,r,i){const o=e.getParent();if(!xn(o)||e.getFirstChild()!==t)return!1;const l=t.getTextContent();if(!i&&l[n-1]!==" ")return!1;for(const{regExp:a,replace:c}of r){const u=l.match(a),d=i||u&&u[0].endsWith(" ")?n:n-1;if(u&&u[0].length===d){const f=t.getNextSiblings(),[h,g]=t.splitText(n);if(c(e,g?[g,...f]:f,u,!1)!==!1)return h.remove(),!0}}return!1}s(lx,"de");function ax(e,t,n,r,i){const o=e.getParent();if(!xn(o)||e.getFirstChild()!==t)return!1;const l=t.getTextContent();if(!i&&l[n-1]!==" ")return!1;for(const{regExpStart:a,replace:c,regExpEnd:u}of r){if(u&&!("optional"in u)||u&&"optional"in u&&!u.optional)continue;const d=l.match(a);if(d){const f=i||d[0].endsWith(" ")?n:n-1;if(d[0].length!==f)continue;const h=t.getNextSiblings(),[g,p]=t.splitText(n);if(c(e,p?[p,...h]:h,d,null,null,!1)!==!1)return g.remove(),!0}}return!1}s(ax,"ge");function ZH(e,t){let n=0;const r=e.getTextContent();for(let i=0;i<t;i++)r[i]==="`"&&n++;return n%2!=0}s(ZH,"he");function cx(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const o=i-r;if(j3(e,o,n,0,r)&&e[o+r]!==" ")return o}return-1}s(cx,"pe");function j3(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}s(j3,"xe");function YH(e,t=z3){const n=IH(t),r=n.element.filter(c=>c.triggerOnEnter),i=Vg(n.textFormat,({tag:c})=>c[c.length-1]),o=Vg(n.textMatch,({trigger:c})=>c),l=new Set([" "]);for(const c of n.textFormat)l.add(c.tag.slice(-1));for(const c of n.textMatch)c.trigger!==void 0&&l.add(c.trigger);for(const c of t){const u=c.type;if(u==="element"||u==="text-match"||u==="multiline-element"){const d=c.dependencies;for(const f of d)e.hasNode(f)||qH(173,f.getType())}}const a=s((c,u,d)=>!!lx(c,u,d,n.element)||!!ax(c,u,d,n.multilineElement)||!!(function(f,h,g){let p=f.getTextContent();const _=g[p[h-1]];if(_==null)return!1;h<p.length&&(p=p.slice(0,h));for(const y of _){if(!y.replace||!y.regExp)continue;const v=p.match(y.regExp);if(v===null)continue;const x=v.index||0,C=x+v[0].length;let b;return x===0?[b]=f.splitText(C):[,b]=f.splitText(x,C),b.selectNext(0,0),y.replace(b,v),!0}return!1})(u,d,o)||!!(function(f,h,g){const p=f.getTextContent(),_=h-1,y=p[_],v=g[y];if(!v)return!1;for(const x of v){const{tag:C}=x,b=C.length,S=_-b+1;if(b>1&&!j3(p,S,C,0,b)||p[S-1]===" ")continue;const M=p[_+1];if(x.intraword===!1&&M&&!rx.test(M))continue;const T=f;let E=T,A=cx(p,S,C),D=E;for(;A<0&&(D=D.getPreviousSibling())&&!Dr(D);)if(Ie(D)){if(D.hasFormat("code"))continue;const me=D.getTextContent();E=D,A=cx(me,me.length,C)}if(A<0||E===T&&A+b===S)continue;const L=E.getTextContent();if(A>0&&L[A-1]===y)continue;const G=L[A-1];if(x.intraword===!1&&G&&!rx.test(G)||!x.format.includes("code")&&ZH(E,A))continue;const $=T.getTextContent(),z=$.slice(0,S)+$.slice(_+1);T.setTextContent(z);const W=E===T?z:L;E.setTextContent(W.slice(0,A)+W.slice(A+b));const ye=re(),q=pd();Xn(q);const ge=_-b*(E===T?2:1)+1;q.anchor.set(E.__key,A,"text"),q.focus.set(T.__key,ge,"text");for(const me of x.format)q.formatText(me,C7[me]);q.anchor.set(q.focus.key,q.focus.offset,q.focus.type);for(const me of x.format)q.hasFormat(me)&&q.toggleFormat(me);return ie(ye)&&(q.format=ye.format),!0}return!1})(u,d,i),"f");return At(e.registerUpdateListener(({tags:c,dirtyLeaves:u,editorState:d,prevEditorState:f})=>{if(c.has(YA)||c.has(ho)||e.isComposing())return;const h=c.has(ib),g=d.read(re),p=f.read(re);if(!ie(p)||!ie(g)||!g.isCollapsed()||g.is(p)&&!h)return;const _=g.anchor.key,y=g.anchor.offset,v=d._nodeMap.get(_);if(Ie(v)&&u.has(_)&&(h||y===1||!(y>p.anchor.offset+1))){if(h){const x=d.read(()=>v.getTextContent())[y-1];if(!l.has(x))return}e.update(()=>{if(!sx(v))return;const x=v.getParent();x===null||ua(x)||a(x,v,g.anchor.offset)&&kh(db)})}}),e.registerCommand(yd,c=>{if(c!==null&&c.shiftKey)return!1;const u=re();if(!ie(u)||!u.isCollapsed())return!1;const d=u.anchor.offset,f=u.anchor.getNode();if(!Ie(f)||!sx(f))return!1;const h=f.getParent();return h===null||ua(h)?!1:d===f.getTextContent().length&&!(!ax(h,f,d,n.multilineElement,!0)&&!lx(h,f,d,r,!0))&&(c!==null&&c.preventDefault(),!0)},st))}s(YH,"me");var XH=[{dependencies:[Da],export:s(e=>Yb(e)?"***":null,"export"),regExp:/^(---|\*\*\*|___)\s?$/,replace:s((e,t,n,r)=>{const i=Td();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},"replace"),triggerOnEnter:!0,type:"element"},...z3];function Wf({transformers:e=XH}){const[t]=fn();return(0,m.useEffect)(()=>YH(t,e),[t,e]),null}s(Wf,"m");var QH=En({init(e){const t=e.getValue(bS),n=rK(t,t.includes("headings")?e.getValue(ku):[]),r=n.filter(i=>!nK.has(i));e.pubIn({[Bs]:()=>m.createElement(Wf,{transformers:n}),[Am]:()=>m.createElement(Wf,{transformers:n}),[CS]:()=>m.createElement(Wf,{transformers:r})})}}),eK=s(e=>(t,n,r)=>{const i=e(r);i.append(...n),t.replace(i),i.select(0,0)},"createBlockNode"),tK={dependencies:[Dd],export:s(e=>Yb(e)?"***":null,"export"),regExp:/^(---|\*\*\*|___)\s?$/,replace:s((e,t,n,r)=>{const i=$a();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},"replace"),type:"element"},nK=new Set([G1,J1,$3]);function rK(e,t){const n=[F3,V3,B3,H3,P3,K3,U3];if(e.includes("headings")){const r=Math.min(...t),i=Math.max(...t),o=new RegExp(`^(#{${r},${i}})\\s`),l={dependencies:[Ra],export:s((a,c)=>{if(!Md(a))return null;const u=Number(a.getTag().slice(1));return"#".repeat(u)+" "+c(a)},"export"),regExp:o,replace:eK(a=>{const c=`h${a[1].length}`;return Ar(c)}),type:"element"};n.push(l)}if(e.includes("thematicBreak")&&n.push(tK),e.includes("quote")&&n.push(L3),e.includes("link")&&n.push(W3),e.includes("lists")&&n.push(G1,J1,$3),e.includes("codeblock")){const r={...Al,dependencies:[Vd],replace:s((i,o,l)=>{const a=Va({code:"",language:l[1]??"",meta:""});i.selectPrevious(),i.replace(a),setTimeout(()=>{a.select()},80)},"replace")};n.push(r)}return n}s(rK,"pickTransformersForActivePlugins");var iK=/^(agent|project|user|skill|routine):\/\//,Bg=class Hg extends Vr{static{s(this,"MentionAwareLinkNode")}static getType(){return"mention-aware-link"}static clone(t){return new Hg(t.getURL(),{rel:t.getRel(),target:t.getTarget(),title:t.getTitle()},t.getKey())}static importJSON(t){return new Hg(t.url??"",{rel:t.rel??null,target:t.target??null,title:t.title??null})}constructor(t,n,r){super(t,n,r)}sanitizeUrl(t){return iK.test(t)?t:super.sanitizeUrl(t)}};function oK(e){return{url:e.getURL(),attributes:{rel:e.getRel(),target:e.getTarget(),title:e.getTitle()}}}s(oK,"getMentionAwareLinkNodeInit");var sK={replace:Vr,with:s(e=>{const{url:t,attributes:n}=oK(e);return new Bg(t,n)},"with"),withKlass:Bg};function ux(e){return!!(e&&St(e)&&qg(e.getURL()))}s(ux,"isMentionLinkNode");function uo(e){if(!e)return null;if(ux(e))return e;let t=e.getParent();for(;t;){if(ux(t))return t;t=t.getParent()}return null}s(uo,"findMentionLinkNode");function lK(e,t){const n=e.getNode(),r=uo(n);if(r)return r;if(e.type==="element"&&xe(n)){const i=t==="backward"?e.offset-1:e.offset;return i<0?null:uo(n.getChildAtIndex(i))}if(e.type==="text"&&Ie(n)){if(t==="backward"&&e.offset===0)return uo(n.getPreviousSibling());if(t==="forward"&&e.offset===n.getTextContentSize())return uo(n.getNextSibling())}return null}s(lK,"findMentionLinkNodeAtPoint");function aK(e){const t=re();if(!t)return null;if(He(t)){const[i]=t.getNodes();return i?uo(i):null}if(!ie(t))return null;const n=uo(t.anchor.getNode()),r=uo(t.focus.getNode());return n&&r&&n.is(r)?n:t.isCollapsed()?lK(t.anchor,e):null}s(aK,"findMentionLinkForDeletion");function cK(e){const t=aK(e);if(!t)return!1;const n=t.getPreviousSibling(),r=t.getNextSibling(),i=t.getParentOrThrow();return t.remove(),e==="backward"?n?(n.selectEnd(),!0):r?(r.selectStart(),!0):(i.selectStart(),!0):r?(r.selectStart(),!0):n?(n.selectEnd(),!0):(i.selectEnd(),!0)}s(cK,"deleteSelectedMentionChip");function dx(e,t){return cK(e)?(t?.preventDefault(),t?.stopPropagation(),!0):!1}s(dx,"handleMentionDelete");var uK=En({init(e){e.pub(Od,[t=>t.registerCommand(vd,n=>dx("backward",n),Jl),t=>t.registerCommand(lm,n=>dx("forward",n),Jl)])}}),dK=[/^#{1,6}\s+/m,/^>\s+/m,/^[-*+]\s+/m,/^\d+\.\s+/m,/^```/m,/^~~~/m,/^\|.+\|$/m,/^---$/m,/^\*\*\*$/m,/^___$/m];function fK(e){return e.replace(/\r\n?/g,`
71
+ `)}s(fK,"normalizePastedMarkdown");function J3(e){const t=fK(e).trim();return t?dK.some(n=>n.test(t)):!1}s(J3,"looksLikeMarkdownPaste");function G3(e){let t=e.replace(/\r\n/g,`
72
+ `).replace(/\r/g,`
73
+ `);const n=t.split(`
74
+ `);if(n.length<=1)return t;let r=1/0,i=null;for(const o of n){if(o.trim()==="")continue;const l=o.match(/^(\s+)/);if(l){const a=l[1],c=a.includes(" ")?"tabs":"spaces";if(i&&i!==c)return t;i=c,r=Math.min(r,a.length)}else{r=0;break}}return r>0&&r<1/0&&(t=n.map(o=>o.trim()===""?"":o.slice(r)).join(`
75
+ `)),t}s(G3,"normalizeMarkdown");var hK=/[A-Za-z!/?]/,gK=/^( {0,3}(?:(?:> ?|(?:[-+*]|\d{1,9}[.)]) +))*)(`{3,}|~{3,})(.*)$/,pK=/(?:[-+*]|\d{1,9}[.)]) +/g,mK=/>/g,_K=/^( *)(`{3,}|~{3,})[ \t]*$/,vK=/^ {0,3}(?:> ?)+/,yK=/^(?: {4}|\t)/,xK=/^<[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\s<>\x00-\x1f]*>/,CK=/^<[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>/,bK=/^<[^<>\n]*>/;function fx(e){return e!==void 0&&hK.test(e)}s(fx,"isHtmlOpener");function EK(e,t){let n=e;for(let r=0;r<t;r+=1){const i=/^ {0,3}> ?/.exec(n);if(!i)return null;n=n.slice(i[0].length)}return n}s(EK,"stripBlockquotePrefix$1");function SK(e,t,n){let r=t;for(;r<e.length;){if(e[r]!=="`"){r+=1;continue}let i=1;for(;e[r+i]==="`";)i+=1;if(i===n)return r+i;r+=i}return-1}s(SK,"findCodeSpanEnd");function hx(e,t){const n=xK.exec(e)??CK.exec(e);if(n)return n[0];if(t.endsWith("](")){const r=bK.exec(e);if(r)return r[0]}return null}s(hx,"matchProtectedConstruct");function TK(e,t){let n="",r=0;for(;r<e.length;){const i=e[r];if(i==="`"){let o=1;for(;e[r+o]==="`";)o+=1;const l=SK(e,r+o,o);if(l!==-1){n+=e.slice(r,l),r=l;continue}n+=e.slice(r,r+o),r+=o;continue}if(i==="\\"){if(t==="unescape"&&e[r+1]==="<"&&fx(e[r+2])&&hx(e.slice(r+1),n)===null){n+="<",r+=2;continue}n+=e.slice(r,r+2),r+=2;continue}if(t==="escape"&&i==="<"&&fx(e[r+1])){const o=hx(e.slice(r),n);if(o){n+=o,r+=o.length;continue}n+="\\<",r+=1;continue}n+=i,r+=1}return n}s(TK,"transformInlineChunk");function q3(e,t){const n=e.split(`
76
+ `),r=[];let i=[];const o=s(()=>{i.length!==0&&(r.push(TK(i.join(`
77
+ `),t)),i=[])},"flushChunk");let l="",a=0,c=0,u=3,d=!1;for(const f of n){if(l){o(),r.push(f);const p=EK(f,c),_=p?_K.exec(p):null;if(_){const y=_[1].length,v=_[2];y<=u&&v[0]===l&&v.length>=a&&(l="",a=0,c=0,u=3)}continue}const h=gK.exec(f);if(h){const p=h[1],_=h[2],y=_[0],v=h[3];if(!(y==="`"&&v.includes("`"))){const x=p.match(pK)??[];o(),r.push(f),l=y,a=_.length,c=(p.match(mK)??[]).length,u=(x.length>0?x.reduce((C,b)=>C+b.length,0):0)+3,d=!1;continue}}const g=f.replace(vK,"");if(g.trim().length===0){o(),r.push(f),d=!1;continue}if(!d&&yK.test(g)){o(),r.push(f);continue}d=!0,i.push(f)}return o(),r.join(`
78
+ `)}s(q3,"transformAngleBrackets");function Kg(e){return e.includes("<")?q3(e,"escape"):e}s(Kg,"escapeUnsupportedAngleBrackets");function wK(e){return e.includes("\\<")?q3(e,"unescape"):e}s(wK,"unescapeAngleBracketEscapes");var kK=/^( {0,3}(?:(?:> ?|(?:[-+*]|\d{1,9}[.)]) +))*)(`{3,}|~{3,})(.*)$/,MK=/(?:[-+*]|\d{1,9}[.)]) +/g,AK=/>/g,IK=/^( *)(`{3,}|~{3,})[ \t]*$/,gx=/^( {0,3})\\>/;function NK(e,t){let n=e;for(let r=0;r<t;r+=1){const i=/^ {0,3}> ?/.exec(n);if(!i)return null;n=n.slice(i[0].length)}return n}s(NK,"stripBlockquotePrefix");function Z3(e){if(!e.includes("\\>"))return e;const t=e.split(`
79
+ `);let n="",r=0,i=0,o=3;for(let l=0;l<t.length;l+=1){const a=t[l];if(n){const u=NK(a,i),d=u?IK.exec(u):null;if(d){const f=d[1].length,h=d[2];f<=o&&h[0]===n&&h.length>=r&&(n="",r=0,i=0,o=3)}continue}const c=kK.exec(a);if(c){const u=c[1],d=c[2],f=d[0],h=c[3];if(!(f==="`"&&h.includes("`"))){const g=u.match(MK)??[];n=f,r=d.length,i=(u.match(AK)??[]).length,o=(g.length>0?g.reduce((p,_)=>p+_.length,0):0)+3;continue}}gx.test(a)&&(t[l]=a.replace(gx,"$1>"))}return t.join(`
80
+ `)}s(Z3,"unescapeBlockquoteMarkers");var OK=En({init(e){e.pub(Od,[t=>{let n=!1;return t.registerCommand(Gl,r=>{if(n)return n=!1,!1;const i=r instanceof ClipboardEvent?r.clipboardData:null;if(!i)return!1;const o=i.getData("text/plain");if(!o||i.getData("text/html")||J3(o))return!1;const l=G3(o);if(l===o)return!1;r instanceof ClipboardEvent&&r.preventDefault();const a=new DataTransfer;a.setData("text/plain",l);const c=new ClipboardEvent("paste",{clipboardData:a,bubbles:!0,cancelable:!0});return n=!0,t.dispatchCommand(Gl,c),!0},Rr)}])}}),DK={list:s((e,t={})=>{const n=new URLSearchParams;t.q&&n.set("q",t.q),t.sort&&n.set("sort",t.sort),t.scope&&n.set("scope",t.scope);for(const i of t.categories??[])n.append("categories[]",i);for(const i of t.include??[])n.append("include[]",i);const r=n.toString();return Ce.get(`/companies/${encodeURIComponent(e)}/skills${r?`?${r}`:""}`)},"list"),categories:s(e=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/categories`),"categories"),detail:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`),"detail"),versions:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/versions`),"versions"),version:s((e,t,n)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/versions/${encodeURIComponent(n)}`),"version"),createVersion:s((e,t,n={})=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/versions`,n),"createVersion"),testInputs:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-inputs`),"testInputs"),createTestInput:s((e,t,n)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-inputs`,n),"createTestInput"),updateTestInput:s((e,t,n,r)=>Ce.patch(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-inputs/${encodeURIComponent(n)}`,r),"updateTestInput"),deleteTestInput:s((e,t,n)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-inputs/${encodeURIComponent(n)}`),"deleteTestInput"),testRunTemplates:s(e=>Ce.get(`/companies/${encodeURIComponent(e)}/skill-test-run-templates`),"testRunTemplates"),createTestRunTemplate:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skill-test-run-templates`,t),"createTestRunTemplate"),updateTestRunTemplate:s((e,t,n)=>Ce.patch(`/companies/${encodeURIComponent(e)}/skill-test-run-templates/${encodeURIComponent(t)}`,n),"updateTestRunTemplate"),deleteTestRunTemplate:s((e,t)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skill-test-run-templates/${encodeURIComponent(t)}`),"deleteTestRunTemplate"),testRuns:s((e,t,n={})=>{const r=new URLSearchParams;n.inputId&&r.set("inputId",n.inputId);const i=r.toString();return Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-runs${i?`?${i}`:""}`)},"testRuns"),testRunDetail:s((e,t,n)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-runs/${encodeURIComponent(n)}`),"testRunDetail"),createTestRun:s((e,t,n)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-runs`,n),"createTestRun"),cancelTestRun:s((e,t,n)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-runs/${encodeURIComponent(n)}/cancel`,{}),"cancelTestRun"),deleteTestRun:s((e,t,n)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/test-runs/${encodeURIComponent(n)}`),"deleteTestRun"),star:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/star`,{}),"star"),unstar:s((e,t)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/star`),"unstar"),fork:s((e,t,n={})=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/fork`,n),"fork"),forkPrecheck:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/fork-precheck`),"forkPrecheck"),comments:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/comments`),"comments"),createComment:s((e,t,n)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/comments`,n),"createComment"),updateComment:s((e,t,n,r)=>Ce.patch(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/comments/${encodeURIComponent(n)}`,r),"updateComment"),deleteComment:s((e,t,n)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/comments/${encodeURIComponent(n)}`),"deleteComment"),updateStatus:s((e,t)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/update-status`),"updateStatus"),file:s((e,t,n)=>Ce.get(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/files?path=${encodeURIComponent(n)}`),"file"),updateFile:s((e,t,n,r,i={})=>Ce.patch(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/files`,{path:n,content:r,...i}),"updateFile"),deleteFile:s((e,t,n)=>Ce.deleteWithBody(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/files`,n),"deleteFile"),create:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills`,t),"create"),update:s((e,t,n)=>Ce.patch(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`,n),"update"),importFromSource:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/import`,{source:t}),"importFromSource"),browseProject:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/browse-project`,t),"browseProject"),scanProjects:s((e,t={})=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/scan-projects`,t),"scanProjects"),installUpdate:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}/install-update`,{}),"installUpdate"),delete:s((e,t)=>Ce.delete(`/companies/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}`),"delete"),catalogList:s((e={})=>{const t=new URLSearchParams;e.kind&&t.set("kind",e.kind),e.category&&t.set("category",e.category),e.q&&t.set("q",e.q);const n=t.toString();return Ce.get(`/skills/catalog${n?`?${n}`:""}`)},"catalogList"),catalogDetail:s(e=>Ce.get(`/skills/catalog/${encodeURIComponent(e)}`),"catalogDetail"),catalogFile:s((e,t="SKILL.md")=>Ce.get(`/skills/catalog/${encodeURIComponent(e)}/files?path=${encodeURIComponent(t)}`),"catalogFile"),installCatalog:s((e,t)=>Ce.post(`/companies/${encodeURIComponent(e)}/skills/install-catalog`,t),"installCatalog")},RK=["/steer","/queue"];function LK(e){return RK.includes(e)}s(LK,"isDeliveryCommand");var $K=["goal","steer","queue"];function px(e){return $K.includes(e)}s(px,"isAbsorbableCommand");function mx(e,t){return e===""||e===t?!0:t==="goal"&&e==="go"}s(mx,"labelMatchesCommand");function PK(e){const t=e.trim(),n=t.match(/^\[\/([A-Za-z]*)[ \t\u00a0]*\]\(<(\/[A-Za-z]+(?:[ \t\u00a0].*)?)>\)$/s);if(n){const i=n[1],o=n[2].replaceAll(" "," "),l=o.slice(1).split(/[ \t]/)[0]??"";return px(l)&&mx(i,l)?o:t.replaceAll(" "," ")}const r=t.match(/^\[\/([A-Za-z]*)[ \t\u00a0]*\]\((\/[A-Za-z]+(?:%20|%C2%A0).*)\)$/s);if(r){const i=r[1],o=r[2],l=decodeURIComponent(o.slice(1).split(/(?:%20|%C2%A0)/)[0]??"");if(px(l)&&mx(i,l))try{return decodeURIComponent(o).replaceAll(" "," ")}catch{return t}}return t.replaceAll(" "," ")}s(PK,"normalizeComposerCommandText");function Rz(e){const t=PK(e);if(!t)return{matched:!1};const n=t.search(/\s/),r=n===-1?t:t.slice(0,n);if(!LK(r))return{matched:!1};const i=n===-1?"":t.slice(n).trim();return i?{matched:!0,command:{mode:r.slice(1),prompt:i}}:{matched:!0,error:`${r} needs a message. Type ${r} followed by what you want to send.`}}s(Rz,"parseMessageDeliveryCommand");var FK=[{id:"action:steer",kind:"action",command:"steer",name:"Steer",description:"Send into the agent's running turn now.",aliases:["steer","steering","steered","now"]},{id:"action:queue",kind:"action",command:"queue",name:"Queue",description:"Queue for the next turn boundary.",aliases:["queue","queued","later","next"]}],VK={not_requested:"",board_only:"an agent cannot steer the turn running its own task, and board steering needs a signed-in board user.",identity_mismatch:"the message answers to a different user than the running turn does.",no_active_run:"there was no active run to steer.",legacy_protocol:"this runner's session protocol cannot accept a mid-turn steer.",conversation_order:"an earlier chat message is still waiting, or this message resets the chat, so it keeps its place in line.",steering_failed:"the steer did not land, so the message is queued and will be read at the next turn."},BK="this task could not be steered mid-turn.";function Lz(e){if(!e||e.deliveredAs==="steered")return null;const t=e.steeringUnavailable??null;return!t||t==="not_requested"?null:`Queued instead of steering the running turn — ${VK[t]??BK}`}s(Lz,"describeDeliveryDowngrade");function $z(e){return e?.comment??void 0}s($z,"deliveryDispositionFromIssueUpdate");var Y3=(0,m.createContext)({slashCommands:[]});function Pz({children:e}){const{selectedCompanyId:t}=yk(),{data:n=[]}=Y1({queryKey:t?Z1.companySkills.list(t):["company-skills","__none__"],queryFn:s(()=>DK.list(t),"queryFn"),enabled:!!t}),{data:r=[]}=Y1({queryKey:t?Z1.routines.list(t):["routines","__none__","__all-projects__"],queryFn:s(()=>lM.list(t),"queryFn"),enabled:!!t}),i=(0,m.useMemo)(()=>({slashCommands:[...FK,...n.map(o=>({id:`skill:${o.id}`,kind:"skill",skillId:o.id,key:o.key,name:o.name,slug:o.slug,description:o.description??null,href:Fk(o.id,o.slug),aliases:[o.slug,o.name,o.key]})),...r.filter(o=>o.status!=="archived").sort((o,l)=>o.title.localeCompare(l.title)).map(o=>({id:`routine:${o.id}`,kind:"routine",routineId:o.id,name:o.title,status:o.status,href:Sx(o.id),aliases:[`routine:${o.title}`,o.title,o.id]}))]}),[n,r]);return(0,ee.jsx)(Y3.Provider,{value:i,children:e})}s(Pz,"EditorAutocompleteProvider");function HK(){return(0,m.useContext)(Y3)}s(HK,"useEditorAutocomplete");var Fz=xx({MarkdownEditor:s(()=>hU,"MarkdownEditor"),computeMentionMenuPosition:s(()=>nk,"computeMentionMenuPosition"),findClosestAutocompleteAnchor:s(()=>ak,"findClosestAutocompleteAnchor"),findMentionMatch:s(()=>tk,"findMentionMatch"),isSameAutocompleteSession:s(()=>lk,"isSameAutocompleteSession"),issueMentionTitle:s(()=>ik,"issueMentionTitle"),placeCaretAfterMentionAnchor:s(()=>ck,"placeCaretAfterMentionAnchor"),placeCaretAtEditableEnd:s(()=>uk,"placeCaretAtEditableEnd"),shouldAcceptAutocompleteKey:s(()=>sk,"shouldAcceptAutocompleteKey")}),KK=class extends m.Component{static{s(this,"MarkdownEditorRichErrorBoundary")}state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e)}render(){return this.state.hasError?null:this.props.children}};function zf(e,t){const n=new RegExp(`${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);return n?.[2]??n?.[3]??n?.[4]??null}s(zf,"readHtmlAttribute");function UK(e){return e==="delete_small"?(0,ee.jsx)(kk,{"aria-hidden":!0}):wS[e]}s(UK,"editorIconFor");function WK(e){return e.replace(/<img\b([^>]*?)\/?>/gi,(t,n)=>{const r=zf(n,"src");if(!r)return t;const i=zf(n,"alt")??"image",o=zf(n,"title"),l=i.replace(/[[\]]/g,"\\$&"),a=o?.replace(/"/g,'\\"');return a?`![${l}](${r} "${a}")`:`![${l}](${r})`})}s(WK,"convertHtmlImagesToMarkdown");function _x(e){const t=e.replace(/\r\n/g,`
81
+ `).replace(/\r/g,`
82
+ `),n=WK(Z3(t));return Kg(n)}s(_x,"prepareMarkdownForEditor");function gc(e){return wK(Z3(e))}s(gc,"toStoredMarkdown");function zK(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(zK,"escapeRegExp");function X3(e){if(!e)return!1;if(e.nodeType===Node.TEXT_NODE)return(e.textContent??"").trim().length>0;if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return["IMG","HR","TABLE","VIDEO","IFRAME"].includes(t.tagName)?!0:Array.from(t.childNodes).some(n=>X3(n))}s(X3,"hasMeaningfulEditorContent");function jK(e){return/!\[[\s\S]*?\]\([^)]+\)/.test(e)}s(jK,"hasMarkdownImage");function JK(e,t,n){const r=t.trim();if(!r)return!1;const i=jK(r),o=(e.textContent??"").trim();if(o.length===0)return i?!1:!Array.from(e.childNodes).some(a=>X3(a));const l=n?.trim();return l&&o===l&&r!==l?!i:!1}s(JK,"isRichEditorDomEmpty");function GK(e){const t=e.trim();return t?!/^(javascript|data|vbscript):/i.test(t):!0}s(GK,"isSafeMarkdownLinkUrl");function vx(e){return e instanceof Error?e.message:typeof e=="string"?e:"Rich editor failed to render"}s(vx,"richEditorErrorMessage");var qK=100,ZK=200,Q3=188,ek=208,jf=8,YK=34,XK=8,yx=50,QK=10,eU={txt:"Text",md:"Markdown",js:"JavaScript",jsx:"JavaScript (JSX)",ts:"TypeScript",tsx:"TypeScript (TSX)",json:"JSON",bash:"Bash",sh:"Shell",python:"Python",go:"Go",rust:"Rust",sql:"SQL",html:"HTML",css:"CSS",yaml:"YAML",yml:"YAML"},tU={priority:0,match:s(()=>!0,"match"),Editor:g3};function tk(e,t){let n=-1,r=null,i=null;for(let l=t-1;l>=0;l--){const a=e[l];if(a==="@"||a==="/"){(l===0||/\s/.test(e[l-1]))&&(n=l,r=a==="@"?"mention":"skill",i=a);break}if(a===`
83
+ `||a==="\r")break}if(n===-1)return null;const o=e.slice(n+1,t);return r==="skill"&&/\s/.test(o)&&!o.toLowerCase().startsWith("routine:")?null:{trigger:r??"mention",marker:i??"@",query:o,atPos:n,endPos:t}}s(tk,"findMentionMatch");function nU(e,t,n){const r=e.textContent?.length??0,i=s((o,l,a)=>{if(o<0||l>r||l<=o)return null;const c=document.createRange();c.setStart(e,o),c.setEnd(e,l);const u=c.getBoundingClientRect();return u.width===0&&u.height===0?null:{top:u.top,bottom:u.bottom,x:a==="right"?u.right:u.left}},"rectFromRange");return i(Math.max(0,t-1),t,"right")??i(t,Math.min(r,t+1),"left")??i(n,n+1,"right")??{top:0,bottom:0,x:0}}s(nU,"measureCaretRect");function rU(e){const t=window.getSelection();if(!t||t.rangeCount===0||!t.isCollapsed)return null;const n=t.getRangeAt(0),r=n.startContainer;if(r.nodeType!==Node.TEXT_NODE||!e.contains(r))return null;const i=r.textContent??"",o=n.startOffset,l=tk(i,o);if(!l)return null;const a=nU(r,o,l.atPos),c=e.getBoundingClientRect();return{trigger:l.trigger,marker:l.marker,query:l.query,top:a.top-c.top,left:a.x-c.left,viewportTop:a.top,viewportBottom:a.bottom,viewportLeft:a.x,textNode:r,atPos:l.atPos,endPos:l.endPos}}s(rU,"detectMention");function iU(){const e=window.visualViewport;return e?{offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,width:e.width,height:e.height}:{offsetLeft:0,offsetTop:0,width:window.innerWidth,height:window.innerHeight}}s(iU,"getMentionMenuViewport");function nk(e,t,n={width:Q3,height:ek}){const r=t.offsetLeft+jf,i=t.offsetLeft+t.width-n.width,o=t.offsetTop+jf,l=t.offsetTop+t.height-n.height,a=t.offsetTop+e.viewportTop;let c;if(a>l){const h=t.offsetTop+e.viewportBottom-n.height;c=Math.max(o,Math.min(h,l))}else c=Math.max(o,a);const u=t.offsetLeft+e.viewportLeft+QK,d=Math.max(r,Math.min(u,i)),f=Math.max(0,t.offsetLeft+t.width-jf-d);return{top:c,left:d,maxWidth:f}}s(nk,"computeMentionMenuPosition");function oU(e){return{width:Q3,height:Math.min(ek,Math.max(1,Math.min(e,8))*YK+XK)}}s(oU,"getMentionMenuSize");var sU=["pre","code",".cm-editor",".cm-content","[class*='codeMirrorWrapper']","[class*='codeBlockEditor']"].join(",");function Ug(e,t){return!t||!e.contains(t)?!1:!!(t instanceof Element?t:t.parentElement)?.closest(sU)}s(Ug,"nodeInsideCodeLike");function rk(e){if(!e)return!1;const t=window.getSelection();if(!t)return!1;for(const n of[t.anchorNode,t.focusNode])if(Ug(e,n))return!0;return!1}s(rk,"isSelectionInsideCodeLikeElement");function lU(e,t){if(!e)return!1;if(t.target instanceof Node&&Ug(e,t.target))return!0;const n=typeof document<"u"?document.activeElement:null;return n instanceof Node&&Ug(e,n)?!0:rk(e)}s(lU,"isPasteInsideCodeLikeElement");function ik(e){const t=e.name.trim(),n=e.issueIdentifier?.trim();return n&&t.toLowerCase().startsWith(n.toLowerCase())?t.slice(n.length).trim():t}s(ik,"issueMentionTitle");function aU(e){if(e.kind==="issue"&&e.issueIdentifier)return`[${e.issueIdentifier}](${Tk(e.issueIdentifier)}) `;if(e.kind==="project"&&e.projectId)return`[@${e.name}](${Vk(e.projectId,e.projectColor??null)}) `;if(e.kind==="user"&&e.userId)return`[@${e.name}](${Dk(e.userId)}) `;const t=e.agentId??e.id.replace(/^agent:/,"");return`[@${e.name}](${Nk(t,e.agentIcon??null)}) `}s(aU,"mentionMarkdown");function ok(e){return e.kind==="routine"?`/routine:${e.name}`:e.kind==="action"?`/${e.command}`:`/${e.slug}`}s(ok,"slashCommandLabel");function cU(e){return e.kind==="action"?`/${e.command} `:e.kind==="routine"?`[${ok(e)}](${Sx(e.routineId)}) `:`[/${e.slug}](${e.href}) `}s(cU,"slashCommandMarkdown");function uU(e){return e.kind==="skill"||e.kind==="routine"||e.kind==="action"?cU(e):aU(e)}s(uU,"autocompleteMarkdown");function sk(e,t,n=!1){return e==="Tab"?!0:e!=="Enter"?!1:t==="mention"||t==="skill"&&n}s(sk,"shouldAcceptAutocompleteKey");function lk(e,t){return!e||!t?!1:e.trigger===t.trigger&&e.marker===t.marker&&e.query===t.query&&e.textNode===t.textNode&&e.atPos===t.atPos&&e.endPos===t.endPos}s(lk,"isSameAutocompleteSession");function dU(e,t){if(e.kind==="action")return!1;const n=qg(t);if(!n)return!1;if(e.kind==="skill")return n.kind==="skill"&&n.skillId===e.skillId;if(e.kind==="routine")return n.kind==="routine"&&n.routineId===e.routineId;if(e.kind==="issue"&&e.issueIdentifier)return n.kind==="issue"&&n.identifier===e.issueIdentifier;if(e.kind==="project"&&e.projectId)return n.kind==="project"&&n.projectId===e.projectId;if(e.kind==="user"&&e.userId)return n.kind==="user"&&n.userId===e.userId;const r=e.agentId??e.id.replace(/^agent:/,"");return n.kind==="agent"&&n.agentId===r}s(dU,"autocompleteOptionMatchesLink");function ak(e,t,n){const r=Array.from(e.querySelectorAll("a")).filter(o=>o instanceof HTMLAnchorElement).filter(o=>dU(t,o.getAttribute("href")??""));if(r.length===0)return null;if(!n)return r[0]??null;const i=e.getBoundingClientRect();return r.sort((o,l)=>{const a=o.getBoundingClientRect(),c=l.getBoundingClientRect(),u=a.left-i.left,d=a.top-i.top,f=c.left-i.left,h=c.top-i.top;return Math.hypot(u-n.left,d-n.top)-Math.hypot(f-n.left,h-n.top)})[0]??null}s(ak,"findClosestAutocompleteAnchor");function ck(e){const t=window.getSelection();if(!t)return!1;const n=document.createRange(),r=e.nextSibling;if(r?.nodeType===Node.TEXT_NODE){const i=r.textContent??"";if(i.startsWith(" "))return n.setStart(r,1),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!0;if(i.length>0)return n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!0}return n.setStartAfter(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!0}s(ck,"placeCaretAfterMentionAnchor");function uk(e){const t=window.getSelection();if(!t)return!1;const n=document.createRange();return n.selectNodeContents(e),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!0}s(uk,"placeCaretAtEditableEnd");function fU(e,t,n){const r=`${t.marker}${t.query}`,i=uU(n),o=e.lastIndexOf(r);return o===-1?e:e.slice(0,o)+i+e.slice(o+r.length)}s(fU,"applyMention");var hU=(0,m.forwardRef)(s(function({value:t,onChange:n,ariaLabel:r,placeholder:i,className:o,contentClassName:l,onBlur:a,imageUploadHandler:c,onDropFile:u,fileDropTarget:d="editor",bordered:f=!0,mentions:h,actionCommands:g=[],onSubmit:p,readOnly:_=!1},y){const v=(0,m.useMemo)(()=>_x(t),[t]),{slashCommands:x}=HK(),C=(0,m.useMemo)(()=>[...g,...x],[g,x]),b=(0,m.useRef)(null),S=(0,m.useRef)(null),M=(0,m.useRef)(null),T=(0,m.useRef)(v);T.current=v;const E=(0,m.useRef)(v),A=(0,m.useRef)(!0),D=(0,m.useRef)(null),[L,G]=(0,m.useState)(null),[$,z]=(0,m.useState)(!1),[W,ye]=(0,m.useState)(null),q=(0,m.useRef)(0),ge=(0,m.useRef)(c);ge.current=c;const[me,oe]=(0,m.useState)(null),Z=(0,m.useRef)(null),[pe,de]=(0,m.useState)(0),ce=(0,m.useRef)([]),j=(0,m.useRef)(!1),ne=(0,m.useRef)(!1),ue=me!==null&&(me.trigger==="mention"&&!!h?.length||me.trigger==="skill"&&C.length>0),Ne=(0,m.useMemo)(()=>{const R=new Map;for(const Y of h??[]){if(Y.kind==="agent"){const be=Y.agentId??Y.id.replace(/^agent:/,"");R.set(`agent:${be}`,Y)}Y.kind==="user"&&Y.userId&&R.set(`user:${Y.userId}`,Y),Y.kind==="project"&&Y.projectId&&R.set(`project:${Y.projectId}`,Y)}return R},[h]),$e=(0,m.useCallback)(R=>{S.current=R,R&&T.current!==E.current&&(D.current=T.current,R.setMarkdown(T.current),E.current=T.current)},[]),Re=(0,m.useMemo)(()=>{if(!me)return[];const R=me.query.trim().toLowerCase();return me.trigger==="skill"?C.filter(Y=>R?Y.aliases.some(be=>be.toLowerCase().includes(R)):!0).slice(0,yx):h?h.filter(Y=>Y.name.toLowerCase().includes(R)).slice(0,yx):[]},[me,h,C]),Pe=(0,m.useCallback)(R=>{if(_)return;if(!W&&S.current){const N=S.current,O=Kg(R);N.focus(()=>N.insertMarkdown(O),{defaultSelection:"rootEnd"});return}const Y=M.current;if(!Y){n(`${t}${R}`);return}const be=Y.selectionStart??t.length,k=Y.selectionEnd??t.length;n(`${t.slice(0,be)}${R}${t.slice(k)}`),requestAnimationFrame(()=>{Y.focus();const N=be+R.length;Y.setSelectionRange(N,N)})},[n,_,W,t]);(0,m.useImperativeHandle)(y,()=>({focus:s(()=>{if(W){M.current?.focus();return}S.current?.focus(void 0,{defaultSelection:"rootEnd"})},"focus"),insertMarkdown:Pe,clear:s(()=>{E.current="",D.current="",S.current?.setMarkdown(""),M.current&&(M.current.value="")},"clear")}),[Pe,W]);const rt=(0,m.useCallback)(R=>{R&&(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[]);(0,m.useEffect)(()=>{W&&rt(M.current)},[rt,W,t]),(0,m.useEffect)(()=>{if(W||v.trim().length===0)return;const R=b.current;if(!R)return;let Y=0,be=0,k=0;const N=s(()=>{const U=R.querySelector('[contenteditable="true"]');if(!(U instanceof HTMLElement))return!1;const se=document.activeElement;return se===U||U.contains(se)?!1:JK(U,v,i)},"looksEmpty"),O=s(()=>{window.clearTimeout(Y),window.clearTimeout(be),Y=window.setTimeout(()=>{if(!N())return;const U=k;be=window.setTimeout(()=>{k===U&&N()&&ye({code:"MDE-EMPTY",message:"Rich editor failed to load content"})},ZK)},qK)},"scheduleCheck");O();const H=new MutationObserver(()=>{k+=1,O()});return H.observe(R,{subtree:!0,childList:!0,characterData:!0}),()=>{window.clearTimeout(Y),window.clearTimeout(be),H.disconnect()}},[v,i,W]);const Je=!!c,pt=(0,m.useMemo)(()=>{const R=Je?async be=>{const k=ge.current;if(!k)throw new Error("No image upload handler");try{const N=await k(be);return G(null),setTimeout(()=>{const O=E.current,H=zK(N),U=O.replace(new RegExp(`(!\\[[^\\]]*\\]\\(${H}\\))(?!\\n\\n)`,"g"),`$1
84
+
85
+ `);U!==O&&(E.current=U,D.current=U,S.current?.setMarkdown(U),n(gc(U)),requestAnimationFrame(()=>{S.current?.focus(void 0,{defaultSelection:"rootEnd"})}))},100),N}catch(N){const O=N instanceof Error?N.message:"Image upload failed";throw G(O),N}}:void 0,Y=[VR(),uL(),VP(),kL(),zL({validateUrl:GK}),yH(),uK(),OK(),jR(),qP({defaultCodeBlockLanguage:"txt",codeBlockEditorDescriptors:[tU]}),pH({codeBlockLanguages:eU}),QH()];return R&&Y.push(AP({imageUploadHandler:R,disableImageSettingsButton:!0})),Y},[Je]);(0,m.useEffect)(()=>{v!==E.current&&S.current&&(D.current=v,S.current.setMarkdown(v),E.current=v)},[v]);const It=(0,m.useCallback)(()=>{const R=b.current?.querySelector('[contenteditable="true"]');if(!R)return;const Y=R.querySelectorAll("a");for(const be of Y){const k=be,N=qg(k.getAttribute("href")??"");if(!N){$k(k);continue}if(N.kind==="project"){const H=Ne.get(`project:${N.projectId}`);Ua(k,{...N,color:N.color??H?.projectColor??null});continue}if(N.kind==="skill"||N.kind==="routine"){Ua(k,N);continue}if(N.kind==="user"||N.kind==="issue"){Ua(k,N);continue}const O=Ne.get(`agent:${N.agentId}`);Ua(k,{...N,appearance:O?.agentAppearance})}},[Ne]),ut=(0,m.useCallback)(()=>{if(!b.current||rk(b.current)){Z.current=null,j.current=!1,oe(null);return}const R=rU(b.current);if(R&&R.trigger==="mention"&&(!h||h.length===0)){Z.current=null,j.current=!1,oe(null);return}if(R&&R.trigger==="skill"&&C.length===0){Z.current=null,j.current=!1,oe(null);return}const Y=Z.current,be=lk(Y,R);Z.current=R,be||(j.current=!1,de(0)),oe(R)},[h,C.length]);(0,m.useEffect)(()=>{if((!h||h.length===0)&&C.length===0)return;const R=b.current,Y=s(()=>requestAnimationFrame(ut),"onInput");return document.addEventListener("selectionchange",ut),R?.addEventListener("input",Y,!0),()=>{document.removeEventListener("selectionchange",ut),R?.removeEventListener("input",Y,!0)}},[ut,h,C.length]),(0,m.useEffect)(()=>{if(!ue)return;const R=s(()=>requestAnimationFrame(ut),"updatePosition"),Y=window.visualViewport;return Y?.addEventListener("resize",R),Y?.addEventListener("scroll",R),window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),()=>{Y?.removeEventListener("resize",R),Y?.removeEventListener("scroll",R),window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)}},[ut,ue]),(0,m.useEffect)(()=>{if(!ue)return;if(ce.current.length=Re.length,pe>=Re.length){de(Math.max(0,Re.length-1));return}const R=ce.current[pe];!R||typeof R.scrollIntoView!="function"||R.scrollIntoView({block:"nearest"})},[Re.length,ue,pe]),(0,m.useEffect)(()=>{ue||(ne.current=!1)},[ue]),(0,m.useEffect)(()=>{const R=b.current?.querySelector('[contenteditable="true"]');if(!R)return;let Y=null,be=!1;const k=s(()=>{H.observe(R,{subtree:!0,childList:!0,characterData:!0})},"observe"),N=s(()=>{Y=null,!be&&(H.disconnect(),It(),be||k())},"flushDecorations"),O=s(()=>{Y===null&&(Y=requestAnimationFrame(N))},"scheduleDecorations"),H=new MutationObserver(()=>{O()});return N(),()=>{be=!0,H.disconnect(),Y!==null&&cancelAnimationFrame(Y)}},[It]);const jt=(0,m.useCallback)(R=>{const Y=Z.current;if(!Y||R.kind==="action"&&R.disabled)return!1;const be=E.current,k=fU(be,Y,R);k!==be&&(E.current=k,D.current=k,S.current?.setMarkdown(k),n(gc(k)));const N=s(O=>{const H=b.current?.querySelector('[contenteditable="true"]');if(!(H instanceof HTMLElement))return;if(It(),H.focus(),R.kind==="action"){uk(H);return}const U=ak(H,R,Y);if(!U){O>0&&requestAnimationFrame(()=>N(O-1));return}ck(U)},"restoreSelection");return requestAnimationFrame(()=>N(4)),Z.current=null,j.current=!1,oe(null),!0},[It,n]),Ge=(0,m.useCallback)((R,Y)=>{R.preventDefault(),R.stopPropagation(),!ne.current&&jt(Y)&&(ne.current=!0)},[jt]),yt=(0,m.useRef)(null),Nt=8,it=(0,m.useCallback)(R=>{const Y=R.touches[0];Y&&(yt.current={x:Y.clientX,y:Y.clientY})},[]),Yt=(0,m.useCallback)(R=>{const Y=yt.current;if(!Y)return;const be=R.touches[0];be&&Math.hypot(be.clientX-Y.x,be.clientY-Y.y)>Nt&&(yt.current=null)},[]),Ln=(0,m.useCallback)((R,Y)=>{const be=yt.current;if(yt.current=null,!be)return;const k=R.changedTouches[0];k&&(Math.hypot(k.clientX-be.x,k.clientY-be.y)>Nt||Ge(R,Y))},[Ge]);function Fe(R){return Array.from(R.dataTransfer?.types??[]).includes("Files")}s(Fe,"hasFilePayload");const $t=d==="editor"&&!!(c||u),$n=(0,m.useCallback)(R=>{const Y=R.clipboardData;if(!Y||!S.current)return;const be=new Set(Array.from(Y.types));if(be.has("Files")||be.has("text/html")||lU(b.current,R))return;const k=Y.getData("text/plain");J3(k)&&(R.preventDefault(),R.stopPropagation(),S.current.insertMarkdown(Kg(G3(k))))},[]),ze=(0,m.useCallback)(R=>{ye({code:"MDE-RENDER",message:vx(R)})},[]),I=(0,m.useCallback)(R=>{ye({code:"MDE-PARSE",message:vx(R)})},[]),Pn=me?nk(me,iU(),oU(Re.length)):null;return W?(0,ee.jsxs)("div",{ref:b,className:Yi("relative paperclip-mdxeditor-scope",f?"rounded-md border border-border bg-transparent":"bg-transparent",o),children:[(0,ee.jsxs)("div",{className:"flex items-start justify-between gap-3 px-3 pt-2 text-xs text-muted-foreground",children:[(0,ee.jsxs)("p",{children:["Rich editor unavailable for this markdown. Showing raw source instead."," ",(0,ee.jsx)("span",{"data-testid":"markdown-editor-fallback-code",className:"font-mono",children:W.code})]}),(0,ee.jsx)("button",{type:"button",className:"shrink-0 underline underline-offset-2 hover:text-foreground",onClick:s(()=>{A.current=!0,ye(null)},"onClick"),children:"Retry rich editor"})]}),(0,ee.jsx)("textarea",{ref:M,"aria-label":r,value:t,placeholder:i,readOnly:_,onChange:s(R=>{_||(n(R.target.value),rt(R.target))},"onChange"),onBlur:s(()=>a?.(),"onBlur"),onKeyDown:s(R=>{p&&R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),p())},"onKeyDown"),className:Yi("min-h-(--sz-12rem) w-full resize-none bg-transparent px-3 pb-3 pt-2 font-mono text-sm leading-6 outline-none",l)})]}):(0,ee.jsxs)("div",{ref:b,className:Yi("relative paperclip-mdxeditor-scope",f?"rounded-md border border-border bg-transparent":"bg-transparent",$&&"ring-1 ring-primary/60 bg-accent/20",o),onInputCapture:s(R=>{!_&&R.target instanceof HTMLElement&&R.target.closest('[contenteditable="true"]')&&(A.current=!1)},"onInputCapture"),onKeyDownCapture:s(R=>{if(!_){if((R.key==="Backspace"||R.key==="Delete")&&R.target instanceof HTMLElement&&R.target.closest('[contenteditable="true"]')&&(A.current=!1),p&&R.key==="Enter"&&(R.metaKey||R.ctrlKey)){R.preventDefault(),R.stopPropagation(),p();return}if(ue){if(R.key===" "&&Z.current?.trigger==="skill"){Z.current=null,j.current=!1,oe(null);return}if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),Z.current=null,j.current=!1,oe(null);return}if(Re.length>0){if(R.key==="ArrowDown"){R.preventDefault(),R.stopPropagation(),j.current=Z.current?.trigger==="skill",de(Y=>Math.min(Y+1,Re.length-1));return}if(R.key==="ArrowUp"){R.preventDefault(),R.stopPropagation(),j.current=Z.current?.trigger==="skill",de(Y=>Math.max(Y-1,0));return}if(sk(R.key,Z.current?.trigger??null,j.current)){R.preventDefault(),R.stopPropagation(),jt(Re[pe]);return}}}}},"onKeyDownCapture"),onDragEnter:s(R=>{_||!$t||!Fe(R)||(q.current+=1,z(!0))},"onDragEnter"),onDragOver:s(R=>{_||!$t||!Fe(R)||(R.preventDefault(),R.dataTransfer.dropEffect="copy")},"onDragOver"),onDragLeave:s(()=>{_||$t&&(q.current=Math.max(0,q.current-1),q.current===0&&z(!1))},"onDragLeave"),onDrop:s(R=>{if(_||(q.current=0,z(!1),!u))return;const Y=R.dataTransfer?.files;if(!Y||Y.length===0)return;const be=Array.from(Y),k=be.filter(N=>!N.type.startsWith("image/"));if(k.length!==0){k.length===be.length&&(R.preventDefault(),R.stopPropagation());for(const N of k)u(N)}},"onDrop"),onPasteCapture:$n,children:[(0,ee.jsx)(KK,{onError:ze,children:(0,ee.jsx)(DR,{ref:$e,translation:s((R,Y,be={})=>R==="contentArea.editableMarkdown"&&r?r:Object.entries(be).reduce((k,[N,O])=>k.replaceAll(`{{${N}}}`,String(O)),Y),"translation"),markdown:v,iconComponentFor:UK,suppressHtmlProcessing:!0,placeholder:i,readOnly:_,onChange:s(R=>{if(_)return;const Y=gc(R),be=D.current;if(be!==null&&(D.current=null,Y===be||Y===gc(be))){E.current=be;return}if(A.current&&(A.current=!1,Y===""&&v!=="")){D.current=v,S.current?.setMarkdown(v);return}E.current=_x(Y),n(Y)},"onChange"),onBlur:s(()=>a?.(),"onBlur"),onError:s(R=>{I(R.error)},"onError"),className:Yi("paperclip-mdxeditor",!f&&"paperclip-mdxeditor--borderless"),contentEditableClassName:Yi("paperclip-mdxeditor-content focus:outline-none [&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li]:list-item",l),additionalLexicalNodes:[Bg,sK],plugins:pt})}),ue&&Re.length>0&&Pn&&(0,Bc.createPortal)((0,ee.jsx)("div",{"data-paperclip-floating-ui":"","data-testid":"mention-autocomplete-menu",className:"pointer-events-auto fixed z-(--z-9999) min-w-(--sz-180px) max-w-(--sz-calc-15) max-h-(--sz-208px) overflow-y-auto overscroll-contain rounded-md border border-border bg-popover shadow-md",style:{top:Pn.top,left:Pn.left,maxWidth:Pn.maxWidth,touchAction:"pan-y",WebkitOverflowScrolling:"touch"},onWheelCapture:s(R=>{R.stopPropagation()},"onWheelCapture"),onTouchMove:s(R=>{R.stopPropagation()},"onTouchMove"),children:Re.map((R,Y)=>(0,ee.jsxs)("button",{type:"button",tabIndex:-1,disabled:R.kind==="action"&&R.disabled===!0,"aria-disabled":R.kind==="action"&&R.disabled===!0,title:R.kind==="action"&&R.disabled?R.disabledReason??void 0:void 0,ref:s(be=>{ce.current[Y]=be},"ref"),className:Yi("flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-accent/50 transition-colors",Y===pe&&"bg-accent",R.kind==="action"&&R.disabled&&"cursor-not-allowed opacity-60 hover:bg-transparent"),onPointerDown:s(be=>{be.pointerType!=="touch"&&Ge(be,R)},"onPointerDown"),onMouseDown:s(be=>Ge(be,R),"onMouseDown"),onTouchStart:it,onTouchMove:Yt,onTouchEnd:s(be=>Ln(be,R),"onTouchEnd"),onMouseEnter:s(()=>{Z.current?.trigger==="skill"&&(j.current=!0),de(Y)},"onMouseEnter"),children:[R.kind==="routine"?(0,ee.jsx)(rM,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):R.kind==="action"?(0,ee.jsx)(iM,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):R.kind==="skill"?(0,ee.jsx)(Ck,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):R.kind==="issue"?(0,ee.jsx)(oM,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):R.kind==="project"&&R.projectId?(0,ee.jsx)("span",{className:"inline-flex h-2 w-2 rounded-full border border-border/50",style:{backgroundColor:R.projectColor??"var(--project-none)"}}):R.kind==="user"?(0,ee.jsx)(sM,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,ee.jsx)(Yk,{agent:{id:R.agentId??R.id,name:R.name,appearance:R.agentAppearance},size:16}),R.kind==="issue"&&R.issueIdentifier?(0,ee.jsxs)("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,ee.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:R.issueIdentifier}),(0,ee.jsx)("span",{className:"truncate",children:ik(R)})]}):(0,ee.jsx)("span",{className:"truncate",children:R.kind==="skill"||R.kind==="routine"||R.kind==="action"?ok(R):R.name}),R.kind==="issue"&&(0,ee.jsx)("span",{className:"ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground",children:"Task"}),R.kind==="project"&&R.projectId&&(0,ee.jsx)("span",{className:"ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground",children:"Project"}),R.kind==="user"&&(0,ee.jsx)("span",{className:"ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground",children:"User"}),R.kind==="skill"&&(0,ee.jsx)("span",{className:"ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground",children:"Skill"}),R.kind==="routine"&&(0,ee.jsx)("span",{className:"ml-auto text-(length:--text-nano) uppercase tracking-wide text-muted-foreground",children:"Routine"}),R.kind==="action"&&(0,ee.jsx)("span",{className:"ml-auto max-w-28 truncate text-(length:--text-nano) text-muted-foreground",children:R.disabled?R.disabledReason:R.description})]},R.id))}),document.body),$&&$t&&(0,ee.jsxs)("div",{className:Yi("pointer-events-none absolute inset-1 z-40 flex items-center justify-center rounded-md border border-dashed border-primary/80 bg-primary/10 text-xs font-medium text-primary",!f&&"inset-0 rounded-sm"),children:["Drop ",u?"file":"image"," to upload"]}),L&&(0,ee.jsx)("p",{className:"px-3 pb-2 text-xs text-destructive",children:L})]})},"MarkdownEditor"));export{Lz as a,DK as c,sM as d,oM as f,R9 as h,$z as i,lM as l,rM as m,Fz as n,PK as o,iM as p,Pz as r,Rz as s,hU as t,qd as u};