wiki-viewer 2.3.0 → 2.4.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 (170) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  14. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/agent/internal/span/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/pdf/save/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/system/clear-root/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/system/root-status/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/branch/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/wiki/file/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/index.html +1 -1
  70. package/.next/standalone/.next/server/app/index.rsc +3 -3
  71. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  72. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  73. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  74. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  75. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  76. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/s/[token]/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_workspaces_[id]_open_route_actions_1087xu7.js +1 -1
  82. package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0ef9kx4._.js → 0~w0_katex_dist_katex_mjs_0.dn635._.js} +1 -1
  83. package/.next/standalone/.next/server/chunks/ssr/0~w0_katex_dist_katex_mjs_0sfjj32._.js +3 -0
  84. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-5ZQYHXKU_mjs_0z1.978._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-KSCS5N6A_mjs_0v4oeem._.js +1 -1
  86. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jerjyj._.js → [root-of-the-server]__0lqvix1._.js} +2 -2
  87. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13~g170._.js +3 -0
  88. package/.next/standalone/.next/server/chunks/ssr/_0kcfv3r._.js +115 -0
  89. package/.next/standalone/.next/server/chunks/ssr/{_0h8pw_0._.js → _0sxeqi8._.js} +10 -10
  90. package/.next/standalone/.next/server/chunks/ssr/_0v4uz-4._.js +3 -3
  91. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0m7~7m_._.js → node_modules__pnpm_0.2jt36._.js} +1 -1
  92. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11mk8o4._.js → node_modules__pnpm_0.9pn81._.js} +1 -1
  93. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f~p3pg._.js → node_modules__pnpm_0.j4-lf._.js} +2 -2
  94. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0n~4rgy._.js → node_modules__pnpm_0.m_sn1._.js} +1 -1
  95. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0b7yz5c._.js → node_modules__pnpm_0.~y1yp._.js} +1 -1
  96. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_10db3bh._.js → node_modules__pnpm_01.ew44._.js} +1 -1
  97. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0nm~rx8._.js → node_modules__pnpm_012zkql._.js} +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_04lfp99._.js → node_modules__pnpm_01bm6g.._.js} +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09-~ynq._.js → node_modules__pnpm_01en521._.js} +1 -1
  100. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~jz5ce._.js → node_modules__pnpm_01ph0qu._.js} +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ltuml.._.js → node_modules__pnpm_02up8r-._.js} +1 -1
  102. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_03iszhk._.js +3 -0
  103. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_13c9fa3._.js → node_modules__pnpm_04it~3e._.js} +2 -2
  104. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_06dwwmm._.js +3 -0
  105. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0sl7atd._.js → node_modules__pnpm_07l0-3-._.js} +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_02vec-5._.js → node_modules__pnpm_07u0tu~._.js} +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_07sm52w._.js → node_modules__pnpm_082nhy2._.js} +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_057iess._.js → node_modules__pnpm_08tbdw0._.js} +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_09g5-vt._.js +3 -0
  110. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ms-p~~._.js → node_modules__pnpm_0_8xpgp._.js} +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_01zl9xh._.js → node_modules__pnpm_0_9lwhn._.js} +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0a4su30._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0bjbrpx._.js +17 -0
  114. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0fpiq-_._.js → node_modules__pnpm_0chjq9a._.js} +1 -1
  115. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ic~tgj._.js → node_modules__pnpm_0eso~ex._.js} +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0wrbfuh._.js → node_modules__pnpm_0fvnnvk._.js} +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-xasf1._.js → node_modules__pnpm_0gmtmgq._.js} +2 -2
  118. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_02ipeoh._.js → node_modules__pnpm_0gp3r26._.js} +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0w3t223._.js → node_modules__pnpm_0hdns-f._.js} +2 -2
  120. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0hljy3~._.js +17 -0
  121. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_076~crc._.js → node_modules__pnpm_0hskwfc._.js} +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0js1rqe._.js +26 -0
  123. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0j~9o1r._.js +17 -0
  124. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0k.lzn_._.js +3 -0
  125. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0kc03c-._.js +3 -0
  126. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0kj9v1z._.js +17 -0
  127. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0e8cct3._.js → node_modules__pnpm_0ld4q_x._.js} +2 -2
  128. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0o8gj4v._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0o~uo~g._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~azz1f._.js → node_modules__pnpm_0pz0-t0._.js} +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0q400lt._.js +3 -0
  132. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0qm_2a5._.js +3 -0
  133. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0qrke.0._.js +3 -0
  134. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0uoh8s.._.js +3 -0
  135. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0vrk4y9._.js +31 -0
  136. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0xmltqw._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0yuw2fj._.js +3 -0
  138. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0z~in-k._.js +11 -0
  139. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0~jhpwz._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_104h_j4._.js +3 -0
  141. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_10f-il_._.js +3 -0
  142. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_10yku0p._.js +17 -0
  143. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_12u_i35._.js +3 -0
  144. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_131cico._.js +45 -0
  145. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_133fmcv._.js +17 -0
  146. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  147. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  148. package/.next/standalone/.next/server/pages/404.html +1 -1
  149. package/.next/standalone/.next/server/pages/500.html +1 -1
  150. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  152. package/.next/standalone/.next/static/chunks/0.g_p6_b0v2sp.js +1 -0
  153. package/.next/standalone/.next/static/chunks/0i8mocynyc173.css +5 -0
  154. package/.next/standalone/.next/static/chunks/{0sshdogvg3twu.js → 0k7avpg83s7w-.js} +9 -9
  155. package/.next/standalone/.next/static/chunks/{0cy32os0684dj.js → 0nk7d18bz9l.f.js} +9 -9
  156. package/.next/standalone/.next/static/chunks/0w53fgzu7u31d.js +17 -0
  157. package/.next/standalone/.next/static/chunks/1012fl5fxholx.js +1 -0
  158. package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.10.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  159. package/.next/standalone/package.json +1 -1
  160. package/.next/standalone/server.js +1 -1
  161. package/package.json +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g2q.m9._.js +0 -3
  163. package/.next/standalone/.next/server/chunks/ssr/_0tz4-ka._.js +0 -115
  164. package/.next/standalone/.next/static/chunks/08mxtht3nlspn.css +0 -5
  165. package/.next/standalone/.next/static/chunks/0bu-qg3xcusv2.js +0 -17
  166. package/.next/standalone/.next/static/chunks/0ff5z2ti4cs.2.js +0 -1
  167. package/.next/standalone/.next/static/chunks/14~-bgg0b~4bh.js +0 -1
  168. /package/.next/standalone/.next/static/{w9MY1r-wlK_u_Hsax3Zde → AhCYyVcUXdav6hSU6ZRPx}/_buildManifest.js +0 -0
  169. /package/.next/standalone/.next/static/{w9MY1r-wlK_u_Hsax3Zde → AhCYyVcUXdav6hSU6ZRPx}/_clientMiddlewareManifest.js +0 -0
  170. /package/.next/standalone/.next/static/{w9MY1r-wlK_u_Hsax3Zde → AhCYyVcUXdav6hSU6ZRPx}/_ssgManifest.js +0 -0
@@ -79,7 +79,7 @@ ${i}
79
79
  `,d+=1;else break}let b=y.slice(1);if(b.length>0){let r=b.map(e=>e.slice(m+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let v=t.createToken(f,e);l.push(v)}if(0!==l.length)return{items:l,raw:c}}function aA(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=`${i}${a}`;return s&&s.length>0&&s.forEach((e,n)=>{var r,i;let o=null!=(i=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?i:t.renderChildren([e]);if(null!=o){let n=o.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");l+="paragraph"===e.type?`
80
80
 
81
81
  ${n}`:`
82
- ${n}`}}),l}function aT(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}i8({},{createAtomBlockMarkdownSpec:()=>ak,createBlockMarkdownSpec:()=>aS,createInlineMarkdownSpec:()=>aM,parseAttributes:()=>aw,parseIndentedBlocks:()=>aN,renderNestedMarkdownContent:()=>aA,serializeAttributes:()=>ax});var aR=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){aT(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(oR()||oT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},aO=class e extends s8{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},aD=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;let{view:l}=this.editor,c=e.target,d=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!d)return;let u=0,h=0;if(this.dom!==d){let t=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),a=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;u=n.x-t.x+a,h=n.y-t.y+l}let p=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();p.style.width=`${Math.round(e.width)}px`,p.style.height=`${Math.round(e.height)}px`,p.style.boxSizing="border-box",p.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(p),document.body.appendChild(f),null==(a=e.dataTransfer)||a.setDragImage(p,u,h)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=eU.create(l.state.doc,m),y=l.state.tr.setSelection(g);l.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="dragover"===e.type||"dragenter"===e.type,o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,c=eU.isSelectable(this.node),d="copy"===e.type,u="paste"===e.type,h="cut"===e.type,p="mousedown"===e.type;if(!l&&c&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(l&&s&&!a&&p){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!a&&!i&&!o&&!d&&!u&&!h&&(!p||!c)&&!0}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(oR()||oT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};e.s(["Editor",0,ab,"Extension",0,ai,"InputRule",0,s6,"Mark",0,ae,"MarkView",0,aR,"Node",0,aO,"NodeView",0,aD,"ResizableNodeView",0,av,"callOrReturn",0,sc,"canInsertNode",0,function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof eU){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1},"combineTransactionSteps",0,sn,"findChildren",0,function(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n},"findChildrenInRange",0,function(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r},"findParentNodeClosestToPos",0,sr,"getAttributes",0,sS,"getChangedRanges",0,sC,"getExtensionField",0,so,"getMarksBetween",0,sE,"getNodeAtPosition",0,(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]},"getNodeType",0,ou,"getRenderedAttributes",0,sf,"getText",0,sx,"getTextSerializersFromSchema",0,sk,"isAtEndOfNode",0,(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=si(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},"isAtStartOfNode",0,e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos},"isNodeActive",0,oJ,"isNodeEmpty",0,sO,"isNodeSelection",0,function(e){return e instanceof eU},"isNodeViewSelected",0,sD,"isTextSelection",0,oM,"markInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sc(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(sE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+r,l);let d=n.from+r+s.length;o.addMark(n.from+r,d,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})},"markPasteRule",0,function(e){return new at({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=sc(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,a=r[r.length-1],l=r[0],c=n.to;if(a){let i=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(sE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+i,d),c=n.from+i+a.length,s.addMark(n.from+i,c,e.type.create(o||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})},"mergeAttributes",0,sp,"nodeInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sc(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,a=n.to,l=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})},"parseIndentedBlocks",0,aN,"posToDOMRect",0,function(e,t,n){let r=e.state.doc.content.size,i=oN(t,0,r),o=oN(n,0,r),s=e.coordsAtPos(i),a=e.coordsAtPos(o,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),u=Math.max(s.right,a.right),h={top:l,bottom:c,left:d,right:u,width:u-d,height:c-l,x:d,y:l};return{...h,toJSON:()=>h}},"renderNestedMarkdownContent",0,aA,"textblockTypeInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=sc(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})},"wrappingInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=sc(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&eg(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&ex(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}],343603);let{getOwnPropertyNames:aj,getOwnPropertySymbols:aI}=Object,{hasOwnProperty:aP}=Object.prototype;function aL(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function a_(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);let a=e(t,n,r);return i.delete(t),i.delete(n),a}}function az(e){return aj(e).concat(aI(e))}let a$=Object.hasOwn||((e,t)=>aP.call(e,t));function aH(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:aB,keys:aF}=Object;function aV(e,t){return e.byteLength===t.byteLength&&a1(new Uint8Array(e),new Uint8Array(t))}function aU(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function aW(e,t){return e.byteLength===t.byteLength&&a1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function aK(e,t){return aH(e.getTime(),t.getTime())}function aq(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function aJ(e,t){return e===t}function aG(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),a=e.entries(),l=0;for(;(r=a.next())&&!r.done;){let o=t.entries(),a=!1,c=0;for(;(i=o.next())&&!i.done;){if(s[c]){c++;continue}let o=r.value,d=i.value;if(n.equals(o[0],d[0],l,c,e,t,n)&&n.equals(o[1],d[1],o[0],d[0],e,t,n)){a=s[c]=!0;break}c++}if(!a)return!1;l++}return!0}function aX(e,t,n){let r=aF(e),i=r.length;if(aF(t).length!==i)return!1;for(;i-- >0;)if(!a3(e,t,n,r[i]))return!1;return!0}function aZ(e,t,n){let r,i,o,s=az(e),a=s.length;if(az(t).length!==a)return!1;for(;a-- >0;)if(!a3(e,t,n,r=s[a])||(i=aB(e,r),o=aB(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function aY(e,t){return aH(e.valueOf(),t.valueOf())}function aQ(e,t){return e.source===t.source&&e.flags===t.flags}function a0(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),a=e.values();for(;(r=a.next())&&!r.done;){let o=t.values(),a=!1,l=0;for(;(i=o.next())&&!i.done;){if(!s[l]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){a=s[l]=!0;break}l++}if(!a)return!1}return!0}function a1(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function a2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function a3(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||a$(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let a5={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},a4=Object.prototype.toString,a6=a9();function a9(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);let v=m.constructor;if(v!==g.constructor)return!1;if(v===Object)return l(m,g,y);if(Array.isArray(m))return t(m,g,y);if(v===Date)return r(m,g,y);if(v===RegExp)return d(m,g,y);if(v===Map)return s(m,g,y);if(v===Set)return u(m,g,y);let w=a4.call(m);if("[object Date]"===w)return r(m,g,y);if("[object RegExp]"===w)return d(m,g,y);if("[object Map]"===w)return s(m,g,y);if("[object Set]"===w)return u(m,g,y);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&l(m,g,y);if("[object URL]"===w)return p(m,g,y);if("[object Error]"===w)return i(m,g,y);if("[object Arguments]"===w)return l(m,g,y);if(a5[w])return h(m,g,y);if("[object ArrayBuffer]"===w)return e(m,g,y);if("[object DataView]"===w)return n(m,g,y);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return c(m,g,y);if(f){let e=f[w];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:aV,areArraysEqual:n?aZ:aU,areDataViewsEqual:aW,areDatesEqual:aK,areErrorsEqual:aq,areFunctionsEqual:aJ,areMapsEqual:n?aL(aG,aZ):aG,areNumbersEqual:aH,areObjectsEqual:n?aZ:aX,arePrimitiveWrappersEqual:aY,areRegExpsEqual:aQ,areSetsEqual:n?aL(a0,aZ):a0,areTypedArraysEqual:n?aL(a1,aZ):a1,areUrlsEqual:a2,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=a_(r.areArraysEqual),t=a_(r.areMapsEqual),n=a_(r.areObjectsEqual),i=a_(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),s=n?n(o):function(e,t,n,r,i,s,a){return o(e,t,a)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){let{cache:a=e?new WeakMap:void 0,meta:l}=n();return t(o,s,{cache:a,equals:r,meta:l,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:s,strict:i})}a9({strict:!0}),a9({circular:!0}),a9({circular:!0,strict:!0}),a9({createInternalComparator:()=>aH}),a9({strict:!0,createInternalComparator:()=>aH}),a9({circular:!0,createInternalComparator:()=>aH}),a9({circular:!0,createInternalComparator:()=>aH,strict:!0});var a7=e.i(383835),a8=({contentComponent:e})=>{let t=(0,iI.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,iP.jsx)(iP.Fragment,{children:Object.values(t)})},le=class extends iD.default.Component{constructor(e){super(e),this.editorContentRef=iD.default.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n;if(t.contentComponent)return;let r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),e=new Set,n={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(t,r){n={...n,[t]:ij.default.createPortal(r.reactElement,r.element,t)},e.forEach(e=>e())},removeRenderer(t){let r={...n};delete r[t],n=r,e.forEach(e=>e())}},t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,iP.jsxs)(iP.Fragment,{children:[(0,iP.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,iP.jsx)(a8,{contentComponent:e.contentComponent})]})}},lt=(0,iD.forwardRef)((e,t)=>{let n=iD.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return iD.default.createElement(le,{key:n,innerRef:t,...e})}),ln=iD.default.memo(lt),lr="u">typeof window?iD.useLayoutEffect:iD.useEffect,li=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},lo="u"<typeof window,ls=lo||!!("u">typeof window&&window.next),la=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=null==e||e;return lo?t=!1:ls&&void 0===e&&(t=!1),t?this.createEditor():null}createEditor(){return new ab({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}},ll=(0,iD.createContext)({editor:null});ll.Consumer;var lc=(0,iD.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ld=iD.default.forwardRef((e,t)=>{let{onDragStart:n}=(0,iD.useContext)(lc),r=e.as||"div";return(0,iP.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function lu(e){return!!("function"==typeof e&&e.prototype&&e.prototype.isReactComponent)}function lh(e){return!!("object"==typeof e&&e.$$typeof&&("Symbol(react.forward_ref)"===e.$$typeof.toString()||"react.forward_ref"===e.$$typeof.description))}var lp=class{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isEditorContentInitialized?(0,ij.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=function(){try{if(iD.version)return parseInt(iD.version.split(".")[0],10)>=19}catch{}return!1}(),o=function(e){if(lu(e)||lh(e))return!0;if("object"==typeof e&&e.$$typeof&&("Symbol(react.memo)"===e.$$typeof.toString()||"react.memo"===e.$$typeof.description)){let t=e.type;if(t)return lu(t)||lh(t)}return!1}(t),s={...n};s.ref&&!(i||o)&&delete s.ref,!s.ref&&(i||o)&&(s.ref=e=>{this.ref=e}),this.reactElement=(0,iP.jsx)(t,{...s}),null==(e=null==r?void 0:r.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;null==(e=null==t?void 0:t.contentComponent)||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};iD.default.createContext({markViewContentRef:()=>{}});var lf=class extends aD{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{let e=this.getPos();"number"==typeof e&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),"function"==typeof this.options.attrs&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const e=this.dom.querySelector("[data-node-view-content]");if(!e)return;e.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){var o;return"storage"===r?null!=(o=e.storage[t.name])?o:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,iD.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute("data-node-view-wrapper")&&e.removeAttribute("data-node-view-wrapper"),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,iD.memo)(e=>(0,iP.jsx)(lc.Provider,{value:t,children:(0,iD.createElement)(n,e)}));r.displayName="ReactNodeView";let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:o=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new lp(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${o}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let e=this.currentPos;if("number"==typeof e)if(sD({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let o={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(o.getPos=()=>this.getPos()),r(o),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){let t=this.editor.extensionManager.attributes,n=sf(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}},lm=(0,iD.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function lg({editor:e,instance:t,children:n}){let r=null!=e?e:t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,iD.useMemo)(()=>({editor:r}),[r]),o=(0,iD.useMemo)(()=>({editor:r}),[r]);return(0,iP.jsx)(ll.Provider,{value:o,children:(0,iP.jsx)(lm.Provider,{value:i,children:n})})}function ly({...e}){let{editor:t}=(0,iD.useContext)(lm);return(0,iP.jsx)(ln,{editor:t,...e})}lm.displayName="TiptapContext",lg.displayName="Tiptap",ly.displayName="Tiptap.Content",Object.assign(lg,{Content:ly}),e.s(["EditorContent",0,ln,"NodeViewWrapper",0,ld,"ReactNodeViewRenderer",0,function(e,t){return n=>n.editor.contentComponent?new lf(e,n,t):{}},"useCurrentEditor",0,()=>(0,iD.useContext)(ll),"useEditor",0,function(e={},t=[]){let n=(0,iD.useRef)(e);n.current=e;let[r]=(0,iD.useState)(()=>new la(n)),i=(0,iI.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,iD.useDebugValue)(i),(0,iD.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,iD.useState)(()=>new li(e.editor)),r=(0,a7.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:a6);lr(()=>n.watch(e.editor),[e.editor,n]),(0,iD.useDebugValue)(r)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}],885047)},313393,e=>{"use strict";let t=(0,e.i(605993).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",0,t],313393)},530229,e=>{"use strict";let t=(0,e.i(605993).default)("file-plus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,t],530229)},231597,417068,660885,490275,534537,562199,24800,96701,990791,395624,246542,592185,926732,417385,e=>{"use strict";let t=(0,e.i(605993).default)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);function n(e,t){return Array(t+1).join(e)}function r(e){return e.replace(/^\n*/,"")}function i(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}e.s(["Sparkles",0,t],231597),e.s(["findNodeByPath",0,function e(t,n){for(let r of t){if(r.path===n)return r;if(r.children){let t=e(r.children,n);if(t)return t}}return null}],417068);var o,s,a=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function l(e){return h(e,a)}var c=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function d(e){return h(e,c)}var u=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function h(e,t){return t.indexOf(e.nodeName)>=0}function p(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var f=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function m(e){return f.reduce(function(e,t){return e.replace(t[0],t[1])},e)}var g={};function y(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function b(e){var t=e.replace(/([<>()])/g,"\\$1");return t.indexOf(" ")>=0?"<"+t+">":t}function v(e){return e.replace(/"/g,'\\"')}function w(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function x(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(function(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if("function"==typeof r){if(r.call(e,t,n))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}(i,t,n))return i}}function k(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function S(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}g.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},g.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},g.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var i=Number(t.nodeName.charAt(1));if("setext"!==r.headingStyle||!(i<3))return"\n\n"+n("#",i)+" "+e+"\n\n";var o=n(1===i?"=":"-",e.length);return"\n\n"+e+"\n"+o+"\n\n"}},g.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=i(r(e)).replace(/^/gm,"> "))+"\n\n"}},g.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},g.listItem={filter:"li",replacement:function(e,t,n){var o=n.bulletListMarker+" ",s=t.parentNode;if("OL"===s.nodeName){var a=s.getAttribute("start"),l=Array.prototype.indexOf.call(s.children,t);o=(a?Number(a)+l:l+1)+". "}var c=/\n$/.test(e);return e=(e=i(r(e))+(c?"\n":"")).replace(/\n/gm,"\n"+" ".repeat(o.length)),o+e+(t.nextSibling?"\n":"")}},g.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},g.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,r){for(var i,o=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,a=r.fence.charAt(0),l=3,c=RegExp("^"+a+"{3,}","gm");i=c.exec(s);)i[0].length>=l&&(l=i[0].length+1);var d=n(a,l);return"\n\n"+d+o+"\n"+s.replace(/\n$/,"")+"\n"+d+"\n\n"}},g.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},g.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=b(t.getAttribute("href")),r=v(y(t.getAttribute("title")));return"["+e+"]("+n+(r?' "'+r+'"':"")+")"}},g.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,o=b(t.getAttribute("href")),s=y(t.getAttribute("title"));switch(s&&(s=' "'+v(s)+'"'),n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+s;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+s;break;default:var a=this.references.length+1;r="["+e+"]["+a+"]",i="["+a+"]: "+o+s}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},g.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},g.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},g.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];-1!==r.indexOf(n);)n+="`";return n+t+e+t+n}},g.image={filter:"img",replacement:function(e,t){var n=m(y(t.getAttribute("alt"))),r=b(t.getAttribute("src")||""),i=y(t.getAttribute("title")),o=i?' "'+v(i)+'"':"";return r?"!["+n+"]("+r+o+")":""}},w.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){var t;return e.isBlank?this.blankRule:(t=x(this.array,e,this.options))||(t=x(this._keep,e,this.options))||(t=x(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var C="u">typeof window?window:{},E=!function(){var e=C.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?(o=function(){},!function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){C.ActiveXObject&&(e=!0)}return e}()?o.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t}:o.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t},o):C.DOMParser;function M(e,t){var n;return!function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(!(!t.firstChild||i(t))){for(var o=null,s=!1,a=null,l=S(null,t,i);l!==t;){if(3===l.nodeType||4===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!o||/ $/.test(o.data))&&!s&&" "===c[0]&&(c=c.substr(1)),!c){l=k(l);continue}l.data=c,o=l}else if(1===l.nodeType)n(l)||"BR"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,s=!1):r(l)||i(l)?(o=null,s=!0):o&&(s=!1);else{l=k(l);continue}var d=S(a,l,i);a=l,l=d}o&&(o.data=o.data.replace(/ $/,""),o.data||k(o))}}({element:n="string"==typeof e?(s=s||new E).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):e.cloneNode(!0),isBlock:l,isVoid:d,isPre:t.preformattedCode?N:null}),n}function N(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function A(e,t){var n;return e.isBlock=l(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=!d(n=e)&&!h(n,u)&&/^\s*$/i.test(n.textContent)&&!p(n,c)&&!p(n,u),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n,r={leading:(n=e.textContent.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/))[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]};return r.leadingAscii&&T("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&T("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}(e,t),e}function T(e,t,n){var r,i,o;return"left"===e?(r=t.previousSibling,i=/ $/):(r=t.nextSibling,i=/^ /),r&&(3===r.nodeType?o=i.test(r.nodeValue):n.preformattedCode&&"CODE"===r.nodeName?o=!1:1!==r.nodeType||l(r)||(o=i.test(r.textContent))),o}var R=Array.prototype.reduce;function O(e){if(!(this instanceof O))return new O(e);this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}({},{rules:g,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}},e),this.rules=new w(this.options)}function D(e){var t=this;return R.call(e.childNodes,function(e,n){n=new A(n,t.options);var r="";return 3===n.nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=I.call(t,n)),P(e,r)},"")}function j(e){var t=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(e=P(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function I(e){var t=this.rules.forNode(e),n=D.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function P(e,t){var n=i(e),o=r(t),s=Math.max(e.length-n.length,t.length-o.length);return n+"\n\n".substring(0,s)+o}O.prototype={turndown:function(e){var t;if(!(null!=(t=e)&&("string"==typeof t||t.nodeType&&(1===t.nodeType||9===t.nodeType||11===t.nodeType))))throw TypeError(e+" is not a string, or an element/document/fragment node.");return""===e?"":j.call(this,D.call(this,new M(e,this.options)))},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if("function"==typeof e)e(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return m(e)}};var L=/highlight-(?:text|source)-([a-z0-9]+)/;function _(e){e.addRule("highlightedCodeBlock",{filter:function(e){var t=e.firstChild;return"DIV"===e.nodeName&&L.test(e.className)&&t&&"PRE"===t.nodeName},replacement:function(e,t,n){var r=((t.className||"").match(L)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function z(e){e.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~"+e+"~"}})}var $=Array.prototype.indexOf,H=Array.prototype.every,B={};function F(e){var t,n,r=e.parentNode;return"THEAD"===r.nodeName||r.firstChild===e&&("TABLE"===r.nodeName||(n=(t=r).previousSibling,"TBODY"===t.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&H.call(e.childNodes,function(e){return"TH"===e.nodeName})}function V(e,t){var n=$.call(t.parentNode.childNodes,t),r=" ";return 0===n&&(r="| "),r+e+" |"}function U(e){for(var t in e.keep(function(e){return"TABLE"===e.nodeName&&!F(e.rows[0])}),B)e.addRule(t,B[t])}function W(e){e.addRule("taskListItems",{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}})}B.tableCell={filter:["th","td"],replacement:function(e,t){return V(e,t)}},B.tableRow={filter:"tr",replacement:function(e,t){var n="",r={left:":--",right:"--:",center:":-:"};if(F(t))for(var i=0;i<t.childNodes.length;i++){var o="---",s=(t.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(o=r[s]||o),n+=V(o,t.childNodes[i])}return"\n"+e+(n?"\n"+n:"")}},B.table={filter:function(e){return"TABLE"===e.nodeName&&F(e.rows[0])},replacement:function(e){return"\n\n"+(e=e.replace("\n\n","\n"))+"\n\n"}},B.tableSection={filter:["thead","tbody","tfoot"],replacement:function(e){return e}};var K=e.i(319814);let q=new O({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",fence:"```",emDelimiter:"*",strongDelimiter:"**"});for(let e of(q.use(function(e){e.use([_,z,U,W])}),q.addRule("codeBlock",{filter:e=>"PRE"===e.nodeName&&null!==e.firstChild&&"CODE"===e.firstChild.nodeName,replacement:(e,t)=>{let n=t.firstChild,r=n.getAttribute("class")?.replace("language-","")||"",i=n.textContent||"";return`
82
+ ${n}`}}),l}function aT(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}i8({},{createAtomBlockMarkdownSpec:()=>ak,createBlockMarkdownSpec:()=>aS,createInlineMarkdownSpec:()=>aM,parseAttributes:()=>aw,parseIndentedBlocks:()=>aN,renderNestedMarkdownContent:()=>aA,serializeAttributes:()=>ax});var aR=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){aT(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(oR()||oT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},aO=class e extends s8{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},aD=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;let{view:l}=this.editor,c=e.target,d=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!d)return;let u=0,h=0;if(this.dom!==d){let t=this.dom.getBoundingClientRect(),n=d.getBoundingClientRect(),a=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;u=n.x-t.x+a,h=n.y-t.y+l}let p=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();p.style.width=`${Math.round(e.width)}px`,p.style.height=`${Math.round(e.height)}px`,p.style.boxSizing="border-box",p.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(p),document.body.appendChild(f),null==(a=e.dataTransfer)||a.setDragImage(p,u,h)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=eU.create(l.state.doc,m),y=l.state.tr.setSelection(g);l.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="dragover"===e.type||"dragenter"===e.type,o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,c=eU.isSelectable(this.node),d="copy"===e.type,u="paste"===e.type,h="cut"===e.type,p="mousedown"===e.type;if(!l&&c&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(l&&s&&!a&&p){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!a&&!i&&!o&&!d&&!u&&!h&&(!p||!c)&&!0}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(oR()||oT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};e.s(["Editor",0,ab,"Extension",0,ai,"InputRule",0,s6,"Mark",0,ae,"MarkView",0,aR,"Node",0,aO,"NodeView",0,aD,"ResizableNodeView",0,av,"callOrReturn",0,sc,"canInsertNode",0,function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof eU){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1},"combineTransactionSteps",0,sn,"findChildren",0,function(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n},"findChildrenInRange",0,function(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r},"findParentNodeClosestToPos",0,sr,"getAttributes",0,sS,"getChangedRanges",0,sC,"getExtensionField",0,so,"getMarksBetween",0,sE,"getNodeAtPosition",0,(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]},"getNodeType",0,ou,"getRenderedAttributes",0,sf,"getText",0,sx,"getTextSerializersFromSchema",0,sk,"isAtEndOfNode",0,(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=si(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},"isAtStartOfNode",0,e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos},"isNodeActive",0,oJ,"isNodeEmpty",0,sO,"isNodeSelection",0,function(e){return e instanceof eU},"isNodeViewSelected",0,sD,"isTextSelection",0,oM,"markInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sc(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(sE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+r,l);let d=n.from+r+s.length;o.addMark(n.from+r,d,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})},"markPasteRule",0,function(e){return new at({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=sc(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,a=r[r.length-1],l=r[0],c=n.to;if(a){let i=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(sE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+i,d),c=n.from+i+a.length,s.addMark(n.from+i,c,e.type.create(o||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})},"mergeAttributes",0,sp,"nodeInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=sc(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,a=n.to,l=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})},"parseIndentedBlocks",0,aN,"posToDOMRect",0,function(e,t,n){let r=e.state.doc.content.size,i=oN(t,0,r),o=oN(n,0,r),s=e.coordsAtPos(i),a=e.coordsAtPos(o,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),d=Math.min(s.left,a.left),u=Math.max(s.right,a.right),h={top:l,bottom:c,left:d,right:u,width:u-d,height:c-l,x:d,y:l};return{...h,toJSON:()=>h}},"renderNestedMarkdownContent",0,aA,"textblockTypeInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=sc(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})},"wrappingInputRule",0,function(e){return new s6({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=sc(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&eg(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&ex(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}],343603);let{getOwnPropertyNames:aj,getOwnPropertySymbols:aI}=Object,{hasOwnProperty:aP}=Object.prototype;function aL(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function a_(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);let a=e(t,n,r);return i.delete(t),i.delete(n),a}}function az(e){return aj(e).concat(aI(e))}let a$=Object.hasOwn||((e,t)=>aP.call(e,t));function aH(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:aB,keys:aF}=Object;function aV(e,t){return e.byteLength===t.byteLength&&a1(new Uint8Array(e),new Uint8Array(t))}function aU(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function aW(e,t){return e.byteLength===t.byteLength&&a1(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function aK(e,t){return aH(e.getTime(),t.getTime())}function aq(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function aJ(e,t){return e===t}function aG(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),a=e.entries(),l=0;for(;(r=a.next())&&!r.done;){let o=t.entries(),a=!1,c=0;for(;(i=o.next())&&!i.done;){if(s[c]){c++;continue}let o=r.value,d=i.value;if(n.equals(o[0],d[0],l,c,e,t,n)&&n.equals(o[1],d[1],o[0],d[0],e,t,n)){a=s[c]=!0;break}c++}if(!a)return!1;l++}return!0}function aX(e,t,n){let r=aF(e),i=r.length;if(aF(t).length!==i)return!1;for(;i-- >0;)if(!a3(e,t,n,r[i]))return!1;return!0}function aZ(e,t,n){let r,i,o,s=az(e),a=s.length;if(az(t).length!==a)return!1;for(;a-- >0;)if(!a3(e,t,n,r=s[a])||(i=aB(e,r),o=aB(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function aY(e,t){return aH(e.valueOf(),t.valueOf())}function aQ(e,t){return e.source===t.source&&e.flags===t.flags}function a0(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),a=e.values();for(;(r=a.next())&&!r.done;){let o=t.values(),a=!1,l=0;for(;(i=o.next())&&!i.done;){if(!s[l]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){a=s[l]=!0;break}l++}if(!a)return!1}return!0}function a1(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function a2(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function a3(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||a$(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let a5={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},a4=Object.prototype.toString,a6=a9();function a9(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,y):"function"===b&&o(m,g,y);let v=m.constructor;if(v!==g.constructor)return!1;if(v===Object)return l(m,g,y);if(Array.isArray(m))return t(m,g,y);if(v===Date)return r(m,g,y);if(v===RegExp)return d(m,g,y);if(v===Map)return s(m,g,y);if(v===Set)return u(m,g,y);let w=a4.call(m);if("[object Date]"===w)return r(m,g,y);if("[object RegExp]"===w)return d(m,g,y);if("[object Map]"===w)return s(m,g,y);if("[object Set]"===w)return u(m,g,y);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&l(m,g,y);if("[object URL]"===w)return p(m,g,y);if("[object Error]"===w)return i(m,g,y);if("[object Arguments]"===w)return l(m,g,y);if(a5[w])return h(m,g,y);if("[object ArrayBuffer]"===w)return e(m,g,y);if("[object DataView]"===w)return n(m,g,y);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return c(m,g,y);if(f){let e=f[w];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:aV,areArraysEqual:n?aZ:aU,areDataViewsEqual:aW,areDatesEqual:aK,areErrorsEqual:aq,areFunctionsEqual:aJ,areMapsEqual:n?aL(aG,aZ):aG,areNumbersEqual:aH,areObjectsEqual:n?aZ:aX,arePrimitiveWrappersEqual:aY,areRegExpsEqual:aQ,areSetsEqual:n?aL(a0,aZ):a0,areTypedArraysEqual:n?aL(a1,aZ):a1,areUrlsEqual:a2,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=a_(r.areArraysEqual),t=a_(r.areMapsEqual),n=a_(r.areObjectsEqual),i=a_(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),s=n?n(o):function(e,t,n,r,i,s,a){return o(e,t,a)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){let{cache:a=e?new WeakMap:void 0,meta:l}=n();return t(o,s,{cache:a,equals:r,meta:l,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:s,strict:i})}a9({strict:!0}),a9({circular:!0}),a9({circular:!0,strict:!0}),a9({createInternalComparator:()=>aH}),a9({strict:!0,createInternalComparator:()=>aH}),a9({circular:!0,createInternalComparator:()=>aH}),a9({circular:!0,createInternalComparator:()=>aH,strict:!0});var a7=e.i(383835),a8=({contentComponent:e})=>{let t=(0,iI.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,iP.jsx)(iP.Fragment,{children:Object.values(t)})},le=class extends iD.default.Component{constructor(e){super(e),this.editorContentRef=iD.default.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n;if(t.contentComponent)return;let r=this.editorContentRef.current;r.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:r}),e=new Set,n={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(t,r){n={...n,[t]:ij.default.createPortal(r.reactElement,r.element,t)},e.forEach(e=>e())},removeRenderer(t){let r={...n};delete r[t],n=r,e.forEach(e=>e())}},t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,iP.jsxs)(iP.Fragment,{children:[(0,iP.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,iP.jsx)(a8,{contentComponent:e.contentComponent})]})}},lt=(0,iD.forwardRef)((e,t)=>{let n=iD.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return iD.default.createElement(le,{key:n,innerRef:t,...e})}),ln=iD.default.memo(lt),lr="u">typeof window?iD.useLayoutEffect:iD.useEffect,li=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},lo="u"<typeof window,ls=lo||!!("u">typeof window&&window.next),la=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=null==e||e;return lo?t=!1:ls&&void 0===e&&(t=!1),t?this.createEditor():null}createEditor(){return new ab({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}},ll=(0,iD.createContext)({editor:null});ll.Consumer;var lc=(0,iD.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),ld=()=>(0,iD.useContext)(lc),lu=iD.default.forwardRef((e,t)=>{let{onDragStart:n}=ld(),r=e.as||"div";return(0,iP.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function lh(e){return!!("function"==typeof e&&e.prototype&&e.prototype.isReactComponent)}function lp(e){return!!("object"==typeof e&&e.$$typeof&&("Symbol(react.forward_ref)"===e.$$typeof.toString()||"react.forward_ref"===e.$$typeof.description))}var lf=class{constructor(e,{editor:t,props:n={},as:r="div",className:i=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isEditorContentInitialized?(0,ij.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=function(){try{if(iD.version)return parseInt(iD.version.split(".")[0],10)>=19}catch{}return!1}(),o=function(e){if(lh(e)||lp(e))return!0;if("object"==typeof e&&e.$$typeof&&("Symbol(react.memo)"===e.$$typeof.toString()||"react.memo"===e.$$typeof.description)){let t=e.type;if(t)return lh(t)||lp(t)}return!1}(t),s={...n};s.ref&&!(i||o)&&delete s.ref,!s.ref&&(i||o)&&(s.ref=e=>{this.ref=e}),this.reactElement=(0,iP.jsx)(t,{...s}),null==(e=null==r?void 0:r.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;null==(e=null==t?void 0:t.contentComponent)||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};iD.default.createContext({markViewContentRef:()=>{}});var lm=class extends aD{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{let e=this.getPos();"number"==typeof e&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),"function"==typeof this.options.attrs&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const e=this.dom.querySelector("[data-node-view-content]");if(!e)return;e.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){var o;return"storage"===r?null!=(o=e.storage[t.name])?o:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,iD.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute("data-node-view-wrapper")&&e.removeAttribute("data-node-view-wrapper"),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,iD.memo)(e=>(0,iP.jsx)(lc.Provider,{value:t,children:(0,iD.createElement)(n,e)}));r.displayName="ReactNodeView";let i=this.node.isInline?"span":"div";this.options.as&&(i=this.options.as);let{className:o=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new lf(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${o}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let e=this.currentPos;if("number"==typeof e)if(sD({selection:this.editor.state.selection,pos:e,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,o=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let o={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(o.getPos=()=>this.getPos()),r(o),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){let t=this.editor.extensionManager.attributes,n=sf(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}},lg=(0,iD.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function ly({editor:e,instance:t,children:n}){let r=null!=e?e:t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,iD.useMemo)(()=>({editor:r}),[r]),o=(0,iD.useMemo)(()=>({editor:r}),[r]);return(0,iP.jsx)(ll.Provider,{value:o,children:(0,iP.jsx)(lg.Provider,{value:i,children:n})})}function lb({...e}){let{editor:t}=(0,iD.useContext)(lg);return(0,iP.jsx)(ln,{editor:t,...e})}lg.displayName="TiptapContext",ly.displayName="Tiptap",lb.displayName="Tiptap.Content",Object.assign(ly,{Content:lb}),e.s(["EditorContent",0,ln,"NodeViewContent",0,function({as:e="div",...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=ld();return(0,iP.jsx)(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style},children:r})},"NodeViewWrapper",0,lu,"ReactNodeViewRenderer",0,function(e,t){return n=>n.editor.contentComponent?new lm(e,n,t):{}},"useCurrentEditor",0,()=>(0,iD.useContext)(ll),"useEditor",0,function(e={},t=[]){let n=(0,iD.useRef)(e);n.current=e;let[r]=(0,iD.useState)(()=>new la(n)),i=(0,iI.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,iD.useDebugValue)(i),(0,iD.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,iD.useState)(()=>new li(e.editor)),r=(0,a7.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:a6);lr(()=>n.watch(e.editor),[e.editor,n]),(0,iD.useDebugValue)(r)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}],885047)},313393,e=>{"use strict";let t=(0,e.i(605993).default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",0,t],313393)},530229,e=>{"use strict";let t=(0,e.i(605993).default)("file-plus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,t],530229)},231597,417068,660885,490275,534537,562199,24800,96701,990791,395624,246542,592185,926732,417385,e=>{"use strict";let t=(0,e.i(605993).default)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);function n(e,t){return Array(t+1).join(e)}function r(e){return e.replace(/^\n*/,"")}function i(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}e.s(["Sparkles",0,t],231597),e.s(["findNodeByPath",0,function e(t,n){for(let r of t){if(r.path===n)return r;if(r.children){let t=e(r.children,n);if(t)return t}}return null}],417068);var o,s,a=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function l(e){return h(e,a)}var c=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function d(e){return h(e,c)}var u=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function h(e,t){return t.indexOf(e.nodeName)>=0}function p(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var f=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function m(e){return f.reduce(function(e,t){return e.replace(t[0],t[1])},e)}var g={};function y(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function b(e){var t=e.replace(/([<>()])/g,"\\$1");return t.indexOf(" ")>=0?"<"+t+">":t}function v(e){return e.replace(/"/g,'\\"')}function w(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function x(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(function(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else if("function"==typeof r){if(r.call(e,t,n))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}(i,t,n))return i}}function k(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function S(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}g.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},g.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},g.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,r){var i=Number(t.nodeName.charAt(1));if("setext"!==r.headingStyle||!(i<3))return"\n\n"+n("#",i)+" "+e+"\n\n";var o=n(1===i?"=":"-",e.length);return"\n\n"+e+"\n"+o+"\n\n"}},g.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=i(r(e)).replace(/^/gm,"> "))+"\n\n"}},g.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},g.listItem={filter:"li",replacement:function(e,t,n){var o=n.bulletListMarker+" ",s=t.parentNode;if("OL"===s.nodeName){var a=s.getAttribute("start"),l=Array.prototype.indexOf.call(s.children,t);o=(a?Number(a)+l:l+1)+". "}var c=/\n$/.test(e);return e=(e=i(r(e))+(c?"\n":"")).replace(/\n/gm,"\n"+" ".repeat(o.length)),o+e+(t.nextSibling?"\n":"")}},g.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},g.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,r){for(var i,o=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,a=r.fence.charAt(0),l=3,c=RegExp("^"+a+"{3,}","gm");i=c.exec(s);)i[0].length>=l&&(l=i[0].length+1);var d=n(a,l);return"\n\n"+d+o+"\n"+s.replace(/\n$/,"")+"\n"+d+"\n\n"}},g.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},g.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=b(t.getAttribute("href")),r=v(y(t.getAttribute("title")));return"["+e+"]("+n+(r?' "'+r+'"':"")+")"}},g.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,o=b(t.getAttribute("href")),s=y(t.getAttribute("title"));switch(s&&(s=' "'+v(s)+'"'),n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+s;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+s;break;default:var a=this.references.length+1;r="["+e+"]["+a+"]",i="["+a+"]: "+o+s}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},g.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},g.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},g.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];-1!==r.indexOf(n);)n+="`";return n+t+e+t+n}},g.image={filter:"img",replacement:function(e,t){var n=m(y(t.getAttribute("alt"))),r=b(t.getAttribute("src")||""),i=y(t.getAttribute("title")),o=i?' "'+v(i)+'"':"";return r?"!["+n+"]("+r+o+")":""}},w.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){var t;return e.isBlank?this.blankRule:(t=x(this.array,e,this.options))||(t=x(this._keep,e,this.options))||(t=x(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var C="u">typeof window?window:{},E=!function(){var e=C.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?(o=function(){},!function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){C.ActiveXObject&&(e=!0)}return e}()?o.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t}:o.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t},o):C.DOMParser;function M(e,t){var n;return!function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(!(!t.firstChild||i(t))){for(var o=null,s=!1,a=null,l=S(null,t,i);l!==t;){if(3===l.nodeType||4===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!o||/ $/.test(o.data))&&!s&&" "===c[0]&&(c=c.substr(1)),!c){l=k(l);continue}l.data=c,o=l}else if(1===l.nodeType)n(l)||"BR"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,s=!1):r(l)||i(l)?(o=null,s=!0):o&&(s=!1);else{l=k(l);continue}var d=S(a,l,i);a=l,l=d}o&&(o.data=o.data.replace(/ $/,""),o.data||k(o))}}({element:n="string"==typeof e?(s=s||new E).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):e.cloneNode(!0),isBlock:l,isVoid:d,isPre:t.preformattedCode?N:null}),n}function N(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function A(e,t){var n;return e.isBlock=l(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=!d(n=e)&&!h(n,u)&&/^\s*$/i.test(n.textContent)&&!p(n,c)&&!p(n,u),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n,r={leading:(n=e.textContent.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/))[1],leadingAscii:n[2],leadingNonAscii:n[3],trailing:n[4],trailingNonAscii:n[5],trailingAscii:n[6]};return r.leadingAscii&&T("left",e,t)&&(r.leading=r.leadingNonAscii),r.trailingAscii&&T("right",e,t)&&(r.trailing=r.trailingNonAscii),{leading:r.leading,trailing:r.trailing}}(e,t),e}function T(e,t,n){var r,i,o;return"left"===e?(r=t.previousSibling,i=/ $/):(r=t.nextSibling,i=/^ /),r&&(3===r.nodeType?o=i.test(r.nodeValue):n.preformattedCode&&"CODE"===r.nodeName?o=!1:1!==r.nodeType||l(r)||(o=i.test(r.textContent))),o}var R=Array.prototype.reduce;function O(e){if(!(this instanceof O))return new O(e);this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}({},{rules:g,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}},e),this.rules=new w(this.options)}function D(e){var t=this;return R.call(e.childNodes,function(e,n){n=new A(n,t.options);var r="";return 3===n.nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=I.call(t,n)),P(e,r)},"")}function j(e){var t=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(e=P(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function I(e){var t=this.rules.forNode(e),n=D.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function P(e,t){var n=i(e),o=r(t),s=Math.max(e.length-n.length,t.length-o.length);return n+"\n\n".substring(0,s)+o}O.prototype={turndown:function(e){var t;if(!(null!=(t=e)&&("string"==typeof t||t.nodeType&&(1===t.nodeType||9===t.nodeType||11===t.nodeType))))throw TypeError(e+" is not a string, or an element/document/fragment node.");return""===e?"":j.call(this,D.call(this,new M(e,this.options)))},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else if("function"==typeof e)e(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return m(e)}};var L=/highlight-(?:text|source)-([a-z0-9]+)/;function _(e){e.addRule("highlightedCodeBlock",{filter:function(e){var t=e.firstChild;return"DIV"===e.nodeName&&L.test(e.className)&&t&&"PRE"===t.nodeName},replacement:function(e,t,n){var r=((t.className||"").match(L)||[null,""])[1];return"\n\n"+n.fence+r+"\n"+t.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function z(e){e.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~"+e+"~"}})}var $=Array.prototype.indexOf,H=Array.prototype.every,B={};function F(e){var t,n,r=e.parentNode;return"THEAD"===r.nodeName||r.firstChild===e&&("TABLE"===r.nodeName||(n=(t=r).previousSibling,"TBODY"===t.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&H.call(e.childNodes,function(e){return"TH"===e.nodeName})}function V(e,t){var n=$.call(t.parentNode.childNodes,t),r=" ";return 0===n&&(r="| "),r+e+" |"}function U(e){for(var t in e.keep(function(e){return"TABLE"===e.nodeName&&!F(e.rows[0])}),B)e.addRule(t,B[t])}function W(e){e.addRule("taskListItems",{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}})}B.tableCell={filter:["th","td"],replacement:function(e,t){return V(e,t)}},B.tableRow={filter:"tr",replacement:function(e,t){var n="",r={left:":--",right:"--:",center:":-:"};if(F(t))for(var i=0;i<t.childNodes.length;i++){var o="---",s=(t.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(o=r[s]||o),n+=V(o,t.childNodes[i])}return"\n"+e+(n?"\n"+n:"")}},B.table={filter:function(e){return"TABLE"===e.nodeName&&F(e.rows[0])},replacement:function(e){return"\n\n"+(e=e.replace("\n\n","\n"))+"\n\n"}},B.tableSection={filter:["thead","tbody","tfoot"],replacement:function(e){return e}};var K=e.i(319814);let q=new O({headingStyle:"atx",hr:"---",bulletListMarker:"-",codeBlockStyle:"fenced",fence:"```",emDelimiter:"*",strongDelimiter:"**"});for(let e of(q.use(function(e){e.use([_,z,U,W])}),q.addRule("codeBlock",{filter:e=>"PRE"===e.nodeName&&null!==e.firstChild&&"CODE"===e.firstChild.nodeName,replacement:(e,t)=>{let n=t.firstChild,r=n.getAttribute("class")?.replace("language-","")||"",i=n.textContent||"";return`
83
83
  \`\`\`${r}
84
84
  ${i}
85
85
  \`\`\`
@@ -95,19 +95,19 @@ ${i}
95
95
  <${n} style="${r}">${e}</${n}>
96
96
  `}}),e.s(["htmlToMarkdown",0,function(e,t){var n;let r=q.turndown(e);return t?(n=r,t?n=(n=n.replace(/\]\((\/api\/assets\/[^)\s]+)\)/g,(e,n)=>`](${J(n,t)})`)).replace(/(src|href)="(\/api\/assets\/[^"]+)"/g,(e,n,r)=>`${n}="${J(r,t)}"`):n):r}],660885);let G=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function X(e){let t=e.trim();if(""===t)return"";if("true"===t)return!0;if("false"===t)return!1;if("null"===t||"~"===t)return null;if(/^-?\d+$/.test(t)||/^-?\d*\.\d+$/.test(t))return Number(t);if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return""===e?[]:e.split(",").map(e=>X(e))}return t}e.s(["parseFrontmatter",0,function(e){let t=G.exec(e);if(!t)return{data:{},body:e};let n=t[1],r=e.slice(t[0].length),i=n.split(/\r?\n/).find(e=>""!==e.trim())??"";if(/^\s*(#{1,6}\s|<|>|-\s|\*\s|\d+\.\s)/.test(i))return{data:{},body:e};let o={},s=n.split(/\r?\n/),a=0;for(;a<s.length;){let e=s[a];if(!e||/^\s*#/.test(e)){a+=1;continue}let t=/^([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(e);if(!t){a+=1;continue}let n=t[1],r=t[2];if(""===r.trim()){let e=[],t=a+1;for(;t<s.length&&/^\s+-\s+/.test(s[t]);){let n=/^\s+-\s+(.*)$/.exec(s[t]);n&&e.push(X(n[1])),t+=1}if(e.length>0){o[n]=e,a=t;continue}o[n]="",a+=1;continue}o[n]=X(r),a+=1}return 0===Object.keys(o).length?{data:{},body:e}:{data:o,body:r}}],490275);var Z=e.i(101685);let Y=e=>{let t,n=new Set,r=(e,r)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,o);return o},Q=e=>{let t=e?Y(e):Y,n=e=>(function(e,t=e=>e){let n=Z.default.useSyncExternalStore(e.subscribe,Z.default.useCallback(()=>t(e.getState()),[e,t]),Z.default.useCallback(()=>t(e.getInitialState()),[e,t]));return Z.default.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},ee=e=>e?Q(e):Q;e.s(["create",0,ee],534537);var et=e.i(671485);function en(){return{}}e.s(["authHeaders",0,en],562199);let er=ee(e=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e(e=>({isOpen:!e.isOpen})),clearMessages:()=>{},activity:[],connections:[],hasToken:!1,pollIntervalMs:1e4,rateLimit:null,loadActivity:async()=>{let t=localStorage.getItem("wiki-agent-token")??null,n=!!(t&&t.trim());try{let t=await (0,et.wsFetch)("/api/agent/activity?limit=50",{headers:en()});if(!t.ok)return void e({hasToken:n});let r=(await t.json()).events??[],i=function(e){let t=new Date(Date.now()-3e5).toISOString(),n=new Map;for(let r of e){if(r.at<t)continue;let e=n.get(r.by);e?n.set(r.by,{opCount:e.opCount+1,lastSeen:r.at>e.lastSeen?r.at:e.lastSeen}):n.set(r.by,{opCount:1,lastSeen:r.at})}return Array.from(n.entries()).map(([e,t])=>({by:e,...t})).sort((e,t)=>e.lastSeen<t.lastSeen?1:-1)}(r),o=null;try{let e=await (0,et.wsFetch)("/api/agent/settings",{headers:en()});e.ok&&(o=(await e.json()).rateLimit??null)}catch{}e({activity:r,connections:i,hasToken:n,rateLimit:o})}catch{e({hasToken:n})}}}));e.s(["useAIPanelStore",0,er],24800);class ei extends Error{status;constructor(e,t){super(e),this.status=t,this.name="FetchPageError"}}async function eo(e,t){let n=await (0,et.wsFetch)(`/api/wiki/content?path=${encodeURIComponent(e)}`,{signal:t});if(!n.ok)throw new ei(`Failed to fetch page: ${e}`,n.status);let r=await n.json(),i=n.headers.get("X-Wiki-Revision"),o=null!==i?Number(i):null;return{path:e,content:r.content,frontmatter:null,revision:o}}class es extends Error{currentRevision;serverContent;constructor(e,t){super("File was modified externally. Reloaded with latest content."),this.currentRevision=e,this.serverContent=t,this.name="StaleRevisionError"}}async function ea(e,t,n){let r={path:e,content:t};null!==n&&(r.baseRevision=n);let i=await (0,et.wsFetch)("/api/wiki/content",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(409===i.status){let n=await i.json(),r=await (0,et.wsFetch)(`/api/wiki/content?path=${encodeURIComponent(e)}`),o=r.ok?(await r.json()).content:t;throw new es(n.currentRevision??0,o)}if(!i.ok)throw Error("Failed to save page");return{revision:(await i.json()).revision??null}}async function el(e,t=""){await ea(e,t,null)}let ec="kb-page-cache",ed=new Map,eu=new Map;function eh(e){if(ed.delete(e.path),ed.set(e.path,e),ed.size>30){let e=ed.keys().next().value;void 0!==e&&ed.delete(e)}}function ep(e){try{localStorage.setItem(ec,JSON.stringify(e))}catch{}}let ef="kb-edit-mode",em=null,eg=null,ey=null,eb=ee((e,t)=>({currentPath:null,content:"",frontmatter:null,saveStatus:"idle",loadStatus:"idle",isDirty:!1,isLoading:!1,lastSavedAt:null,currentRevision:null,editMode:"suggesting"===localStorage.getItem(ef)?"suggesting":"editing",setEditMode:t=>{localStorage.setItem(ef,t),e({editMode:t})},loadPage:async n=>{let r,i=t();i.isDirty&&i.currentPath&&i.currentPath!==n&&await t().save(),e({currentPath:n,isLoading:!0,loadStatus:"loading",isDirty:!1,content:"",currentRevision:null});let o=(r=ed.get(n))?(ed.delete(n),ed.set(n,r),r):null,s=o??function(e){try{let t=localStorage.getItem(ec);if(!t)return null;let n=JSON.parse(t);if(n.path!==e)return null;return n}catch{return null}}(n);s&&e({content:s.content,frontmatter:s.frontmatter,isLoading:!1,loadStatus:"ok",...o?{currentRevision:o.revision}:{}});let a=eu.get(n);if(a)try{let r=await a;if(t().currentPath!==n)return;e({content:r.content,frontmatter:r.frontmatter,isLoading:!1,loadStatus:"ok",currentRevision:r.revision}),ep({path:n,content:r.content,frontmatter:r.frontmatter});return}catch{}ey?.abort();let l=new AbortController;ey=l;try{let r=await eo(n,l.signal);if(eh(r),t().currentPath!==n)return;e({content:r.content,frontmatter:r.frontmatter,isLoading:!1,loadStatus:"ok",currentRevision:r.revision}),ep({path:n,content:r.content,frontmatter:r.frontmatter})}catch(r){if(r instanceof DOMException&&"AbortError"===r.name||t().currentPath!==n)return;r instanceof ei&&404===r.status?e({isLoading:!1,loadStatus:"missing",content:""}):e({isLoading:!1,loadStatus:"error"})}},updateContent:n=>{"suggesting"===t().editMode?e({content:n}):(e({content:n,isDirty:!0}),em&&clearTimeout(em),em=setTimeout(()=>{t().save()},500))},updateFrontmatter:n=>{e({frontmatter:{...t().frontmatter,...n},isDirty:!0}),em&&clearTimeout(em),em=setTimeout(()=>{t().save()},500)},save:async()=>{let{currentPath:n,content:r,isDirty:i,currentRevision:o,editMode:s}=t();if(n&&i&&"suggesting"!==s){e({saveStatus:"saving"});try{let i=await ea(n,r,o);e({saveStatus:"saved",isDirty:!1,lastSavedAt:Date.now(),currentRevision:i.revision??o}),ep({path:n,content:r,frontmatter:t().frontmatter}),eh({path:n,content:r,frontmatter:t().frontmatter,revision:i.revision??o}),eg&&clearTimeout(eg),eg=setTimeout(()=>{"saved"===t().saveStatus&&e({saveStatus:"idle"})},2e3)}catch(r){r instanceof es?(e({content:r.serverContent,isDirty:!1,saveStatus:"error",currentRevision:r.currentRevision}),ep({path:n,content:r.serverContent,frontmatter:t().frontmatter})):e({saveStatus:"error"})}}},createMissingPage:async n=>{let{currentPath:r}=t();if(!r)return;let i=`# ${n}
97
97
 
98
- `;try{await el(`${r}/index.md`,i),e({content:i,isDirty:!1,loadStatus:"ok"}),ep({path:r,content:i,frontmatter:null})}catch{}},clear:()=>{em&&clearTimeout(em),eg&&clearTimeout(eg),e({currentPath:null,content:"",frontmatter:null,saveStatus:"idle",loadStatus:"idle",isDirty:!1,isLoading:!1,lastSavedAt:null,currentRevision:null})},syncRevision:t=>{e({currentRevision:t})}}));e.s(["prefetchPage",0,function(e){if(ed.has(e)||eu.has(e))return;let t=eo(e).then(e=>(eh(e),e)).finally(()=>{eu.delete(e)});eu.set(e,t),t.catch(()=>{})},"useEditorStore",0,eb],96701);let ev=ee((e,t)=>({nodes:[],selectedPath:null,expandedPaths:new Set,loadTree:async()=>{},selectPage:t=>{e({selectedPath:t})},expandPath:n=>{let{expandedPaths:r}=t();if(!r.has(n)){let t=new Set(r);t.add(n),e({expandedPaths:t})}},focusPath:n=>{let{expandedPaths:r}=t(),i=new Set(r),o=n.split("/");for(let e=1;e<o.length;e++)i.add(o.slice(0,e).join("/"));e({selectedPath:n,expandedPaths:i})}}));e.s(["useTreeStore",0,ev],990791);let ew="wiki-view-width",ex="wiki-view-align",ek=["narrow","normal","wide"],eS=ee(e=>{let t,n;return{width:"narrow"===(t=localStorage.getItem(ew))||"normal"===t||"wide"===t?t:"normal",align:"center"===(n=localStorage.getItem(ex))||"left"===n?n:"center",setWidth:t=>{localStorage.setItem(ew,t),e({width:t})},setAlign:t=>{localStorage.setItem(ex,t),e({align:t})},cycle:()=>e(e=>{let t=ek.indexOf(e.width),n=ek[(t+1)%ek.length];return localStorage.setItem(ew,n),{width:n}})}});e.s(["VIEW_ALIGN_CLASS",0,{center:"mx-auto",left:"mr-auto"},"VIEW_ALIGN_LABEL",0,{center:"Center",left:"Left"},"VIEW_ALIGN_ML",0,{center:"auto",left:"0"},"VIEW_ALIGN_ORDER",0,["center","left"],"VIEW_WIDTH_CLASS",0,{narrow:"max-w-2xl",normal:"max-w-5xl",wide:"max-w-[90rem]"},"VIEW_WIDTH_CSS",0,{narrow:"42rem",normal:"64rem",wide:"90rem"},"VIEW_WIDTH_LABEL",0,{narrow:"Narrow",normal:"Normal",wide:"Wide"},"VIEW_WIDTH_ORDER",0,ek,"useViewWidthStore",0,eS],395624);let eC=ee((e,t)=>({slugs:new Set,slugDir:new Map,loadedAt:null,loading:!1,load:async()=>{let{loadedAt:n,loading:r}=t();if(!r&&!(null!==n&&Date.now()-n<1e4)){e({loading:!0});try{let t=await (0,et.wsFetch)("/api/wiki/slugs");if(!t.ok)throw Error("Failed to fetch wiki slugs");let n=await t.json(),r=new Set,i=new Map;for(let e of["entities","concepts","comparisons","root"])for(let t of n[e])r.add(t),i.has(t)||i.set(t,e);e({slugs:r,slugDir:i,loadedAt:Date.now(),loading:!1})}catch{e({loading:!1})}}},has:e=>t().slugs.has(e),getDir:e=>t().slugDir.get(e)??null,invalidate(){e({loadedAt:null})}}));function eE(){return{sidecar:null,snapshotRevision:0,lastEventId:0,snapshotBlocks:[]}}e.s(["useWikiSlugsStore",0,eC],246542);let eM=ee((e,t)=>({byPath:{},loadSidecar:async t=>{let n=encodeURIComponent(t).replace(/%2F/g,"/");try{let r=await (0,et.wsFetch)(`/api/agent/sidecar/${n}`,{headers:en()});if(!r.ok)return;let i=await r.json();e(e=>({byPath:{...e.byPath,[t]:{...e.byPath[t]??eE(),sidecar:i,snapshotRevision:i.revision,lastEventId:i.nextEventId-1}}}))}catch{}},loadSnapshot:async t=>{let n=encodeURIComponent(t).replace(/%2F/g,"/");try{let r=await (0,et.wsFetch)(`/api/agent/files/${n}`,{headers:en()});if(!r.ok)return;let i=await r.json();e(e=>({byPath:{...e.byPath,[t]:{...e.byPath[t]??eE(),snapshotBlocks:i.blocks,snapshotRevision:i.revision}}}));let o=eb.getState();o.currentPath===t&&o.syncRevision(i.revision)}catch{}},pollEvents:async e=>{let n=t().byPath[e]??eE(),r=encodeURIComponent(e).replace(/%2F/g,"/");try{let i=await (0,et.wsFetch)(`/api/agent/events/${r}?after=${n.lastEventId}`,{headers:en()});if(!i.ok)return;for(let n of(await i.json()).events)t().applyEvent(e,n)}catch{}},applyEvent:(t,n)=>{e(e=>{let r=e.byPath[t]??eE();return{byPath:{...e.byPath,[t]:{...r,lastEventId:Math.max(r.lastEventId,n.id)}}}})},reset:t=>{e(e=>{let n={...e.byPath};return delete n[t],{byPath:n}})}}));async function eN(e,t,n){let r=encodeURIComponent(e).replace(/%2F/g,"/"),i=await fetch(`/api/agent/files/${r}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...en()},body:JSON.stringify({baseRevision:t,by:"human",ops:[n]})});if(409===i.status){let e=await i.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return{ok:i.ok,stale:!1}}async function eA(e){let{path:t,ref:n,kind:r,markdown:i,basisDetail:o,getRevision:s,refresh:a}=e,l={type:"suggestion.add",ref:n,kind:r,basis:"suggested"};"delete"!==r&&(l.markdown=i??""),o&&(l.basisDetail=o);let c=await eN(t,s(),l);return!c.ok&&c.stale&&void 0!==c.newRevision&&(await a(),c=await eN(t,c.newRevision,l)),c.ok}e.s(["useProofStore",0,eM],592185),e.s(["captureSuggestion",0,eA],926732);var eT=e.i(187014);e.s(["showError",0,function(e,t){eT.toast.error(e,t)},"showSuccess",0,function(e,t){eT.toast.success(e,t)}],417385)},153840,580330,792934,85741,464675,419943,674155,425275,891734,187080,253190,73313,736586,132807,e=>{"use strict";var t=e.i(343603),n=e.i(278928),r=e.i(111092);e.i(150663);var i=e.i(608926),o=class{constructor({editor:e,element:n,view:r,pluginKey:i="bubbleMenu",updateDelay:o=250,resizeDelay:s=60,shouldShow:a,appendTo:l,getReferencedVirtualElement:c,options:d}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:a}=s,l=!o.textBetween(r,i).length&&(0,t.isTextSelection)(n.selection),c=this.element.contains(document.activeElement);return!!(e.hasFocus()||c)&&!a&&!l&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.editor.isDestroyed)return void this.destroy();if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.editor=e,this.element=n,this.view=r,this.pluginKey=i,this.updateDelay=o,this.resizeDelay=s,this.appendTo=l,this.scrollTarget=null!=(u=null==d?void 0:d.scrollTarget)?u:window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,n.flip)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,n.shift)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,n.offset)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,n.arrow)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,n.size)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,n.autoPlacement)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,n.hide)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,n.inline)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,n,o,s,a;let{selection:l}=this.editor.state,c=null==(e=this.getReferencedVirtualElement)?void 0:e.call(this);if(c)return c;if(!(null==(o=null==(n=this.view)?void 0:n.dom)?void 0:o.parentNode))return;let d=(0,t.posToDOMRect)(this.view,l.from,l.to),u={getBoundingClientRect:()=>d,getClientRects:()=>[d]};if(l instanceof r.NodeSelection){let e=this.view.nodeDOM(l.from),t=e.dataset.nodeViewWrapper?e:e.querySelector("[data-node-view-wrapper]");t&&(e=t),e&&(u={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(l instanceof i.CellSelection){let e,t,n,{$anchorCell:r,$headCell:i}=l,o=r?r.pos:i.pos,c=i?i.pos:r.pos,d=this.view.nodeDOM(o),h=this.view.nodeDOM(c);if(!d||!h)return;let p=d===h?d.getBoundingClientRect():(s=d.getBoundingClientRect(),a=h.getBoundingClientRect(),e=Math.min(s.top,a.top),t=Math.max(s.bottom,a.bottom),n=Math.min(s.left,a.left),new DOMRect(n,e,Math.max(s.right,a.right)-n,t-e));u={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return u}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&(0,n.computePosition)(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if(this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected){if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r)return void this.handleDebouncedUpdate(e,t);let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return(null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:o,to:s}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.getReferencedVirtualElement&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},s=e=>new r.Plugin({key:"string"==typeof e.pluginKey?new r.PluginKey(e.pluginKey):e.pluginKey,view:t=>new o({view:t,...e})});t.Extension.create({name:"bubbleMenu",addOptions:()=>({element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[s({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var a=e.i(885047),l=e.i(101685),c=e.i(380560),d=class{constructor({editor:e,element:t,view:n,pluginKey:r="floatingMenu",updateDelay:i=250,resizeDelay:o=60,options:s,appendTo:a,shouldShow:l}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&0===r.parent.childCount&&!this.getTextContent(r.parent);return!!e.hasFocus()&&!!i&&!!o&&!!s&&!!this.editor.isEditable},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=o,this.appendTo=a,this.scrollTarget=null!=(c=null==s?void 0:s.scrollTarget)?c:window,this.floatingUIOptions={...this.floatingUIOptions,...s},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return(0,t.getText)(e,{textSerializers:(0,t.getTextSerializersFromSchema)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,n.flip)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,n.shift)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,n.offset)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,n.arrow)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,n.size)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,n.autoPlacement)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,n.hide)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,n.inline)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:o,to:s})}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e,r;if(!(null==(r=null==(e=this.view)?void 0:e.dom)?void 0:r.parentNode))return;let{selection:i}=this.editor.state,o=(0,t.posToDOMRect)(this.view,i.from,i.to);(0,n.computePosition)({getBoundingClientRect:()=>o,getClientRects:()=>[o]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,n,r,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},u=e=>new r.Plugin({key:"string"==typeof e.pluginKey?new r.PluginKey(e.pluginKey):e.pluginKey,view:t=>new d({view:t,...e})});function h(e,t){return null!=e?e:new r.PluginKey(t)}t.Extension.create({name:"floatingMenu",addOptions:()=>({element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}),addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[u({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var p="u">typeof window?l.useLayoutEffect:l.useEffect,f=new Set(["left","opacity","position","top","visibility","width"]),m=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),g=new Set(["children","className","style"]),y=new Set(["tabIndex"]),b=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),v={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function w(e,t){return/^on[A-Z]/.test(e)&&"function"==typeof t}function x(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function k(e,t,n){if("tabIndex"===t){e.tabIndex=Number(n);return}e[t]=n}function S(e,t){let n=(0,l.useRef)({}),r=(0,l.useRef)([]);p(()=>{var i,o,s;let a,l,c,d=n.current;return!function(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}(e,d.className,t.className),i=d.style,o=t.style,a=null!=i?i:{},l=null!=o?o:{},new Set([...Object.keys(a),...Object.keys(l)]).forEach(t=>{let n=a[t],r=l[t];if(n!==r){if(null==r)return void(!f.has(t)&&e.style.removeProperty(x(t)));f.has(t)||e.style.setProperty(x(t),"number"!=typeof r||0===r||t.startsWith("--")||m.has(t)?String(r):`${r}px`)}}),new Set([...Object.keys(d),...Object.keys(t)]).forEach(n=>{if(g.has(n)||!(n.startsWith("aria-")||n.startsWith("data-")||b.has(n))||w(n,d[n])||w(n,t[n]))return;let r=d[n],i=t[n];if(r===i)return;let o=(n.startsWith("aria-")||n.startsWith("data-"),n);if(null==i||!1===i){y.has(n)&&function(e,t){if("tabIndex"===t)return e.removeAttribute("tabindex");let n=e[t];if("boolean"==typeof n){e[t]=!1;return}if("number"==typeof n){e[t]=0;return}e[t]=""}(e,n),e.removeAttribute(o);return}if(!0===i){y.has(n)&&k(e,n,!0),e.setAttribute(o,"");return}y.has(n)?k(e,n,i):e.setAttribute(o,String(i))}),s=r.current,s.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),c=[],Object.entries(t).forEach(([t,n])=>{var r;let i,o;if(!w(t,n))return;let{eventName:s,options:a}={eventName:null!=(r=v[o=((i=t.endsWith("Capture"))?t.slice(0,-7):t).slice(2)])?r:o.toLowerCase(),options:i?{capture:!0}:void 0},l=t=>{let r,i,o;n((r=t.defaultPrevented,i=!1,Object.defineProperties(o=Object.create(t),{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>r},isPropagationStopped:{value:()=>i},preventDefault:{value:()=>{r=!0,t.preventDefault()}},stopPropagation:{value:()=>{i=!0,t.stopPropagation()}}}),o))};e.addEventListener(s,l,a),c.push({eventName:s,listener:l,options:a})}),r.current=c,n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var C=l.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,getReferencedVirtualElement:d,options:u,children:p,...f},m)=>{let g=(0,l.useRef)(document.createElement("div")),y=(0,l.useRef)(h(e,"bubbleMenu")).current;S(g.current,f),"function"==typeof m?m(g.current):m&&(m.current=g.current);let{editor:b}=(0,a.useCurrentEditor)(),v=t||b,w={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:y,shouldShow:o,getReferencedVirtualElement:d,options:u},x=(0,l.useRef)(w);x.current=w;let[k,C]=(0,l.useState)(!1),E=(0,l.useRef)(!0);return(0,l.useEffect)(()=>{if(null==v?void 0:v.isDestroyed)return;if(!v)return void console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");let e=g.current;e.style.visibility="hidden",e.style.position="absolute";let t=s({...x.current,editor:v,element:e});v.registerPlugin(t);let n=x.current.pluginKey;return E.current=!0,C(!0),()=>{C(!1),v.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[v]),(0,l.useEffect)(()=>{if(k&&v&&!v.isDestroyed){if(E.current){E.current=!1;return}v.view.dispatch(v.state.tr.setMeta(y,{type:"updateOptions",options:x.current}))}},[k,v,n,r,o,u,i,d,y]),(0,c.createPortal)(p,g.current)});l.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,options:s,children:d,...p},f)=>{let m=(0,l.useRef)(document.createElement("div")),g=(0,l.useRef)(h(e,"floatingMenu")).current;S(m.current,p),"function"==typeof f?f(m.current):f&&(f.current=m.current);let{editor:y}=(0,a.useCurrentEditor)(),b=t||y,v={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:g,shouldShow:o,options:s},w=(0,l.useRef)(v);w.current=v;let[x,k]=(0,l.useState)(!1),C=(0,l.useRef)(!0);return(0,l.useEffect)(()=>{if(null==b?void 0:b.isDestroyed)return;if(!b)return void console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");let e=m.current;e.style.visibility="hidden",e.style.position="absolute";let t=u({...w.current,editor:b,element:e});b.registerPlugin(t);let n=w.current.pluginKey;return C.current=!0,k(!0),()=>{k(!1),b.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[b]),(0,l.useEffect)(()=>{if(x&&b&&!b.isDestroyed){if(C.current){C.current=!1;return}b.view.dispatch(b.state.tr.setMeta(g,{type:"updateOptions",options:w.current}))}},[x,b,n,r,o,s,i,g]),(0,c.createPortal)(d,m.current)}),e.s(["BubbleMenu",0,C],153840);var E=e.i(605993);let M=(0,E.default)("align-center",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignCenter",0,M],580330);let N=(0,E.default)("align-justify",[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]]);e.s(["AlignJustify",0,N],792934);let A=(0,E.default)("align-left",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignLeft",0,A],85741);let T=(0,E.default)("align-right",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignRight",0,T],464675);let R=(0,E.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);e.s(["Bold",0,R],419943);let O=(0,E.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,O],674155);let D=(0,E.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);e.s(["Italic",0,D],425275);let j=(0,E.default)("message-circle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);e.s(["MessageCircle",0,j],891734);let I=(0,E.default)("message-square-plus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);e.s(["MessageSquarePlus",0,I],187080);let P=(0,E.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);e.s(["Strikethrough",0,P],253190);let L=(0,E.default)("subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);e.s(["Subscript",0,L],73313);let _=(0,E.default)("superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);e.s(["Superscript",0,_],736586);let z=(0,E.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);e.s(["Underline",0,z],132807)},920978,e=>{"use strict";let t=(0,e.i(605993).default)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],920978)},582612,933850,987027,307154,148623,395330,398441,977112,799916,853840,864255,991685,67667,733716,703550,492622,579767,978375,750110,772436,374435,e=>{"use strict";var t=e.i(44501),n=e.i(153840),r=e.i(580330),i=e.i(792934),o=e.i(85741),s=e.i(464675),a=e.i(419943),l=e.i(674155),c=e.i(425275),d=e.i(702166),u=e.i(891734),h=e.i(187080),p=e.i(253190),f=e.i(73313),m=e.i(736586),g=e.i(132807),y=e.i(101685),b=e.i(975157),v=e.i(412473),w=e.i(920978);function x({anchor:e,initialUrl:n="",onCancel:r,onApply:i,onRemove:o}){let[s,a]=(0,y.useState)(n);(0,y.useEffect)(()=>{let e=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]);let l=()=>{let e=s.trim();e?i(e):r()};return(0,t.jsxs)("div",{className:"absolute z-50 w-[340px] bg-popover border border-border rounded-lg shadow-xl overflow-hidden",style:{top:e.top,left:e.left},onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] font-medium",children:[(0,t.jsx)(d.Link,{className:"w-3.5 h-3.5"}),n?"Edit link":"Add link"]}),(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)("input",{type:"url",autoFocus:!0,value:s,placeholder:"https://example.com",onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),l())},className:"w-full bg-background border border-border rounded-md px-2.5 py-1.5 text-[12px] focus:outline-none focus:ring-2 focus:ring-primary/30"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:l,disabled:!s.trim(),className:"flex-1 py-1.5 text-[12px] rounded-md bg-primary text-primary-foreground disabled:opacity-50 hover:bg-primary/90",children:n?"Update":"Add link"}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",className:"p-1.5 rounded-md border border-border hover:bg-accent text-muted-foreground hover:text-foreground",title:"Open link",children:(0,t.jsx)(v.ExternalLink,{className:"w-3.5 h-3.5"})}),o&&(0,t.jsx)("button",{type:"button",onClick:o,className:"p-1.5 rounded-md border border-border hover:bg-accent text-destructive",title:"Remove link",children:(0,t.jsx)(w.Trash2,{className:"w-3.5 h-3.5"})})]})]})]})]})}e.s(["LinkPopover",0,x],933850),e.s(["EditorBubbleMenu",0,function({editor:e,onSuggestEdit:v,onComment:w,readOnly:k}){let[S,C]=(0,y.useState)(null);if((0,y.useEffect)(()=>{if(!S)return;let e=e=>{let t=e.target;t?.closest("[data-bubble-popover='true']")||C(null)},t=window.setTimeout(()=>window.addEventListener("mousedown",e),10);return()=>{window.clearTimeout(t),window.removeEventListener("mousedown",e)}},[S]),!e)return null;let E=e=>(0,b.cn)("h-9 w-9 sm:h-7 sm:w-7 flex items-center justify-center rounded hover:bg-accent text-foreground/80 transition-colors",e&&"bg-accent text-foreground"),M=()=>{let{from:t,to:n}=e.state.selection;return{from:t,to:n}},N=t=>e.chain().focus().setTextSelection(t).run(),A=e=>t=>{t.preventDefault(),e()},T=t=>{S?.type==="align"&&(N(S.range),e.chain().focus().setTextAlign(t).run(),C(null))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.BubbleMenu,{editor:e,options:{placement:"top",offset:8},className:"flex items-center gap-0.5 px-1 py-1 bg-popover border border-border rounded-sm shadow-lg",children:[!k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:E(e.isActive("bold")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleBold().run()),"aria-label":"Bold",children:(0,t.jsx)(a.Bold,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("italic")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleItalic().run()),"aria-label":"Italic",children:(0,t.jsx)(c.Italic,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("underline")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleUnderline().run()),"aria-label":"Underline",children:(0,t.jsx)(g.Underline,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("strike")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleStrike().run()),"aria-label":"Strikethrough",children:(0,t.jsx)(p.Strikethrough,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("code")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleCode().run()),"aria-label":"Inline code",children:(0,t.jsx)(l.Code,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("superscript")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleSuperscript().run()),"aria-label":"Superscript",children:(0,t.jsx)(m.Superscript,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("subscript")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleSubscript().run()),"aria-label":"Subscript",children:(0,t.jsx)(f.Subscript,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("link")),onMouseDown:e=>e.preventDefault(),onClick:t=>{t.preventDefault();let n=e.getAttributes("link")?.href??"",r=t.currentTarget.getBoundingClientRect();C({type:"link",range:M(),existing:n,anchor:{top:r.bottom+6,left:r.left}})},"aria-label":"Link",children:(0,t.jsx)(d.Link,{className:"w-3.5 h-3.5"})}),(v||w)&&(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),w&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),w()},"aria-label":"Comment",title:"Comment",children:(0,t.jsx)(u.MessageCircle,{className:"w-3.5 h-3.5"})}),v&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),v()},"aria-label":"Suggest edit",title:"Suggest edit",children:(0,t.jsx)(h.MessageSquarePlus,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),C({type:"align",range:M()})},"aria-label":"Align",children:(0,t.jsx)(o.AlignLeft,{className:"w-3.5 h-3.5"})}),S?.type==="align"&&(0,t.jsxs)("div",{"data-bubble-popover":"true",className:"absolute top-full left-0 mt-1 z-50 bg-popover border border-border rounded-sm shadow-lg p-1 flex gap-0.5",children:[(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"left"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("left"),"aria-label":"Align left",children:(0,t.jsx)(o.AlignLeft,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"center"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("center"),"aria-label":"Align center",children:(0,t.jsx)(r.AlignCenter,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"right"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("right"),"aria-label":"Align right",children:(0,t.jsx)(s.AlignRight,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"justify"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("justify"),"aria-label":"Justify",children:(0,t.jsx)(i.AlignJustify,{className:"w-3.5 h-3.5"})})]})]})]}),k&&w&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),w()},"aria-label":"Comment",title:"Add comment",children:(0,t.jsx)(u.MessageCircle,{className:"w-3.5 h-3.5"})})]}),S?.type==="link"&&(0,t.jsx)("div",{"data-bubble-popover":"true",style:{position:"fixed",top:S.anchor.top,left:S.anchor.left,zIndex:60},children:(0,t.jsx)(x,{anchor:{top:0,left:0},initialUrl:S.existing,onCancel:()=>C(null),onApply:t=>{S?.type==="link"&&(N(S.range),e.chain().focus().extendMarkRange("link").setLink({href:t}).run(),C(null))},onRemove:S.existing?()=>{S?.type==="link"&&(N(S.range),e.chain().focus().unsetLink().run(),C(null))}:void 0})})]})}],582612);var k=e.i(605993);let S=(0,k.default)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckSquare",0,S],987027);let C=(0,k.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,C],307154);let E=(0,k.default)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);e.s(["FileCode",0,E],148623);let M=(0,k.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);e.s(["Heading1",0,M],395330);let N=(0,k.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);e.s(["Heading2",0,N],398441);let A=(0,k.default)("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);e.s(["Heading3",0,A],977112);var T=e.i(375707);e.s(["ImageIcon",()=>T.default],799916);let R=(0,k.default)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);e.s(["List",0,R],853840);let O=(0,k.default)("list-ordered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);e.s(["ListOrdered",0,O],864255);let D=(0,k.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,D],991685);let j=(0,k.default)("pilcrow-left",[["path",{d:"M14 3v11",key:"mlfb7b"}],["path",{d:"M14 9h-3a3 3 0 0 1 0-6h9",key:"1ulc19"}],["path",{d:"M18 3v11",key:"1phi0r"}],["path",{d:"M22 18H2l4-4",key:"yt65j9"}],["path",{d:"m6 22-4-4",key:"6jgyf5"}]]);e.s(["PilcrowLeft",0,j],67667);let I=(0,k.default)("pilcrow-right",[["path",{d:"M10 3v11",key:"o3l5kj"}],["path",{d:"M10 9H7a1 1 0 0 1 0-6h8",key:"1wb1nc"}],["path",{d:"M14 3v11",key:"mlfb7b"}],["path",{d:"m18 14 4 4H2",key:"4r8io1"}],["path",{d:"m22 18-4 4",key:"1hjjrd"}]]);e.s(["PilcrowRight",0,I],733716);let P=(0,k.default)("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);e.s(["Quote",0,P],703550);let L=(0,k.default)("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);e.s(["Redo",0,L],492622);let _=(0,k.default)("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);e.s(["Undo",0,_],579767);let z=(0,k.default)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);e.s(["Video",0,z],978375),e.i(380560);var $=e.i(206102),H=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let r=(0,$.createSlot)(`Primitive.${n}`),i=y.forwardRef((e,i)=>{let{asChild:o,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?r:n,{...s,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});e.s(["Primitive",0,H],750110);var B="horizontal",F=["horizontal","vertical"],V=y.forwardRef((e,n)=>{var r;let{decorative:i,orientation:o=B,...s}=e,a=(r=o,F.includes(r))?o:B;return(0,t.jsx)(H.div,{"data-orientation":a,...i?{role:"none"}:{"aria-orientation":"vertical"===a?a:void 0,role:"separator"},...s,ref:n})});V.displayName="Separator";let U=y.forwardRef(({className:e,orientation:n="horizontal",decorative:r=!0,...i},o)=>(0,t.jsx)(V,{ref:o,decorative:r,orientation:n,className:(0,b.cn)("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...i}));U.displayName=V.displayName,e.s(["Separator",0,U],772436);let W=(0,k.default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);e.s(["Clipboard",0,W],374435)},924782,e=>{"use strict";let t=(0,e.i(605993).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],924782)},454184,(e,t,n)=>{class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let a=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function u(e){return f("(?=",e,")")}function h(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>d(e)).join("")}function m(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>d(e)).join("|")+")"}function g(e){return RegExp(e.toString()+"|").exec("").length-1}let y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,r=d(e),i="";for(;r.length>0;){let e=y.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}let v="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",S="\\b(0b[01]+)",C={begin:"\\\\[\\s\\S]",relevance:0},E=function(e,t,n={}){let r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:f(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},M=E("//","$"),N=E("/\\*","\\*/"),A=E("#","$");var T=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[C]},BACKSLASH_ESCAPE:C,BINARY_NUMBER_MODE:{scope:"number",begin:S,relevance:0},BINARY_NUMBER_RE:S,COMMENT:E,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:M,C_NUMBER_MODE:{scope:"number",begin:k,relevance:0},C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:A,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+w,relevance:0},NUMBER_MODE:{scope:"number",begin:x,relevance:0},NUMBER_RE:x,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[C]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[C,{begin:/\[/,end:/\]/,relevance:0,contains:[C]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:v,relevance:0},UNDERSCORE_IDENT_RE:w,UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0}});function R(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function O(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function j(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function I(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function P(e,t){void 0===e.relevance&&(e.relevance=1)}let L=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,u(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_=["of","and","for","in","not","or","if","then","parent","list","value"],z={},$=e=>{console.error(e)},H=(e,...t)=>{console.log(`WARN: ${e}`,...t)},B=(e,t)=>{z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)},F=Error();function V(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function U(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),F;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"),F;V(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"),F;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"),F;V(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}class W extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let K=Symbol("nomatch"),q=function(e){let t=Object.create(null),n=Object.create(null),s=[],a=!0,l="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},v={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function w(e){return v.noHighlightRe.test(e)}function x(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);let o={code:r,language:i};z("before:highlight",o);let s=o.result?o.result:k(o.language,o.code,n);return s.code=o.code,z("after:highlight",s),s}function k(e,n,s,c){let u=Object.create(null);function h(){if(!A.keywords)return void R.addText(H);let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(H),n="";for(;t;){n+=H.substring(e,t.index);let r=C.case_insensitive?t[0].toLowerCase():t[0],i=A.keywords[r];if(i){let[e,o]=i;if(R.addText(n),n="",u[r]=(u[r]||0)+1,u[r]<=7&&(B+=o),e.startsWith("_"))n+=t[0];else{let n=C.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(H)}n+=H.substring(e),R.addText(n)}function p(){null!=A.subLanguage?function(){if(""===H)return;let e=null;if("string"==typeof A.subLanguage){if(!t[A.subLanguage])return R.addText(H);e=k(A.subLanguage,H,!0,T[A.subLanguage]),T[A.subLanguage]=e._top}else e=S(H,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(B+=e.relevance),R.__addSublanguage(e._emitter,e.language)}():h(),H=""}function f(e,t){""!==e&&(R.startScope(t),R.addText(e),R.endScope())}function m(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=C.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(H=i,h(),H=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&R.openNode(C.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(H,C.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),H=""):e.beginScope._multi&&(m(e.beginScope,t),H="")),A=Object.create(e,{parent:{value:A}})}let w={};function x(t,i){let o=i&&i[0];if(H+=t,null==o)return p(),0;if("begin"===w.type&&"end"===i.type&&w.index===i.index&&""===o){if(H+=n.slice(i.index,i.index+1),!a){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=i,"begin"===i.type){let e=i[0],t=i.rule,n=new r(t);for(let r of[t.__beforeBegin,t["on:begin"]])if(r&&(r(i,n),n.isMatchIgnored))return 0===A.matcher.regexIndex?(H+=e[0],1):(W=!0,0);return t.skip?H+=e:(t.excludeBegin&&(H+=e),p(),t.returnBegin||t.excludeBegin||(H=e)),y(t,i),t.returnBegin?0:e.length}if("illegal"!==i.type||s){if("end"===i.type){let e=function(e){let t=e[0],i=n.substring(e.index),o=function e(t,n,i){var o;let s,a=(o=t.endRe,(s=o&&o.exec(i))&&0===s.index);if(a){if(t["on:end"]){let e=new r(t);t["on:end"](n,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(A,e,i);if(!o)return K;let s=A;A.endScope&&A.endScope._wrap?(p(),f(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),m(A.endScope,e)):s.skip?H+=t:(s.returnEnd||s.excludeEnd||(H+=t),p(),s.excludeEnd&&(H=t));do A.scope&&R.closeNode(),A.skip||A.subLanguage||(B+=A.relevance),A=A.parent;while(A!==o.parent)return o.starts&&y(o.starts,e),s.returnEnd?0:t.length}(i);if(e!==K)return e}}else{let e=Error('Illegal lexeme "'+o+'" for mode "'+(A.scope||"<unnamed>")+'"');throw e.mode=A,e}if("illegal"===i.type&&""===o)return H+="\n",1;if(V>1e5&&V>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return H+=o,o.length}let C=N(e);if(!C)throw $(l.replace("{}",e)),Error('Unknown language: "'+e+'"');let E=function(e){function t(t,n){return RegExp(d(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,s){let a;if(i.isCompiled)return i;[O,I,U,L].forEach(e=>e(i,s)),e.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[D,j,P].forEach(e=>e(i,s)),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=function e(t,n,r="keyword"){let i=Object.create(null);return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(r){Object.assign(i,e(t[r],n,r))}),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var n,r,o;let s=t.split("|");i[s[0]]=[e,(n=s[0],(r=s[1])?Number(r):+(o=n,!_.includes(o.toLowerCase())))]})}}(i.keywords,e.case_insensitive)),i.keywordPatternRe=t(l,!0),s&&(i.begin||(i.begin=/\B|\b/),i.beginRe=t(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=t(i.end)),i.terminatorEnd=d(i.end)||"",i.endsWithParent&&s.terminatorEnd&&(i.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(i.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){var t;return((t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return o(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?o(t):t:o(t,{starts:t.starts?o(t.starts):null})})),i.contains.forEach(function(e){n(e,i)}),i.starts&&n(i.starts,s),a=new r,i.contains.forEach(e=>a.addRule(e.begin,{rule:e,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),i.matcher=a,i}(e)}(C),M="",A=c||E,T={},R=new v.__emitter(v),z=[];for(let e=A;e!==C;e=e.parent)e.scope&&z.unshift(e.scope);z.forEach(e=>R.openNode(e));let H="",B=0,F=0,V=0,W=!1;try{if(C.__emitTokens)C.__emitTokens(n,R);else{for(A.matcher.considerAll();;){V++,W?W=!1:A.matcher.considerAll(),A.matcher.lastIndex=F;let e=A.matcher.exec(n);if(!e)break;let t=n.substring(F,e.index),r=x(t,e);F=e.index+r}x(n.substring(F))}return R.finalize(),M=R.toHTML(),{language:e,value:M,relevance:B,illegal:!1,_emitter:R,_top:A}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:i(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:M},_emitter:R};if(a)return{language:e,value:i(n),illegal:!1,relevance:0,errorRaised:t,_emitter:R,_top:A};throw t}}function S(e,n){let r;n=n||v.languages||Object.keys(t);let o=((r={value:i(e),illegal:!1,relevance:0,_top:y,_emitter:new v.__emitter(v)})._emitter.addText(e),r),s=n.filter(N).filter(R).map(t=>k(t,e,!1));s.unshift(o);let[a,l]=s.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;else if(N(t.language).supersetOf===e.language)return -1}return 0});return a.secondBest=l,a}function C(e){var t;let r,i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=v.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(H(l.replace("{}",n[1])),H("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>w(e)||N(e))}(e);if(w(i))return;if(z("before:highlightElement",{el:e,language:i}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(v.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),v.throwUnescapedHTML))throw new W("One of your code blocks includes unescaped HTML.",e.innerHTML);let o=e.textContent,s=i?x(o,{language:i,ignoreIllegals:!0}):S(o);e.innerHTML=s.value,e.dataset.highlighted="yes",t=s.language,r=i&&n[i]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),z("after:highlightElement",{el:e,result:s,text:o})}let E=!1;function M(){if("loading"===document.readyState){E||window.addEventListener("DOMContentLoaded",function(){M()},!1),E=!0;return}document.querySelectorAll(v.cssSelector).forEach(C)}function N(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function A(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function R(e){let t=N(e);return t&&!t.disableAutodetect}function z(e,t){s.forEach(function(n){n[e]&&n[e](t)})}for(let r in Object.assign(e,{highlight:x,highlightAuto:S,highlightAll:M,highlightElement:C,highlightBlock:function(e){return B("10.7.0","highlightBlock will be removed entirely in v12.0"),B("10.7.0","Please use highlightElement now."),C(e)},configure:function(e){v=o(v,e)},initHighlighting:()=>{M(),B("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){M(),B("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if($("Language definition for '{}' could not be registered.".replace("{}",n)),a)$(e);else throw e;i=y}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&A(i.aliases,{languageName:n})},unregisterLanguage:function(e){for(let r of(delete t[e],Object.keys(n)))n[r]===e&&delete n[r]},listLanguages:function(){return Object.keys(t)},getLanguage:N,registerAliases:A,autoDetection:R,inherit:o,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),s.push(e)},removePlugin:function(e){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:u,either:m,optional:p,anyNumberOfTimes:h},T)"object"==typeof T[r]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],i=typeof r;"object"!==i&&"function"!==i||Object.isFrozen(r)||e(r)}),t}(T[r]);return Object.assign(e,T),e},J=q({});J.newInstance=()=>q({}),t.exports=J,J.HighlightJS=J,J.default=J},240409,512527,944404,334609,265590,441228,576500,194633,32033,623568,42420,278909,532270,503658,185503,993667,314206,388503,284766,965837,582966,25688,770271,e=>{"use strict";var t=e.i(44501),n=e.i(580330),r=e.i(792934),i=e.i(85741),o=e.i(464675),s=e.i(419943),a=e.i(987027),l=e.i(307154),c=e.i(10137),d=e.i(674155),u=e.i(148623),h=e.i(395330),p=e.i(398441),f=e.i(977112),m=e.i(799916),g=e.i(425275),y=e.i(702166),b=e.i(853840),v=e.i(864255),w=e.i(991685),x=e.i(67667),k=e.i(733716),S=e.i(703550),C=e.i(492622),E=e.i(253190),M=e.i(73313),N=e.i(736586),A=e.i(132807),T=e.i(579767),R=e.i(978375),O=e.i(101685),D=e.i(772436),j=e.i(975157),I=e.i(96701),P=e.i(933850),L=e.i(374435),_=e.i(924782),z=e.i(671485);async function $(e,t){let n=new FormData;n.append("file",t);try{let t=await (0,z.wsFetch)(`/api/upload/${e}`,{method:"POST",body:n});if(!t.ok)return null;let r=await t.json();return{url:(0,z.withWs)(r.url),filename:r.filename}}catch{return null}}function H({kind:e,pagePath:n,onCancel:r,onInsert:i,anchor:o}){let[s,a]=(0,O.useState)("upload"),[l,c]=(0,O.useState)(""),[d,u]=(0,O.useState)(!1),[h,p]=(0,O.useState)(null),f=(0,O.useRef)(null),m=async e=>{if(e&&0!==e.length){u(!0),p(null);try{let t=e[0],r=await $(n,t);if(!r)return void p("Upload failed.");i({url:r.url,alt:t.name,mimeType:t.type})}finally{u(!1)}}},g=()=>{let e=l.trim();e&&i({url:e})};return(0,t.jsxs)("div",{className:"absolute z-50 w-[360px] bg-popover border border-border rounded-xl shadow-e-4 overflow-hidden",style:{top:o.top,left:o.left},onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,t.jsx)("div",{className:"text-[12px] font-medium",children:"image"===e?"Insert image":"video"===e?"Insert video":"Attach file"}),(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),(0,t.jsxs)("div",{className:"flex border-b border-border bg-muted/30",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a("upload"),className:(0,j.cn)("flex-1 py-1.5 text-[11px] flex items-center justify-center gap-1.5 transition-colors","upload"===s?"bg-background text-foreground border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(_.Upload,{className:"w-3 h-3"})," Upload"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>a("url"),className:(0,j.cn)("flex-1 py-1.5 text-[11px] flex items-center justify-center gap-1.5 transition-colors","url"===s?"bg-background text-foreground border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(y.Link,{className:"w-3 h-3"})," From URL"]})]}),"upload"===s?(0,t.jsxs)("div",{className:"p-4",onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),m(e.dataTransfer.files)},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>f.current?.click(),disabled:d,className:"w-full border-2 border-dashed border-border rounded-sm py-6 flex flex-col items-center justify-center text-muted-foreground hover:bg-accent/30 transition-colors",children:[(0,t.jsx)(_.Upload,{className:"w-5 h-5 mb-1.5"}),(0,t.jsx)("span",{className:"text-[12px] font-medium",children:d?"Uploading…":`Click to upload ${e}`}),(0,t.jsx)("span",{className:"text-[10px] mt-0.5",children:"or drop a file here"})]}),(0,t.jsx)("input",{ref:f,type:"file",accept:"image"===e?"image/*":"video"===e?"video/*":"*/*",className:"hidden",onChange:e=>m(e.target.files)}),h&&(0,t.jsx)("div",{className:"mt-2 text-[11px] text-destructive",children:h})]}):(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)("input",{type:"url",autoFocus:!0,value:l,placeholder:"image"===e?"https://example.com/image.png":"video"===e?"https://example.com/video.mp4":"https://example.com/file",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),g()):"Escape"===e.key&&r()},className:"w-full bg-background border border-border rounded-sm px-2.5 py-1.5 text-[12px] focus:outline-none focus:ring-2 focus:ring-primary/30"}),(0,t.jsx)("button",{type:"button",onClick:g,disabled:!l.trim(),className:"w-full py-1.5 text-[12px] rounded-sm bg-primary text-primary-foreground disabled:opacity-50 hover:bg-primary/90",children:"Insert"})]}),(0,t.jsxs)("div",{className:"px-3 py-2 border-t border-border bg-muted/30 text-[10px] text-muted-foreground flex items-start gap-1.5",children:[(0,t.jsx)(L.Clipboard,{className:"w-3 h-3 shrink-0 mt-[1px]"}),(0,t.jsxs)("span",{children:["Tip: you can also"," ",(0,t.jsx)("strong",{className:"text-foreground/80",children:"paste"})," or"," ",(0,t.jsx)("strong",{className:"text-foreground/80",children:"drag & drop"}),"files directly into the page — they'll be saved alongside this page automatically."]})]})]})}function B({label:e,icon:n,active:r,disabled:i,style:o,onAction:s}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,disabled:i,style:o,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.preventDefault(),s(e)},className:(0,j.cn)("h-8 w-8 shrink-0 inline-flex items-center justify-center rounded-md text-foreground/80 hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-40",r&&"bg-accent text-accent-foreground ring-1 ring-inset ring-foreground/15"),children:(0,t.jsx)(n,{className:"h-4 w-4"})})}function F({onClose:e}){return(0,O.useEffect)(()=>{let t=window.setTimeout(()=>{let t=t=>{let n=t.target;n?.closest('[data-editor-popover="true"]')||e()};window.addEventListener("mousedown",t),window.__editorPopClose=()=>window.removeEventListener("mousedown",t)},10);return()=>{window.clearTimeout(t);let e=window;e.__editorPopClose&&(e.__editorPopClose(),e.__editorPopClose=void 0)}},[e]),null}e.s(["MediaPopover",0,H],512527),e.s(["EditorToolbar",0,function({editor:e}){let j=(0,I.useEditorStore)(e=>e.frontmatter),L=(0,I.useEditorStore)(e=>e.updateFrontmatter),_=(0,I.useEditorStore)(e=>e.currentPath),z=j?.dir==="rtl",[$,V]=(0,O.useState)(null),U=(0,O.useRef)(null),[W,K]=(0,O.useState)(!1),[q,J]=(0,O.useState)(!1),[,G]=(0,O.useState)(0);(0,O.useEffect)(()=>{if(!e)return;let t=()=>G(e=>e+1);return e.on("selectionUpdate",t),e.on("transaction",t),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e]);let X=(0,O.useCallback)(()=>{let e=U.current;e&&(K(e.scrollLeft>4),J(e.scrollLeft+e.clientWidth<e.scrollWidth-4))},[]);(0,O.useEffect)(()=>{if(!e)return;let t=U.current;if(!t)return;let n=requestAnimationFrame(X),r=()=>X();window.addEventListener("resize",r),t.addEventListener("scroll",X);let i=new ResizeObserver(()=>X());for(let e of(i.observe(t),Array.from(t.children)))i.observe(e);return()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r),t.removeEventListener("scroll",X),i.disconnect()}},[e,X]);let Z=e=>{let t=U.current;t&&t.scrollBy({left:e*Math.max(160,.6*t.clientWidth),behavior:"smooth"})};if(!e)return null;let Y=(t,n)=>{e.chain().focus().setTextSelection(t).run(),n()},Q=(t,n)=>{let r=t.currentTarget.getBoundingClientRect();V(n({top:r.bottom+6,left:r.left},(()=>{let{from:t,to:n}=e.state.selection;return{from:t,to:n}})()))},ee=[{icon:h.Heading1,action:()=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e.isActive("heading",{level:1}),label:"Heading 1"},{icon:p.Heading2,action:()=>e.chain().focus().toggleHeading({level:2}).run(),isActive:e.isActive("heading",{level:2}),label:"Heading 2"},{icon:f.Heading3,action:()=>e.chain().focus().toggleHeading({level:3}).run(),isActive:e.isActive("heading",{level:3}),label:"Heading 3"},{separator:!0},{icon:s.Bold,action:()=>e.chain().focus().toggleBold().run(),isActive:e.isActive("bold"),label:"Bold"},{icon:g.Italic,action:()=>e.chain().focus().toggleItalic().run(),isActive:e.isActive("italic"),label:"Italic"},{icon:A.Underline,action:()=>e.chain().focus().toggleUnderline().run(),isActive:e.isActive("underline"),label:"Underline"},{icon:E.Strikethrough,action:()=>e.chain().focus().toggleStrike().run(),isActive:e.isActive("strike"),label:"Strikethrough"},{icon:d.Code,action:()=>e.chain().focus().toggleCode().run(),isActive:e.isActive("code"),label:"Inline code"},{icon:y.Link,action:t=>{let n=e.getAttributes("link")?.href??"";Q(t,(e,t)=>({type:"link",anchor:e,range:t,existing:n}))},isActive:e.isActive("link"),label:"Link"},{separator:!0},{icon:b.List,action:()=>e.chain().focus().toggleBulletList().run(),isActive:e.isActive("bulletList"),label:"Bullet list"},{icon:v.ListOrdered,action:()=>e.chain().focus().toggleOrderedList().run(),isActive:e.isActive("orderedList"),label:"Ordered list"},{icon:S.Quote,action:()=>e.chain().focus().toggleBlockquote().run(),isActive:e.isActive("blockquote"),label:"Blockquote"},{icon:a.CheckSquare,action:()=>e.chain().focus().toggleTaskList().run(),isActive:e.isActive("taskList"),label:"Checklist"},{icon:u.FileCode,action:()=>e.chain().focus().toggleCodeBlock().run(),isActive:e.isActive("codeBlock"),label:"Code block"},{icon:w.Minus,action:()=>e.chain().focus().setHorizontalRule().run(),isActive:!1,label:"Divider"}],et=[{icon:i.AlignLeft,action:()=>e.chain().focus().setTextAlign("left").run(),isActive:e.isActive({textAlign:"left"}),label:"Align left"},{icon:n.AlignCenter,action:()=>e.chain().focus().setTextAlign("center").run(),isActive:e.isActive({textAlign:"center"}),label:"Align center"},{icon:o.AlignRight,action:()=>e.chain().focus().setTextAlign("right").run(),isActive:e.isActive({textAlign:"right"}),label:"Align right"},{icon:r.AlignJustify,action:()=>e.chain().focus().setTextAlign("justify").run(),isActive:e.isActive({textAlign:"justify"}),label:"Justify"},{separator:!0},{icon:N.Superscript,action:()=>e.chain().focus().toggleSuperscript().run(),isActive:e.isActive("superscript"),label:"Superscript"},{icon:M.Subscript,action:()=>e.chain().focus().toggleSubscript().run(),isActive:e.isActive("subscript"),label:"Subscript"},{separator:!0},{icon:m.ImageIcon,action:e=>Q(e,e=>({type:"media",kind:"image",anchor:e})),isActive:!1,label:"Insert image"},{icon:R.Video,action:e=>Q(e,e=>({type:"media",kind:"video",anchor:e})),isActive:!1,label:"Insert video"},{separator:!0},{icon:T.Undo,action:()=>e.chain().focus().undo().run(),isActive:!1,label:"Undo"},{icon:C.Redo,action:()=>e.chain().focus().redo().run(),isActive:!1,label:"Redo"},{separator:!0},{icon:z?x.PilcrowLeft:k.PilcrowRight,action:()=>L({dir:z?void 0:"rtl"}),isActive:z,label:z?"Switch to LTR":"Switch to RTL"}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative border-b border-border bg-background/50",children:[W&&(0,t.jsx)("button",{type:"button","aria-label":"Scroll toolbar left",onMouseDown:e=>e.preventDefault(),onClick:()=>Z(-1),className:"absolute left-0 top-0 bottom-0 w-6 z-10 flex items-center justify-start pl-0.5 bg-gradient-to-r from-background via-background/80 to-transparent text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(l.ChevronLeft,{className:"h-4 w-4"})}),q&&(0,t.jsx)("button",{type:"button","aria-label":"Scroll toolbar right",onMouseDown:e=>e.preventDefault(),onClick:()=>Z(1),className:"absolute right-0 top-0 bottom-0 w-6 z-10 flex items-center justify-end pr-0.5 bg-gradient-to-l from-background via-background/80 to-transparent text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(c.ChevronRight,{className:"h-4 w-4"})}),(0,t.jsx)("div",{ref:U,onWheel:e=>{let t=U.current;t&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(t.scrollLeft+=e.deltaY)},className:"flex items-center gap-0.5 px-2 pt-1 pb-1.5 overflow-x-scroll overflow-y-hidden editor-toolbar-scroll",children:[...ee,{separator:!0},...et].map((e,n)=>"separator"in e?(0,t.jsx)(D.Separator,{orientation:"vertical",className:"mx-1 h-6 shrink-0"},n):(0,t.jsx)(B,{label:e.label,icon:e.icon,active:e.isActive,style:e.style,onAction:e.action},n))})]}),$?.type==="link"&&(0,t.jsx)("div",{"data-editor-popover":"true",style:{position:"fixed",top:$.anchor.top,left:$.anchor.left,zIndex:60},children:(0,t.jsx)(P.LinkPopover,{anchor:{top:0,left:0},initialUrl:$.existing,onCancel:()=>V(null),onApply:t=>{$?.type==="link"&&(Y($.range,()=>{e.chain().focus().extendMarkRange("link").setLink({href:t}).run()}),V(null))},onRemove:$.existing?()=>{$?.type==="link"&&(Y($.range,()=>{e.chain().focus().unsetLink().run()}),V(null))}:void 0})}),$?.type==="media"&&_&&(0,t.jsx)("div",{"data-editor-popover":"true",style:{position:"fixed",top:$.anchor.top,left:$.anchor.left,zIndex:60},children:(0,t.jsx)(H,{kind:$.kind,pagePath:_,anchor:{top:0,left:0},onCancel:()=>V(null),onInsert:t=>((t,n)=>{let{url:r,alt:i,mimeType:o}=n;"image"===t||(o??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(r)?e.chain().focus().setImage({src:r,alt:i??""}).run():e.chain().focus().insertContent(`<a href="${r}">${i??r}</a>`).run(),V(null)})($.kind,t)})}),$&&(0,t.jsx)(F,{onClose:()=>V(null)})]})}],240409);var V=e.i(343603),U=e.i(111092),W=/^```([a-z]+)?[\s\n]$/,K=/^~~~([a-z]+)?[\s\n]$/,q=V.Node.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,V.mergeAttributes)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&(null==(r=e.raw)?void 0:r.startsWith("~~~"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
99
-
100
- \`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),a=o.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n"),c=0,d=0,u=i-s;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=u){c=e;break}d+=l[e].length+1}let h=Math.min(((null==(t=l[c].match(/^ */))?void 0:t[0])||"").length,n);if(0===h)return!0;let p=s;for(let e=0;e<c;e+=1)p+=l[e].length+1;return e.delete(p,p+h),i-p<=h&&e.setSelection(U.TextSelection.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(U.Selection.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,V.textblockTypeInputRule)({find:W,type:this.type,getAttributes:e=>({language:e[1]})}),(0,V.textblockTypeInputRule)({find:K,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new U.Plugin({key:new U.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(U.TextSelection.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),J=e.i(362615);let G=e.i(454184).default;function X(e){return e.value||e.children||[]}function Z({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return(0,V.findChildren)(e,e=>e.type.name===t).forEach(e=>{var t;let o=e.pos+1,s=e.node.attrs.language||r,a=n.listLanguages();(function e(t,n=[]){return t.flatMap(t=>{let r=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,r):{text:t.value,classes:r}})})(s&&(a.includes(s)||G.getLanguage(s)||(null==(t=n.registered)?void 0:t.call(n,s)))?X(n.highlight(s,e.node.textContent)):X(n.highlightAuto(e.node.textContent))).forEach(e=>{let t=o+e.text.length;if(e.classes.length){let n=J.Decoration.inline(o,t,{class:e.classes.join(" ")});i.push(n)}o=t})}),J.DecorationSet.create(e,i)}var Y=q.extend({addOptions(){var e;return{...null==(e=this.parent)?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...(null==(e=this.parent)?void 0:e.call(this))||[],function({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(e=>"function"==typeof t[e]))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new U.Plugin({key:new U.PluginKey("lowlight"),state:{init:(r,{doc:i})=>Z({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{let a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,V.findChildren)(o.doc,t=>t.type.name===e),d=(0,V.findChildren)(s.doc,t=>t.type.name===e);return r.docChanged&&([a,l].includes(e)||d.length!==c.length||r.steps.some(e=>void 0!==e.from&&void 0!==e.to&&c.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?Z({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});let Q="numeric",ee="ascii",et="alpha",en="asciinumeric",er="alphanumeric",ei="domain",eo="emoji",es="whitespace";function ea(e,t,n){for(let r in t[Q]&&(t[en]=!0,t[er]=!0),t[ee]&&(t[en]=!0,t[et]=!0),t[en]&&(t[er]=!0),t[et]&&(t[er]=!0),t[er]&&(t[ei]=!0),t[eo]&&(t[ei]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function el(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}el.groups={},el.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||el.groups,t&&t.j?i=t:(i=new el(t),n&&r&&ea(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||el.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new el).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new el,t&&(r&&(i.t&&"string"==typeof i.t?ea(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&ea(t,n,r)),i.t=t),this.j[e]=i,i}};let ec=(e,t,n,r,i)=>e.ta(t,n,r,i),ed=(e,t,n,r,i)=>e.tr(t,n,r,i),eu=(e,t,n,r,i)=>e.ts(t,n,r,i),eh=(e,t,n,r,i)=>e.tt(t,n,r,i),ep="WORD",ef="UWORD",em="ASCIINUMERICAL",eg="ALPHANUMERICAL",ey="LOCALHOST",eb="UTLD",ev="SCHEME",ew="SLASH_SCHEME",ex="OPENBRACE",ek="CLOSEBRACE",eS="OPENBRACKET",eC="CLOSEBRACKET",eE="OPENPAREN",eM="CLOSEPAREN",eN="OPENANGLEBRACKET",eA="CLOSEANGLEBRACKET",eT="FULLWIDTHLEFTPAREN",eR="FULLWIDTHRIGHTPAREN",eO="LEFTCORNERBRACKET",eD="RIGHTCORNERBRACKET",ej="LEFTWHITECORNERBRACKET",eI="RIGHTWHITECORNERBRACKET",eP="FULLWIDTHLESSTHAN",eL="FULLWIDTHGREATERTHAN",e_="AMPERSAND",ez="APOSTROPHE",e$="ASTERISK",eH="BACKSLASH",eB="BACKTICK",eF="CARET",eV="COLON",eU="COMMA",eW="DOLLAR",eK="EQUALS",eq="EXCLAMATION",eJ="HYPHEN",eG="PERCENT",eX="PIPE",eZ="PLUS",eY="POUND",eQ="QUERY",e0="QUOTE",e1="FULLWIDTHMIDDLEDOT",e2="SEMI",e3="SLASH",e5="TILDE",e4="UNDERSCORE",e6="EMOJI";var e9=Object.freeze({__proto__:null,ALPHANUMERICAL:eg,AMPERSAND:e_,APOSTROPHE:ez,ASCIINUMERICAL:em,ASTERISK:e$,AT:"AT",BACKSLASH:eH,BACKTICK:eB,CARET:eF,CLOSEANGLEBRACKET:eA,CLOSEBRACE:ek,CLOSEBRACKET:eC,CLOSEPAREN:eM,COLON:eV,COMMA:eU,DOLLAR:eW,DOT:"DOT",EMOJI:e6,EQUALS:eK,EXCLAMATION:eq,FULLWIDTHGREATERTHAN:eL,FULLWIDTHLEFTPAREN:eT,FULLWIDTHLESSTHAN:eP,FULLWIDTHMIDDLEDOT:e1,FULLWIDTHRIGHTPAREN:eR,HYPHEN:eJ,LEFTCORNERBRACKET:eO,LEFTWHITECORNERBRACKET:ej,LOCALHOST:ey,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:eN,OPENBRACE:ex,OPENBRACKET:eS,OPENPAREN:eE,PERCENT:eG,PIPE:eX,PLUS:eZ,POUND:eY,QUERY:eQ,QUOTE:e0,RIGHTCORNERBRACKET:eD,RIGHTWHITECORNERBRACKET:eI,SCHEME:ev,SEMI:e2,SLASH:e3,SLASH_SCHEME:ew,SYM:"SYM",TILDE:e5,TLD:"TLD",UNDERSCORE:e4,UTLD:eb,UWORD:ef,WORD:ep,WS:"WS"});let e7=/[a-z]/,e8=/\p{L}/u,te=/\p{Emoji}/u,tt=/\d/,tn=/\s/,tr=null,ti=null;function to(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)(a=l).accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=u,s-=h,c-=u,i.push({t:d.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function ts(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new el(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new el(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function ta(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let tl={defaultProtocol:"http",events:null,format:td,formatHref:td,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function tc(e,t=null){let n=Object.assign({},tl);e&&(n=Object.assign(n,e instanceof tc?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function td(e){return e}function tu(e,t){this.t="token",this.v=e,this.tk=t}function th(e,t){class n extends tu{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}tc.prototype={o:tl,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:tl[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},tu.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=tl.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),a=e.get("target",t,this),l=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),a&&(o.target=a),l&&(o.rel=l),c&&Object.assign(o,c),{tagName:r,attributes:o,content:i,eventListeners:d}}};let tp=th("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),tf=th("text"),tm=th("nl"),tg=th("url",{isLink:!0,toHref(e=tl.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==ey&&e[1].t===eV}}),ty=e=>new el(e);function tb(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let tv="u">typeof console&&console&&console.warn||(()=>{}),tw={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tx(e,t=!1){if(tw.initialized&&tv(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
98
+ `;try{await el(`${r}/index.md`,i),e({content:i,isDirty:!1,loadStatus:"ok"}),ep({path:r,content:i,frontmatter:null})}catch{}},clear:()=>{em&&clearTimeout(em),eg&&clearTimeout(eg),e({currentPath:null,content:"",frontmatter:null,saveStatus:"idle",loadStatus:"idle",isDirty:!1,isLoading:!1,lastSavedAt:null,currentRevision:null})},syncRevision:t=>{e({currentRevision:t})}}));e.s(["prefetchPage",0,function(e){if(ed.has(e)||eu.has(e))return;let t=eo(e).then(e=>(eh(e),e)).finally(()=>{eu.delete(e)});eu.set(e,t),t.catch(()=>{})},"useEditorStore",0,eb],96701);let ev=ee((e,t)=>({nodes:[],selectedPath:null,expandedPaths:new Set,loadTree:async()=>{},selectPage:t=>{e({selectedPath:t})},expandPath:n=>{let{expandedPaths:r}=t();if(!r.has(n)){let t=new Set(r);t.add(n),e({expandedPaths:t})}},focusPath:n=>{let{expandedPaths:r}=t(),i=new Set(r),o=n.split("/");for(let e=1;e<o.length;e++)i.add(o.slice(0,e).join("/"));e({selectedPath:n,expandedPaths:i})}}));e.s(["useTreeStore",0,ev],990791);let ew="wiki-view-width",ex="wiki-view-align",ek=["narrow","normal","wide"],eS=ee(e=>{let t,n;return{width:"narrow"===(t=localStorage.getItem(ew))||"normal"===t||"wide"===t?t:"normal",align:"center"===(n=localStorage.getItem(ex))||"left"===n?n:"center",setWidth:t=>{localStorage.setItem(ew,t),e({width:t})},setAlign:t=>{localStorage.setItem(ex,t),e({align:t})},cycle:()=>e(e=>{let t=ek.indexOf(e.width),n=ek[(t+1)%ek.length];return localStorage.setItem(ew,n),{width:n}})}});e.s(["VIEW_ALIGN_CLASS",0,{center:"mx-auto",left:"mr-auto"},"VIEW_ALIGN_LABEL",0,{center:"Center",left:"Left"},"VIEW_ALIGN_ML",0,{center:"auto",left:"0"},"VIEW_ALIGN_ORDER",0,["center","left"],"VIEW_WIDTH_CLASS",0,{narrow:"max-w-2xl",normal:"max-w-5xl",wide:"max-w-[90rem]"},"VIEW_WIDTH_CSS",0,{narrow:"42rem",normal:"64rem",wide:"90rem"},"VIEW_WIDTH_LABEL",0,{narrow:"Narrow",normal:"Normal",wide:"Wide"},"VIEW_WIDTH_ORDER",0,ek,"useViewWidthStore",0,eS],395624);let eC=ee((e,t)=>({slugs:new Set,slugDir:new Map,loadedAt:null,loading:!1,load:async()=>{let{loadedAt:n,loading:r}=t();if(!r&&!(null!==n&&Date.now()-n<1e4)){e({loading:!0});try{let t=await (0,et.wsFetch)("/api/wiki/slugs");if(!t.ok)throw Error("Failed to fetch wiki slugs");let n=await t.json(),r=new Set,i=new Map;for(let e of["entities","concepts","comparisons","root"])for(let t of n[e])r.add(t),i.has(t)||i.set(t,e);e({slugs:r,slugDir:i,loadedAt:Date.now(),loading:!1})}catch{e({loading:!1})}}},has:e=>t().slugs.has(e),getDir:e=>t().slugDir.get(e)??null,invalidate(){e({loadedAt:null})}}));function eE(){return{sidecar:null,snapshotRevision:0,lastEventId:0,snapshotBlocks:[]}}e.s(["useWikiSlugsStore",0,eC],246542);let eM=ee((e,t)=>({byPath:{},loadSidecar:async t=>{let n=encodeURIComponent(t).replace(/%2F/g,"/");try{let r=await (0,et.wsFetch)(`/api/agent/sidecar/${n}`,{headers:en()});if(!r.ok)return;let i=await r.json();e(e=>({byPath:{...e.byPath,[t]:{...e.byPath[t]??eE(),sidecar:i,snapshotRevision:i.revision,lastEventId:i.nextEventId-1}}}))}catch{}},loadSnapshot:async t=>{let n=encodeURIComponent(t).replace(/%2F/g,"/");try{let r=await (0,et.wsFetch)(`/api/agent/files/${n}`,{headers:en()});if(!r.ok)return;let i=await r.json();e(e=>({byPath:{...e.byPath,[t]:{...e.byPath[t]??eE(),snapshotBlocks:i.blocks,snapshotRevision:i.revision}}}));let o=eb.getState();o.currentPath===t&&o.syncRevision(i.revision)}catch{}},pollEvents:async e=>{let n=t().byPath[e]??eE(),r=encodeURIComponent(e).replace(/%2F/g,"/");try{let i=await (0,et.wsFetch)(`/api/agent/events/${r}?after=${n.lastEventId}`,{headers:en()});if(!i.ok)return;for(let n of(await i.json()).events)t().applyEvent(e,n)}catch{}},applyEvent:(t,n)=>{e(e=>{let r=e.byPath[t]??eE();return{byPath:{...e.byPath,[t]:{...r,lastEventId:Math.max(r.lastEventId,n.id)}}}})},reset:t=>{e(e=>{let n={...e.byPath};return delete n[t],{byPath:n}})}}));async function eN(e,t,n){let r=encodeURIComponent(e).replace(/%2F/g,"/"),i=await fetch(`/api/agent/files/${r}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...en()},body:JSON.stringify({baseRevision:t,by:"human",ops:[n]})});if(409===i.status){let e=await i.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return{ok:i.ok,stale:!1}}async function eA(e){let{path:t,ref:n,kind:r,markdown:i,basisDetail:o,getRevision:s,refresh:a}=e,l={type:"suggestion.add",ref:n,kind:r,basis:"suggested"};"delete"!==r&&(l.markdown=i??""),o&&(l.basisDetail=o);let c=await eN(t,s(),l);return!c.ok&&c.stale&&void 0!==c.newRevision&&(await a(),c=await eN(t,c.newRevision,l)),c.ok}e.s(["useProofStore",0,eM],592185),e.s(["captureSuggestion",0,eA],926732);var eT=e.i(187014);e.s(["showError",0,function(e,t){eT.toast.error(e,t)},"showSuccess",0,function(e,t){eT.toast.success(e,t)}],417385)},153840,580330,792934,85741,464675,419943,674155,425275,891734,187080,253190,73313,736586,132807,e=>{"use strict";var t=e.i(343603),n=e.i(278928),r=e.i(111092);e.i(150663);var i=e.i(608926),o=class{constructor({editor:e,element:n,view:r,pluginKey:i="bubbleMenu",updateDelay:o=250,resizeDelay:s=60,shouldShow:a,appendTo:l,getReferencedVirtualElement:c,options:d}){var u;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:a}=s,l=!o.textBetween(r,i).length&&(0,t.isTextSelection)(n.selection),c=this.element.contains(document.activeElement);return!!(e.hasFocus()||c)&&!a&&!l&&!!this.editor.isEditable},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.editor.isDestroyed)return void this.destroy();if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.editor=e,this.element=n,this.view=r,this.pluginKey=i,this.updateDelay=o,this.resizeDelay=s,this.appendTo=l,this.scrollTarget=null!=(u=null==d?void 0:d.scrollTarget)?u:window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...d},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(r,r.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,n.flip)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,n.shift)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,n.offset)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,n.arrow)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,n.size)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,n.autoPlacement)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,n.hide)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,n.inline)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}get virtualElement(){var e,n,o,s,a;let{selection:l}=this.editor.state,c=null==(e=this.getReferencedVirtualElement)?void 0:e.call(this);if(c)return c;if(!(null==(o=null==(n=this.view)?void 0:n.dom)?void 0:o.parentNode))return;let d=(0,t.posToDOMRect)(this.view,l.from,l.to),u={getBoundingClientRect:()=>d,getClientRects:()=>[d]};if(l instanceof r.NodeSelection){let e=this.view.nodeDOM(l.from),t=e.dataset.nodeViewWrapper?e:e.querySelector("[data-node-view-wrapper]");t&&(e=t),e&&(u={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(l instanceof i.CellSelection){let e,t,n,{$anchorCell:r,$headCell:i}=l,o=r?r.pos:i.pos,c=i?i.pos:r.pos,d=this.view.nodeDOM(o),h=this.view.nodeDOM(c);if(!d||!h)return;let p=d===h?d.getBoundingClientRect():(s=d.getBoundingClientRect(),a=h.getBoundingClientRect(),e=Math.min(s.top,a.top),t=Math.max(s.bottom,a.bottom),n=Math.min(s.left,a.left),new DOMRect(n,e,Math.max(s.right,a.right)-n,t-e));u={getBoundingClientRect:()=>p,getClientRects:()=>[p]}}return u}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&(0,n.computePosition)(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if(this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected){if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r)return void this.handleDebouncedUpdate(e,t);let i=!(null==t?void 0:t.selection.eq(e.state.selection)),o=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,i,o,t)}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return(null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,element:this.element,view:this.view,state:n,oldState:e,from:o,to:s}))||!1}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.getReferencedVirtualElement&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},s=e=>new r.Plugin({key:"string"==typeof e.pluginKey?new r.PluginKey(e.pluginKey):e.pluginKey,view:t=>new o({view:t,...e})});t.Extension.create({name:"bubbleMenu",addOptions:()=>({element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[s({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var a=e.i(885047),l=e.i(101685),c=e.i(380560),d=class{constructor({editor:e,element:t,view:n,pluginKey:r="floatingMenu",updateDelay:i=250,resizeDelay:o=60,options:s,appendTo:a,shouldShow:l}){var c;this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,o=1===r.depth,s=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&0===r.parent.childCount&&!this.getTextContent(r.parent);return!!e.hasFocus()&&!!i&&!!o&&!!s&&!!this.editor.isEditable},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;!i&&(t||n)&&(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{var t;if(this.preventHide){this.preventHide=!1;return}(null==e?void 0:e.relatedTarget)&&(null==(t=this.element.parentNode)?void 0:t.contains(e.relatedTarget))||(null==e?void 0:e.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);"updatePosition"===t?this.updatePosition():t&&"object"==typeof t&&"updateOptions"===t.type?this.updateOptions(t.options):"hide"===t?this.hide():"show"===t&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=o,this.appendTo=a,this.scrollTarget=null!=(c=null==s?void 0:s.scrollTarget)?c:window,this.floatingUIOptions={...this.floatingUIOptions,...s},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return(0,t.getText)(e,{textSerializers:(0,t.getTextSerializersFromSchema)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push((0,n.flip)("boolean"!=typeof this.floatingUIOptions.flip?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&e.push((0,n.shift)("boolean"!=typeof this.floatingUIOptions.shift?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&e.push((0,n.offset)("boolean"!=typeof this.floatingUIOptions.offset?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&e.push((0,n.arrow)(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push((0,n.size)("boolean"!=typeof this.floatingUIOptions.size?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&e.push((0,n.autoPlacement)("boolean"!=typeof this.floatingUIOptions.autoPlacement?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&e.push((0,n.hide)("boolean"!=typeof this.floatingUIOptions.hide?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&e.push((0,n.inline)("boolean"!=typeof this.floatingUIOptions.inline?this.floatingUIOptions.inline:void 0)),e}getShouldShow(e){var t;let{state:n}=this.view,{selection:r}=n,{ranges:i}=r,o=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos));return null==(t=this.shouldShow)?void 0:t.call(this,{editor:this.editor,view:this.view,state:n,oldState:e,from:o,to:s})}updateOptions(e){var t;if(void 0!==e.updateDelay&&(this.updateDelay=e.updateDelay),void 0!==e.resizeDelay&&(this.resizeDelay=e.resizeDelay),void 0!==e.appendTo&&(this.appendTo=e.appendTo),void 0!==e.shouldShow&&e.shouldShow&&(this.shouldShow=e.shouldShow),void 0!==e.options){let n=null!=(t=e.options.scrollTarget)?t:window;n!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=n,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e,r;if(!(null==(r=null==(e=this.view)?void 0:e.dom)?void 0:r.parentNode))return;let{selection:i}=this.editor.state,o=(0,t.posToDOMRect)(this.view,i.from,i.to);(0,n.computePosition)({getBoundingClientRect:()=>o,getClientRects:()=>[o]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{var i,o;if((null==(i=r.hide)?void 0:i.referenceHidden)||(null==(o=r.hide)?void 0:o.escaped)){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!(null==t?void 0:t.selection.eq(e.state.selection)),r=!(null==t?void 0:t.doc.eq(e.state.doc));this.updateHandler(e,n,r,t)}show(){var e;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";let t="function"==typeof this.appendTo?this.appendTo():this.appendTo;null==(e=null!=t?t:this.view.dom.parentElement)||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},u=e=>new r.Plugin({key:"string"==typeof e.pluginKey?new r.PluginKey(e.pluginKey):e.pluginKey,view:t=>new d({view:t,...e})});function h(e,t){return null!=e?e:new r.PluginKey(t)}t.Extension.create({name:"floatingMenu",addOptions:()=>({element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}),addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[u({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var p="u">typeof window?l.useLayoutEffect:l.useEffect,f=new Set(["left","opacity","position","top","visibility","width"]),m=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),g=new Set(["children","className","style"]),y=new Set(["tabIndex"]),b=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),v={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function w(e,t){return/^on[A-Z]/.test(e)&&"function"==typeof t}function x(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function k(e,t,n){if("tabIndex"===t){e.tabIndex=Number(n);return}e[t]=n}function S(e,t){let n=(0,l.useRef)({}),r=(0,l.useRef)([]);p(()=>{var i,o,s;let a,l,c,d=n.current;return!function(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute("class")}}(e,d.className,t.className),i=d.style,o=t.style,a=null!=i?i:{},l=null!=o?o:{},new Set([...Object.keys(a),...Object.keys(l)]).forEach(t=>{let n=a[t],r=l[t];if(n!==r){if(null==r)return void(!f.has(t)&&e.style.removeProperty(x(t)));f.has(t)||e.style.setProperty(x(t),"number"!=typeof r||0===r||t.startsWith("--")||m.has(t)?String(r):`${r}px`)}}),new Set([...Object.keys(d),...Object.keys(t)]).forEach(n=>{if(g.has(n)||!(n.startsWith("aria-")||n.startsWith("data-")||b.has(n))||w(n,d[n])||w(n,t[n]))return;let r=d[n],i=t[n];if(r===i)return;let o=(n.startsWith("aria-")||n.startsWith("data-"),n);if(null==i||!1===i){y.has(n)&&function(e,t){if("tabIndex"===t)return e.removeAttribute("tabindex");let n=e[t];if("boolean"==typeof n){e[t]=!1;return}if("number"==typeof n){e[t]=0;return}e[t]=""}(e,n),e.removeAttribute(o);return}if(!0===i){y.has(n)&&k(e,n,!0),e.setAttribute(o,"");return}y.has(n)?k(e,n,i):e.setAttribute(o,String(i))}),s=r.current,s.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),c=[],Object.entries(t).forEach(([t,n])=>{var r;let i,o;if(!w(t,n))return;let{eventName:s,options:a}={eventName:null!=(r=v[o=((i=t.endsWith("Capture"))?t.slice(0,-7):t).slice(2)])?r:o.toLowerCase(),options:i?{capture:!0}:void 0},l=t=>{let r,i,o;n((r=t.defaultPrevented,i=!1,Object.defineProperties(o=Object.create(t),{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>r},isPropagationStopped:{value:()=>i},preventDefault:{value:()=>{r=!0,t.preventDefault()}},stopPropagation:{value:()=>{i=!0,t.stopPropagation()}}}),o))};e.addEventListener(s,l,a),c.push({eventName:s,listener:l,options:a})}),r.current=c,n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var C=l.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,getReferencedVirtualElement:d,options:u,children:p,...f},m)=>{let g=(0,l.useRef)(document.createElement("div")),y=(0,l.useRef)(h(e,"bubbleMenu")).current;S(g.current,f),"function"==typeof m?m(g.current):m&&(m.current=g.current);let{editor:b}=(0,a.useCurrentEditor)(),v=t||b,w={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:y,shouldShow:o,getReferencedVirtualElement:d,options:u},x=(0,l.useRef)(w);x.current=w;let[k,C]=(0,l.useState)(!1),E=(0,l.useRef)(!0);return(0,l.useEffect)(()=>{if(null==v?void 0:v.isDestroyed)return;if(!v)return void console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");let e=g.current;e.style.visibility="hidden",e.style.position="absolute";let t=s({...x.current,editor:v,element:e});v.registerPlugin(t);let n=x.current.pluginKey;return E.current=!0,C(!0),()=>{C(!1),v.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[v]),(0,l.useEffect)(()=>{if(k&&v&&!v.isDestroyed){if(E.current){E.current=!1;return}v.view.dispatch(v.state.tr.setMeta(y,{type:"updateOptions",options:x.current}))}},[k,v,n,r,o,u,i,d,y]),(0,c.createPortal)(p,g.current)});l.default.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:o=null,options:s,children:d,...p},f)=>{let m=(0,l.useRef)(document.createElement("div")),g=(0,l.useRef)(h(e,"floatingMenu")).current;S(m.current,p),"function"==typeof f?f(m.current):f&&(f.current=m.current);let{editor:y}=(0,a.useCurrentEditor)(),b=t||y,v={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:g,shouldShow:o,options:s},w=(0,l.useRef)(v);w.current=v;let[x,k]=(0,l.useState)(!1),C=(0,l.useRef)(!0);return(0,l.useEffect)(()=>{if(null==b?void 0:b.isDestroyed)return;if(!b)return void console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");let e=m.current;e.style.visibility="hidden",e.style.position="absolute";let t=u({...w.current,editor:b,element:e});b.registerPlugin(t);let n=w.current.pluginKey;return C.current=!0,k(!0),()=>{k(!1),b.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[b]),(0,l.useEffect)(()=>{if(x&&b&&!b.isDestroyed){if(C.current){C.current=!1;return}b.view.dispatch(b.state.tr.setMeta(g,{type:"updateOptions",options:w.current}))}},[x,b,n,r,o,s,i,g]),(0,c.createPortal)(d,m.current)}),e.s(["BubbleMenu",0,C],153840);var E=e.i(605993);let M=(0,E.default)("align-center",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignCenter",0,M],580330);let N=(0,E.default)("align-justify",[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]]);e.s(["AlignJustify",0,N],792934);let A=(0,E.default)("align-left",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignLeft",0,A],85741);let T=(0,E.default)("align-right",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);e.s(["AlignRight",0,T],464675);let R=(0,E.default)("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);e.s(["Bold",0,R],419943);let O=(0,E.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,O],674155);let D=(0,E.default)("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);e.s(["Italic",0,D],425275);let j=(0,E.default)("message-circle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);e.s(["MessageCircle",0,j],891734);let I=(0,E.default)("message-square-plus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);e.s(["MessageSquarePlus",0,I],187080);let P=(0,E.default)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);e.s(["Strikethrough",0,P],253190);let L=(0,E.default)("subscript",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);e.s(["Subscript",0,L],73313);let _=(0,E.default)("superscript",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);e.s(["Superscript",0,_],736586);let z=(0,E.default)("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);e.s(["Underline",0,z],132807)},920978,e=>{"use strict";let t=(0,e.i(605993).default)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);e.s(["Trash2",0,t],920978)},582612,933850,987027,307154,148623,395330,398441,977112,799916,853840,864255,991685,67667,733716,703550,492622,579767,978375,750110,772436,374435,e=>{"use strict";var t=e.i(44501),n=e.i(153840),r=e.i(580330),i=e.i(792934),o=e.i(85741),s=e.i(464675),a=e.i(419943),l=e.i(674155),c=e.i(425275),d=e.i(702166),u=e.i(891734),h=e.i(187080),p=e.i(253190),f=e.i(73313),m=e.i(736586),g=e.i(132807),y=e.i(101685),b=e.i(975157),v=e.i(412473),w=e.i(920978);function x({anchor:e,initialUrl:n="",onCancel:r,onApply:i,onRemove:o}){let[s,a]=(0,y.useState)(n);(0,y.useEffect)(()=>{let e=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]);let l=()=>{let e=s.trim();e?i(e):r()};return(0,t.jsxs)("div",{className:"absolute z-50 w-[340px] bg-popover border border-border rounded-lg shadow-xl overflow-hidden",style:{top:e.top,left:e.left},onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] font-medium",children:[(0,t.jsx)(d.Link,{className:"w-3.5 h-3.5"}),n?"Edit link":"Add link"]}),(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)("input",{type:"url",autoFocus:!0,value:s,placeholder:"https://example.com",onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),l())},className:"w-full bg-background border border-border rounded-md px-2.5 py-1.5 text-[12px] focus:outline-none focus:ring-2 focus:ring-primary/30"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:l,disabled:!s.trim(),className:"flex-1 py-1.5 text-[12px] rounded-md bg-primary text-primary-foreground disabled:opacity-50 hover:bg-primary/90",children:n?"Update":"Add link"}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("a",{href:n,target:"_blank",rel:"noreferrer noopener",className:"p-1.5 rounded-md border border-border hover:bg-accent text-muted-foreground hover:text-foreground",title:"Open link",children:(0,t.jsx)(v.ExternalLink,{className:"w-3.5 h-3.5"})}),o&&(0,t.jsx)("button",{type:"button",onClick:o,className:"p-1.5 rounded-md border border-border hover:bg-accent text-destructive",title:"Remove link",children:(0,t.jsx)(w.Trash2,{className:"w-3.5 h-3.5"})})]})]})]})]})}e.s(["LinkPopover",0,x],933850),e.s(["EditorBubbleMenu",0,function({editor:e,onSuggestEdit:v,onComment:w,readOnly:k}){let[S,C]=(0,y.useState)(null);if((0,y.useEffect)(()=>{if(!S)return;let e=e=>{let t=e.target;t?.closest("[data-bubble-popover='true']")||C(null)},t=window.setTimeout(()=>window.addEventListener("mousedown",e),10);return()=>{window.clearTimeout(t),window.removeEventListener("mousedown",e)}},[S]),!e)return null;let E=e=>(0,b.cn)("h-9 w-9 sm:h-7 sm:w-7 flex items-center justify-center rounded hover:bg-accent text-foreground/80 transition-colors",e&&"bg-accent text-foreground"),M=()=>{let{from:t,to:n}=e.state.selection;return{from:t,to:n}},N=t=>e.chain().focus().setTextSelection(t).run(),A=e=>t=>{t.preventDefault(),e()},T=t=>{S?.type==="align"&&(N(S.range),e.chain().focus().setTextAlign(t).run(),C(null))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.BubbleMenu,{editor:e,options:{placement:"top",offset:8},className:"flex items-center gap-0.5 px-1 py-1 bg-popover border border-border rounded-sm shadow-lg",children:[!k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:E(e.isActive("bold")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleBold().run()),"aria-label":"Bold",children:(0,t.jsx)(a.Bold,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("italic")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleItalic().run()),"aria-label":"Italic",children:(0,t.jsx)(c.Italic,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("underline")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleUnderline().run()),"aria-label":"Underline",children:(0,t.jsx)(g.Underline,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("strike")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleStrike().run()),"aria-label":"Strikethrough",children:(0,t.jsx)(p.Strikethrough,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("code")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleCode().run()),"aria-label":"Inline code",children:(0,t.jsx)(l.Code,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("superscript")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleSuperscript().run()),"aria-label":"Superscript",children:(0,t.jsx)(m.Superscript,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("subscript")),onMouseDown:e=>e.preventDefault(),onClick:A(()=>e.chain().focus().toggleSubscript().run()),"aria-label":"Subscript",children:(0,t.jsx)(f.Subscript,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsx)("button",{type:"button",className:E(e.isActive("link")),onMouseDown:e=>e.preventDefault(),onClick:t=>{t.preventDefault();let n=e.getAttributes("link")?.href??"",r=t.currentTarget.getBoundingClientRect();C({type:"link",range:M(),existing:n,anchor:{top:r.bottom+6,left:r.left}})},"aria-label":"Link",children:(0,t.jsx)(d.Link,{className:"w-3.5 h-3.5"})}),(v||w)&&(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),w&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),w()},"aria-label":"Comment",title:"Comment",children:(0,t.jsx)(u.MessageCircle,{className:"w-3.5 h-3.5"})}),v&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),v()},"aria-label":"Suggest edit",title:"Suggest edit",children:(0,t.jsx)(h.MessageSquarePlus,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("div",{className:"w-px h-5 bg-border mx-1"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),C({type:"align",range:M()})},"aria-label":"Align",children:(0,t.jsx)(o.AlignLeft,{className:"w-3.5 h-3.5"})}),S?.type==="align"&&(0,t.jsxs)("div",{"data-bubble-popover":"true",className:"absolute top-full left-0 mt-1 z-50 bg-popover border border-border rounded-sm shadow-lg p-1 flex gap-0.5",children:[(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"left"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("left"),"aria-label":"Align left",children:(0,t.jsx)(o.AlignLeft,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"center"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("center"),"aria-label":"Align center",children:(0,t.jsx)(r.AlignCenter,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"right"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("right"),"aria-label":"Align right",children:(0,t.jsx)(s.AlignRight,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",className:E(e.isActive({textAlign:"justify"})),onMouseDown:e=>e.preventDefault(),onClick:()=>T("justify"),"aria-label":"Justify",children:(0,t.jsx)(i.AlignJustify,{className:"w-3.5 h-3.5"})})]})]})]}),k&&w&&(0,t.jsx)("button",{type:"button",className:E(!1),onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),w()},"aria-label":"Comment",title:"Add comment",children:(0,t.jsx)(u.MessageCircle,{className:"w-3.5 h-3.5"})})]}),S?.type==="link"&&(0,t.jsx)("div",{"data-bubble-popover":"true",style:{position:"fixed",top:S.anchor.top,left:S.anchor.left,zIndex:60},children:(0,t.jsx)(x,{anchor:{top:0,left:0},initialUrl:S.existing,onCancel:()=>C(null),onApply:t=>{S?.type==="link"&&(N(S.range),e.chain().focus().extendMarkRange("link").setLink({href:t}).run(),C(null))},onRemove:S.existing?()=>{S?.type==="link"&&(N(S.range),e.chain().focus().unsetLink().run(),C(null))}:void 0})})]})}],582612);var k=e.i(605993);let S=(0,k.default)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);e.s(["CheckSquare",0,S],987027);let C=(0,k.default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,C],307154);let E=(0,k.default)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);e.s(["FileCode",0,E],148623);let M=(0,k.default)("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);e.s(["Heading1",0,M],395330);let N=(0,k.default)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);e.s(["Heading2",0,N],398441);let A=(0,k.default)("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);e.s(["Heading3",0,A],977112);var T=e.i(375707);e.s(["ImageIcon",()=>T.default],799916);let R=(0,k.default)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);e.s(["List",0,R],853840);let O=(0,k.default)("list-ordered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);e.s(["ListOrdered",0,O],864255);let D=(0,k.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,D],991685);let j=(0,k.default)("pilcrow-left",[["path",{d:"M14 3v11",key:"mlfb7b"}],["path",{d:"M14 9h-3a3 3 0 0 1 0-6h9",key:"1ulc19"}],["path",{d:"M18 3v11",key:"1phi0r"}],["path",{d:"M22 18H2l4-4",key:"yt65j9"}],["path",{d:"m6 22-4-4",key:"6jgyf5"}]]);e.s(["PilcrowLeft",0,j],67667);let I=(0,k.default)("pilcrow-right",[["path",{d:"M10 3v11",key:"o3l5kj"}],["path",{d:"M10 9H7a1 1 0 0 1 0-6h8",key:"1wb1nc"}],["path",{d:"M14 3v11",key:"mlfb7b"}],["path",{d:"m18 14 4 4H2",key:"4r8io1"}],["path",{d:"m22 18-4 4",key:"1hjjrd"}]]);e.s(["PilcrowRight",0,I],733716);let P=(0,k.default)("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);e.s(["Quote",0,P],703550);let L=(0,k.default)("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);e.s(["Redo",0,L],492622);let _=(0,k.default)("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);e.s(["Undo",0,_],579767);let z=(0,k.default)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);e.s(["Video",0,z],978375),e.i(380560);var $=e.i(206102),H=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let r=(0,$.createSlot)(`Primitive.${n}`),i=y.forwardRef((e,i)=>{let{asChild:o,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?r:n,{...s,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});e.s(["Primitive",0,H],750110);var B="horizontal",F=["horizontal","vertical"],V=y.forwardRef((e,n)=>{var r;let{decorative:i,orientation:o=B,...s}=e,a=(r=o,F.includes(r))?o:B;return(0,t.jsx)(H.div,{"data-orientation":a,...i?{role:"none"}:{"aria-orientation":"vertical"===a?a:void 0,role:"separator"},...s,ref:n})});V.displayName="Separator";let U=y.forwardRef(({className:e,orientation:n="horizontal",decorative:r=!0,...i},o)=>(0,t.jsx)(V,{ref:o,decorative:r,orientation:n,className:(0,b.cn)("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...i}));U.displayName=V.displayName,e.s(["Separator",0,U],772436);let W=(0,k.default)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);e.s(["Clipboard",0,W],374435)},924782,e=>{"use strict";let t=(0,e.i(605993).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],924782)},454184,(e,t,n)=>{class r{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}class s{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}let a=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=a(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=a({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new s(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function u(e){return f("(?=",e,")")}function h(e){return f("(?:",e,")*")}function p(e){return f("(?:",e,")?")}function f(...e){return e.map(e=>d(e)).join("")}function m(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>d(e)).join("|")+")"}function g(e){return RegExp(e.toString()+"|").exec("").length-1}let y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,r=d(e),i="";for(;r.length>0;){let e=y.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+String(Number(e[1])+t):(i+=e[0],"("===e[0]&&n++)}return i}).map(e=>`(${e})`).join(t)}let v="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",S="\\b(0b[01]+)",C={begin:"\\\\[\\s\\S]",relevance:0},E=function(e,t,n={}){let r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:f(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},M=E("//","$"),N=E("/\\*","\\*/"),A=E("#","$");var T=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[C]},BACKSLASH_ESCAPE:C,BINARY_NUMBER_MODE:{scope:"number",begin:S,relevance:0},BINARY_NUMBER_RE:S,COMMENT:E,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:M,C_NUMBER_MODE:{scope:"number",begin:k,relevance:0},C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:A,IDENT_RE:v,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+w,relevance:0},NUMBER_MODE:{scope:"number",begin:x,relevance:0},NUMBER_RE:x,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[C]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[C,{begin:/\[/,end:/\]/,relevance:0,contains:[C]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:v,relevance:0},UNDERSCORE_IDENT_RE:w,UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0}});function R(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function O(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function j(e,t){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function I(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function P(e,t){void 0===e.relevance&&(e.relevance=1)}let L=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=f(n.beforeMatch,u(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},_=["of","and","for","in","not","or","if","then","parent","list","value"],z={},$=e=>{console.error(e)},H=(e,...t)=>{console.log(`WARN: ${e}`,...t)},B=(e,t)=>{z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0)},F=Error();function V(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let e=1;e<=t.length;e++)s[e+r]=i[e],o[e+r]=!0,r+=g(t[e-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function U(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),F;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"),F;V(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"),F;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"),F;V(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}class W extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let K=Symbol("nomatch"),q=function(e){let t=Object.create(null),n=Object.create(null),s=[],a=!0,l="Could not find the language '{}', did you forget to load/include a language module?",y={disableAutodetect:!0,name:"Plain text",contains:[]},v={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function w(e){return v.noHighlightRe.test(e)}function x(e,t,n){let r="",i="";"object"==typeof t?(r=e,n=t.ignoreIllegals,i=t.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);let o={code:r,language:i};z("before:highlight",o);let s=o.result?o.result:k(o.language,o.code,n);return s.code=o.code,z("after:highlight",s),s}function k(e,n,s,c){let u=Object.create(null);function h(){if(!A.keywords)return void R.addText(H);let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(H),n="";for(;t;){n+=H.substring(e,t.index);let r=C.case_insensitive?t[0].toLowerCase():t[0],i=A.keywords[r];if(i){let[e,o]=i;if(R.addText(n),n="",u[r]=(u[r]||0)+1,u[r]<=7&&(B+=o),e.startsWith("_"))n+=t[0];else{let n=C.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(H)}n+=H.substring(e),R.addText(n)}function p(){null!=A.subLanguage?function(){if(""===H)return;let e=null;if("string"==typeof A.subLanguage){if(!t[A.subLanguage])return R.addText(H);e=k(A.subLanguage,H,!0,T[A.subLanguage]),T[A.subLanguage]=e._top}else e=S(H,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(B+=e.relevance),R.__addSublanguage(e._emitter,e.language)}():h(),H=""}function f(e,t){""!==e&&(R.startScope(t),R.addText(e),R.endScope())}function m(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=C.classNameAliases[e[n]]||e[n],i=t[n];r?f(i,r):(H=i,h(),H=""),n++}}function y(e,t){return e.scope&&"string"==typeof e.scope&&R.openNode(C.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(H,C.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),H=""):e.beginScope._multi&&(m(e.beginScope,t),H="")),A=Object.create(e,{parent:{value:A}})}let w={};function x(t,i){let o=i&&i[0];if(H+=t,null==o)return p(),0;if("begin"===w.type&&"end"===i.type&&w.index===i.index&&""===o){if(H+=n.slice(i.index,i.index+1),!a){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=w.rule,t}return 1}if(w=i,"begin"===i.type){let e=i[0],t=i.rule,n=new r(t);for(let r of[t.__beforeBegin,t["on:begin"]])if(r&&(r(i,n),n.isMatchIgnored))return 0===A.matcher.regexIndex?(H+=e[0],1):(W=!0,0);return t.skip?H+=e:(t.excludeBegin&&(H+=e),p(),t.returnBegin||t.excludeBegin||(H=e)),y(t,i),t.returnBegin?0:e.length}if("illegal"!==i.type||s){if("end"===i.type){let e=function(e){let t=e[0],i=n.substring(e.index),o=function e(t,n,i){var o;let s,a=(o=t.endRe,(s=o&&o.exec(i))&&0===s.index);if(a){if(t["on:end"]){let e=new r(t);t["on:end"](n,e),e.isMatchIgnored&&(a=!1)}if(a){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,i)}(A,e,i);if(!o)return K;let s=A;A.endScope&&A.endScope._wrap?(p(),f(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),m(A.endScope,e)):s.skip?H+=t:(s.returnEnd||s.excludeEnd||(H+=t),p(),s.excludeEnd&&(H=t));do A.scope&&R.closeNode(),A.skip||A.subLanguage||(B+=A.relevance),A=A.parent;while(A!==o.parent)return o.starts&&y(o.starts,e),s.returnEnd?0:t.length}(i);if(e!==K)return e}}else{let e=Error('Illegal lexeme "'+o+'" for mode "'+(A.scope||"<unnamed>")+'"');throw e.mode=A,e}if("illegal"===i.type&&""===o)return H+="\n",1;if(V>1e5&&V>3*i.index)throw Error("potential infinite loop, way more iterations than matches");return H+=o,o.length}let C=N(e);if(!C)throw $(l.replace("{}",e)),Error('Unknown language: "'+e+'"');let E=function(e){function t(t,n){return RegExp(d(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=g(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,s){let a;if(i.isCompiled)return i;[O,I,U,L].forEach(e=>e(i,s)),e.compilerExtensions.forEach(e=>e(i,s)),i.__beforeBegin=null,[D,j,P].forEach(e=>e(i,s)),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=function e(t,n,r="keyword"){let i=Object.create(null);return"string"==typeof t?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(r){Object.assign(i,e(t[r],n,r))}),i;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var n,r,o;let s=t.split("|");i[s[0]]=[e,(n=s[0],(r=s[1])?Number(r):+(o=n,!_.includes(o.toLowerCase())))]})}}(i.keywords,e.case_insensitive)),i.keywordPatternRe=t(l,!0),s&&(i.begin||(i.begin=/\B|\b/),i.beginRe=t(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=t(i.end)),i.terminatorEnd=d(i.end)||"",i.endsWithParent&&s.terminatorEnd&&(i.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(i.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(e){var t;return((t="self"===e?i:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return o(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?o(t):t:o(t,{starts:t.starts?o(t.starts):null})})),i.contains.forEach(function(e){n(e,i)}),i.starts&&n(i.starts,s),a=new r,i.contains.forEach(e=>a.addRule(e.begin,{rule:e,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),i.matcher=a,i}(e)}(C),M="",A=c||E,T={},R=new v.__emitter(v),z=[];for(let e=A;e!==C;e=e.parent)e.scope&&z.unshift(e.scope);z.forEach(e=>R.openNode(e));let H="",B=0,F=0,V=0,W=!1;try{if(C.__emitTokens)C.__emitTokens(n,R);else{for(A.matcher.considerAll();;){V++,W?W=!1:A.matcher.considerAll(),A.matcher.lastIndex=F;let e=A.matcher.exec(n);if(!e)break;let t=n.substring(F,e.index),r=x(t,e);F=e.index+r}x(n.substring(F))}return R.finalize(),M=R.toHTML(),{language:e,value:M,relevance:B,illegal:!1,_emitter:R,_top:A}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:i(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:F,context:n.slice(F-100,F+100),mode:t.mode,resultSoFar:M},_emitter:R};if(a)return{language:e,value:i(n),illegal:!1,relevance:0,errorRaised:t,_emitter:R,_top:A};throw t}}function S(e,n){let r;n=n||v.languages||Object.keys(t);let o=((r={value:i(e),illegal:!1,relevance:0,_top:y,_emitter:new v.__emitter(v)})._emitter.addText(e),r),s=n.filter(N).filter(R).map(t=>k(t,e,!1));s.unshift(o);let[a,l]=s.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;else if(N(t.language).supersetOf===e.language)return -1}return 0});return a.secondBest=l,a}function C(e){var t;let r,i=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=v.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(H(l.replace("{}",n[1])),H("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>w(e)||N(e))}(e);if(w(i))return;if(z("before:highlightElement",{el:e,language:i}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(v.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),v.throwUnescapedHTML))throw new W("One of your code blocks includes unescaped HTML.",e.innerHTML);let o=e.textContent,s=i?x(o,{language:i,ignoreIllegals:!0}):S(o);e.innerHTML=s.value,e.dataset.highlighted="yes",t=s.language,r=i&&n[i]||t,e.classList.add("hljs"),e.classList.add(`language-${r}`),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),z("after:highlightElement",{el:e,result:s,text:o})}let E=!1;function M(){if("loading"===document.readyState){E||window.addEventListener("DOMContentLoaded",function(){M()},!1),E=!0;return}document.querySelectorAll(v.cssSelector).forEach(C)}function N(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function A(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function R(e){let t=N(e);return t&&!t.disableAutodetect}function z(e,t){s.forEach(function(n){n[e]&&n[e](t)})}for(let r in Object.assign(e,{highlight:x,highlightAuto:S,highlightAll:M,highlightElement:C,highlightBlock:function(e){return B("10.7.0","highlightBlock will be removed entirely in v12.0"),B("10.7.0","Please use highlightElement now."),C(e)},configure:function(e){v=o(v,e)},initHighlighting:()=>{M(),B("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){M(),B("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if($("Language definition for '{}' could not be registered.".replace("{}",n)),a)$(e);else throw e;i=y}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&A(i.aliases,{languageName:n})},unregisterLanguage:function(e){for(let r of(delete t[e],Object.keys(n)))n[r]===e&&delete n[r]},listLanguages:function(){return Object.keys(t)},getLanguage:N,registerAliases:A,autoDetection:R,inherit:o,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),s.push(e)},removePlugin:function(e){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}}),e.debugMode=function(){a=!1},e.safeMode=function(){a=!0},e.versionString="11.11.1",e.regex={concat:f,lookahead:u,either:m,optional:p,anyNumberOfTimes:h},T)"object"==typeof T[r]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],i=typeof r;"object"!==i&&"function"!==i||Object.isFrozen(r)||e(r)}),t}(T[r]);return Object.assign(e,T),e},J=q({});J.newInstance=()=>q({}),t.exports=J,J.HighlightJS=J,J.default=J},240409,512527,944404,334609,844552,441228,576500,194633,32033,623568,42420,278909,532270,503658,185503,993667,893030,314206,388503,284766,965837,582966,25688,770271,e=>{"use strict";var t=e.i(44501),n=e.i(580330),r=e.i(792934),i=e.i(85741),o=e.i(464675),s=e.i(419943),a=e.i(987027),l=e.i(307154),c=e.i(10137),d=e.i(674155),u=e.i(148623),h=e.i(395330),p=e.i(398441),f=e.i(977112),m=e.i(799916),g=e.i(425275),y=e.i(702166),b=e.i(853840),v=e.i(864255),w=e.i(991685),x=e.i(67667),k=e.i(733716),S=e.i(703550),C=e.i(492622),E=e.i(253190),M=e.i(73313),N=e.i(736586),A=e.i(132807),T=e.i(579767),R=e.i(978375),O=e.i(101685),D=e.i(772436),j=e.i(975157),I=e.i(96701),P=e.i(933850),L=e.i(374435),_=e.i(924782),z=e.i(671485);async function $(e,t){let n=new FormData;n.append("file",t);try{let t=await (0,z.wsFetch)(`/api/upload/${e}`,{method:"POST",body:n});if(!t.ok)return null;let r=await t.json();return{url:(0,z.withWs)(r.url),filename:r.filename}}catch{return null}}function H({kind:e,pagePath:n,onCancel:r,onInsert:i,anchor:o}){let[s,a]=(0,O.useState)("upload"),[l,c]=(0,O.useState)(""),[d,u]=(0,O.useState)(!1),[h,p]=(0,O.useState)(null),f=(0,O.useRef)(null),m=async e=>{if(e&&0!==e.length){u(!0),p(null);try{let t=e[0],r=await $(n,t);if(!r)return void p("Upload failed.");i({url:r.url,alt:t.name,mimeType:t.type})}finally{u(!1)}}},g=()=>{let e=l.trim();e&&i({url:e})};return(0,t.jsxs)("div",{className:"absolute z-50 w-[360px] bg-popover border border-border rounded-xl shadow-e-4 overflow-hidden",style:{top:o.top,left:o.left},onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,t.jsx)("div",{className:"text-[12px] font-medium",children:"image"===e?"Insert image":"video"===e?"Insert video":"Attach file"}),(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[11px] text-muted-foreground hover:text-foreground",children:"Cancel"})]}),(0,t.jsxs)("div",{className:"flex border-b border-border bg-muted/30",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a("upload"),className:(0,j.cn)("flex-1 py-1.5 text-[11px] flex items-center justify-center gap-1.5 transition-colors","upload"===s?"bg-background text-foreground border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(_.Upload,{className:"w-3 h-3"})," Upload"]}),(0,t.jsxs)("button",{type:"button",onClick:()=>a("url"),className:(0,j.cn)("flex-1 py-1.5 text-[11px] flex items-center justify-center gap-1.5 transition-colors","url"===s?"bg-background text-foreground border-b-2 border-primary":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(y.Link,{className:"w-3 h-3"})," From URL"]})]}),"upload"===s?(0,t.jsxs)("div",{className:"p-4",onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),m(e.dataTransfer.files)},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>f.current?.click(),disabled:d,className:"w-full border-2 border-dashed border-border rounded-sm py-6 flex flex-col items-center justify-center text-muted-foreground hover:bg-accent/30 transition-colors",children:[(0,t.jsx)(_.Upload,{className:"w-5 h-5 mb-1.5"}),(0,t.jsx)("span",{className:"text-[12px] font-medium",children:d?"Uploading…":`Click to upload ${e}`}),(0,t.jsx)("span",{className:"text-[10px] mt-0.5",children:"or drop a file here"})]}),(0,t.jsx)("input",{ref:f,type:"file",accept:"image"===e?"image/*":"video"===e?"video/*":"*/*",className:"hidden",onChange:e=>m(e.target.files)}),h&&(0,t.jsx)("div",{className:"mt-2 text-[11px] text-destructive",children:h})]}):(0,t.jsxs)("div",{className:"p-3 space-y-2",children:[(0,t.jsx)("input",{type:"url",autoFocus:!0,value:l,placeholder:"image"===e?"https://example.com/image.png":"video"===e?"https://example.com/video.mp4":"https://example.com/file",onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),g()):"Escape"===e.key&&r()},className:"w-full bg-background border border-border rounded-sm px-2.5 py-1.5 text-[12px] focus:outline-none focus:ring-2 focus:ring-primary/30"}),(0,t.jsx)("button",{type:"button",onClick:g,disabled:!l.trim(),className:"w-full py-1.5 text-[12px] rounded-sm bg-primary text-primary-foreground disabled:opacity-50 hover:bg-primary/90",children:"Insert"})]}),(0,t.jsxs)("div",{className:"px-3 py-2 border-t border-border bg-muted/30 text-[10px] text-muted-foreground flex items-start gap-1.5",children:[(0,t.jsx)(L.Clipboard,{className:"w-3 h-3 shrink-0 mt-[1px]"}),(0,t.jsxs)("span",{children:["Tip: you can also"," ",(0,t.jsx)("strong",{className:"text-foreground/80",children:"paste"})," or"," ",(0,t.jsx)("strong",{className:"text-foreground/80",children:"drag & drop"}),"files directly into the page — they'll be saved alongside this page automatically."]})]})]})}function B({label:e,icon:n,active:r,disabled:i,style:o,onAction:s}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,disabled:i,style:o,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.preventDefault(),s(e)},className:(0,j.cn)("h-8 w-8 shrink-0 inline-flex items-center justify-center rounded-md text-foreground/80 hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-40",r&&"bg-accent text-accent-foreground ring-1 ring-inset ring-foreground/15"),children:(0,t.jsx)(n,{className:"h-4 w-4"})})}function F({onClose:e}){return(0,O.useEffect)(()=>{let t=window.setTimeout(()=>{let t=t=>{let n=t.target;n?.closest('[data-editor-popover="true"]')||e()};window.addEventListener("mousedown",t),window.__editorPopClose=()=>window.removeEventListener("mousedown",t)},10);return()=>{window.clearTimeout(t);let e=window;e.__editorPopClose&&(e.__editorPopClose(),e.__editorPopClose=void 0)}},[e]),null}e.s(["MediaPopover",0,H],512527),e.s(["EditorToolbar",0,function({editor:e}){let j=(0,I.useEditorStore)(e=>e.frontmatter),L=(0,I.useEditorStore)(e=>e.updateFrontmatter),_=(0,I.useEditorStore)(e=>e.currentPath),z=j?.dir==="rtl",[$,V]=(0,O.useState)(null),U=(0,O.useRef)(null),[W,K]=(0,O.useState)(!1),[q,J]=(0,O.useState)(!1),[,G]=(0,O.useState)(0);(0,O.useEffect)(()=>{if(!e)return;let t=()=>G(e=>e+1);return e.on("selectionUpdate",t),e.on("transaction",t),()=>{e.off("selectionUpdate",t),e.off("transaction",t)}},[e]);let X=(0,O.useCallback)(()=>{let e=U.current;e&&(K(e.scrollLeft>4),J(e.scrollLeft+e.clientWidth<e.scrollWidth-4))},[]);(0,O.useEffect)(()=>{if(!e)return;let t=U.current;if(!t)return;let n=requestAnimationFrame(X),r=()=>X();window.addEventListener("resize",r),t.addEventListener("scroll",X);let i=new ResizeObserver(()=>X());for(let e of(i.observe(t),Array.from(t.children)))i.observe(e);return()=>{cancelAnimationFrame(n),window.removeEventListener("resize",r),t.removeEventListener("scroll",X),i.disconnect()}},[e,X]);let Z=e=>{let t=U.current;t&&t.scrollBy({left:e*Math.max(160,.6*t.clientWidth),behavior:"smooth"})};if(!e)return null;let Y=(t,n)=>{e.chain().focus().setTextSelection(t).run(),n()},Q=(t,n)=>{let r=t.currentTarget.getBoundingClientRect();V(n({top:r.bottom+6,left:r.left},(()=>{let{from:t,to:n}=e.state.selection;return{from:t,to:n}})()))},ee=[{icon:h.Heading1,action:()=>e.chain().focus().toggleHeading({level:1}).run(),isActive:e.isActive("heading",{level:1}),label:"Heading 1"},{icon:p.Heading2,action:()=>e.chain().focus().toggleHeading({level:2}).run(),isActive:e.isActive("heading",{level:2}),label:"Heading 2"},{icon:f.Heading3,action:()=>e.chain().focus().toggleHeading({level:3}).run(),isActive:e.isActive("heading",{level:3}),label:"Heading 3"},{separator:!0},{icon:s.Bold,action:()=>e.chain().focus().toggleBold().run(),isActive:e.isActive("bold"),label:"Bold"},{icon:g.Italic,action:()=>e.chain().focus().toggleItalic().run(),isActive:e.isActive("italic"),label:"Italic"},{icon:A.Underline,action:()=>e.chain().focus().toggleUnderline().run(),isActive:e.isActive("underline"),label:"Underline"},{icon:E.Strikethrough,action:()=>e.chain().focus().toggleStrike().run(),isActive:e.isActive("strike"),label:"Strikethrough"},{icon:d.Code,action:()=>e.chain().focus().toggleCode().run(),isActive:e.isActive("code"),label:"Inline code"},{icon:y.Link,action:t=>{let n=e.getAttributes("link")?.href??"";Q(t,(e,t)=>({type:"link",anchor:e,range:t,existing:n}))},isActive:e.isActive("link"),label:"Link"},{separator:!0},{icon:b.List,action:()=>e.chain().focus().toggleBulletList().run(),isActive:e.isActive("bulletList"),label:"Bullet list"},{icon:v.ListOrdered,action:()=>e.chain().focus().toggleOrderedList().run(),isActive:e.isActive("orderedList"),label:"Ordered list"},{icon:S.Quote,action:()=>e.chain().focus().toggleBlockquote().run(),isActive:e.isActive("blockquote"),label:"Blockquote"},{icon:a.CheckSquare,action:()=>e.chain().focus().toggleTaskList().run(),isActive:e.isActive("taskList"),label:"Checklist"},{icon:u.FileCode,action:()=>e.chain().focus().toggleCodeBlock().run(),isActive:e.isActive("codeBlock"),label:"Code block"},{icon:w.Minus,action:()=>e.chain().focus().setHorizontalRule().run(),isActive:!1,label:"Divider"}],et=[{icon:i.AlignLeft,action:()=>e.chain().focus().setTextAlign("left").run(),isActive:e.isActive({textAlign:"left"}),label:"Align left"},{icon:n.AlignCenter,action:()=>e.chain().focus().setTextAlign("center").run(),isActive:e.isActive({textAlign:"center"}),label:"Align center"},{icon:o.AlignRight,action:()=>e.chain().focus().setTextAlign("right").run(),isActive:e.isActive({textAlign:"right"}),label:"Align right"},{icon:r.AlignJustify,action:()=>e.chain().focus().setTextAlign("justify").run(),isActive:e.isActive({textAlign:"justify"}),label:"Justify"},{separator:!0},{icon:N.Superscript,action:()=>e.chain().focus().toggleSuperscript().run(),isActive:e.isActive("superscript"),label:"Superscript"},{icon:M.Subscript,action:()=>e.chain().focus().toggleSubscript().run(),isActive:e.isActive("subscript"),label:"Subscript"},{separator:!0},{icon:m.ImageIcon,action:e=>Q(e,e=>({type:"media",kind:"image",anchor:e})),isActive:!1,label:"Insert image"},{icon:R.Video,action:e=>Q(e,e=>({type:"media",kind:"video",anchor:e})),isActive:!1,label:"Insert video"},{separator:!0},{icon:T.Undo,action:()=>e.chain().focus().undo().run(),isActive:!1,label:"Undo"},{icon:C.Redo,action:()=>e.chain().focus().redo().run(),isActive:!1,label:"Redo"},{separator:!0},{icon:z?x.PilcrowLeft:k.PilcrowRight,action:()=>L({dir:z?void 0:"rtl"}),isActive:z,label:z?"Switch to LTR":"Switch to RTL"}];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative border-b border-border bg-background/50",children:[W&&(0,t.jsx)("button",{type:"button","aria-label":"Scroll toolbar left",onMouseDown:e=>e.preventDefault(),onClick:()=>Z(-1),className:"absolute left-0 top-0 bottom-0 w-6 z-10 flex items-center justify-start pl-0.5 bg-gradient-to-r from-background via-background/80 to-transparent text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(l.ChevronLeft,{className:"h-4 w-4"})}),q&&(0,t.jsx)("button",{type:"button","aria-label":"Scroll toolbar right",onMouseDown:e=>e.preventDefault(),onClick:()=>Z(1),className:"absolute right-0 top-0 bottom-0 w-6 z-10 flex items-center justify-end pr-0.5 bg-gradient-to-l from-background via-background/80 to-transparent text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(c.ChevronRight,{className:"h-4 w-4"})}),(0,t.jsx)("div",{ref:U,onWheel:e=>{let t=U.current;t&&Math.abs(e.deltaY)>Math.abs(e.deltaX)&&(t.scrollLeft+=e.deltaY)},className:"flex items-center gap-0.5 px-2 pt-1 pb-1.5 overflow-x-scroll overflow-y-hidden editor-toolbar-scroll",children:[...ee,{separator:!0},...et].map((e,n)=>"separator"in e?(0,t.jsx)(D.Separator,{orientation:"vertical",className:"mx-1 h-6 shrink-0"},n):(0,t.jsx)(B,{label:e.label,icon:e.icon,active:e.isActive,style:e.style,onAction:e.action},n))})]}),$?.type==="link"&&(0,t.jsx)("div",{"data-editor-popover":"true",style:{position:"fixed",top:$.anchor.top,left:$.anchor.left,zIndex:60},children:(0,t.jsx)(P.LinkPopover,{anchor:{top:0,left:0},initialUrl:$.existing,onCancel:()=>V(null),onApply:t=>{$?.type==="link"&&(Y($.range,()=>{e.chain().focus().extendMarkRange("link").setLink({href:t}).run()}),V(null))},onRemove:$.existing?()=>{$?.type==="link"&&(Y($.range,()=>{e.chain().focus().unsetLink().run()}),V(null))}:void 0})}),$?.type==="media"&&_&&(0,t.jsx)("div",{"data-editor-popover":"true",style:{position:"fixed",top:$.anchor.top,left:$.anchor.left,zIndex:60},children:(0,t.jsx)(H,{kind:$.kind,pagePath:_,anchor:{top:0,left:0},onCancel:()=>V(null),onInsert:t=>((t,n)=>{let{url:r,alt:i,mimeType:o}=n;"image"===t||(o??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(r)?e.chain().focus().setImage({src:r,alt:i??""}).run():e.chain().focus().insertContent(`<a href="${r}">${i??r}</a>`).run(),V(null)})($.kind,t)})}),$&&(0,t.jsx)(F,{onClose:()=>V(null)})]})}],240409);var V=e.i(343603);let U="numeric",W="ascii",K="alpha",q="asciinumeric",J="alphanumeric",G="domain",X="emoji",Z="whitespace";function Y(e,t,n){for(let r in t[U]&&(t[q]=!0,t[J]=!0),t[W]&&(t[q]=!0,t[K]=!0),t[q]&&(t[J]=!0),t[K]&&(t[J]=!0),t[J]&&(t[G]=!0),t[X]&&(t[G]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function Q(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Q.groups={},Q.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||Q.groups,t&&t.j?i=t:(i=new Q(t),n&&r&&Y(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||Q.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new Q).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new Q,t&&(r&&(i.t&&"string"==typeof i.t?Y(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&Y(t,n,r)),i.t=t),this.j[e]=i,i}};let ee=(e,t,n,r,i)=>e.ta(t,n,r,i),et=(e,t,n,r,i)=>e.tr(t,n,r,i),en=(e,t,n,r,i)=>e.ts(t,n,r,i),er=(e,t,n,r,i)=>e.tt(t,n,r,i),ei="WORD",eo="UWORD",es="ASCIINUMERICAL",ea="ALPHANUMERICAL",el="LOCALHOST",ec="UTLD",ed="SCHEME",eu="SLASH_SCHEME",eh="OPENBRACE",ep="CLOSEBRACE",ef="OPENBRACKET",em="CLOSEBRACKET",eg="OPENPAREN",ey="CLOSEPAREN",eb="OPENANGLEBRACKET",ev="CLOSEANGLEBRACKET",ew="FULLWIDTHLEFTPAREN",ex="FULLWIDTHRIGHTPAREN",ek="LEFTCORNERBRACKET",eS="RIGHTCORNERBRACKET",eC="LEFTWHITECORNERBRACKET",eE="RIGHTWHITECORNERBRACKET",eM="FULLWIDTHLESSTHAN",eN="FULLWIDTHGREATERTHAN",eA="AMPERSAND",eT="APOSTROPHE",eR="ASTERISK",eO="BACKSLASH",eD="BACKTICK",ej="CARET",eI="COLON",eP="COMMA",eL="DOLLAR",e_="EQUALS",ez="EXCLAMATION",e$="HYPHEN",eH="PERCENT",eB="PIPE",eF="PLUS",eV="POUND",eU="QUERY",eW="QUOTE",eK="FULLWIDTHMIDDLEDOT",eq="SEMI",eJ="SLASH",eG="TILDE",eX="UNDERSCORE",eZ="EMOJI";var eY=Object.freeze({__proto__:null,ALPHANUMERICAL:ea,AMPERSAND:eA,APOSTROPHE:eT,ASCIINUMERICAL:es,ASTERISK:eR,AT:"AT",BACKSLASH:eO,BACKTICK:eD,CARET:ej,CLOSEANGLEBRACKET:ev,CLOSEBRACE:ep,CLOSEBRACKET:em,CLOSEPAREN:ey,COLON:eI,COMMA:eP,DOLLAR:eL,DOT:"DOT",EMOJI:eZ,EQUALS:e_,EXCLAMATION:ez,FULLWIDTHGREATERTHAN:eN,FULLWIDTHLEFTPAREN:ew,FULLWIDTHLESSTHAN:eM,FULLWIDTHMIDDLEDOT:eK,FULLWIDTHRIGHTPAREN:ex,HYPHEN:e$,LEFTCORNERBRACKET:ek,LEFTWHITECORNERBRACKET:eC,LOCALHOST:el,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:eb,OPENBRACE:eh,OPENBRACKET:ef,OPENPAREN:eg,PERCENT:eH,PIPE:eB,PLUS:eF,POUND:eV,QUERY:eU,QUOTE:eW,RIGHTCORNERBRACKET:eS,RIGHTWHITECORNERBRACKET:eE,SCHEME:ed,SEMI:eq,SLASH:eJ,SLASH_SCHEME:eu,SYM:"SYM",TILDE:eG,TLD:"TLD",UNDERSCORE:eX,UTLD:ec,UWORD:eo,WORD:ei,WS:"WS"});let eQ=/[a-z]/,e0=/\p{L}/u,e1=/\p{Emoji}/u,e2=/\d/,e3=/\s/,e5=null,e4=null;function e6(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)(a=l).accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=u,s-=h,c-=u,i.push({t:d.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function e9(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new Q(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new Q(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function e7(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let e8={defaultProtocol:"http",events:null,format:tt,formatHref:tt,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function te(e,t=null){let n=Object.assign({},e8);e&&(n=Object.assign(n,e instanceof te?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function tt(e){return e}function tn(e,t){this.t="token",this.v=e,this.tk=t}function tr(e,t){class n extends tn{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}te.prototype={o:e8,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:e8[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},tn.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=e8.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),a=e.get("target",t,this),l=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),a&&(o.target=a),l&&(o.rel=l),c&&Object.assign(o,c),{tagName:r,attributes:o,content:i,eventListeners:d}}};let ti=tr("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),to=tr("text"),ts=tr("nl"),ta=tr("url",{isLink:!0,toHref(e=e8.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==el&&e[1].t===eI}}),tl=e=>new Q(e);function tc(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let td="u">typeof console&&console&&console.warn||(()=>{}),tu={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function th(e,t=!1){if(tu.initialized&&td(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
101
99
  1. Must only contain digits, lowercase ASCII letters or "-"
102
100
  2. Cannot start or end with "-"
103
- 3. "-" cannot repeat`);tw.customSchemes.push([e,t])}function tk(e){return tw.initialized||function(){tw.scanner=function(e=[]){let t={};el.groups=t;let n=new el;null==tr&&(tr=ta("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==ti&&(ti=ta("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),eh(n,"'",ez),eh(n,"{",ex),eh(n,"}",ek),eh(n,"[",eS),eh(n,"]",eC),eh(n,"(",eE),eh(n,")",eM),eh(n,"<",eN),eh(n,">",eA),eh(n,"(",eT),eh(n,")",eR),eh(n,"「",eO),eh(n,"」",eD),eh(n,"『",ej),eh(n,"』",eI),eh(n,"<",eP),eh(n,">",eL),eh(n,"&",e_),eh(n,"*",e$),eh(n,"@","AT"),eh(n,"`",eB),eh(n,"^",eF),eh(n,":",eV),eh(n,",",eU),eh(n,"$",eW),eh(n,".","DOT"),eh(n,"=",eK),eh(n,"!",eq),eh(n,"-",eJ),eh(n,"%",eG),eh(n,"|",eX),eh(n,"+",eZ),eh(n,"#",eY),eh(n,"?",eQ),eh(n,'"',e0),eh(n,"/",e3),eh(n,";",e2),eh(n,"~",e5),eh(n,"_",e4),eh(n,"\\",eH),eh(n,"・",e1);let r=ed(n,tt,"NUM",{[Q]:!0});ed(r,tt,r);let i=ed(r,e7,em,{[en]:!0}),o=ed(r,e8,eg,{[er]:!0}),s=ed(n,e7,ep,{[ee]:!0});ed(s,tt,i),ed(s,e7,s),ed(i,tt,i),ed(i,e7,i);let a=ed(n,e8,ef,{[et]:!0});ed(a,e7),ed(a,tt,o),ed(a,e8,a),ed(o,tt,o),ed(o,e7),ed(o,e8,o);let l=eh(n,"\n","NL",{[es]:!0}),c=eh(n,"\r","WS",{[es]:!0}),d=ed(n,tn,"WS",{[es]:!0});eh(n,"",d),eh(c,"\n",l),eh(c,"",d),ed(c,tn,d),eh(d,"\r"),eh(d,"\n"),ed(d,tn,d),eh(d,"",d);let u=ed(n,te,e6,{[eo]:!0});eh(u,"#"),ed(u,te,u),eh(u,"️",u);let h=eh(u,"‍");eh(h,"#"),ed(h,te,u);let p=[[e7,s],[tt,i]],f=[[e7,null],[e8,a],[tt,o]];for(let e=0;e<tr.length;e++)ts(n,tr[e],"TLD",ep,p);for(let e=0;e<ti.length;e++)ts(n,ti[e],eb,ef,f);ea("TLD",{tld:!0,ascii:!0},t),ea(eb,{utld:!0,alpha:!0},t),ts(n,"file",ev,ep,p),ts(n,"mailto",ev,ep,p),ts(n,"http",ew,ep,p),ts(n,"https",ew,ep,p),ts(n,"ftp",ew,ep,p),ts(n,"ftps",ew,ep,p),ea(ev,{scheme:!0,ascii:!0},t),ea(ew,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[ei]=!0:e7.test(r)?tt.test(r)?i[en]=!0:i[ee]=!0:i[Q]=!0,eu(n,r,r,i)}return eu(n,"localhost",ey,{ascii:!0}),n.jd=new el("SYM"),{start:n,tokens:Object.assign({groups:t},e9)}}(tw.customSchemes);for(let e=0;e<tw.tokenQueue.length;e++)tw.tokenQueue[e][1]({scanner:tw.scanner});tw.parser=function({groups:e}){let t=e.domain.concat([e_,e$,"AT",eH,eB,eF,eW,eK,eJ,"NUM",eG,eX,eZ,eY,e3,"SYM",e5,e4]),n=[ez,eV,eU,"DOT",eq,eG,eQ,e0,e2,eN,eA,ex,ek,eC,eS,eE,eM,eT,eR,eO,eD,ej,eI,eP,eL],r=[e_,ez,e$,eH,eB,eF,eW,eK,eJ,ex,ek,eG,eX,eZ,eY,eQ,e3,"SYM",e5,e4],i=ty(),o=eh(i,e5);ec(o,r,o),ec(o,e.domain,o);let s=ty(),a=ty(),l=ty();ec(i,e.domain,s),ec(i,e.scheme,a),ec(i,e.slashscheme,l),ec(s,r,o),ec(s,e.domain,s);let c=eh(s,"AT");eh(o,"AT",c),eh(a,"AT",c),eh(l,"AT",c);let d=eh(o,"DOT");ec(d,r,o),ec(d,e.domain,o);let u=ty();ec(c,e.domain,u),ec(u,e.domain,u);let h=eh(u,"DOT");ec(h,e.domain,u);let p=ty(tp);ec(h,e.tld,p),ec(h,e.utld,p),eh(c,ey,p);let f=eh(u,eJ);eh(f,eJ,f),ec(f,e.domain,u),ec(p,e.domain,u),eh(p,"DOT",h),eh(p,eJ,f);let m=eh(s,eJ),g=eh(s,"DOT");eh(m,eJ,m),ec(m,e.domain,s),ec(g,r,o),ec(g,e.domain,s);let y=ty(tg);ec(g,e.tld,y),ec(g,e.utld,y),ec(y,e.domain,s),ec(y,r,o),eh(y,"DOT",g),eh(y,eJ,m),eh(y,"AT",c);let b=eh(y,eV),v=ty(tg);ec(b,e.numeric,v);let w=ty(tg),x=ty();ec(w,t,w),ec(w,n,x),ec(x,t,w),ec(x,n,x),eh(y,e3,w),eh(v,e3,w);let k=eh(a,eV),S=eh(l,eV),C=eh(S,e3),E=eh(C,e3);ec(a,e.domain,s),eh(a,"DOT",g),eh(a,eJ,m),ec(l,e.domain,s),eh(l,"DOT",g),eh(l,eJ,m),ec(k,e.domain,w),eh(k,e3,w),eh(k,eQ,w),ec(E,e.domain,w),ec(E,t,w),eh(E,e3,w);let M=[[ex,ek],[eS,eC],[eE,eM],[eN,eA],[eT,eR],[eO,eD],[ej,eI],[eP,eL]];for(let e=0;e<M.length;e++){let[r,i]=M[e],o=eh(w,r);eh(x,r,o);let s=ty(tg);ec(o,t,s);let a=ty();ec(o,n,a),eh(o,i,w),ec(s,t,s),ec(s,n,a),ec(a,t,s),ec(a,n,a),eh(s,i,w),eh(a,i,w)}return eh(i,ey,y),eh(i,"NL",tm),{start:i,tokens:e9}}(tw.scanner.tokens);for(let e=0;e<tw.pluginQueue.length;e++)tw.pluginQueue[e][1]({scanner:tw.scanner,parser:tw.parser});tw.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,l=null,c=null,d=0,u=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,(a=c).accepts()?(h=0,u=a):h>=0&&h++,i++,d++;if(h<0)(i-=d)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(tb(tf,t,s)),s=[]),i-=h,d-=h;let e=u.t,r=n.slice(i-d,i);o.push(tb(e,t,r))}}return s.length>0&&o.push(tb(tf,t,s)),o}(tw.parser.start,e,to(tw.scanner.start,e))}function tS(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new tc(n),i=tk(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}tk.scan=to;var tC="[\0-   ᠎ -\u2029  ]",tE=new RegExp(tC),tM=RegExp(`${tC}$`),tN=RegExp(tC,"g");function tA(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(tN,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var tT=V.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?tx(e):tx(e.scheme,e.optionalSlashes)})},onDestroy(){el.groups={},tw.scanner=null,tw.parser=null,tw.tokenQueue=[],tw.pluginQueue=[],tw.customSchemes=[],tw.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!tA(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!tA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!tA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]:["a",(0,V.mergeAttributes)(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!tA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!tA(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,V.markPasteRule)({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=tS(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!tA(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!tA(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new U.Plugin({key:new U.PluginKey("autolink"),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,a=(0,V.combineTransactionSteps)(n.doc,[...t]);if((0,V.getChangedRanges)(a).forEach(({newRange:t})=>{let n,i,o=(0,V.findChildrenInRange)(r.doc,t,e=>e.isTextblock);if(o.length>1)n=o[0],i=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!tM.test(e))return;n=o[0],i=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&i){let t=i.split(tE).filter(Boolean);if(t.length<=0)return!1;let o=t[t.length-1],a=n.pos+i.lastIndexOf(o);if(!o)return!1;let l=tk(o).map(t=>t.toObject(e.defaultProtocol));if(!(1===l.length?l[0].isLink:3===l.length&&!!l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;l.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,V.getMarksBetween)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),r.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new U.Plugin({key:new U.PluginKey("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target;if(!e)return!1;let n=t.editor.view.dom;(s=e.closest("a"))&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=(0,V.getAttributes)(e.state,t.type.name),r=null!=(i=s.href)?i:n.href,l=null!=(o=s.target)?o:n.target;r&&(window.open(r,l),a=!0)}return a}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new U.Plugin({key:new U.PluginKey("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let c=tS(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!c&&(void 0===i||!!i(c.value))&&n.editor.commands.setMark(n.type,{href:c.href})}}}))),r}}),tR=e.i(605842);class tO{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),a=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*l;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,i=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/a+"px",this.element.style.top=(i.top-t)/l+"px",this.element.style.width=(i.right-i.left)/a+"px",this.element.style.height=(i.bottom-i.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,tR.dropPoint)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var tD=e.i(202008),tj=U,tI=e.i(644575);class tP extends tj.Selection{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return tP.valid(n)?new tP(n):tj.Selection.near(n)}content(){return tI.Slice.empty}eq(e){return e instanceof tP&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new tP(e.resolve(t.pos))}getBookmark(){return new tL(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||t_(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||t_(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&tP.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(tP.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!tj.NodeSelection.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(tP.valid(s))return s}return null}}}tP.prototype.visible=!1,tP.findFrom=tP.findGapCursorFrom,tj.Selection.jsonID("gapcursor",tP);class tL{constructor(e){this.pos=e}map(e){return new tL(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return tP.valid(t)?new tP(t):tj.Selection.near(t)}}function t_(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let tz=(0,tD.keydownHandler)({ArrowLeft:t$("horiz",-1),ArrowRight:t$("horiz",1),ArrowUp:t$("vert",-1),ArrowDown:t$("vert",1)});function t$(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof tj.TextSelection){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=tP.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new tP(l))),!0)}}function tH(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!tP.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&tj.NodeSelection.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new tP(r))),!0)}function tB(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof tP))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=tI.Fragment.empty;for(let e=r.length-1;e>=0;e--)i=tI.Fragment.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new tI.Slice(i,0,0));return o.setSelection(tj.TextSelection.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function tF(e){if(!(e.selection instanceof tP))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",J.DecorationSet.create(e.doc,[J.Decoration.widget(e.selection.head,t,{key:"gapcursor"})])}var tV=function(){};tV.prototype.append=function(e){return e.length?(e=tV.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},tV.prototype.prepend=function(e){return e.length?tV.from(e).append(this):this},tV.prototype.appendInner=function(e){return new tW(this,e)},tV.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?tV.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},tV.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},tV.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},tV.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},tV.from=function(e){return e instanceof tV?e:e&&e.length?new tU(e):tV.empty};var tU=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(tV);tV.empty=new tU([]);var tW=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(tV);class tK{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new tq(e.map));let t=e.step.map(n.slice(r)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new tq(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new tK(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(e,t,n,r){var i,o;let s,a=[],l=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new tq(e.mapping.maps[n],i,t),s;(s=d&&d.merge(o))&&(o=s,n?a.pop():c=c.slice(0,c.length-1)),a.push(o),t&&(l++,t=void 0),r||(d=o)}let u=l-n.depth;return u>tG&&(i=c,o=u,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),c=i.slice(s),l-=u),new tK(c.append(a),l)}remapping(e,t){let n=new tR.Mapping;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new tK(this.items.append(e.map(e=>new tq(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new tq(l,o,c))}else n.push(new tq(l))},r);let l=[];for(let e=t;e<o;e++)l.push(new tq(i.maps[e]));let c=new tK(this.items.slice(0,r).append(l).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l=new tq(s.invert(),e,a),c,d=r.length-1;(c=r.length&&r[d].merge(l))?r[d]=c:r.push(l)}}else o.map&&n--},this.items.length,0),new tK(tV.from(r.reverse()),i)}}tK.empty=new tK(tV.empty,0);class tq{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new tq(t.getMap().invert(),t,this.selection)}}}class tJ{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let tG=20;function tX(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function tZ(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let tY=!1,tQ=null;function t0(e){let t=e.plugins;if(tQ!=t){tY=!1,tQ=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){tY=!0;break}}return tY}let t1=new U.PluginKey("history"),t2=new U.PluginKey("closeHistory");function t3(e,t){return(n,r)=>{let i=t1.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=t0(t),i=t1.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new tJ(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(t1,{redo:n,historyState:l})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let t5=t3(!1,!0),t4=t3(!0,!0);t3(!1,!1),t3(!0,!1),V.Extension.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new U.Plugin({key:new U.PluginKey("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,o=this.options.autoTrim;if(null==i||0===i||!1===o){e=!0;return}let s=this.storage.characters({node:r.doc});if(s>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,s-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}});var t6=V.Extension.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new U.Plugin({view:t=>new tO(t,e)})}(this.options)]}});V.Extension.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new U.Plugin({key:new U.PluginKey("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return J.DecorationSet.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void o.push(J.Decoration.node(t,t+e.nodeSize,{class:this.options.className})))),J.DecorationSet.create(e,o)}}})]}});var t9=V.Extension.create({name:"gapCursor",addProseMirrorPlugins:()=>[new tj.Plugin({props:{decorations:tF,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&tP.valid(n)?new tP(n):null,handleClick:tH,handleKeyDown:tz,handleDOMEvents:{beforeinput:tB}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,V.callOrReturn)((0,V.getExtensionField)(e,"allowGapCursor",n)))?t:null}}}),t7="placeholder",t8=new U.PluginKey("tiptap__placeholder");function ne(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:o,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,d=[l];return s&&d.push(c),J.Decoration.node(i,i+o.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:o,pos:i,hasAnchor:a}):n})}var nt={init:()=>({topPos:null,bottomPos:null}),apply(e,t){let n=e.getMeta(t8);return(null==n?void 0:n.positions)?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:null!==t.topPos?e.mapping.map(t.topPos):null,bottomPos:null!==t.bottomPos?e.mapping.map(t.bottomPos):null}:t}};function nn(e){let t=function(e){let t=e;for(;t;){if(function(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}break}t=e}return window}(e.dom),n=()=>{let n=function({doc:e,view:t,scrollContainer:n}){let r=t.dom.getBoundingClientRect(),i=n?n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect():{top:0,bottom:window.innerHeight},o=Math.max(r.top,i.top)-200,s=Math.min(r.bottom,i.bottom)+200;if(o>=s)return{top:0,bottom:e.content.size};let a="rtl"===getComputedStyle(t.dom).direction?Math.max(r.right-2,r.left+2):r.left+2,l=t.posAtCoords({left:a,top:o+2}),c=t.posAtCoords({left:a,top:s-2});return{top:l?l.pos:0,bottom:c?c.pos:e.content.size}}({view:e,doc:e.state.doc,scrollContainer:t}),r=t8.getState(e.state);if((null==r?void 0:r.topPos)===n.top&&(null==r?void 0:r.bottomPos)===n.bottom)return;let i=e.state.tr.setMeta(t8,{positions:n});e.dispatch(i)},r=null,i=0,o=()=>{null===r&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):o()}))};return t.addEventListener("scroll",o,{passive:!0}),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&o()},destroy:()=>{null!==r&&cancelAnimationFrame(r),t.removeEventListener("scroll",o)}}}var nr=V.Extension.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:t7,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[function({editor:e,options:t}){let n=t.dataAttribute?`data-${t.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${t7}`;return new U.Plugin({key:t8,state:nt,view:nn,props:{decorations:({doc:r,selection:i})=>(function({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){var o,s;if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,l=[],c=e.isEmpty,d={emptyEditor:t.emptyEditorClass,emptyNode:t.emptyNodeClass};if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),o=i.depth>0?i.node(1):i.nodeAfter,s=i.depth>0?i.before(1):a;if(o&&o.type.isTextblock&&(0,V.isNodeEmpty)(o)){let r=a>=s&&a<=s+o.nodeSize;l.push(ne({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:d,node:o,pos:s}))}}else{let i=t8.getState(e.state),u=null!=(o=null==i?void 0:i.topPos)?o:0,h=null!=(s=null==i?void 0:i.bottomPos)?s:r.content.size;r.nodesBetween(u,h,(r,i)=>{let o=a>=i&&a<=i+r.nodeSize,s=!r.isLeaf&&(0,V.isNodeEmpty)(r);return r.type.isTextblock&&(o||!t.showOnlyCurrent)&&s&&l.push(ne({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:o,placeholder:t.placeholder,classes:d,node:r,pos:i})),t.includeChildren})}return J.DecorationSet.create(r,l)})({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}({editor:this.editor,options:this.options})]}});function ni({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}V.Extension.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new U.Plugin({key:new U.PluginKey("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||(0,V.isNodeSelection)(n.selection)||e.view.dragging?null:J.DecorationSet.create(n.doc,[J.Decoration.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var no=V.Extension.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new U.PluginKey(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new U.Plugin({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:a}=i,l=t.getState(i),c=o.content.size,d=a.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&l)return s.insert(c,d.create())},state:{init:(e,t)=>!ni({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!ni({node:e.doc.lastChild,types:r})}})]}}),ns=V.Extension.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>t5(e,t),redo:()=>({state:e,dispatch:t})=>t4(e,t)}),addProseMirrorPlugins(){return[function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new U.Plugin({key:t1,state:{init:()=>new tJ(tK.empty,tK.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(t1),o;if(i)return i.historyState;n.getMeta(t2)&&(e=new tJ(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(t1))if(s.getMeta(t1).redo)return new tJ(e.done.addTransform(n,void 0,r,t0(t)),e.undone,tX(n.mapping.maps),e.prevTime,e.prevComposition);else return new tJ(e.done,e.undone.addTransform(n,void 0,r,t0(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new tJ(e.done.rebased(n,o),e.undone.rebased(n,o),tZ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new tJ(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),tZ(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),a=s?tZ(e.prevRanges,n.mapping):tX(n.mapping.maps);return new tJ(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,t0(t)),tK.empty,a,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?t5:"historyRedo"==n?t4:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),na=V.Mark.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),nl=V.Mark.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});e.i(150663);var nc=e.i(608926);function nd(e){return"left"===e||"right"===e||"center"===e?e:null}function nu(){return{default:null,parseHTML:e=>{let t,n;return t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase(),nd(t||n)},renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var nh=V.Node.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var t,n;let r=e.getAttribute("colwidth"),i=r?r.split(",").map(e=>parseInt(e,10)):null;if(!i){let r=null==(t=e.closest("table"))?void 0:t.querySelectorAll("colgroup > col"),i=Array.from((null==(n=e.parentElement)?void 0:n.children)||[]).indexOf(e);if(i&&i>-1&&r&&r[i]){let e=r[i].getAttribute("width");return e?[parseInt(e,10)]:null}}return i}},align:nu()}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),np=V.Node.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}},align:nu()}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),nf=V.Node.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}});function nm(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function ng(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild,d=e.firstChild;if(null!==d)for(let e=0,n=0;e<d.childCount;e+=1){let{colspan:s,colwidth:u}=d.child(e).attrs;for(let e=0;e<s;e+=1,n+=1){let s=i===n?o:u&&u[e],d=s?`${s}px`:"";if(a+=s||r,s||(l=!1),c){if(c.style.width!==d){let[e,t]=nm(r,s);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement("col"),[n,i]=nm(r,s);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){let e=c.nextSibling;null==(s=c.parentNode)||s.removeChild(c),c=e}let u=e.attrs.style&&"string"==typeof e.attrs.style&&/\bwidth\s*:/i.test(e.attrs.style);l&&!u?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var ny=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ng(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,ng(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!n&&!r&&("attributes"===e.type||"childList"===e.type||"characterData"===e.type)}};function nb(e,t){return t?e.createChecked(null,t):e.createAndFill()}var nv=({editor:e})=>{let{selection:t}=e.state;if(!(t instanceof nc.CellSelection))return!1;let n=0,r=(0,V.findParentNodeClosestToPos)(t.ranges[0].$from,e=>"table"===e.type.name);return null==r||r.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)},nw=function(e,t,n={}){var r;let i=null!=(r=n.cellLineSeparator)?r:"\x1f";if(!e||!e.content||0===e.content.length)return"";let o=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{var r;let o=((e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(i):e.content?t.renderChildren(e.content):"")||"").replace(/\s+/g," ").trim(),s="tableHeader"===e.type,a=nd(null==(r=e.attrs)?void 0:r.align);n.push({text:o,isHeader:s,align:a})}),o.push(n)});let s=o.reduce((e,t)=>Math.max(e,t.length),0);if(0===s)return"";let a=Array.from({length:s}).fill(0);o.forEach(e=>{var t;for(let n=0;n<s;n+=1){let r=((null==(t=e[n])?void 0:t.text)||"").length;r>a[n]&&(a[n]=r),a[n]<3&&(a[n]=3)}});let l=(e,t)=>e+" ".repeat(Math.max(0,t-e.length)),c=o[0],d=c.some(e=>e.isHeader),u=Array.from({length:s}).fill(null);o.forEach(e=>{var t;for(let n=0;n<s;n+=1)!u[n]&&(null==(t=e[n])?void 0:t.align)&&(u[n]=e[n].align)});let h="\n",p=Array.from({length:s}).map((e,t)=>d&&c[t]&&c[t].text||"");return h+=`| ${p.map((e,t)=>l(e,a[t])).join(" | ")} |
101
+ 3. "-" cannot repeat`);tu.customSchemes.push([e,t])}function tp(e){return tu.initialized||function(){tu.scanner=function(e=[]){let t={};Q.groups=t;let n=new Q;null==e5&&(e5=e7("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==e4&&(e4=e7("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),er(n,"'",eT),er(n,"{",eh),er(n,"}",ep),er(n,"[",ef),er(n,"]",em),er(n,"(",eg),er(n,")",ey),er(n,"<",eb),er(n,">",ev),er(n,"(",ew),er(n,")",ex),er(n,"「",ek),er(n,"」",eS),er(n,"『",eC),er(n,"』",eE),er(n,"<",eM),er(n,">",eN),er(n,"&",eA),er(n,"*",eR),er(n,"@","AT"),er(n,"`",eD),er(n,"^",ej),er(n,":",eI),er(n,",",eP),er(n,"$",eL),er(n,".","DOT"),er(n,"=",e_),er(n,"!",ez),er(n,"-",e$),er(n,"%",eH),er(n,"|",eB),er(n,"+",eF),er(n,"#",eV),er(n,"?",eU),er(n,'"',eW),er(n,"/",eJ),er(n,";",eq),er(n,"~",eG),er(n,"_",eX),er(n,"\\",eO),er(n,"・",eK);let r=et(n,e2,"NUM",{[U]:!0});et(r,e2,r);let i=et(r,eQ,es,{[q]:!0}),o=et(r,e0,ea,{[J]:!0}),s=et(n,eQ,ei,{[W]:!0});et(s,e2,i),et(s,eQ,s),et(i,e2,i),et(i,eQ,i);let a=et(n,e0,eo,{[K]:!0});et(a,eQ),et(a,e2,o),et(a,e0,a),et(o,e2,o),et(o,eQ),et(o,e0,o);let l=er(n,"\n","NL",{[Z]:!0}),c=er(n,"\r","WS",{[Z]:!0}),d=et(n,e3,"WS",{[Z]:!0});er(n,"",d),er(c,"\n",l),er(c,"",d),et(c,e3,d),er(d,"\r"),er(d,"\n"),et(d,e3,d),er(d,"",d);let u=et(n,e1,eZ,{[X]:!0});er(u,"#"),et(u,e1,u),er(u,"️",u);let h=er(u,"‍");er(h,"#"),et(h,e1,u);let p=[[eQ,s],[e2,i]],f=[[eQ,null],[e0,a],[e2,o]];for(let e=0;e<e5.length;e++)e9(n,e5[e],"TLD",ei,p);for(let e=0;e<e4.length;e++)e9(n,e4[e],ec,eo,f);Y("TLD",{tld:!0,ascii:!0},t),Y(ec,{utld:!0,alpha:!0},t),e9(n,"file",ed,ei,p),e9(n,"mailto",ed,ei,p),e9(n,"http",eu,ei,p),e9(n,"https",eu,ei,p),e9(n,"ftp",eu,ei,p),e9(n,"ftps",eu,ei,p),Y(ed,{scheme:!0,ascii:!0},t),Y(eu,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[G]=!0:eQ.test(r)?e2.test(r)?i[q]=!0:i[W]=!0:i[U]=!0,en(n,r,r,i)}return en(n,"localhost",el,{ascii:!0}),n.jd=new Q("SYM"),{start:n,tokens:Object.assign({groups:t},eY)}}(tu.customSchemes);for(let e=0;e<tu.tokenQueue.length;e++)tu.tokenQueue[e][1]({scanner:tu.scanner});tu.parser=function({groups:e}){let t=e.domain.concat([eA,eR,"AT",eO,eD,ej,eL,e_,e$,"NUM",eH,eB,eF,eV,eJ,"SYM",eG,eX]),n=[eT,eI,eP,"DOT",ez,eH,eU,eW,eq,eb,ev,eh,ep,em,ef,eg,ey,ew,ex,ek,eS,eC,eE,eM,eN],r=[eA,eT,eR,eO,eD,ej,eL,e_,e$,eh,ep,eH,eB,eF,eV,eU,eJ,"SYM",eG,eX],i=tl(),o=er(i,eG);ee(o,r,o),ee(o,e.domain,o);let s=tl(),a=tl(),l=tl();ee(i,e.domain,s),ee(i,e.scheme,a),ee(i,e.slashscheme,l),ee(s,r,o),ee(s,e.domain,s);let c=er(s,"AT");er(o,"AT",c),er(a,"AT",c),er(l,"AT",c);let d=er(o,"DOT");ee(d,r,o),ee(d,e.domain,o);let u=tl();ee(c,e.domain,u),ee(u,e.domain,u);let h=er(u,"DOT");ee(h,e.domain,u);let p=tl(ti);ee(h,e.tld,p),ee(h,e.utld,p),er(c,el,p);let f=er(u,e$);er(f,e$,f),ee(f,e.domain,u),ee(p,e.domain,u),er(p,"DOT",h),er(p,e$,f);let m=er(s,e$),g=er(s,"DOT");er(m,e$,m),ee(m,e.domain,s),ee(g,r,o),ee(g,e.domain,s);let y=tl(ta);ee(g,e.tld,y),ee(g,e.utld,y),ee(y,e.domain,s),ee(y,r,o),er(y,"DOT",g),er(y,e$,m),er(y,"AT",c);let b=er(y,eI),v=tl(ta);ee(b,e.numeric,v);let w=tl(ta),x=tl();ee(w,t,w),ee(w,n,x),ee(x,t,w),ee(x,n,x),er(y,eJ,w),er(v,eJ,w);let k=er(a,eI),S=er(l,eI),C=er(S,eJ),E=er(C,eJ);ee(a,e.domain,s),er(a,"DOT",g),er(a,e$,m),ee(l,e.domain,s),er(l,"DOT",g),er(l,e$,m),ee(k,e.domain,w),er(k,eJ,w),er(k,eU,w),ee(E,e.domain,w),ee(E,t,w),er(E,eJ,w);let M=[[eh,ep],[ef,em],[eg,ey],[eb,ev],[ew,ex],[ek,eS],[eC,eE],[eM,eN]];for(let e=0;e<M.length;e++){let[r,i]=M[e],o=er(w,r);er(x,r,o);let s=tl(ta);ee(o,t,s);let a=tl();ee(o,n,a),er(o,i,w),ee(s,t,s),ee(s,n,a),ee(a,t,s),ee(a,n,a),er(s,i,w),er(a,i,w)}return er(i,el,y),er(i,"NL",ts),{start:i,tokens:eY}}(tu.scanner.tokens);for(let e=0;e<tu.pluginQueue.length;e++)tu.pluginQueue[e][1]({scanner:tu.scanner,parser:tu.parser});tu.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,l=null,c=null,d=0,u=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,(a=c).accepts()?(h=0,u=a):h>=0&&h++,i++,d++;if(h<0)(i-=d)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(tc(to,t,s)),s=[]),i-=h,d-=h;let e=u.t,r=n.slice(i-d,i);o.push(tc(e,t,r))}}return s.length>0&&o.push(tc(to,t,s)),o}(tu.parser.start,e,e6(tu.scanner.start,e))}function tf(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new te(n),i=tp(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}tp.scan=e6;var tm=e.i(111092),tg="[\0-   ᠎ -\u2029  ]",ty=new RegExp(tg),tb=RegExp(`${tg}$`),tv=RegExp(tg,"g");function tw(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(tv,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var tx=V.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?th(e):th(e.scheme,e.optionalSlashes)})},onDestroy(){Q.groups={},tu.scanner=null,tu.parser=null,tu.tokenQueue=[],tu.pluginQueue=[],tu.customSchemes=[],tu.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!tw(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!tw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!tw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]:["a",(0,V.mergeAttributes)(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!tw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!tw(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,V.markPasteRule)({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=tf(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!tw(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!tw(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new tm.Plugin({key:new tm.PluginKey("autolink"),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,a=(0,V.combineTransactionSteps)(n.doc,[...t]);if((0,V.getChangedRanges)(a).forEach(({newRange:t})=>{let n,i,o=(0,V.findChildrenInRange)(r.doc,t,e=>e.isTextblock);if(o.length>1)n=o[0],i=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!tb.test(e))return;n=o[0],i=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&i){let t=i.split(ty).filter(Boolean);if(t.length<=0)return!1;let o=t[t.length-1],a=n.pos+i.lastIndexOf(o);if(!o)return!1;let l=tp(o).map(t=>t.toObject(e.defaultProtocol));if(!(1===l.length?l[0].isLink:3===l.length&&!!l[1].isLink&&["()","[]"].includes(l[0].value+l[2].value)))return!1;l.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,V.getMarksBetween)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),r.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new tm.Plugin({key:new tm.PluginKey("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target;if(!e)return!1;let n=t.editor.view.dom;(s=e.closest("a"))&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=(0,V.getAttributes)(e.state,t.type.name),r=null!=(i=s.href)?i:n.href,l=null!=(o=s.target)?o:n.target;r&&(window.open(r,l),a=!0)}return a}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new tm.Plugin({key:new tm.PluginKey("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let c=tf(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!c&&(void 0===i||!!i(c.value))&&n.editor.commands.setMark(n.type,{href:c.href})}}}))),r}}),tk=e.i(605842);class tS{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),a=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*l;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,i=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/a+"px",this.element.style.top=(i.top-t)/l+"px",this.element.style.width=(i.right-i.left)/a+"px",this.element.style.height=(i.bottom-i.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,tk.dropPoint)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}var tC=e.i(362615),tE=e.i(202008),tM=tm,tN=e.i(644575);class tA extends tM.Selection{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return tA.valid(n)?new tA(n):tM.Selection.near(n)}content(){return tN.Slice.empty}eq(e){return e instanceof tA&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new tA(e.resolve(t.pos))}getBookmark(){return new tT(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||tR(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||tR(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&tA.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(tA.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!tM.NodeSelection.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(tA.valid(s))return s}return null}}}tA.prototype.visible=!1,tA.findFrom=tA.findGapCursorFrom,tM.Selection.jsonID("gapcursor",tA);class tT{constructor(e){this.pos=e}map(e){return new tT(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return tA.valid(t)?new tA(t):tM.Selection.near(t)}}function tR(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let tO=(0,tE.keydownHandler)({ArrowLeft:tD("horiz",-1),ArrowRight:tD("horiz",1),ArrowUp:tD("vert",-1),ArrowDown:tD("vert",1)});function tD(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,a=o.empty;if(o instanceof tM.TextSelection){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=tA.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new tA(l))),!0)}}function tj(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!tA.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&tM.NodeSelection.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new tA(r))),!0)}function tI(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof tA))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=tN.Fragment.empty;for(let e=r.length-1;e>=0;e--)i=tN.Fragment.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new tN.Slice(i,0,0));return o.setSelection(tM.TextSelection.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function tP(e){if(!(e.selection instanceof tA))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",tC.DecorationSet.create(e.doc,[tC.Decoration.widget(e.selection.head,t,{key:"gapcursor"})])}var tL=function(){};tL.prototype.append=function(e){return e.length?(e=tL.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},tL.prototype.prepend=function(e){return e.length?tL.from(e).append(this):this},tL.prototype.appendInner=function(e){return new tz(this,e)},tL.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?tL.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},tL.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},tL.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},tL.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},tL.from=function(e){return e instanceof tL?e:e&&e.length?new t_(e):tL.empty};var t_=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(tL);tL.empty=new t_([]);var tz=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(tL);class t${constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new tH(e.map));let t=e.step.map(n.slice(r)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new tH(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new t$(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(e,t,n,r){var i,o;let s,a=[],l=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new tH(e.mapping.maps[n],i,t),s;(s=d&&d.merge(o))&&(o=s,n?a.pop():c=c.slice(0,c.length-1)),a.push(o),t&&(l++,t=void 0),r||(d=o)}let u=l-n.depth;return u>tF&&(i=c,o=u,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),c=i.slice(s),l-=u),new t$(c.append(a),l)}remapping(e,t){let n=new tk.Mapping;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new t$(this.items.append(e.map(e=>new tH(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new tH(l,o,c))}else n.push(new tH(l))},r);let l=[];for(let e=t;e<o;e++)l.push(new tH(i.maps[e]));let c=new t$(this.items.slice(0,r).append(l).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l=new tH(s.invert(),e,a),c,d=r.length-1;(c=r.length&&r[d].merge(l))?r[d]=c:r.push(l)}}else o.map&&n--},this.items.length,0),new t$(tL.from(r.reverse()),i)}}t$.empty=new t$(tL.empty,0);class tH{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new tH(t.getMap().invert(),t,this.selection)}}}class tB{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let tF=20;function tV(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function tU(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let tW=!1,tK=null;function tq(e){let t=e.plugins;if(tK!=t){tW=!1,tK=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){tW=!0;break}}return tW}let tJ=new tm.PluginKey("history"),tG=new tm.PluginKey("closeHistory");function tX(e,t){return(n,r)=>{let i=tJ.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=tq(t),i=tJ.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new tB(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(tJ,{redo:n,historyState:l})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let tZ=tX(!1,!0),tY=tX(!0,!0);tX(!1,!1),tX(!0,!1),V.Extension.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new tm.Plugin({key:new tm.PluginKey("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,o=this.options.autoTrim;if(null==i||0===i||!1===o){e=!0;return}let s=this.storage.characters({node:r.doc});if(s>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,s-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}});var tQ=V.Extension.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new tm.Plugin({view:t=>new tS(t,e)})}(this.options)]}});V.Extension.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new tm.Plugin({key:new tm.PluginKey("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return tC.DecorationSet.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void o.push(tC.Decoration.node(t,t+e.nodeSize,{class:this.options.className})))),tC.DecorationSet.create(e,o)}}})]}});var t0=V.Extension.create({name:"gapCursor",addProseMirrorPlugins:()=>[new tM.Plugin({props:{decorations:tP,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&tA.valid(n)?new tA(n):null,handleClick:tj,handleKeyDown:tO,handleDOMEvents:{beforeinput:tI}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,V.callOrReturn)((0,V.getExtensionField)(e,"allowGapCursor",n)))?t:null}}}),t1="placeholder",t2=new tm.PluginKey("tiptap__placeholder");function t3(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:o,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,d=[l];return s&&d.push(c),tC.Decoration.node(i,i+o.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:o,pos:i,hasAnchor:a}):n})}var t5={init:()=>({topPos:null,bottomPos:null}),apply(e,t){let n=e.getMeta(t2);return(null==n?void 0:n.positions)?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:null!==t.topPos?e.mapping.map(t.topPos):null,bottomPos:null!==t.bottomPos?e.mapping.map(t.bottomPos):null}:t}};function t4(e){let t=function(e){let t=e;for(;t;){if(function(e){let t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}(t))return t;let e=t.parentElement;if(!e){let e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}break}t=e}return window}(e.dom),n=()=>{let n=function({doc:e,view:t,scrollContainer:n}){let r=t.dom.getBoundingClientRect(),i=n?n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect():{top:0,bottom:window.innerHeight},o=Math.max(r.top,i.top)-200,s=Math.min(r.bottom,i.bottom)+200;if(o>=s)return{top:0,bottom:e.content.size};let a="rtl"===getComputedStyle(t.dom).direction?Math.max(r.right-2,r.left+2):r.left+2,l=t.posAtCoords({left:a,top:o+2}),c=t.posAtCoords({left:a,top:s-2});return{top:l?l.pos:0,bottom:c?c.pos:e.content.size}}({view:e,doc:e.state.doc,scrollContainer:t}),r=t2.getState(e.state);if((null==r?void 0:r.topPos)===n.top&&(null==r?void 0:r.bottomPos)===n.bottom)return;let i=e.state.tr.setMeta(t2,{positions:n});e.dispatch(i)},r=null,i=0,o=()=>{null===r&&(r=requestAnimationFrame(()=>{r=null;let e=performance.now();e-i>=150?(i=e,n()):o()}))};return t.addEventListener("scroll",o,{passive:!0}),n(),{update(t,n){e.state.doc.content.size!==n.doc.content.size&&o()},destroy:()=>{null!==r&&cancelAnimationFrame(r),t.removeEventListener("scroll",o)}}}var t6=V.Extension.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:t1,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[function({editor:e,options:t}){let n=t.dataAttribute?`data-${t.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${t1}`;return new tm.Plugin({key:t2,state:t5,view:t4,props:{decorations:({doc:r,selection:i})=>(function({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){var o,s;if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:a}=i,l=[],c=e.isEmpty,d={emptyEditor:t.emptyEditorClass,emptyNode:t.emptyNodeClass};if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),o=i.depth>0?i.node(1):i.nodeAfter,s=i.depth>0?i.before(1):a;if(o&&o.type.isTextblock&&(0,V.isNodeEmpty)(o)){let r=a>=s&&a<=s+o.nodeSize;l.push(t3({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:d,node:o,pos:s}))}}else{let i=t2.getState(e.state),u=null!=(o=null==i?void 0:i.topPos)?o:0,h=null!=(s=null==i?void 0:i.bottomPos)?s:r.content.size;r.nodesBetween(u,h,(r,i)=>{let o=a>=i&&a<=i+r.nodeSize,s=!r.isLeaf&&(0,V.isNodeEmpty)(r);return r.type.isTextblock&&(o||!t.showOnlyCurrent)&&s&&l.push(t3({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:o,placeholder:t.placeholder,classes:d,node:r,pos:i})),t.includeChildren})}return tC.DecorationSet.create(r,l)})({editor:e,options:t,dataAttribute:n,doc:r,selection:i})}})}({editor:this.editor,options:this.options})]}});function t9({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}V.Extension.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new tm.Plugin({key:new tm.PluginKey("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||(0,V.isNodeSelection)(n.selection)||e.view.dragging?null:tC.DecorationSet.create(n.doc,[tC.Decoration.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var t7=V.Extension.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new tm.PluginKey(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new tm.Plugin({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:a}=i,l=t.getState(i),c=o.content.size,d=a.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&l)return s.insert(c,d.create())},state:{init:(e,t)=>!t9({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!t9({node:e.doc.lastChild,types:r})}})]}}),t8=V.Extension.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>tZ(e,t),redo:()=>({state:e,dispatch:t})=>tY(e,t)}),addProseMirrorPlugins(){return[function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new tm.Plugin({key:tJ,state:{init:()=>new tB(t$.empty,t$.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(tJ),o;if(i)return i.historyState;n.getMeta(tG)&&(e=new tB(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(tJ))if(s.getMeta(tJ).redo)return new tB(e.done.addTransform(n,void 0,r,tq(t)),e.undone,tV(n.mapping.maps),e.prevTime,e.prevComposition);else return new tB(e.done,e.undone.addTransform(n,void 0,r,tq(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new tB(e.done.rebased(n,o),e.undone.rebased(n,o),tU(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new tB(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),tU(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),a=s?tU(e.prevRanges,n.mapping):tV(n.mapping.maps);return new tB(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,tq(t)),t$.empty,a,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?tZ:"historyRedo"==n?tY:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ne=V.Mark.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),nt=V.Mark.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}});e.i(150663);var nn=e.i(608926);function nr(e){return"left"===e||"right"===e||"center"===e?e:null}function ni(){return{default:null,parseHTML:e=>{let t,n;return t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase(),nr(t||n)},renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var no=V.Node.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var t,n;let r=e.getAttribute("colwidth"),i=r?r.split(",").map(e=>parseInt(e,10)):null;if(!i){let r=null==(t=e.closest("table"))?void 0:t.querySelectorAll("colgroup > col"),i=Array.from((null==(n=e.parentElement)?void 0:n.children)||[]).indexOf(e);if(i&&i>-1&&r&&r[i]){let e=r[i].getAttribute("width");return e?[parseInt(e,10)]:null}}return i}},align:ni()}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),ns=V.Node.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}},align:ni()}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),na=V.Node.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]}});function nl(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function nc(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild,d=e.firstChild;if(null!==d)for(let e=0,n=0;e<d.childCount;e+=1){let{colspan:s,colwidth:u}=d.child(e).attrs;for(let e=0;e<s;e+=1,n+=1){let s=i===n?o:u&&u[e],d=s?`${s}px`:"";if(a+=s||r,s||(l=!1),c){if(c.style.width!==d){let[e,t]=nl(r,s);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement("col"),[n,i]=nl(r,s);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){let e=c.nextSibling;null==(s=c.parentNode)||s.removeChild(c),c=e}let u=e.attrs.style&&"string"==typeof e.attrs.style&&/\bwidth\s*:/i.test(e.attrs.style);l&&!u?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var nd=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),nc(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,nc(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!n&&!r&&("attributes"===e.type||"childList"===e.type||"characterData"===e.type)}};function nu(e,t){return t?e.createChecked(null,t):e.createAndFill()}var nh=({editor:e})=>{let{selection:t}=e.state;if(!(t instanceof nn.CellSelection))return!1;let n=0,r=(0,V.findParentNodeClosestToPos)(t.ranges[0].$from,e=>"table"===e.type.name);return null==r||r.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)},np=function(e,t,n={}){var r;let i=null!=(r=n.cellLineSeparator)?r:"\x1f";if(!e||!e.content||0===e.content.length)return"";let o=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{var r;let o=((e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(i):e.content?t.renderChildren(e.content):"")||"").replace(/\s+/g," ").trim(),s="tableHeader"===e.type,a=nr(null==(r=e.attrs)?void 0:r.align);n.push({text:o,isHeader:s,align:a})}),o.push(n)});let s=o.reduce((e,t)=>Math.max(e,t.length),0);if(0===s)return"";let a=Array.from({length:s}).fill(0);o.forEach(e=>{var t;for(let n=0;n<s;n+=1){let r=((null==(t=e[n])?void 0:t.text)||"").length;r>a[n]&&(a[n]=r),a[n]<3&&(a[n]=3)}});let l=(e,t)=>e+" ".repeat(Math.max(0,t-e.length)),c=o[0],d=c.some(e=>e.isHeader),u=Array.from({length:s}).fill(null);o.forEach(e=>{var t;for(let n=0;n<s;n+=1)!u[n]&&(null==(t=e[n])?void 0:t.align)&&(u[n]=e[n].align)});let h="\n",p=Array.from({length:s}).map((e,t)=>d&&c[t]&&c[t].text||"");return h+=`| ${p.map((e,t)=>l(e,a[t])).join(" | ")} |
104
102
  | ${a.map((e,t)=>{let n=Math.max(3,e),r=u[t];return"left"===r?`:${"-".repeat(n)}`:"right"===r?`${"-".repeat(n)}:`:"center"===r?`:${"-".repeat(n)}:`:"-".repeat(n)}).join(" | ")} |
105
103
  `,(d?o.slice(1):o).forEach(e=>{h+=`| ${Array.from({length:s}).fill(0).map((t,n)=>l(e[n]&&e[n].text||"",a[n])).join(" | ")} |
106
- `}),h},nx=V.Node.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:ny,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=function(e,t){let n=0,r=!0,i=[],o=e.firstChild;if(!o)return{};for(let e=0,s=0;e<o.childCount;e+=1){let{colspan:a,colwidth:l}=o.child(e).attrs;for(let e=0;e<a;e+=1,s+=1){let o=void 0===s?void 0:l&&l[e];n+=o||t,o||(r=!1);let[a,c]=nm(t,o);i.push(["col",{style:`${a}: ${c}`}])}}return{colgroup:["colgroup",{},...i],tableWidth:r?`${n}px`:"",tableMinWidth:r?"":`${n}px`}}(e,this.options.cellMinWidth),o=t.style,s=["table",(0,V.mergeAttributes)(this.options.HTMLAttributes,t,{style:o||(r?`width: ${r}`:`min-width: ${i}`)}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{var o;let s=nd(null!=(o=r[n])?o:e.align);i.push(t.createNode("tableHeader",s?{align:s}:{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{var o;let s=nd(null!=(o=r[n])?o:e.align);i.push(t.createNode("tableCell",s?{align:s}:{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>nw(e,t),addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=function(e,t,n,r){let i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=nb(i.cell,void 0);if(e&&s.push(e),r){let e=nb(i.header_cell,void 0);e&&o.push(e)}}let a=[];for(let e=0;e<t;e+=1)a.push(i.row.createChecked(null,r&&0===e?o:s));return i.table.createChecked(null,a)}(o.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(U.TextSelection.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>(0,nc.addColumnBefore)(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>(0,nc.addColumnAfter)(e,t),deleteColumn:()=>({state:e,dispatch:t})=>(0,nc.deleteColumn)(e,t),addRowBefore:()=>({state:e,dispatch:t})=>(0,nc.addRowBefore)(e,t),addRowAfter:()=>({state:e,dispatch:t})=>(0,nc.addRowAfter)(e,t),deleteRow:()=>({state:e,dispatch:t})=>(0,nc.deleteRow)(e,t),deleteTable:()=>({state:e,dispatch:t})=>(0,nc.deleteTable)(e,t),mergeCells:()=>({state:e,dispatch:t})=>(0,nc.mergeCells)(e,t),splitCell:()=>({state:e,dispatch:t})=>(0,nc.splitCell)(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>(0,nc.toggleHeader)("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>(0,nc.toggleHeader)("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>(0,nc.toggleHeaderCell)(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!(0,nc.mergeCells)(e,t)||(0,nc.splitCell)(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>(0,nc.setCellAttr)(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>(0,nc.goToNextCell)(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>(0,nc.goToNextCell)(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&(0,nc.fixTables)(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=nc.CellSelection.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:nv,"Mod-Backspace":nv,Delete:nv,"Mod-Delete":nv}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[(0,nc.columnResizing)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],(0,nc.tableEditing)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n})=>new t(e,this.options.cellMinWidth,n)},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,V.callOrReturn)((0,V.getExtensionField)(e,"tableRole",t))}}});V.Extension.create({name:"tableKit",addExtensions(){let e=[];return!1!==this.options.table&&e.push(nx.configure(this.options.table)),!1!==this.options.tableCell&&e.push(nh.configure(this.options.tableCell)),!1!==this.options.tableHeader&&e.push(np.configure(this.options.tableHeader)),!1!==this.options.tableRow&&e.push(nf.configure(this.options.tableRow)),e}});var nk=Object.defineProperty,nS="textStyle",nC=/^\s*([-+*])\s$/,nE=V.Node.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(nS)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,V.wrappingInputRule)({find:nC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,V.wrappingInputRule)({find:nC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(nS),editor:this.editor})),[e]}}),nM=V.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n,r,i,o;if("list_item"!==e.type)return[];let s=null!=(n=t.parseBlockChildren)?n:t.parseChildren,a=[];if(e.tokens&&e.tokens.length>0){let n;if(n=null==(r=e.tokens)?void 0:r[0],e.text&&(null==(i=e.tokens)?void 0:i.length)===1&&(null==n?void 0:n.type)==="list"&&n.ordered&&n.raw===e.text)return{type:"listItem",content:[{type:"paragraph",content:(o=e.text||"",t.tokenizeInline?t.parseInline(t.tokenizeInline(o)):t.parseInline([{type:"text",raw:o,text:o}]))}]};if(e.tokens.some(e=>"paragraph"===e.type))a=s(e.tokens);else{let n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(a=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){let t=s(e.tokens.slice(1));a.push(...t)}}else a=s(e.tokens)}}return 0===a.length&&(a=[{type:"paragraph",content:[]}]),{type:"listItem",content:a}},renderMarkdown:(e,t,n)=>(0,V.renderNestedMarkdownContent)(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),nN={},nA={findListItemPos:()=>nR,getNextListDepth:()=>nO,handleBackspace:()=>nP,handleDelete:()=>nz,hasListBefore:()=>nD,hasListItemAfter:()=>n$,hasListItemBefore:()=>nj,listItemHasSubList:()=>nI,nextListIsDeeper:()=>nL,nextListIsHigher:()=>n_};for(var nT in nA)nk(nN,nT,{get:nA[nT],enumerable:!0});var nR=(e,t)=>{let{$from:n}=t.selection,r=(0,V.getNodeType)(e,t.schema),i=n.depth,o=n.pos,s=null;for(;i>0&&null===s;)n.node(i).type===r?s=i:(i-=1,o-=1);return null===s?null:{$pos:t.doc.resolve(o),depth:s}},nO=(e,t)=>{let n=nR(e,t);if(!n)return!1;let[,r]=(0,V.getNodeAtPosition)(t,e,n.$pos.pos+4);return r},nD=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},nj=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},nI=(e,t,n)=>{if(!n)return!1;let r=(0,V.getNodeType)(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},nP=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,V.isNodeActive)(e.state,t)&&nD(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!(0,V.isNodeActive)(e.state,t)||!(0,V.isAtStartOfNode)(e.state))return!1;let r=nR(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=nI(t,e.state,i);return nj(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},nL=(e,t)=>{let n=nO(e,t),r=nR(e,t);return!!r&&!!n&&n>r.depth},n_=(e,t)=>{let n=nO(e,t),r=nR(e,t);return!!r&&!!n&&n<r.depth},nz=(e,t)=>{if(!(0,V.isNodeActive)(e.state,t)||!(0,V.isAtEndOfNode)(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&(nL(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():n_(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},n$=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},nH=V.Extension.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nz(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nz(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&nP(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&nP(e,n,r)&&(t=!0)}),t}}}}),nB=/^(\s*)(\d+)\.\s+(.*)$/,nF=/^\s/,nV="textStyle",nU=/^(\d+)\.\s$/,nW=V.Node.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",(0,V.mergeAttributes)(this.options.HTMLAttributes,n),0]:["ol",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(nB);if(!o)break;let[,s,a,l]=o,c=s.length,d=[l],u=n+1,h=[i],p=!1;for(;u<e.length;){let t=e[u];if(t.match(nB))break;if(""===t.trim())h.push(t),d.push(""),p=!0,u+=1;else if(t.match(nF))h.push(t),d.push(t.slice(c+2)),u+=1;else{if(p)break;h.push(t),d.push(t),u+=1}}t.push({indent:c,number:parseInt(a,10),content:d.join("\n").trim(),contentLines:d,raw:h.join("\n")}),r=u,n=u}return[t,r]}(i);if(0===o.length)return;let a=function e(t,n,r){let i=[],o=0;for(;o<t.length;){let s=t[o];if(s.indent===n){let{paragraphLines:a,blockLines:l}=function(e){let t=[],n=[],r=!1;return e.forEach(e=>{let i;if(r)return void n.push(e);if(""===e.trim()||t.length>0&&(i=e.trimStart(),/^[-+*]\s+/.test(i)||/^\d+\.\s+/.test(i)||/^>\s?/.test(i)||/^```/.test(i)||/^~~~/.test(i))){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}(s.contentLines),c=a.join("\n").trim(),d=[];c&&d.push({type:"paragraph",raw:c,tokens:r.inlineTokens(c)});let u=l.join("\n").trim();if(u){let e=r.blockTokens(u);d.push(...e)}let h=o+1,p=[];for(;h<t.length&&t[h].indent>n;)p.push(t[h]),h+=1;if(p.length>0){let t=Math.min(...p.map(e=>e.indent)),n=e(p,t,r);d.push({type:"list",ordered:!0,start:p[0].number,items:n,raw:p.map(e=>e.raw).join("\n")})}i.push({type:"list_item",raw:s.raw,tokens:d}),o=h}else o+=1}return i}(o,0,n);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:a,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(nV)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,V.wrappingInputRule)({find:nU,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,V.wrappingInputRule)({find:nU,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(nV)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),nK=/^\s*(\[([( |x])?\])\s$/,nq=V.Node.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,V.mergeAttributes)(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",i=`- [${r}] `;return(0,V.renderNestedMarkdownContent)(e,t,i)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(a.checked=!a.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);let t=r.extensionManager.attributes,n=(0,V.getRenderedAttributes)(e,t),o=new Set(Object.keys(n)),s=this.options.HTMLAttributes;return d.forEach(e=>{o.has(e)||(e in s?i.setAttribute(e,s[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{null==t?e in s?i.setAttribute(e,s[e]):i.removeAttribute(e):i.setAttribute(e,t)}),d=o,!0}}}},addInputRules(){return[(0,V.wrappingInputRule)({find:nK,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),nJ=V.Node.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",(0,V.mergeAttributes)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let r=e=>{let t=(0,V.parseIndentedBlocks)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=(0,V.parseIndentedBlocks)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});V.Extension.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(nE.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(nM.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(nH.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(nW.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(nq.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(nJ.configure(this.options.taskList)),e}});var nG=V.Extension.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),nX=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},nZ=/^\s*>\s$/,nY=V.Node.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return nX("blockquote",{...(0,V.mergeAttributes)(this.options.HTMLAttributes,e),children:nX("slot",{})})},parseMarkdown:(e,t)=>{var n;let r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach((e,r)=>{var i,o;let s=(null!=(o=null==(i=t.renderChild)?void 0:i.call(t,e,r))?o:t.renderChildren([e])).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(s.join("\n"))}),n.join(`
104
+ `}),h},nf=V.Node.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:nd,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=function(e,t){let n=0,r=!0,i=[],o=e.firstChild;if(!o)return{};for(let e=0,s=0;e<o.childCount;e+=1){let{colspan:a,colwidth:l}=o.child(e).attrs;for(let e=0;e<a;e+=1,s+=1){let o=void 0===s?void 0:l&&l[e];n+=o||t,o||(r=!1);let[a,c]=nl(t,o);i.push(["col",{style:`${a}: ${c}`}])}}return{colgroup:["colgroup",{},...i],tableWidth:r?`${n}px`:"",tableMinWidth:r?"":`${n}px`}}(e,this.options.cellMinWidth),o=t.style,s=["table",(0,V.mergeAttributes)(this.options.HTMLAttributes,t,{style:o||(r?`width: ${r}`:`min-width: ${i}`)}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{var o;let s=nr(null!=(o=r[n])?o:e.align);i.push(t.createNode("tableHeader",s?{align:s}:{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{var o;let s=nr(null!=(o=r[n])?o:e.align);i.push(t.createNode("tableCell",s?{align:s}:{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>np(e,t),addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=function(e,t,n,r){let i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=nu(i.cell,void 0);if(e&&s.push(e),r){let e=nu(i.header_cell,void 0);e&&o.push(e)}}let a=[];for(let e=0;e<t;e+=1)a.push(i.row.createChecked(null,r&&0===e?o:s));return i.table.createChecked(null,a)}(o.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(tm.TextSelection.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>(0,nn.addColumnBefore)(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>(0,nn.addColumnAfter)(e,t),deleteColumn:()=>({state:e,dispatch:t})=>(0,nn.deleteColumn)(e,t),addRowBefore:()=>({state:e,dispatch:t})=>(0,nn.addRowBefore)(e,t),addRowAfter:()=>({state:e,dispatch:t})=>(0,nn.addRowAfter)(e,t),deleteRow:()=>({state:e,dispatch:t})=>(0,nn.deleteRow)(e,t),deleteTable:()=>({state:e,dispatch:t})=>(0,nn.deleteTable)(e,t),mergeCells:()=>({state:e,dispatch:t})=>(0,nn.mergeCells)(e,t),splitCell:()=>({state:e,dispatch:t})=>(0,nn.splitCell)(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>(0,nn.toggleHeader)("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>(0,nn.toggleHeader)("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>(0,nn.toggleHeaderCell)(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!(0,nn.mergeCells)(e,t)||(0,nn.splitCell)(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>(0,nn.setCellAttr)(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>(0,nn.goToNextCell)(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>(0,nn.goToNextCell)(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&(0,nn.fixTables)(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=nn.CellSelection.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:nh,"Mod-Backspace":nh,Delete:nh,"Mod-Delete":nh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[(0,nn.columnResizing)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],(0,nn.tableEditing)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n})=>new t(e,this.options.cellMinWidth,n)},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,V.callOrReturn)((0,V.getExtensionField)(e,"tableRole",t))}}});V.Extension.create({name:"tableKit",addExtensions(){let e=[];return!1!==this.options.table&&e.push(nf.configure(this.options.table)),!1!==this.options.tableCell&&e.push(no.configure(this.options.tableCell)),!1!==this.options.tableHeader&&e.push(ns.configure(this.options.tableHeader)),!1!==this.options.tableRow&&e.push(na.configure(this.options.tableRow)),e}});var nm=Object.defineProperty,ng="textStyle",ny=/^\s*([-+*])\s$/,nb=V.Node.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ng)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,V.wrappingInputRule)({find:ny,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,V.wrappingInputRule)({find:ny,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ng),editor:this.editor})),[e]}}),nv=V.Node.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n,r,i,o;if("list_item"!==e.type)return[];let s=null!=(n=t.parseBlockChildren)?n:t.parseChildren,a=[];if(e.tokens&&e.tokens.length>0){let n;if(n=null==(r=e.tokens)?void 0:r[0],e.text&&(null==(i=e.tokens)?void 0:i.length)===1&&(null==n?void 0:n.type)==="list"&&n.ordered&&n.raw===e.text)return{type:"listItem",content:[{type:"paragraph",content:(o=e.text||"",t.tokenizeInline?t.parseInline(t.tokenizeInline(o)):t.parseInline([{type:"text",raw:o,text:o}]))}]};if(e.tokens.some(e=>"paragraph"===e.type))a=s(e.tokens);else{let n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(a=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){let t=s(e.tokens.slice(1));a.push(...t)}}else a=s(e.tokens)}}return 0===a.length&&(a=[{type:"paragraph",content:[]}]),{type:"listItem",content:a}},renderMarkdown:(e,t,n)=>(0,V.renderNestedMarkdownContent)(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),nw={},nx={findListItemPos:()=>nS,getNextListDepth:()=>nC,handleBackspace:()=>nA,handleDelete:()=>nO,hasListBefore:()=>nE,hasListItemAfter:()=>nD,hasListItemBefore:()=>nM,listItemHasSubList:()=>nN,nextListIsDeeper:()=>nT,nextListIsHigher:()=>nR};for(var nk in nx)nm(nw,nk,{get:nx[nk],enumerable:!0});var nS=(e,t)=>{let{$from:n}=t.selection,r=(0,V.getNodeType)(e,t.schema),i=n.depth,o=n.pos,s=null;for(;i>0&&null===s;)n.node(i).type===r?s=i:(i-=1,o-=1);return null===s?null:{$pos:t.doc.resolve(o),depth:s}},nC=(e,t)=>{let n=nS(e,t);if(!n)return!1;let[,r]=(0,V.getNodeAtPosition)(t,e,n.$pos.pos+4);return r},nE=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},nM=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},nN=(e,t,n)=>{if(!n)return!1;let r=(0,V.getNodeType)(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},nA=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,V.isNodeActive)(e.state,t)&&nE(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!(0,V.isNodeActive)(e.state,t)||!(0,V.isAtStartOfNode)(e.state))return!1;let r=nS(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=nN(t,e.state,i);return nM(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},nT=(e,t)=>{let n=nC(e,t),r=nS(e,t);return!!r&&!!n&&n>r.depth},nR=(e,t)=>{let n=nC(e,t),r=nS(e,t);return!!r&&!!n&&n<r.depth},nO=(e,t)=>{if(!(0,V.isNodeActive)(e.state,t)||!(0,V.isAtEndOfNode)(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&(nT(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():nR(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},nD=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},nj=V.Extension.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nO(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nO(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&nA(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&nA(e,n,r)&&(t=!0)}),t}}}}),nI=/^(\s*)(\d+)\.\s+(.*)$/,nP=/^\s/,nL="textStyle",n_=/^(\d+)\.\s$/,nz=V.Node.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",(0,V.mergeAttributes)(this.options.HTMLAttributes,n),0]:["ol",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(nI);if(!o)break;let[,s,a,l]=o,c=s.length,d=[l],u=n+1,h=[i],p=!1;for(;u<e.length;){let t=e[u];if(t.match(nI))break;if(""===t.trim())h.push(t),d.push(""),p=!0,u+=1;else if(t.match(nP))h.push(t),d.push(t.slice(c+2)),u+=1;else{if(p)break;h.push(t),d.push(t),u+=1}}t.push({indent:c,number:parseInt(a,10),content:d.join("\n").trim(),contentLines:d,raw:h.join("\n")}),r=u,n=u}return[t,r]}(i);if(0===o.length)return;let a=function e(t,n,r){let i=[],o=0;for(;o<t.length;){let s=t[o];if(s.indent===n){let{paragraphLines:a,blockLines:l}=function(e){let t=[],n=[],r=!1;return e.forEach(e=>{let i;if(r)return void n.push(e);if(""===e.trim()||t.length>0&&(i=e.trimStart(),/^[-+*]\s+/.test(i)||/^\d+\.\s+/.test(i)||/^>\s?/.test(i)||/^```/.test(i)||/^~~~/.test(i))){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}(s.contentLines),c=a.join("\n").trim(),d=[];c&&d.push({type:"paragraph",raw:c,tokens:r.inlineTokens(c)});let u=l.join("\n").trim();if(u){let e=r.blockTokens(u);d.push(...e)}let h=o+1,p=[];for(;h<t.length&&t[h].indent>n;)p.push(t[h]),h+=1;if(p.length>0){let t=Math.min(...p.map(e=>e.indent)),n=e(p,t,r);d.push({type:"list",ordered:!0,start:p[0].number,items:n,raw:p.map(e=>e.raw).join("\n")})}i.push({type:"list_item",raw:s.raw,tokens:d}),o=h}else o+=1}return i}(o,0,n);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:a,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(nL)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,V.wrappingInputRule)({find:n_,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,V.wrappingInputRule)({find:n_,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(nL)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),n$=/^\s*(\[([( |x])?\])\s$/,nH=V.Node.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,V.mergeAttributes)(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",i=`- [${r}] `;return(0,V.renderNestedMarkdownContent)(e,t,i)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(a.checked=!a.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);let t=r.extensionManager.attributes,n=(0,V.getRenderedAttributes)(e,t),o=new Set(Object.keys(n)),s=this.options.HTMLAttributes;return d.forEach(e=>{o.has(e)||(e in s?i.setAttribute(e,s[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{null==t?e in s?i.setAttribute(e,s[e]):i.removeAttribute(e):i.setAttribute(e,t)}),d=o,!0}}}},addInputRules(){return[(0,V.wrappingInputRule)({find:n$,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),nB=V.Node.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",(0,V.mergeAttributes)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let r=e=>{let t=(0,V.parseIndentedBlocks)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=(0,V.parseIndentedBlocks)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});V.Extension.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(nb.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(nv.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(nj.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(nz.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(nH.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(nB.configure(this.options.taskList)),e}});var nF=V.Extension.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),nV=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},nU=/^\s*>\s$/,nW=V.Node.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return nV("blockquote",{...(0,V.mergeAttributes)(this.options.HTMLAttributes,e),children:nV("slot",{})})},parseMarkdown:(e,t)=>{var n;let r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach((e,r)=>{var i,o;let s=(null!=(o=null==(i=t.renderChild)?void 0:i.call(t,e,r))?o:t.renderChildren([e])).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(s.join("\n"))}),n.join(`
107
105
  >
108
- `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,V.wrappingInputRule)({find:nZ,type:this.type})]}}),nQ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,n0=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,n1=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,n2=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,n3=V.Mark.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return nX("strong",{...(0,V.mergeAttributes)(this.options.HTMLAttributes,e),children:nX("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,V.markInputRule)({find:nQ,type:this.type}),(0,V.markInputRule)({find:n1,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:n0,type:this.type}),(0,V.markPasteRule)({find:n2,type:this.type})]}}),n5=/(^|[^`])`([^`]+)`(?!`)$/,n4=/(^|[^`])`([^`]+)`(?!`)/g,n6=V.Mark.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,V.markInputRule)({find:n5,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:n4,type:this.type})]}}),n9=V.Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),n7=V.Node.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`
109
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&o){let t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),n8=V.Node.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,(0,V.mergeAttributes)(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>(0,V.textblockTypeInputRule)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),re=V.Node.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,V.canInsertNode)(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return(0,V.isNodeSelection)(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(U.TextSelection.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(U.NodeSelection.create(t.doc,n.pos)):t.setSelection(U.TextSelection.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(U.TextSelection.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,V.nodeInputRule)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),rt=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,rn=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,rr=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ri=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ro=V.Mark.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,V.markInputRule)({find:rt,type:this.type}),(0,V.markInputRule)({find:rr,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:rn,type:this.type}),(0,V.markPasteRule)({find:ri,type:this.type})]}}),rs="&nbsp;",ra=V.Node.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===n.length&&"text"===n[0].type&&(n[0].raw===rs||n[0].text===rs||" "===n[0].raw||" "===n[0].text)&&1===r.length&&"text"===r[0].type&&(r[0].text===rs||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";let o=Array.isArray(e.content)?e.content:[];if(0===o.length){let e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return(null==(i=null==n?void 0:n.previousNode)?void 0:i.type)==="paragraph"&&0===e.length?rs:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rl=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,rc=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rd=V.Mark.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,V.markInputRule)({find:rl,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:rc,type:this.type})]}}),ru=V.Node.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),rh=V.Mark.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),rp=V.Extension.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(n3.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(nY.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(nE.configure(this.options.bulletList)),!1!==this.options.code&&i.push(n6.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(q.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(n9.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(t6.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(t9.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(n7.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(n8.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(ns.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(re.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(ro.configure(this.options.italic)),!1!==this.options.listItem&&i.push(nM.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(nH.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(tT.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(nW.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(ra.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(rd.configure(this.options.strike)),!1!==this.options.text&&i.push(ru.configure(this.options.text)),!1!==this.options.underline&&i.push(rh.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(no.configure(null==(r=this.options)?void 0:r.trailingNode)),i}});function rf(e){let t=e.regex,n={};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]}]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(s);let a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,i,o,{match:/(\/[a-z._-]+)+/},s,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}}e.s(["default",0,rf],944404);let rm=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],rg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ry=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),rb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rv=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rw(e){let t=e.regex,n={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ry.join("|")+")"},{begin:":(:)?("+rb.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rv.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:rg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+rm.join("|")+")\\b"}]}}function rx(e){let t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}e.s(["default",0,rw],334609),e.s(["default",0,rx],265590);let rk="[A-Za-z$_][0-9A-Za-z$_]*",rS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rC=["true","false","null","undefined","NaN","Infinity"],rE=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rM=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rA=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rT=[].concat(rN,rE,rM);function rR(e){var t;let n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o={$pattern:rk,keyword:rS,literal:rC,built_in:rT,"variable.language":rA},s="[0-9](_?[0-9])*",a=`\\.(${s})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${l})((${a})|\\.)?|(${a}))[eE][+-]?(${s})\\b`},{begin:`\\b(${l})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},p={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:rk+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,p,f,{match:/\$\d+/},c];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(g)});let y=[].concat(m,d.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(y)}]),v={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b},w={variants:[{match:[/class/,/\s+/,rk,/\s+/,/extends/,/\s+/,n.concat(rk,"(",n.concat(/\./,rk),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,rk],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rE,...rM]}},k={match:n.concat(/\b/,(t=[...rN,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),rk,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},S={begin:n.concat(/\./,n.lookahead(n.concat(rk,/(?![0-9A-Za-z$_(])/))),end:rk,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,rk,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,p,f,m,{match:/\$\d+/},c,x,{scope:"attr",match:rk+n.lookahead(":"),relevance:0},E,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,rk,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:rk,className:"title.function"})]},{match:/\.\.\./,relevance:0},S,{match:"\\$"+rk,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,{match:[/get|set/,/\s+/,rk,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},{match:/\$[(.]/}]}}function rO(e){let t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rD(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},s=e.inherit(i,{contains:[]}),a=e.inherit(o,{contains:[]});i.contains.push(a),o.contains.push(s);let l=[n,r];return[i,o,s,a].forEach(e=>{e.contains=e.contains.concat(l)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l=l.concat(i,o)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},n,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,o,{className:"quote",begin:"^>\\s+",contains:l,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},r,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rj(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,h,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[o,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,f,l]}]}}function rI(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:a,type:l}},{className:"punctuation",begin:"->"},o]}}function rP(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function rL(e){let t=e.regex,n=e.COMMENT("--","$"),r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!r.includes(e)),o={match:t.concat(/\b/,t.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function s(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let a={scope:"keyword",match:s(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?`${e}|0`:e)}(i,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:s(["double precision","large object","with timezone","without timezone"])},a,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}e.s(["default",0,rR],441228),e.s(["default",0,rO],576500),e.s(["default",0,rD],194633),e.s(["default",0,rj],32033),e.s(["default",0,rI],623568),e.s(["default",0,rP],42420),e.s(["default",0,rL],278909);let r_="[A-Za-z$_][0-9A-Za-z$_]*",rz=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],r$=["true","false","null","undefined","NaN","Infinity"],rH=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rB=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rF=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rV=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rU=[].concat(rF,rH,rB);function rW(e){var t;let n,r,i,o,s,a,l,c,d,u,h,p,f,m,g,y,b,v,w,x,k,S,C,E,M,N=e.regex,A=(n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o=(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},s={$pattern:r_,keyword:rz,literal:r$,built_in:rU,"variable.language":rV},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},f={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r_+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},u.contains=(y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,f,m,{match:/\$\d+/},d]).concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(y)}),v=(b=[].concat(g,u.contains)).concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v},x={variants:[{match:[/class/,/\s+/,r_,/\s+/,/extends/,/\s+/,n.concat(r_,"(",n.concat(/\./,r_),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r_],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rH,...rB]}},S={match:n.concat(/\b/,(t=[...rF,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),r_,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},C={begin:n.concat(/\./,n.lookahead(n.concat(r_,/(?![0-9A-Za-z$_(])/))),end:r_,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r_,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]},{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,f,m,g,{match:/\$\d+/},d,k,{scope:"attr",match:r_+n.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":o,end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,r_,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r_,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+r_,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},S,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,{match:[/get|set/,/\s+/,r_,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},{match:/\$[(.]/}]}),T=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],R={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},O={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:T},contains:[A.exports.CLASS_REFERENCE]},D={$pattern:r_,keyword:rz.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:r$,built_in:rU.concat(T),"variable.language":rV},j={className:"meta",begin:"@"+r_},I=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(A.keywords,D),A.exports.PARAMS_CONTAINS.push(j);let P=A.contains.find(e=>"attr"===e.scope),L=Object.assign({},P,{match:N.concat(r_,N.lookahead(/\s*\?:/))});return A.exports.PARAMS_CONTAINS.push([A.exports.CLASS_REFERENCE,P,L]),A.contains=A.contains.concat([j,R,O,L]),I(A,"shebang",e.SHEBANG()),I(A,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),A.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(A,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),A}function rK(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function rq(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},{begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},{begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},r],a=[...s];return a.pop(),a.push(i),o.contains=a,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:s}}e.s(["default",0,rW],532270),e.s(["default",0,rK],503658),e.s(["default",0,rq],185503);var rJ=e.i(897802);let rG={};function rX(e){let t=G.newInstance();return e&&i(e),{highlight:n,highlightAuto:function(e,i){let o;(0,rJ.ok)("string"==typeof e,"expected `string` as `value`");let s=(i||rG).subset||r(),a=-1,l=0;for(;++a<s.length;){let r=s[a];if(!t.getLanguage(r))continue;let c=n(r,e,i);c.data&&void 0!==c.data.relevance&&c.data.relevance>l&&(l=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:r,register:i,registerAlias:function(e,n){if("string"==typeof e)(0,rJ.ok)(void 0!==n),t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(e){return!!t.getLanguage(e)}};function n(e,n,r){(0,rJ.ok)("string"==typeof e,"expected `string` as `name`"),(0,rJ.ok)("string"==typeof n,"expected `string` as `value`");let i=r||rG,o="string"==typeof i.prefix?i.prefix:"hljs-";if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:rZ,classPrefix:o});let s=t.highlight(n,{ignoreIllegals:!0,language:e});if(s.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:s.errorRaised});let a=s._emitter.root,l=a.data;return l.language=s.language,l.relevance=s.relevance,a}function r(){return t.listLanguages()}function i(e,n){if("string"==typeof e)(0,rJ.ok)(void 0!==n,"expected `grammar`"),t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}class rZ{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}e.s(["createLowlight",0,rX],993667);let rY=V.Node.create({name:"callout",group:"block",content:"block+",defining:!0,addAttributes:()=>({type:{default:"info",parseHTML:e=>e.getAttribute("data-callout-type")||"info",renderHTML:e=>({"data-callout-type":e.type})}}),parseHTML:()=>[{tag:'div[data-callout="true"]'}],renderHTML:({HTMLAttributes:e})=>["div",(0,V.mergeAttributes)(e,{"data-callout":"true",class:`callout callout-${e["data-callout-type"]||"info"}`}),0]});function rQ(e,t,n){let{selection:r,doc:i}=e,o=i.resolve(r.from);for(;o.depth>1;)o=i.resolve(o.before(o.depth));if(0===o.depth)return!1;let s=o.before(1),a=i.nodeAt(s);if(!a)return!1;let l=o.index(0),c="up"===n?l-1:l+1;if(c<0||c>=i.childCount)return!1;let d=i.child(c),u=e.tr,h=s+a.nodeSize,p="up"===n?s-d.nodeSize:h,f="up"===n?s:h+d.nodeSize;if("up"===n)u=(u=(u=u.delete(s,h)).insert(p,a)).setSelection(U.NodeSelection.create(u.doc,p));else{u=u.delete(s,h);let e=f-a.nodeSize;u=(u=u.insert(e,a)).setSelection(U.NodeSelection.create(u.doc,e))}return t&&t(u.scrollIntoView()),!0}let r0="cabinet-drag-handle",r1="cabinet-gutter-add",r2=V.Extension.create({name:"dragHandle",addKeyboardShortcuts:()=>({"Mod-Alt-ArrowUp":({editor:e})=>rQ(e.state,e.view.dispatch,"up"),"Mod-Alt-ArrowDown":({editor:e})=>rQ(e.state,e.view.dispatch,"down"),"Alt-Shift-ArrowUp":({editor:e})=>rQ(e.state,e.view.dispatch,"up"),"Alt-Shift-ArrowDown":({editor:e})=>rQ(e.state,e.view.dispatch,"down")}),addProseMirrorPlugins(){let e,t,n=null,r="u">typeof document?((e=document.getElementById(r0))||((e=document.createElement("div")).id=r0,e.setAttribute("data-drag-handle","true"),e.draggable=!0,e.innerHTML='<svg width="10" height="16" viewBox="0 0 10 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><circle cx="2.5" cy="3" r="1.2"/><circle cx="2.5" cy="8" r="1.2"/><circle cx="2.5" cy="13" r="1.2"/><circle cx="7.5" cy="3" r="1.2"/><circle cx="7.5" cy="8" r="1.2"/><circle cx="7.5" cy="13" r="1.2"/></svg>',Object.assign(e.style,{position:"absolute",display:"none",cursor:"grab",padding:"2px 4px",borderRadius:"4px",color:"var(--muted-foreground)",opacity:"0.55",zIndex:"40",userSelect:"none",transition:"opacity 120ms ease"}),e.addEventListener("mouseenter",()=>{e&&(e.style.opacity="1")}),e.addEventListener("mouseleave",()=>{e&&(e.style.opacity="0.55")}),document.body.appendChild(e)),e):null,i="u">typeof document?((t=document.getElementById(r1))||((t=document.createElement("button")).id=r1,t.type="button",t.setAttribute("aria-label","Add block"),t.title="Add block",t.innerHTML='<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 1V9M1 5H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',Object.assign(t.style,{position:"absolute",display:"none",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",cursor:"pointer",borderRadius:"4px",color:"var(--muted-foreground)",opacity:"0.55",zIndex:"40",transition:"opacity 120ms ease, background 120ms ease",background:"transparent",border:"none",padding:"0"}),t.addEventListener("mouseenter",()=>{t&&(t.style.opacity="1",t.style.background="var(--muted)")}),t.addEventListener("mouseleave",()=>{t&&(t.style.opacity="0.55",t.style.background="transparent")}),document.body.appendChild(t)),t):null,o=()=>{r&&(r.style.display="none"),i&&(i.style.display="none"),n=null};return[new U.Plugin({key:new U.PluginKey("cabinetDragHandle"),view:e=>{if(!r)return{destroy:()=>{}};let t=t=>{if(!e.editable)return;let s=e.dom.getBoundingClientRect();if(t.clientX<s.left-60||t.clientX>s.right+60||t.clientY<s.top||t.clientY>s.bottom)return void o();let a=function(e,t){let n=e.posAtCoords(t);if(!n)return null;let r=e.state.doc.resolve(n.inside>=0?n.inside:n.pos);for(;r.depth>0&&!r.parent.type.isBlock;)r=e.state.doc.resolve(r.before());let i=r.depth;for(;i>1&&"doc"!==e.state.doc.resolve(r.before(i)).parent.type.name;)i-=1;let o=0===i?0:r.before(Math.max(i,1)),s=e.state.doc.nodeAt(o);if(!s)return null;let a=e.nodeDOM(o);return{pos:o,node:s,dom:a}}(e,{left:Math.max(s.left+20,Math.min(s.right-20,t.clientX)),top:t.clientY});if(!a?.dom||!(a.dom instanceof HTMLElement))return void o();n=a;let l=a.dom.getBoundingClientRect();r.style.display="flex",r.style.top=`${window.scrollY+l.top+4}px`,r.style.left=`${window.scrollX+l.left-22}px`,i&&(i.style.display="flex",i.style.top=`${window.scrollY+l.top+4}px`,i.style.left=`${window.scrollX+l.left-44}px`)},s=()=>o(),a=()=>{if(!n)return;let t=n.pos+n.node.nodeSize,r=t<=e.state.doc.content.size,i=e.state.tr;if(r){let n=U.TextSelection.create(e.state.doc,Math.min(t-1,e.state.doc.content.size));e.dispatch(i.setSelection(n))}e.focus();let o=e.state.tr.split(e.state.selection.from);e.dispatch(o),e.dom.dispatchEvent(new KeyboardEvent("keydown",{key:"/",bubbles:!0,cancelable:!0}))},l=t=>{if(!n||!t.dataTransfer)return;let{pos:r,dom:i}=n,o=e.state.tr.setSelection(U.NodeSelection.create(e.state.doc,r));e.dispatch(o);let s=e.state.selection.content(),a=document.createElement("div");a.appendChild(e.someProp("clipboardSerializer")?.serializeFragment(s.content)??document.createElement("div")),t.dataTransfer.clearData(),t.dataTransfer.setData("text/html",a.innerHTML),t.dataTransfer.setData("text/plain",i.textContent??""),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(i,0,0),e.dragging={slice:s,move:!0}};return window.addEventListener("mousemove",t),e.dom.addEventListener("mouseleave",s),r.addEventListener("dragstart",l),i&&i.addEventListener("click",a),{destroy(){window.removeEventListener("mousemove",t),e.dom.removeEventListener("mouseleave",s),r.removeEventListener("dragstart",l),i&&i.removeEventListener("click",a),o()}}}})]}}),r3=new U.PluginKey("headingAnchors");function r5(e){let t=[],n=new Map;return e.descendants((e,r)=>{if("heading"!==e.type.name)return;let i=e.textContent.toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-");if(!i)return;let o=n.get(i)??0;n.set(i,o+1);let s=0===o?i:`${i}-${o}`;t.push(J.Decoration.node(r,r+e.nodeSize,{id:s}))}),J.DecorationSet.create(e,t)}let r4=V.Extension.create({name:"headingAnchors",addProseMirrorPlugins:()=>[new U.Plugin({key:r3,state:{init:(e,{doc:t})=>r5(t),apply:(e,t)=>e.docChanged?r5(e.doc):t},props:{decorations:e=>r3.getState(e)}})]}),r6=V.Mark.create({name:"proofSpan",priority:900,inclusive:!1,keepOnSplit:!1,addAttributes:()=>({spanId:{default:null,parseHTML:e=>e.getAttribute("id"),renderHTML:e=>({id:e.spanId})},origin:{default:"ai",parseHTML:e=>e.getAttribute("origin"),renderHTML:e=>({origin:e.origin})},basis:{default:null,parseHTML:e=>e.getAttribute("basis"),renderHTML:e=>({basis:e.basis})},basisDetail:{default:null,parseHTML:e=>e.getAttribute("basis-detail"),renderHTML:e=>({"basis-detail":e.basisDetail})},by:{default:null,parseHTML:e=>e.getAttribute("by"),renderHTML:e=>({by:e.by})},at:{default:null,parseHTML:e=>e.getAttribute("at"),renderHTML:e=>({at:e.at})},inResponseTo:{default:null,parseHTML:e=>e.getAttribute("in-response-to"),renderHTML:e=>({"in-response-to":e.inResponseTo})}}),parseHTML:()=>[{tag:"proof-span"}],renderHTML:({HTMLAttributes:e})=>["proof-span",(0,V.mergeAttributes)(e,{class:"proof-span"}),0]});var r9=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,r7=V.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,o,s;let a=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",l=null!=(i=null==(r=e.attrs)?void 0:r.alt)?i:"",c=null!=(s=null==(o=e.attrs)?void 0:o.title)?s:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:o,HTMLAttributes:s,editor:a})=>{let l=document.createElement("img");Object.entries(s).forEach(([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}}),l.src=s.src;let c=new V.ResizableNodeView({element:l,editor:a,node:i,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===r}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,V.nodeInputRule)({find:r9,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),r8=e.i(885047);function ie(e){let{node:n,updateAttributes:r,selected:i,editor:o}=e,s=n.attrs,a=(0,O.useRef)(null),l=(0,O.useRef)(null),[c,d]=(0,O.useState)(null),u=s.align??"center",h=(0,O.useCallback)((e,t)=>{if(!o.isEditable)return;e.preventDefault(),e.stopPropagation();let n=a.current,i=l.current;if(!n||!i)return;let s=e.clientX,c=n.getBoundingClientRect().width,u=i.parentElement?.getBoundingClientRect().width??800,h=e=>{d(Math.max(80,Math.min(u,c+("right"===t?e.clientX-s:s-e.clientX))))},p=()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",p),d(e=>(null!=e&&r({width:Math.round(e)}),null))};window.addEventListener("pointermove",h),window.addEventListener("pointerup",p)},[o.isEditable,r]),p=null!=c?`${Math.round(c)}px`:"number"==typeof s.width?`${s.width}px`:"string"==typeof s.width&&s.width?s.width:void 0,f="left"===u?"mr-auto":"right"===u?"ml-auto":"mx-auto";return(0,t.jsx)(r8.NodeViewWrapper,{as:"div",className:`resizable-image my-3 ${f}`,"data-align":u,style:{width:p??"fit-content",maxWidth:"100%"},children:(0,t.jsxs)("div",{ref:l,className:`relative group inline-block max-w-full ${i?"ring-2 ring-primary rounded-md":""}`,contentEditable:!1,children:[(0,t.jsx)("img",{ref:a,src:s.src,alt:s.alt??"",title:s.title??void 0,className:"block rounded-md max-w-full h-auto",style:{width:p},draggable:!1}),o.isEditable&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-label":"Resize from left",onPointerDown:e=>h(e,"left"),className:"hover-reveal resize-hit absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1 h-8 bg-card border border-border rounded-full shadow"})}),(0,t.jsx)("div",{"aria-label":"Resize from right",onPointerDown:e=>h(e,"right"),className:"hover-reveal resize-hit absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1 h-8 bg-card border border-border rounded-full shadow"})}),null!=c&&(0,t.jsxs)("div",{className:"absolute top-1 right-1 text-[10px] px-1.5 py-0.5 rounded bg-primary/80 text-primary-foreground font-mono",children:[Math.round(c),"px"]})]})]})})}let it=r7.extend({name:"image",draggable:!0,addAttributes(){return{...this.parent?.(),width:{default:null,parseHTML:e=>{let t=e.getAttribute("width")??e.style.width;if(!t)return null;let n=/^(\d+)(px)?$/.exec(t);return n?Number(n[1]):t},renderHTML:e=>{if(!e.width)return{};let t="number"==typeof e.width?`${e.width}px`:e.width;return{style:`width: ${t}`}}},align:{default:null,parseHTML:e=>e.getAttribute("data-align"),renderHTML:e=>e.align?{"data-align":e.align}:{}}}},addNodeView:()=>(0,r8.ReactNodeViewRenderer)(ie)});var ir=e.i(246542);let ii=new U.PluginKey("wikiLinkDecorator"),io="wikiLinkDecorator:refresh";function is(e){let{has:t}=ir.useWikiSlugsStore.getState(),n=e.schema.marks.wikiLink;if(!n)return J.DecorationSet.empty;let r=[];return e.doc.descendants((e,i)=>{if(!e.isText)return;let o=e.marks.find(e=>e.type===n);if(!o)return;let s=o.attrs.slug;!s||t(s)||r.push(J.Decoration.inline(i,i+e.nodeSize,{"data-broken":"true"}))}),J.DecorationSet.create(e.doc,r)}let ia=/\[\[([a-z0-9-]+)(?:\|([^\]#|]+)|#([a-z0-9-]+))?\]\]$/,il=V.Mark.create({name:"wikiLink",priority:1e3,keepOnSplit:!1,inclusive:!1,addAttributes:()=>({slug:{default:null,parseHTML:e=>e.getAttribute("data-slug"),renderHTML:e=>({"data-slug":e.slug})},alias:{default:null,parseHTML:e=>e.getAttribute("data-alias"),renderHTML:e=>null!=e.alias?{"data-alias":e.alias}:{}},anchor:{default:null,parseHTML:e=>e.getAttribute("data-anchor"),renderHTML:e=>null!=e.anchor?{"data-anchor":e.anchor}:{}}}),parseHTML:()=>[{tag:'a[data-wiki-link="true"]'}],renderHTML({HTMLAttributes:e}){let t=String(e["data-slug"]??""),n=null!=e["data-anchor"]?String(e["data-anchor"]):null,r=n?`#wiki:${t}#${n}`:`#wiki:${t}`;return["a",(0,V.mergeAttributes)(e,{"data-wiki-link":"true",href:r,class:"wiki-link"}),0]},addInputRules(){return[new V.InputRule({find:ia,handler:({state:e,range:t,match:n})=>{let r=n[1]??"",i=n[2]??null,o=n[3]??null,s=i??(o?`${r}#${o}`:r),{tr:a}=e;a.replaceWith(t.from,t.to,e.schema.text(s,[this.type.create({slug:r,alias:i,anchor:o})]))}})]},addProseMirrorPlugins:()=>[new U.Plugin({key:ii,state:{init:(e,t)=>is(t),apply:(e,t,n,r)=>e.getMeta(io)||e.docChanged?is(r):t.map(e.mapping,e.doc)},props:{decorations:e=>ii.getState(e)??J.DecorationSet.empty},view(e){let t=ir.useWikiSlugsStore.subscribe(()=>{let t=e.state.tr.setMeta(io,!0);e.dispatch(t)});return{destroy(){t()}}}})],addCommands(){return{setWikiLink:e=>({commands:t})=>t.setMark(this.name,{slug:e.slug,alias:e.alias??null,anchor:e.anchor??null}),unsetWikiLink:()=>({commands:e})=>e.unsetMark(this.name)}}}),ic=rX({bash:rf,css:rw,go:rx,javascript:rR,json:rO,markdown:rD,python:rj,rust:rI,shell:rP,sql:rL,typescript:rW,xml:rK,yaml:rq}),id=[rp.configure({heading:{levels:[1,2,3,4]},codeBlock:!1,link:!1,underline:!1}),Y.configure({lowlight:ic,HTMLAttributes:{class:"rounded-md bg-muted p-4 font-mono text-sm"}}),nr.configure({placeholder:"Start writing, or press '/' for commands..."}),it.configure({HTMLAttributes:{class:"rounded-lg max-w-full"},allowBase64:!1}),nx.configure({resizable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"border-collapse w-full"}}),nf,nh,np,nJ.configure({HTMLAttributes:{class:"task-list"}}),nq.configure({nested:!0}),tT.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline cursor-pointer"}}).extend({parseHTML:()=>[{tag:'a[href]:not([data-wiki-link="true"])'}],addKeyboardShortcuts(){return{"Mod-e":()=>{let{state:e}=this.editor,{from:t,to:n}=e.selection;if(t===n)return!1;let r=this.editor.getAttributes("link").href??"",i=window.prompt("Link URL",r);return null!==i&&(""===i?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():this.editor.chain().focus().extendMarkRange("link").setLink({href:i}).run())}}}}),rY,r6,nG.configure({types:["heading","paragraph"]}),na,nl,r2,r4,il];e.s(["editorExtensions",0,id],314206);var iu=e.i(605993);let ih=(0,iu.default)("app-window",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);e.s(["AppWindow",0,ih],388503);let ip=(0,iu.default)("file-audio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);e.s(["FileAudio",0,ip],284766);let im=(0,iu.default)("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);e.s(["FileCode2",0,im],965837);let ig=(0,iu.default)("file-image",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);e.s(["FileImage",0,ig],582966);let iy=(0,iu.default)("file-spreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);e.s(["FileSpreadsheet",0,iy],25688);let ib=(0,iu.default)("file-video",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);e.s(["FileVideo",0,ib],770271)},916767,e=>{"use strict";let t=(0,e.i(605993).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],916767)},845478,e=>{"use strict";let t=(0,e.i(605993).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",0,t],845478)},496668,665794,e=>{"use strict";var t=e.i(44501),n=e.i(388503),r=e.i(284766),i=e.i(965837),o=e.i(582966),s=e.i(25688),a=e.i(764143),l=e.i(770271),c=e.i(916767),d=e.i(845478),u=e.i(605993);let h=(0,u.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var p=e.i(853840),f=e.i(101685),m=e.i(96701),g=e.i(990791),y=e.i(671485);let b="kb-folder-view-mode";function v(e){return"image"===e.type}function w(e){switch(e.type){case"directory":case"cabinet":return c.Folder;case"image":return o.FileImage;case"video":return l.FileVideo;case"audio":return r.FileAudio;case"code":return i.FileCode2;case"csv":case"xlsx":return s.FileSpreadsheet;case"website":return d.Globe;case"app":return n.AppWindow;default:return a.FileText}}function x(e){let{selectPage:t,expandPath:n}=g.useTreeStore.getState(),r=e.split("/");for(let e=1;e<r.length;e++)n(r.slice(0,e).join("/"));t(e),m.useEditorStore.getState().loadPage(e)}e.s(["FolderIndex",0,function({folderPath:e,entries:n}){let r=(0,f.useMemo)(()=>(function(e){if(0===e.length)return!1;let t=e.filter(v).length;return t>=4&&t/e.length>=.6})(n),[n]),[i,o]=(0,f.useState)(()=>{let t=function(e){try{let t=localStorage.getItem(b);if(!t)return null;return JSON.parse(t)[e]??null}catch{return null}}(e);return t||(r?"gallery":"list")}),s=t=>{o(t);try{let n=localStorage.getItem(b),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(b,JSON.stringify(r))}catch{}},a=(0,f.useMemo)(()=>{let e=[...n];return e.sort((e,t)=>{let n="directory"===e.type||"cabinet"===e.type;return n!==("directory"===t.type||"cabinet"===t.type)?n?-1:1:e.name.localeCompare(t.name)}),e},[n]);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground/70",children:[a.length," ",1===a.length?"item":"items"]}),(0,t.jsxs)("div",{className:"inline-flex items-center rounded-md border border-border p-0.5 text-[11px]",children:[(0,t.jsxs)("button",{onClick:()=>s("list"),className:`flex items-center gap-1 px-2 py-1 rounded transition-colors ${"list"===i?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":"list"===i,title:"List view",children:[(0,t.jsx)(p.List,{className:"h-3 w-3"}),"List"]}),(0,t.jsxs)("button",{onClick:()=>s("gallery"),className:`flex items-center gap-1 px-2 py-1 rounded transition-colors ${"gallery"===i?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":"gallery"===i,title:"Gallery view",children:[(0,t.jsx)(h,{className:"h-3 w-3"}),"Gallery"]})]})]}),"list"===i?(0,t.jsx)("ul",{className:"divide-y divide-border rounded-md border border-border overflow-hidden",children:a.map(e=>{let n=w(e),r=e.frontmatter?.title||e.name;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"w-full flex items-center gap-3 px-3 py-2 text-left text-sm hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:r}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60 capitalize",children:e.type})]})},e.path)})}):(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:a.map(e=>{let n=e.frontmatter?.title||e.name;if(v(e))return(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"group flex flex-col gap-1.5 text-left",title:n,children:[(0,t.jsx)("div",{className:"aspect-square w-full overflow-hidden rounded-md border border-border bg-muted",children:(0,t.jsx)("img",{src:(0,y.withWs)(`/api/assets/${e.path}`),alt:n,loading:"lazy",className:"h-full w-full object-cover transition-transform group-hover:scale-[1.02]"})}),(0,t.jsx)("span",{className:"truncate text-[12px] text-muted-foreground group-hover:text-foreground",children:n})]},e.path);let r=w(e);return(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"group flex flex-col gap-1.5 text-left",title:n,children:[(0,t.jsx)("div",{className:"aspect-square w-full flex items-center justify-center rounded-md border border-border bg-muted/40 group-hover:bg-muted transition-colors",children:(0,t.jsx)(r,{className:"h-8 w-8 text-muted-foreground/60"})}),(0,t.jsx)("span",{className:"truncate text-[12px] text-muted-foreground group-hover:text-foreground",children:n})]},e.path)})})]})}],496668);let k=(0,u.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var S=e.i(891734);e.s(["CommentPip",0,function({anchorKey:e,anchorLabel:n,comments:r,top:i,left:o,onClick:s}){let a;if(0===r.length)return null;let l=r.filter(e=>!e.resolved);if(0===l.length)a="check";else{let e=l[0].turns.at(-1);a=e?.by.startsWith("ai:")?"dot-ai":"ring-human"}return(0,t.jsxs)("button",{type:"button",onClick:s,style:{position:"absolute",top:i,left:o,transform:"translateY(2px)"},className:"z-10 p-2 sm:p-0.5 -m-1.5 sm:m-0 rounded transition-colors hover:bg-accent focus:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":`Comment thread for ${n??e}`,children:["check"===a&&(0,t.jsx)(k,{className:"h-3.5 w-3.5 text-muted-foreground/30"}),"dot-ai"===a&&(0,t.jsx)(S.MessageCircle,{className:"h-3.5 w-3.5 fill-primary text-primary"}),"ring-human"===a&&(0,t.jsx)(S.MessageCircle,{className:"h-3.5 w-3.5 text-muted-foreground/70"})]})}],665794)},926128,803043,589676,294250,955537,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(291967),i=e.i(967928),o=e.i(543250),s=e.i(348989),a=e.i(539340),l=e.i(445424),c=e.i(433616),d=e.i(638154),u=e.i(332374),h=e.i(190088),p=e.i(980939),f=e.i(652053),m=e.i(417256),g=e.i(73772),y=e.i(206500),b="Popover",[v,w]=(0,o.createContextScope)(b,[d.createPopperScope]),x=(0,d.createPopperScope)(),[k,S]=v(b),C=e=>{let{__scopePopover:r,children:i,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=x(r),h=n.useRef(null),[p,f]=n.useState(!1),[g,y]=(0,m.useControllableState)({prop:o,defaultProp:s??!1,onChange:a,caller:b});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(k,{scope:r,contentId:(0,c.useId)(),triggerRef:h,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(e=>!e),[y]),hasCustomAnchor:p,onCustomAnchorAdd:n.useCallback(()=>f(!0),[]),onCustomAnchorRemove:n.useCallback(()=>f(!1),[]),modal:l,children:i})})};C.displayName=b;var E="PopoverAnchor",M=n.forwardRef((e,r)=>{let{__scopePopover:i,...o}=e,s=S(E,i),a=x(i),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return n.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...o,ref:r})});M.displayName=E;var N="PopoverTrigger";n.forwardRef((e,n)=>{let{__scopePopover:o,...s}=e,a=S(N,o),l=x(o),c=(0,i.useComposedRefs)(n,a.triggerRef),u=(0,t.jsx)(p.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":H(a.open),...s,ref:c,onClick:(0,r.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})}).displayName=N;var A="PopoverPortal",[T,R]=v(A,{forceMount:void 0}),O=e=>{let{__scopePopover:n,forceMount:r,children:i,container:o}=e,s=S(A,n);return(0,t.jsx)(T,{scope:n,forceMount:r,children:(0,t.jsx)(h.Presence,{present:r||s.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:o,children:i})})})};O.displayName=A;var D="PopoverContent",j=n.forwardRef((e,n)=>{let r=R(D,e.__scopePopover),{forceMount:i=r.forceMount,...o}=e,s=S(D,e.__scopePopover);return(0,t.jsx)(h.Presence,{present:i||s.open,children:s.modal?(0,t.jsx)(P,{...o,ref:n}):(0,t.jsx)(L,{...o,ref:n})})});j.displayName=D;var I=(0,f.createSlot)("PopoverContent.RemoveScroll"),P=n.forwardRef((e,o)=>{let s=S(D,e.__scopePopover),a=n.useRef(null),l=(0,i.useComposedRefs)(o,a),c=n.useRef(!1);return n.useEffect(()=>{let e=a.current;if(e)return(0,g.hideOthers)(e)},[]),(0,t.jsx)(y.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(_,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||s.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=n.forwardRef((e,r)=>{let i=S(D,e.__scopePopover),o=n.useRef(!1),s=n.useRef(!1);return(0,t.jsx)(_,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||i.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let n=t.target;i.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),_=n.forwardRef((e,n)=>{let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,...g}=e,y=S(D,r),b=x(r);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:c,children:(0,t.jsx)(s.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":H(y.open),role:"dialog",id:y.contentId,...b,...g,ref:n,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),z="PopoverClose";n.forwardRef((e,n)=>{let{__scopePopover:i,...o}=e,s=S(z,i);return(0,t.jsx)(p.Primitive.button,{type:"button",...o,ref:n,onClick:(0,r.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})}).displayName=z;var $=n.forwardRef((e,n)=>{let{__scopePopover:r,...i}=e,o=x(r);return(0,t.jsx)(d.Arrow,{...o,...i,ref:n})});function H(e){return e?"open":"closed"}$.displayName="PopoverArrow";var B=e.i(562199),F=e.i(592185),V=e.i(671485);let U=new Intl.RelativeTimeFormat("en",{numeric:"auto"});async function W(e,t,n,r){let i=encodeURIComponent(e).replace(/%2F/g,"/"),o=await (0,V.wsFetch)(`/api/agent/files/${i}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:n,ops:r})});if(409===o.status){let e=await o.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return o.ok?{ok:!0,stale:!1}:{ok:!1,stale:!1}}async function K(e,t,n,r){let i=encodeURIComponent(e).replace(/%2F/g,"/"),o=await (0,V.wsFetch)(`/api/agent/files/${i}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:"human",ops:[{type:n,suggestionId:r}]})});return{ok:o.ok,status:o.status}}async function q(e,t,n){let r=encodeURIComponent(e).replace(/%2F/g,"/"),i=await (0,V.wsFetch)(`/api/agent/files/${r}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:"human",ops:n})});if(409===i.status){let e=await i.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return i.ok?{ok:!0,stale:!1}:{ok:!1,stale:!1}}e.s(["CommentThread",0,function({path:e,anchorKey:r,anchorLabel:i,anchorRef:o,lineAnchor:s,comments:a,anchorEl:l,onClose:c,readOnly:d}){let[u,h]=(0,n.useState)(null),[p,f]=(0,n.useState)(""),[m,g]=(0,n.useState)(!1),y=(0,n.useRef)(null),b=a.filter(e=>!e.resolved),v=b.length>0,w=b[0]??a[0]??null;if((0,n.useEffect)(()=>{if(!l)return void h(null);let e=l.getBoundingClientRect();h({top:e.bottom+4,left:e.left})},[l]),(0,n.useEffect)(()=>{if(!l)return;let e=e=>{"Escape"===e.key&&c()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,c]),(0,n.useEffect)(()=>{u&&setTimeout(()=>y.current?.focus(),50)},[u]),!l||!u)return null;function x(){let t=F.useProofStore.getState().byPath[e];return t?.snapshotRevision??0}async function k(){if(p.trim()&&!m){g(!0);try{let t=w?{type:"comment.reply",commentId:w.id,text:p.trim()}:s?{type:"comment.add",lineAnchor:s,text:p.trim()}:{type:"comment.add",ref:o??r,text:p.trim()},n=x(),i=await W(e,n,"human",[t]);!i.ok&&i.stale&&void 0!==i.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=i.newRevision,i=await W(e,n,"human",[t])),i.ok&&(await F.useProofStore.getState().loadSidecar(e),f(""),c())}finally{g(!1)}}}async function S(){if(w&&!m){g(!0);try{let t=w.resolved?"comment.reopen":"comment.resolve",n=x(),r=await W(e,n,"human",[{type:t,commentId:w.id}]);!r.ok&&r.stale&&void 0!==r.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=r.newRevision,r=await W(e,n,"human",[{type:t,commentId:w.id}])),r.ok&&(await F.useProofStore.getState().loadSidecar(e),c())}finally{g(!1)}}}let E=a.flatMap(e=>e.turns.map(t=>({...t,resolved:e.resolved,commentId:e.id})));return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:u.top,left:u.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:c,className:"z-50 w-[min(18rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground/60 truncate",children:i??r}),w&&!d&&(0,t.jsx)("button",{type:"button",disabled:m,onClick:()=>void S(),className:"ml-2 shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-border hover:bg-accent disabled:opacity-50 transition-colors",children:w.resolved?"Reopen":"Resolve"})]}),E.length>0&&(0,t.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1",children:E.map((e,n)=>(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/60",children:[e.by," · ",function(e){let t=Math.round((Date.now()-new Date(e).getTime())/1e3);if(60>Math.abs(t))return U.format(-t,"second");let n=Math.round(t/60);if(60>Math.abs(n))return U.format(-n,"minute");let r=Math.round(n/60);return 24>Math.abs(r)?U.format(-r,"hour"):U.format(-Math.round(r/24),"day")}(e.at)]}),(0,t.jsx)("p",{className:"text-foreground leading-snug whitespace-pre-wrap",children:e.text})]},n))}),(!w?.resolved||0===a.length)&&(0,t.jsxs)("div",{className:"space-y-1.5 pt-1",children:[(0,t.jsx)("textarea",{ref:y,value:p,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&k()},placeholder:v?"Reply…":"Add a comment…",rows:2,className:"w-full resize-none rounded-md border border-border bg-background px-2 py-1.5 text-[12px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"⌘↵ send"}),(0,t.jsx)("button",{type:"button",disabled:m||!p.trim(),onClick:()=>void k(),className:"px-2.5 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Send"})]})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],926128),e.s(["ProofSpanPopover",0,function({targetEl:e,path:r,onClose:i,onComment:o}){let[s,a]=(0,n.useState)(null),[l,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(!e){a(null),c(null);return}let t=e.getBoundingClientRect();a({top:t.bottom+window.scrollY+4,left:t.left+window.scrollX}),c({spanId:e.getAttribute("id")??"",origin:e.getAttribute("origin"),basis:e.getAttribute("basis"),basisDetail:e.getAttribute("basis-detail"),by:e.getAttribute("by"),at:e.getAttribute("at")})},[e]),(0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,i]),!e||!s||!l)return null;async function h(e){if(!d&&l){u(!0);try{await (0,V.wsFetch)("/api/agent/internal/span",{method:"POST",headers:{"Content-Type":"application/json",...(0,B.authHeaders)()},body:JSON.stringify({path:r,spanId:l.spanId,action:e,idempotencyKey:crypto.randomUUID()})})}finally{u(!1),i()}}}return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:s.top,left:s.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:i,className:"z-50 w-[min(16rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("p",{className:"font-medium text-foreground truncate",children:[l.by??"unknown"," · ",l.basis??"—"," · ",function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(l.at)]}),l.basisDetail&&(0,t.jsxs)("p",{className:"text-muted-foreground italic truncate",children:["“",l.basisDetail,"”"]}),l.origin&&(0,t.jsxs)("p",{className:"text-muted-foreground/60",children:["origin: ",l.origin]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-1",children:[(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>void h("accept"),className:"flex-1 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Accept"}),(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>void h("revert"),className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Revert"}),(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>{o?.(),i()},className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Comment"})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],803043),e.s(["SuggestionCard",0,function({suggestion:e,currentMarkdown:r,path:i,baseRevision:o,getLatestRevision:s,top:a,left:l,width:c,onSettled:d,readOnly:u}){let[h,p]=(0,n.useState)(!1);async function f(){if(!h){p(!0);try{let t=await K(i,o,"suggestion.accept",e.id);t.ok||409!==t.status||(t=await K(i,s(),"suggestion.accept",e.id))}finally{p(!1),d()}}}async function m(){if(!h){p(!0);try{await K(i,o,"suggestion.reject",e.id)}finally{p(!1),d()}}}let g="delete"===e.kind,y="insertAfter"===e.kind||"insertBefore"===e.kind;return(0,t.jsxs)("div",{style:{position:"absolute",top:a,left:l,width:c>0?c:void 0,zIndex:30},className:"my-1 rounded-lg border border-border bg-card shadow-md text-[12px] overflow-hidden",role:"region","aria-label":`Suggestion by ${e.by}`,children:[(0,t.jsx)("div",{className:"flex items-center justify-between px-3 py-2 bg-muted/50 border-b border-border",children:(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[(0,t.jsx)("span",{className:"text-primary",children:e.by})," suggests ",(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e){switch(e){case"replace":return"replacing this block";case"insertAfter":return"inserting content after this block";case"insertBefore":return"inserting content before this block";case"delete":return"deleting this block"}}(e.kind)})]})}),(0,t.jsxs)("div",{className:"p-3 space-y-2",children:["replace"===e.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ current ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground bg-destructive/5 rounded px-2 py-1",children:r||"(empty)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ proposed ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground bg-primary/5 rounded px-2 py-1",children:e.markdown??"(empty)"})]})]}),y&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ will be inserted ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground bg-primary/5 rounded px-2 py-1",children:e.markdown??"(empty)"})]}),g&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ will be deleted ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground line-through bg-destructive/5 rounded px-2 py-1",children:r||"(empty)"})]}),e.basisDetail&&(0,t.jsxs)("p",{className:"italic text-muted-foreground/70 text-[11px]",children:["Reason: ",e.basisDetail]})]}),!u&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-t border-border bg-muted/30",children:[(0,t.jsx)("button",{type:"button",disabled:h,onClick:()=>void f(),className:"flex-1 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Accept"}),(0,t.jsx)("button",{type:"button",disabled:h,onClick:()=>void m(),className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Reject"})]})]})}],589676);let J={replace:"Replace block",insertAfter:"Insert after",insertBefore:"Insert before",delete:"Delete block"};e.s(["SuggestEditPopover",0,function({path:e,blockRef:r,currentMarkdown:i,anchor:o,onClose:s}){let[a,l]=(0,n.useState)("replace"),[c,d]=(0,n.useState)(i),[u,h]=(0,n.useState)(""),[p,f]=(0,n.useState)(!1),m=(0,n.useRef)(null);(0,n.useEffect)(()=>{"replace"===a?d(i):d("")},[a,i]),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,n.useEffect)(()=>{setTimeout(()=>m.current?.focus(),50)},[]);let g="delete"!==a,y=!p&&(!g||c.trim().length>0);async function b(){if(y){f(!0);try{let t={type:"suggestion.add",ref:r,kind:a,basis:"suggested"};g&&(t.markdown=c),u.trim()&&(t.basisDetail=u.trim());let n=F.useProofStore.getState().byPath[e]?.snapshotRevision??0,i=await q(e,n,[t]);!i.ok&&i.stale&&void 0!==i.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=i.newRevision,i=await q(e,n,[t])),i.ok&&(await F.useProofStore.getState().loadSidecar(e),await F.useProofStore.getState().loadSnapshot(e),s())}finally{f(!1)}}}return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:o.top,left:o.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:s,className:"z-50 w-[min(20rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2.5 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Suggest an edit"}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground/60 truncate ml-2",children:r})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.keys(J).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>l(e),className:`px-2 py-0.5 rounded-md text-[10.5px] border transition-colors ${a===e?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:bg-accent"}`,children:J[e]},e))}),"delete"===a&&(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground line-through bg-destructive/5 rounded px-2 py-1 max-h-32 overflow-y-auto",children:i||"(empty)"}),g&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60",children:"replace"===a?"proposed content":"content to insert"}),(0,t.jsx)("textarea",{ref:m,value:c,onChange:e=>d(e.target.value),rows:4,placeholder:"Markdown…",className:"w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 font-mono text-[11px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"})]}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&b()},placeholder:"Reason (optional)",className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-[12px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-0.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"⌘↵ submit"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:p,onClick:s,className:"px-2.5 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:!y,onClick:()=>void b(),className:"px-2.5 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Suggest"})]})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],294250);let G=(0,e.i(605993).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,G],955537)},73302,e=>{"use strict";let t=(0,e.i(605993).default)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);e.s(["File",0,t],73302)},203195,521470,623616,794469,877031,152555,e=>{"use strict";var t=e.i(44501),n=e.i(955537),r=e.i(987027),i=e.i(674155),o=e.i(73302),s=e.i(395330),a=e.i(398441),l=e.i(977112),c=e.i(799916),d=e.i(605993);let u=(0,d.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var h=e.i(853840),p=e.i(864255),f=e.i(991685),m=e.i(703550);let g=(0,d.default)("sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]),y=(0,d.default)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var b=e.i(109680),v=e.i(978375),w=e.i(101685),x=e.i(975157),k=e.i(96701),S=e.i(512527);let C=[{label:"Text",icon:b.Type,description:"Start writing plain text",category:"basic",action:{type:"direct",run:e=>e.chain().focus().setParagraph().run()}},{label:"Heading 1",icon:s.Heading1,description:"Large section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:1}).run()}},{label:"Heading 2",icon:a.Heading2,description:"Medium section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:2}).run()}},{label:"Heading 3",icon:l.Heading3,description:"Small section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:3}).run()}},{label:"Bullet List",icon:h.List,description:"Create a bullet list",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleBulletList().run()}},{label:"Numbered List",icon:p.ListOrdered,description:"Create a numbered list",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleOrderedList().run()}},{label:"Checklist",icon:r.CheckSquare,description:"Create a task checklist",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleTaskList().run()}},{label:"Code Block",icon:i.Code,description:"Insert a code block",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleCodeBlock().run()}},{label:"Blockquote",icon:m.Quote,description:"Insert a blockquote",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleBlockquote().run()}},{label:"Divider",icon:f.Minus,description:"Insert a horizontal rule",category:"basic",action:{type:"direct",run:e=>e.chain().focus().setHorizontalRule().run()}},{label:"Table",icon:y,description:"Insert a 3x3 table",category:"basic",action:{type:"direct",run:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}},{label:"Image",icon:c.ImageIcon,description:"Upload, paste URL, or drop an image",category:"media",action:{type:"popover",kind:{type:"media",kind:"image"}}},{label:"Video",icon:v.Video,description:"Upload or paste a video URL",category:"media",action:{type:"popover",kind:{type:"media",kind:"video"}}},{label:"File",icon:o.File,description:"Attach any file to this page",category:"media",action:{type:"popover",kind:{type:"media",kind:"file"}}},{label:"Callout",icon:u,description:"Insert an info callout",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().wrapIn("callout",{type:"info"}).run()}},{label:"Warning",icon:n.AlertTriangle,description:"Insert a warning callout",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().wrapIn("callout",{type:"warning"}).run()}},{label:"Math",icon:g,description:"Insert a LaTeX math expression",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().insertContent("$x=y$").run()}}];function E({cmd:e}){switch(e.label){case"Heading 1":return(0,t.jsx)("p",{className:"font-bold text-[18px] leading-tight text-foreground/80 truncate",children:"Heading 1"});case"Heading 2":return(0,t.jsx)("p",{className:"font-semibold text-[14px] leading-tight text-foreground/80 truncate",children:"Heading 2"});case"Heading 3":return(0,t.jsx)("p",{className:"font-medium text-[12px] leading-tight text-foreground/80 truncate",children:"Heading 3"});case"Text":return(0,t.jsx)("p",{className:"text-[11px] text-foreground/60 leading-snug",children:"The quick brown fox jumps over the lazy dog."});case"Bullet List":return(0,t.jsxs)("ul",{className:"list-disc pl-4 text-[10px] text-foreground/60 space-y-0.5",children:[(0,t.jsx)("li",{children:"First item"}),(0,t.jsx)("li",{children:"Second item"}),(0,t.jsx)("li",{children:"Third item"})]});case"Numbered List":return(0,t.jsxs)("ol",{className:"list-decimal pl-4 text-[10px] text-foreground/60 space-y-0.5",children:[(0,t.jsx)("li",{children:"First item"}),(0,t.jsx)("li",{children:"Second item"}),(0,t.jsx)("li",{children:"Third item"})]});case"Checklist":return(0,t.jsxs)("div",{className:"space-y-0.5 text-[10px] text-foreground/60",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 border border-foreground/30 rounded-sm inline-block shrink-0"}),"Pending task"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 border border-foreground/30 rounded-sm bg-foreground/20 inline-block shrink-0"}),"Done task"]})]});case"Code Block":return(0,t.jsx)("pre",{className:"bg-muted rounded px-2 py-1 text-[10px] font-mono text-foreground/70 leading-snug",children:(0,t.jsx)("code",{children:"const x = 42;"})});case"Blockquote":return(0,t.jsx)("div",{className:"border-l-2 border-foreground/30 pl-2 text-[10px] text-foreground/60 italic",children:"A thought worth quoting."});case"Divider":return(0,t.jsx)("hr",{className:"border-foreground/20 w-full"});case"Table":return(0,t.jsxs)("table",{className:"text-[9px] border-collapse w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:["Col A","Col B","Col C"].map(e=>(0,t.jsx)("th",{className:"border border-foreground/20 px-1.5 py-0.5 text-left font-semibold bg-muted/50 text-foreground/70",children:e},e))})}),(0,t.jsx)("tbody",{children:[["1","2","3"],["4","5","6"]].map((e,n)=>(0,t.jsx)("tr",{children:e.map((e,n)=>(0,t.jsx)("td",{className:"border border-foreground/20 px-1.5 py-0.5 text-foreground/50",children:e},n))},n))})]});case"Image":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(c.ImageIcon,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"image.png"})]});case"Video":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(v.Video,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"video.mp4"})]});case"File":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(o.File,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"attachment.pdf"})]});case"Callout":return(0,t.jsxs)("div",{className:"flex items-start gap-1.5 bg-blue-500/10 border border-blue-500/20 rounded px-2 py-1",children:[(0,t.jsx)(u,{className:"h-3 w-3 text-blue-500 shrink-0 mt-0.5"}),(0,t.jsx)("span",{className:"text-[10px] text-foreground/60",children:"Info callout"})]});case"Warning":return(0,t.jsxs)("div",{className:"flex items-start gap-1.5 bg-warning/10 border border-warning/20 rounded px-2 py-1",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-3 w-3 text-warning shrink-0 mt-0.5"}),(0,t.jsx)("span",{className:"text-[10px] text-foreground/60",children:"Warning callout"})]});case"Math":return(0,t.jsx)("p",{className:"font-mono text-[13px] text-foreground/70",children:"E = mc²"});default:return(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground",children:e.description})}}function M(e){let t=[],n=new Map;return e.state.doc.forEach((e,r)=>{if("heading"===e.type.name){let i=e.textContent,o=e.attrs.level,s=i.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")||"heading",a=(n.get(s)??0)+1;n.set(s,a);let l=1===a?s:`${s}-${a}`;t.push({level:o,text:i,pos:r,uid:l})}}),t}e.s(["SlashCommands",0,function({editor:e}){let[n,r]=(0,w.useState)(!1),[i,o]=(0,w.useState)(""),[s,a]=(0,w.useState)(0),[l,c]=(0,w.useState)({top:0,left:0}),[d,u]=(0,w.useState)(null),h=(0,w.useRef)(null),p=(0,k.useEditorStore)(e=>e.currentPath),f=C.filter(e=>e.label.toLowerCase().includes(i.toLowerCase())||e.description.toLowerCase().includes(i.toLowerCase())),m=(0,w.useCallback)(()=>{r(!1),o(""),a(0)},[]),g=(0,w.useCallback)(t=>{if(!e)return;let{from:n}=e.state.selection,s=n-i.length-1;e.chain().focus().deleteRange({from:s,to:n}).run(),"direct"===t.action.type?(t.action.run(e),m()):(u(t.action.kind),r(!1),o(""))},[e,i,m]);if((0,w.useEffect)(()=>{if(!e)return;let t=t=>{if(!n){if("/"===t.key){let{from:t}=e.state.selection,n=e.state.doc.textBetween(Math.max(0,t-1),t);if(1===t||""===n||"\n"===n||" "===n){let n=e.view.coordsAtPos(t),i=e.view.dom.getBoundingClientRect();c({top:n.bottom-i.top+4,left:n.left-i.left}),r(!0),o(""),a(0)}}return}"Escape"===t.key?(t.preventDefault(),m()):"ArrowDown"===t.key?(t.preventDefault(),a(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),a(e=>Math.max(e-1,0))):"Enter"===t.key?(t.preventDefault(),f[s]&&g(f[s])):"Backspace"===t.key?0===i.length?m():(o(e=>e.slice(0,-1)),a(0)):" "===t.key?m():1!==t.key.length||t.metaKey||t.ctrlKey||(o(e=>e+t.key),a(0))};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,n,i,s,f,m,g]),(0,w.useEffect)(()=>{if(!n)return;let e=e=>{h.current&&!h.current.contains(e.target)&&m()};return window.addEventListener("mousedown",e),()=>window.removeEventListener("mousedown",e)},[n,m]),(!n||0===f.length)&&!d)return null;let y=new Map;for(let e of f){let t=y.get(e.category)??[];t.push(e),y.set(e.category,t)}let b=f[s]??null;return(0,t.jsxs)(t.Fragment,{children:[n&&f.length>0&&(0,t.jsxs)("div",{ref:h,className:"absolute z-50 w-[280px] bg-popover border border-border rounded-lg shadow-lg overflow-hidden",style:{top:l.top,left:l.left},children:[(0,t.jsx)("div",{className:"max-h-[300px] overflow-y-auto py-1",children:[{key:"basic",title:"Basic"},{key:"media",title:"Media"},{key:"advanced",title:"Advanced"}].map(e=>{let n=y.get(e.key);return n&&0!==n.length?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-muted-foreground px-3 pt-2 pb-1",children:e.title}),n.map(e=>{let n=f.indexOf(e),r=e.icon,i=n===s;return(0,t.jsxs)("button",{onMouseDown:t=>{t.preventDefault(),g(e)},onMouseEnter:()=>a(n),className:(0,x.cn)("flex items-center gap-3 w-full px-3 py-1.5 text-left transition-colors",i?"bg-accent text-accent-foreground ring-1 ring-inset ring-accent-foreground/10":"hover:bg-accent/50"),children:[(0,t.jsx)(r,{className:(0,x.cn)("h-4 w-4 shrink-0 transition-colors",i?"text-accent-foreground":"text-muted-foreground")}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[12px] font-medium truncate",children:e.label}),(0,t.jsx)("p",{className:(0,x.cn)("text-[10px] truncate transition-colors",i?"text-accent-foreground/70":"text-muted-foreground"),children:e.description})]})]},e.label)})]},e.key):null})}),b&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/30 px-3 py-2 min-h-[52px] flex items-center",children:(0,t.jsx)(E,{cmd:b})})]}),d&&e?"media"===d.type?p?(0,t.jsx)(S.MediaPopover,{kind:d.kind,pagePath:p,anchor:l,onCancel:()=>u(null),onInsert:t=>((t,n)=>{if(!e)return;let{url:r,alt:i,mimeType:o}=n;"image"===t||(o??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(r)?e.chain().focus().setImage({src:r,alt:i??""}).run():e.chain().focus().insertContent(`<a href="${r}">${i??r}</a>`).run(),u(null)})(d.kind,t)}):null:null:null]})}],203195),e.s(["DocumentOutline",0,function({editor:e,scrollContainerRef:n}){let[r,i]=(0,w.useState)([]),[o,s]=(0,w.useState)(null),[a,l]=(0,w.useState)(!1),[c,d]=(0,w.useState)(0),u=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=null,n=()=>{t&&clearTimeout(t),t=setTimeout(()=>i(M(e)),250)};return e.on("update",n),i(M(e)),()=>{t&&clearTimeout(t),e.off("update",n)}},[e]),(0,w.useEffect)(()=>{let e=n.current;if(!e)return;let t=0,r=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>{let t=e.scrollHeight-e.clientHeight;d(t>0?Math.min(1,e.scrollTop/t):0)})};return e.addEventListener("scroll",r,{passive:!0}),()=>{e.removeEventListener("scroll",r),cancelAnimationFrame(t)}},[n]),(0,w.useEffect)(()=>{u.current?.disconnect();let t=n.current;if(!t||!e||0===r.length)return;let i=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){let e=t.target.dataset.outlineId;e&&s(e)}},{root:t,rootMargin:"-8% 0px -72% 0px",threshold:0});for(let t of r)try{let{node:n}=e.view.domAtPos(t.pos+1),r=n.nodeType===Node.ELEMENT_NODE?n.closest("h1,h2,h3,h4,h5,h6")??n:n.parentElement?.closest("h1,h2,h3,h4,h5,h6")??null;r&&(r.dataset.outlineId=t.uid,i.observe(r))}catch{}return u.current=i,()=>{i.disconnect()}},[r,e,n]);let p=(0,w.useCallback)(t=>{if(e)try{let{node:n}=e.view.domAtPos(t.pos+1),r=n.nodeType===Node.ELEMENT_NODE?n.closest("h1,h2,h3,h4,h5,h6")??n:n.parentElement?.closest("h1,h2,h3,h4,h5,h6")??null;r?.scrollIntoView({behavior:"smooth",block:"start"})}catch{}},[e]),f=r.length>=2,[m,g]=(0,w.useState)(!1),y=(0,t.jsx)(t.Fragment,{children:r.map((e,n)=>(0,t.jsx)("button",{onClick:()=>{p(e),g(!1)},title:e.text,className:(0,x.cn)("text-left text-[10.5px] leading-snug py-0.5 rounded truncate transition-colors shrink-0",o===e.uid?"text-primary bg-primary/10 font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent"),style:{paddingLeft:`${(e.level-1)*8+4}px`},children:e.text},`${e.uid}-${n}`))});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"absolute top-0 left-0 right-0 h-0.5 z-30 pointer-events-none",children:(0,t.jsx)("div",{className:"h-full bg-primary/35 transition-[width] duration-100 ease-out",style:{width:`${100*c}%`}})}),f&&(0,t.jsxs)("div",{className:"absolute right-1 top-4 z-20 hidden xl:block w-40",children:[(0,t.jsxs)("button",{onClick:()=>l(e=>!e),className:"flex items-center gap-1 mb-1.5 px-1 py-0.5 rounded text-muted-foreground/40 hover:text-muted-foreground hover:bg-accent transition-colors text-[10px]","aria-label":a?"Expand outline":"Collapse outline",children:[(0,t.jsx)(h.List,{className:"h-3 w-3"}),!a&&(0,t.jsx)("span",{children:"Outline"})]}),!a&&(0,t.jsx)("nav",{"aria-label":"Document outline",className:"flex flex-col gap-px max-h-[50vh] overflow-y-auto pr-1",children:y})]}),f&&(0,t.jsxs)("div",{className:"absolute right-2 top-2 z-30 xl:hidden",children:[(0,t.jsx)("button",{onClick:()=>g(e=>!e),className:"flex items-center gap-1 px-1.5 py-1 rounded bg-background/80 backdrop-blur border border-border/60 text-muted-foreground/60 hover:text-foreground hover:bg-accent transition-colors text-[10px] shadow-sm","aria-label":"Document outline","aria-expanded":m,children:(0,t.jsx)(h.List,{className:"h-3.5 w-3.5"})}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{"aria-hidden":!0,tabIndex:-1,className:"fixed inset-0 z-0 cursor-default",onClick:()=>g(!1)}),(0,t.jsx)("nav",{"aria-label":"Document outline",className:"absolute right-0 top-9 z-10 w-52 max-h-[60vh] overflow-y-auto flex flex-col gap-px rounded-lg border border-border bg-popover p-2 shadow-lg",children:y})]})]})]})}],521470);var N=e.i(367092),A=e.i(10137);let T=(0,d.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),R=(0,d.default)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);var O=e.i(671485),D=e.i(246542);e.s(["BacklinksPanel",0,function({currentPath:e}){let[n,r]=(0,w.useState)([]),[i,o]=(0,w.useState)(!1),[s,a]=(0,w.useState)(!1),l=(0,D.useWikiSlugsStore)(e=>e.has);return((0,w.useEffect)(()=>{if(!e)return;let t=!1;o(!0),r([]);let n=setTimeout(()=>{(async()=>{try{let n=await (0,O.wsFetch)(`/api/wiki/backlinks?path=${encodeURIComponent(e)}`),i=n.ok?await n.json():{backlinks:[]};if(t)return;r(i.backlinks??[])}catch{t||r([])}finally{t||o(!1)}})()},200);return()=>{t=!0,clearTimeout(n)}},[e]),i||0!==n.length)?(0,t.jsx)("div",{className:"max-w-[var(--editor-max-w,48rem)] mx-auto px-4 sm:px-8 pb-8 pt-1",children:(0,t.jsxs)("div",{className:"border-t border-border/60 pt-4",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>!e),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60 hover:text-muted-foreground transition-colors mb-2","aria-expanded":!s,children:[s?(0,t.jsx)(A.ChevronRight,{className:"h-3 w-3 shrink-0"}):(0,t.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(T,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:"Linked from"}),n.length>0&&(0,t.jsxs)("span",{className:"opacity-50 tabular-nums",children:["(",n.length,")"]}),i&&(0,t.jsx)("span",{className:"opacity-40 ml-1",children:"…"})]}),!s&&n.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-1.5",children:n.map(e=>{var n,r;let i,o=l(((n=e.path).split("/").pop()??n).replace(/\.md$/i,""));return(0,t.jsxs)("li",{className:"flex flex-col",children:[(0,t.jsxs)("button",{onClick:()=>o&&k.useEditorStore.getState().loadPage(e.path),className:o?"text-left text-[12px] text-primary/70 hover:text-primary hover:underline underline-offset-2 truncate transition-colors flex items-center gap-1":"text-left text-[12px] text-muted-foreground/40 truncate cursor-default flex items-center gap-1",title:o?e.path:`${e.path} (file not found)`,children:[!o&&(0,t.jsx)(R,{className:"h-2.5 w-2.5 shrink-0 text-muted-foreground/30"}),(i=(r=e.path).replace(/\.md$/i,"").split("/")).length>1?i.slice(-2).join(" / "):i[0]??r]}),e.snippet&&(0,t.jsx)("p",{className:o?"text-[10.5px] text-muted-foreground/50 line-clamp-1 mt-0.5":"text-[10.5px] text-muted-foreground/25 line-clamp-1 mt-0.5",children:e.snippet})]},e.path)})})]})}):null}],623616),e.i(150663);var j=e.i(608926),I=e.i(153840);let P=(0,d.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),L=(0,d.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,L],794469);let _=(0,d.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),z=(0,d.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),$=(0,d.default)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),H=(0,d.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["PanelLeft",0,H],877031);let B=(0,d.default)("panel-top",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]),F=(0,d.default)("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var V=e.i(920978);function U({label:e,icon:n,disabled:r,active:i,danger:o,onAction:s}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,disabled:r,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),s()},className:(0,x.cn)("h-7 w-7 inline-flex items-center justify-center rounded text-foreground/80 hover:bg-accent transition-colors disabled:pointer-events-none disabled:opacity-35",i&&"bg-accent text-foreground",o&&"text-destructive hover:bg-destructive/10"),children:(0,t.jsx)(n,{className:"h-3.5 w-3.5"})})}function W(){return(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-border"})}e.s(["TableMenu",0,function({editor:e}){if(!e)return null;let n=()=>{if(!(0,j.isInTable)(e.state))return null;try{return(0,j.selectedRect)(e.state)}catch{return null}},r=t=>{t()&&(e.commands.focus(),e.commands.fixTables())},i=t=>{let r=n();if(!r)return;let i=r.top,o=i+t;o<0||o>=r.map.height||((0,j.moveTableRow)({from:i,to:o})(e.state,e.view.dispatch),e.commands.focus())},o=t=>{let r=n();if(!r)return;let i=r.left,o=i+t;o<0||o>=r.map.width||((0,j.moveTableColumn)({from:i,to:o})(e.state,e.view.dispatch),e.commands.focus())},s=n(),a=!!s&&s.top>0,l=!!s&&s.top<s.map.height-1,c=!!s&&s.left>0,d=!!s&&s.left<s.map.width-1;return(0,t.jsxs)(I.BubbleMenu,{editor:e,pluginKey:"tableMenu",options:{placement:"top",offset:10},shouldShow:({editor:e})=>e.isActive("table"),className:"flex items-center gap-0.5 rounded-md border border-border bg-popover px-1 py-1 shadow-lg",children:[(0,t.jsx)(U,{label:"Select cell text",icon:y,onAction:()=>{let t=(0,j.cellAround)(e.state.selection.$from),n=t?.nodeAfter;t&&n&&e.chain().focus().setTextSelection({from:t.pos+1,to:t.pos+n.nodeSize-1}).run()}}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Add row above",icon:F,onAction:()=>r(()=>e.chain().focus().addRowBefore().run())}),(0,t.jsx)(U,{label:"Add row below",icon:P,onAction:()=>r(()=>e.chain().focus().addRowAfter().run())}),(0,t.jsx)(U,{label:"Move row up",icon:z,disabled:!a,onAction:()=>i(-1)}),(0,t.jsx)(U,{label:"Move row down",icon:P,disabled:!l,onAction:()=>i(1)}),(0,t.jsx)(U,{label:"Delete row",icon:V.Trash2,danger:!0,onAction:()=>r(()=>e.chain().focus().deleteRow().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Add column before",icon:$,onAction:()=>r(()=>e.chain().focus().addColumnBefore().run())}),(0,t.jsx)(U,{label:"Add column after",icon:_,onAction:()=>r(()=>e.chain().focus().addColumnAfter().run())}),(0,t.jsx)(U,{label:"Move column left",icon:L,disabled:!c,onAction:()=>o(-1)}),(0,t.jsx)(U,{label:"Move column right",icon:_,disabled:!d,onAction:()=>o(1)}),(0,t.jsx)(U,{label:"Delete column",icon:V.Trash2,danger:!0,onAction:()=>r(()=>e.chain().focus().deleteColumn().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Toggle header row",icon:B,onAction:()=>r(()=>e.chain().focus().toggleHeaderRow().run())}),(0,t.jsx)(U,{label:"Toggle header column",icon:H,onAction:()=>r(()=>e.chain().focus().toggleHeaderColumn().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Delete table",icon:V.Trash2,danger:!0,onAction:()=>e.chain().focus().deleteTable().run()})]})}],152555)},46951,e=>{"use strict";var t=e.i(101685),n=e.i(291967),r=e.i(967928),i=e.i(543250),o=e.i(433616),s=e.i(417256),a=e.i(348989),l=e.i(445424),c=e.i(332374),d=e.i(190088),u=e.i(980939),h=e.i(539340),p=e.i(206500),f=e.i(73772),m=e.i(652053),g=e.i(44501),y="Dialog",[b,v]=(0,i.createContextScope)(y),[w,x]=b(y),k=e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=t.useRef(null),u=t.useRef(null),[h,p]=(0,s.useControllableState)({prop:i,defaultProp:a??!1,onChange:l,caller:y});return(0,g.jsx)(w,{scope:n,triggerRef:d,contentRef:u,contentId:(0,o.useId)(),titleId:(0,o.useId)(),descriptionId:(0,o.useId)(),open:h,onOpenChange:p,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),modal:c,children:r})};k.displayName=y;var S="DialogTrigger",C=t.forwardRef((e,t)=>{let{__scopeDialog:i,...o}=e,s=x(S,i),a=(0,r.useComposedRefs)(t,s.triggerRef);return(0,g.jsx)(u.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":U(s.open),...o,ref:a,onClick:(0,n.composeEventHandlers)(e.onClick,s.onOpenToggle)})});C.displayName=S;var E="DialogPortal",[M,N]=b(E,{forceMount:void 0}),A=e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=x(E,n);return(0,g.jsx)(M,{scope:n,forceMount:r,children:t.Children.map(i,e=>(0,g.jsx)(d.Presence,{present:r||s.open,children:(0,g.jsx)(c.Portal,{asChild:!0,container:o,children:e})}))})};A.displayName=E;var T="DialogOverlay",R=t.forwardRef((e,t)=>{let n=N(T,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=x(T,e.__scopeDialog);return o.modal?(0,g.jsx)(d.Presence,{present:r||o.open,children:(0,g.jsx)(D,{...i,ref:t})}):null});R.displayName=T;var O=(0,m.createSlot)("DialogOverlay.RemoveScroll"),D=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(T,n);return(0,g.jsx)(p.RemoveScroll,{as:O,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(u.Primitive.div,{"data-state":U(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),j="DialogContent",I=t.forwardRef((e,t)=>{let n=N(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=x(j,e.__scopeDialog);return(0,g.jsx)(d.Presence,{present:r||o.open,children:o.modal?(0,g.jsx)(P,{...i,ref:t}):(0,g.jsx)(L,{...i,ref:t})})});I.displayName=j;var P=t.forwardRef((e,i)=>{let o=x(j,e.__scopeDialog),s=t.useRef(null),a=(0,r.useComposedRefs)(i,o.contentRef,s);return t.useEffect(()=>{let e=s.current;if(e)return(0,f.hideOthers)(e)},[]),(0,g.jsx)(_,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,n.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:(0,n.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),L=t.forwardRef((e,n)=>{let r=x(j,e.__scopeDialog),i=t.useRef(!1),o=t.useRef(!1);return(0,g.jsx)(_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),_=t.forwardRef((e,n)=>{let{__scopeDialog:i,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,...d}=e,u=x(j,i),p=t.useRef(null),f=(0,r.useComposedRefs)(n,p);return(0,h.useFocusGuards)(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:c,children:(0,g.jsx)(a.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":U(u.open),...d,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(J,{titleId:u.titleId}),(0,g.jsx)(G,{contentRef:p,descriptionId:u.descriptionId})]})]})}),z="DialogTitle",$=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(z,n);return(0,g.jsx)(u.Primitive.h2,{id:i.titleId,...r,ref:t})});$.displayName=z;var H="DialogDescription",B=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(H,n);return(0,g.jsx)(u.Primitive.p,{id:i.descriptionId,...r,ref:t})});B.displayName=H;var F="DialogClose",V=t.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,o=x(F,r);return(0,g.jsx)(u.Primitive.button,{type:"button",...i,ref:t,onClick:(0,n.composeEventHandlers)(e.onClick,()=>o.onOpenChange(!1))})});function U(e){return e?"open":"closed"}V.displayName=F;var W="DialogTitleWarning",[K,q]=(0,i.createContext)(W,{contentName:j,titleName:z,docsSlug:"dialog"}),J=({titleId:e})=>{let n=q(W),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
106
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,V.wrappingInputRule)({find:nU,type:this.type})]}}),nK=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,nq=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,nJ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,nG=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,nX=V.Mark.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return nV("strong",{...(0,V.mergeAttributes)(this.options.HTMLAttributes,e),children:nV("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,V.markInputRule)({find:nK,type:this.type}),(0,V.markInputRule)({find:nJ,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:nq,type:this.type}),(0,V.markPasteRule)({find:nG,type:this.type})]}}),nZ=/(^|[^`])`([^`]+)`(?!`)$/,nY=/(^|[^`])`([^`]+)`(?!`)/g,nQ=V.Mark.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,V.markInputRule)({find:nZ,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:nY,type:this.type})]}}),n0=/^```([a-z]+)?[\s\n]$/,n1=/^~~~([a-z]+)?[\s\n]$/,n2=V.Node.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,V.mergeAttributes)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&(null==(r=e.raw)?void 0:r.startsWith("~~~"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
107
+
108
+ \`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),a=o.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n"),c=0,d=0,u=i-s;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=u){c=e;break}d+=l[e].length+1}let h=Math.min(((null==(t=l[c].match(/^ */))?void 0:t[0])||"").length,n);if(0===h)return!0;let p=s;for(let e=0;e<c;e+=1)p+=l[e].length+1;return e.delete(p,p+h),i-p<=h&&e.setSelection(tm.TextSelection.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(tm.Selection.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,V.textblockTypeInputRule)({find:n0,type:this.type,getAttributes:e=>({language:e[1]})}),(0,V.textblockTypeInputRule)({find:n1,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new tm.Plugin({key:new tm.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(tm.TextSelection.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),n3=V.Node.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),n5=V.Node.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`
109
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&o){let t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),n4=V.Node.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,(0,V.mergeAttributes)(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>(0,V.textblockTypeInputRule)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),n6=V.Node.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,V.canInsertNode)(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return(0,V.isNodeSelection)(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(tm.TextSelection.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(tm.NodeSelection.create(t.doc,n.pos)):t.setSelection(tm.TextSelection.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(tm.TextSelection.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,V.nodeInputRule)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),n9=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,n7=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,n8=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,re=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,rt=V.Mark.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,V.markInputRule)({find:n9,type:this.type}),(0,V.markInputRule)({find:n8,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:n7,type:this.type}),(0,V.markPasteRule)({find:re,type:this.type})]}}),rn="&nbsp;",rr=V.Node.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===n.length&&"text"===n[0].type&&(n[0].raw===rn||n[0].text===rn||" "===n[0].raw||" "===n[0].text)&&1===r.length&&"text"===r[0].type&&(r[0].text===rn||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";let o=Array.isArray(e.content)?e.content:[];if(0===o.length){let e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return(null==(i=null==n?void 0:n.previousNode)?void 0:i.type)==="paragraph"&&0===e.length?rn:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ri=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ro=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rs=V.Mark.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,V.markInputRule)({find:ri,type:this.type})]},addPasteRules(){return[(0,V.markPasteRule)({find:ro,type:this.type})]}}),ra=V.Node.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),rl=V.Mark.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,V.mergeAttributes)(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),rc=V.Extension.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(nX.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(nW.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(nb.configure(this.options.bulletList)),!1!==this.options.code&&i.push(nQ.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(n2.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(n3.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(tQ.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(t0.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(n5.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(n4.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(t8.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(n6.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(rt.configure(this.options.italic)),!1!==this.options.listItem&&i.push(nv.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(nj.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(tx.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(nz.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(rr.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(rs.configure(this.options.strike)),!1!==this.options.text&&i.push(ra.configure(this.options.text)),!1!==this.options.underline&&i.push(rl.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(t7.configure(null==(r=this.options)?void 0:r.trailingNode)),i}});function rd(e){let t=e.regex,n={};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]}]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(s);let a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,i,o,{match:/(\/[a-z._-]+)+/},s,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}}e.s(["default",0,rd],944404);let ru=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],rh=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rp=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),rf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rm=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rg(e){let t=e.regex,n={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rp.join("|")+")"},{begin:":(:)?("+rf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rm.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:rh.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ru.join("|")+")\\b"}]}}function ry(e){let t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}e.s(["default",0,rg],334609),e.s(["default",0,ry],844552);let rb="[A-Za-z$_][0-9A-Za-z$_]*",rv=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rw=["true","false","null","undefined","NaN","Infinity"],rx=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rE=[].concat(rS,rx,rk);function rM(e){var t;let n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o={$pattern:rb,keyword:rv,literal:rw,built_in:rE,"variable.language":rC},s="[0-9](_?[0-9])*",a=`\\.(${s})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${l})((${a})|\\.)?|(${a}))[eE][+-]?(${s})\\b`},{begin:`\\b(${l})\\b((${a})\\b|\\.)?|(${a})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},p={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:rb+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},g=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,p,f,{match:/\$\d+/},c];d.contains=g.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(g)});let y=[].concat(m,d.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(y)}]),v={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b},w={variants:[{match:[/class/,/\s+/,rb,/\s+/,/extends/,/\s+/,n.concat(rb,"(",n.concat(/\./,rb),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,rb],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rx,...rk]}},k={match:n.concat(/\b/,(t=[...rS,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),rb,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},S={begin:n.concat(/\./,n.lookahead(n.concat(rb,/(?![0-9A-Za-z$_(])/))),end:rb,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,rb,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,p,f,m,{match:/\$\d+/},c,x,{scope:"attr",match:rb+n.lookahead(":"),relevance:0},E,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,rb,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:rb,className:"title.function"})]},{match:/\.\.\./,relevance:0},S,{match:"\\$"+rb,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,{match:[/get|set/,/\s+/,rb,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},{match:/\$[(.]/}]}}function rN(e){let t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rA(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},s=e.inherit(i,{contains:[]}),a=e.inherit(o,{contains:[]});i.contains.push(a),o.contains.push(s);let l=[n,r];return[i,o,s,a].forEach(e=>{e.contains=e.contains.concat(l)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l=l.concat(i,o)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},n,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,o,{className:"quote",begin:"^>\\s+",contains:l,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},r,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rT(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,u=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${c})[jJ](?=${u})`}]},p={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:["self",o,h,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[o,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,f,l]}]}}function rR(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:a,type:l}},{className:"punctuation",begin:"->"},o]}}function rO(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function rD(e){let t=e.regex,n=e.COMMENT("--","$"),r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],i=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!r.includes(e)),o={match:t.concat(/\b/,t.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function s(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let a={scope:"keyword",match:s(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?`${e}|0`:e)}(i,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:s(["double precision","large object","with timezone","without timezone"])},a,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}e.s(["default",0,rM],441228),e.s(["default",0,rN],576500),e.s(["default",0,rA],194633),e.s(["default",0,rT],32033),e.s(["default",0,rR],623568),e.s(["default",0,rO],42420),e.s(["default",0,rD],278909);let rj="[A-Za-z$_][0-9A-Za-z$_]*",rI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],rP=["true","false","null","undefined","NaN","Infinity"],rL=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],r_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rz=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],r$=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rH=[].concat(rz,rL,r_);function rB(e){var t;let n,r,i,o,s,a,l,c,d,u,h,p,f,m,g,y,b,v,w,x,k,S,C,E,M,N=e.regex,A=(n=e.regex,r=/<[A-Za-z0-9\\._:-]+/,i=/\/[A-Za-z0-9\\._:-]+>|\/>/,o=(e,t)=>{let n,r=e[0].length+e.index,i=e.input[r];if("<"===i||","===i)return void t.ignoreMatch();">"!==i||((e,{after:t})=>{let n="</"+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:r})||t.ignoreMatch();let o=e.input.substring(r);if((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)return void t.ignoreMatch()},s={$pattern:rj,keyword:rI,literal:rP,built_in:rH,"variable.language":r$},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},f={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:rj+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},u.contains=(y=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,f,m,{match:/\$\d+/},d]).concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(y)}),v=(b=[].concat(g,u.contains)).concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v},x={variants:[{match:[/class/,/\s+/,rj,/\s+/,/extends/,/\s+/,n.concat(rj,"(",n.concat(/\./,rj),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,rj],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rL,...r_]}},S={match:n.concat(/\b/,(t=[...rz,"super","import"].map(e=>`${e}\\s*\\(`),n.concat("(?!",t.join("|"),")")),rj,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},C={begin:n.concat(/\./,n.lookahead(n.concat(rj,/(?![0-9A-Za-z$_(])/))),end:rj,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,rj,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]},{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,f,m,g,{match:/\$\d+/},d,k,{scope:"attr",match:rj+n.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:"</>"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:r,"on:begin":o,end:i}],subLanguage:"xml",contains:[{begin:r,end:i,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,rj,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:rj,className:"title.function"})]},{match:/\.\.\./,relevance:0},C,{match:"\\$"+rj,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},S,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},x,{match:[/get|set/,/\s+/,rj,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},{match:/\$[(.]/}]}),T=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],R={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},O={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:T},contains:[A.exports.CLASS_REFERENCE]},D={$pattern:rj,keyword:rI.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:rP,built_in:rH.concat(T),"variable.language":r$},j={className:"meta",begin:"@"+rj},I=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw Error("can not find mode to replace");e.contains.splice(r,1,n)};Object.assign(A.keywords,D),A.exports.PARAMS_CONTAINS.push(j);let P=A.contains.find(e=>"attr"===e.scope),L=Object.assign({},P,{match:N.concat(rj,N.lookahead(/\s*\?:/))});return A.exports.PARAMS_CONTAINS.push([A.exports.CLASS_REFERENCE,P,L]),A.contains=A.contains.concat([j,R,O,L]),I(A,"shebang",e.SHEBANG()),I(A,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),A.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(A,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),A}function rF(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function rV(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(r,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},s=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},{begin:/\{/,end:/\}/,contains:[o],illegal:"\\n",relevance:0},{begin:"\\[",end:"\\]",contains:[o],illegal:"\\n",relevance:0},{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},r],a=[...s];return a.pop(),a.push(i),o.contains=a,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:s}}e.s(["default",0,rB],532270),e.s(["default",0,rF],503658),e.s(["default",0,rV],185503);var rU=e.i(897802);let rW=e.i(454184).default,rK={};function rq(e){let t=rW.newInstance();return e&&i(e),{highlight:n,highlightAuto:function(e,i){let o;(0,rU.ok)("string"==typeof e,"expected `string` as `value`");let s=(i||rK).subset||r(),a=-1,l=0;for(;++a<s.length;){let r=s[a];if(!t.getLanguage(r))continue;let c=n(r,e,i);c.data&&void 0!==c.data.relevance&&c.data.relevance>l&&(l=c.data.relevance,o=c)}return o||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:r,register:i,registerAlias:function(e,n){if("string"==typeof e)(0,rU.ok)(void 0!==n),t.registerAliases("string"==typeof n?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases("string"==typeof r?r:[...r],{languageName:n})}}},registered:function(e){return!!t.getLanguage(e)}};function n(e,n,r){(0,rU.ok)("string"==typeof e,"expected `string` as `name`"),(0,rU.ok)("string"==typeof n,"expected `string` as `value`");let i=r||rK,o="string"==typeof i.prefix?i.prefix:"hljs-";if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:rJ,classPrefix:o});let s=t.highlight(n,{ignoreIllegals:!0,language:e});if(s.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:s.errorRaised});let a=s._emitter.root,l=a.data;return l.language=s.language,l.relevance=s.relevance,a}function r(){return t.listLanguages()}function i(e,n){if("string"==typeof e)(0,rU.ok)(void 0!==n,"expected `grammar`"),t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}}class rJ{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(".").map(function(e,n){return n?e+"_".repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}e.s(["createLowlight",0,rq],993667);let rG=V.Node.create({name:"callout",group:"block",content:"block+",defining:!0,addAttributes:()=>({type:{default:"info",parseHTML:e=>e.getAttribute("data-callout-type")||"info",renderHTML:e=>({"data-callout-type":e.type})}}),parseHTML:()=>[{tag:'div[data-callout="true"]'}],renderHTML:({HTMLAttributes:e})=>["div",(0,V.mergeAttributes)(e,{"data-callout":"true",class:`callout callout-${e["data-callout-type"]||"info"}`}),0]});function rX(e,t,n){let{selection:r,doc:i}=e,o=i.resolve(r.from);for(;o.depth>1;)o=i.resolve(o.before(o.depth));if(0===o.depth)return!1;let s=o.before(1),a=i.nodeAt(s);if(!a)return!1;let l=o.index(0),c="up"===n?l-1:l+1;if(c<0||c>=i.childCount)return!1;let d=i.child(c),u=e.tr,h=s+a.nodeSize,p="up"===n?s-d.nodeSize:h,f="up"===n?s:h+d.nodeSize;if("up"===n)u=(u=(u=u.delete(s,h)).insert(p,a)).setSelection(tm.NodeSelection.create(u.doc,p));else{u=u.delete(s,h);let e=f-a.nodeSize;u=(u=u.insert(e,a)).setSelection(tm.NodeSelection.create(u.doc,e))}return t&&t(u.scrollIntoView()),!0}let rZ="cabinet-drag-handle",rY="cabinet-gutter-add",rQ=V.Extension.create({name:"dragHandle",addKeyboardShortcuts:()=>({"Mod-Alt-ArrowUp":({editor:e})=>rX(e.state,e.view.dispatch,"up"),"Mod-Alt-ArrowDown":({editor:e})=>rX(e.state,e.view.dispatch,"down"),"Alt-Shift-ArrowUp":({editor:e})=>rX(e.state,e.view.dispatch,"up"),"Alt-Shift-ArrowDown":({editor:e})=>rX(e.state,e.view.dispatch,"down")}),addProseMirrorPlugins(){let e,t,n=null,r="u">typeof document?((e=document.getElementById(rZ))||((e=document.createElement("div")).id=rZ,e.setAttribute("data-drag-handle","true"),e.draggable=!0,e.innerHTML='<svg width="10" height="16" viewBox="0 0 10 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><circle cx="2.5" cy="3" r="1.2"/><circle cx="2.5" cy="8" r="1.2"/><circle cx="2.5" cy="13" r="1.2"/><circle cx="7.5" cy="3" r="1.2"/><circle cx="7.5" cy="8" r="1.2"/><circle cx="7.5" cy="13" r="1.2"/></svg>',Object.assign(e.style,{position:"absolute",display:"none",cursor:"grab",padding:"2px 4px",borderRadius:"4px",color:"var(--muted-foreground)",opacity:"0.55",zIndex:"40",userSelect:"none",transition:"opacity 120ms ease"}),e.addEventListener("mouseenter",()=>{e&&(e.style.opacity="1")}),e.addEventListener("mouseleave",()=>{e&&(e.style.opacity="0.55")}),document.body.appendChild(e)),e):null,i="u">typeof document?((t=document.getElementById(rY))||((t=document.createElement("button")).id=rY,t.type="button",t.setAttribute("aria-label","Add block"),t.title="Add block",t.innerHTML='<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 1V9M1 5H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',Object.assign(t.style,{position:"absolute",display:"none",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",cursor:"pointer",borderRadius:"4px",color:"var(--muted-foreground)",opacity:"0.55",zIndex:"40",transition:"opacity 120ms ease, background 120ms ease",background:"transparent",border:"none",padding:"0"}),t.addEventListener("mouseenter",()=>{t&&(t.style.opacity="1",t.style.background="var(--muted)")}),t.addEventListener("mouseleave",()=>{t&&(t.style.opacity="0.55",t.style.background="transparent")}),document.body.appendChild(t)),t):null,o=()=>{r&&(r.style.display="none"),i&&(i.style.display="none"),n=null};return[new tm.Plugin({key:new tm.PluginKey("cabinetDragHandle"),view:e=>{if(!r)return{destroy:()=>{}};let t=t=>{if(!e.editable)return;let s=e.dom.getBoundingClientRect();if(t.clientX<s.left-60||t.clientX>s.right+60||t.clientY<s.top||t.clientY>s.bottom)return void o();let a=function(e,t){let n=e.posAtCoords(t);if(!n)return null;let r=e.state.doc.resolve(n.inside>=0?n.inside:n.pos);for(;r.depth>0&&!r.parent.type.isBlock;)r=e.state.doc.resolve(r.before());let i=r.depth;for(;i>1&&"doc"!==e.state.doc.resolve(r.before(i)).parent.type.name;)i-=1;let o=0===i?0:r.before(Math.max(i,1)),s=e.state.doc.nodeAt(o);if(!s)return null;let a=e.nodeDOM(o);return{pos:o,node:s,dom:a}}(e,{left:Math.max(s.left+20,Math.min(s.right-20,t.clientX)),top:t.clientY});if(!a?.dom||!(a.dom instanceof HTMLElement))return void o();n=a;let l=a.dom.getBoundingClientRect();r.style.display="flex",r.style.top=`${window.scrollY+l.top+4}px`,r.style.left=`${window.scrollX+l.left-22}px`,i&&(i.style.display="flex",i.style.top=`${window.scrollY+l.top+4}px`,i.style.left=`${window.scrollX+l.left-44}px`)},s=()=>o(),a=()=>{if(!n)return;let t=n.pos+n.node.nodeSize,r=t<=e.state.doc.content.size,i=e.state.tr;if(r){let n=tm.TextSelection.create(e.state.doc,Math.min(t-1,e.state.doc.content.size));e.dispatch(i.setSelection(n))}e.focus();let o=e.state.tr.split(e.state.selection.from);e.dispatch(o),e.dom.dispatchEvent(new KeyboardEvent("keydown",{key:"/",bubbles:!0,cancelable:!0}))},l=t=>{if(!n||!t.dataTransfer)return;let{pos:r,dom:i}=n,o=e.state.tr.setSelection(tm.NodeSelection.create(e.state.doc,r));e.dispatch(o);let s=e.state.selection.content(),a=document.createElement("div");a.appendChild(e.someProp("clipboardSerializer")?.serializeFragment(s.content)??document.createElement("div")),t.dataTransfer.clearData(),t.dataTransfer.setData("text/html",a.innerHTML),t.dataTransfer.setData("text/plain",i.textContent??""),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage(i,0,0),e.dragging={slice:s,move:!0}};return window.addEventListener("mousemove",t),e.dom.addEventListener("mouseleave",s),r.addEventListener("dragstart",l),i&&i.addEventListener("click",a),{destroy(){window.removeEventListener("mousemove",t),e.dom.removeEventListener("mouseleave",s),r.removeEventListener("dragstart",l),i&&i.removeEventListener("click",a),o()}}}})]}}),r0=new tm.PluginKey("headingAnchors");function r1(e){let t=[],n=new Map;return e.descendants((e,r)=>{if("heading"!==e.type.name)return;let i=e.textContent.toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-");if(!i)return;let o=n.get(i)??0;n.set(i,o+1);let s=0===o?i:`${i}-${o}`;t.push(tC.Decoration.node(r,r+e.nodeSize,{id:s}))}),tC.DecorationSet.create(e,t)}let r2=V.Extension.create({name:"headingAnchors",addProseMirrorPlugins:()=>[new tm.Plugin({key:r0,state:{init:(e,{doc:t})=>r1(t),apply:(e,t)=>e.docChanged?r1(e.doc):t},props:{decorations:e=>r0.getState(e)}})]});function r3(e){return e.value||e.children||[]}function r5({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return(0,V.findChildren)(e,e=>e.type.name===t).forEach(e=>{var t;let o=e.pos+1,s=e.node.attrs.language||r,a=n.listLanguages();(function e(t,n=[]){return t.flatMap(t=>{let r=[...n,...t.properties?t.properties.className:[]];return t.children?e(t.children,r):{text:t.value,classes:r}})})(s&&(a.includes(s)||rW.getLanguage(s)||(null==(t=n.registered)?void 0:t.call(n,s)))?r3(n.highlight(s,e.node.textContent)):r3(n.highlightAuto(e.node.textContent))).forEach(e=>{let t=o+e.text.length;if(e.classes.length){let n=tC.Decoration.inline(o,t,{class:e.classes.join(" ")});i.push(n)}o=t})}),tC.DecorationSet.create(e,i)}var r4=n2.extend({addOptions(){var e;return{...null==(e=this.parent)?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...(null==(e=this.parent)?void 0:e.call(this))||[],function({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(e=>"function"==typeof t[e]))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new tm.Plugin({key:new tm.PluginKey("lowlight"),state:{init:(r,{doc:i})=>r5({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,o,s)=>{let a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,V.findChildren)(o.doc,t=>t.type.name===e),d=(0,V.findChildren)(s.doc,t=>t.type.name===e);return r.docChanged&&([a,l].includes(e)||d.length!==c.length||r.steps.some(e=>void 0!==e.from&&void 0!==e.to&&c.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?r5({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),r6=e.i(885047),r9=e.i(605993);let r7=(0,r9.default)("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),r8=(0,r9.default)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),ie=(0,r9.default)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),it=(0,r9.default)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var ir=e.i(380560),ii=e.i(519455);function io({svg:e,className:n,allowPlainWheel:r,maxHeight:i,onExpand:o,onClose:s}){let[a,l]=(0,O.useState)(1),[c,d]=(0,O.useState)({x:0,y:0}),[u,h]=(0,O.useState)(!1),[p,f]=(0,O.useState)(i),m=(0,O.useRef)({x:0,y:0,panX:0,panY:0}),g=(0,O.useRef)(null);(0,O.useLayoutEffect)(()=>{if(null==i)return;let e=g.current?.querySelector("svg");if(!e)return;let t=e.getBoundingClientRect().height;t&&f(Math.min(Math.round(t)+32,i))},[e,i]);let y=(0,O.useCallback)(e=>{if(!(r||e.ctrlKey||e.metaKey))return;e.preventDefault();let t=e.deltaY>0?-.25:.25;l(e=>Math.min(Math.max(e+t,.25),5))},[r]),b=(0,O.useCallback)(e=>{0===e.button&&(h(!0),m.current={x:e.clientX,y:e.clientY,panX:c.x,panY:c.y},e.target.setPointerCapture(e.pointerId))},[c]),v=(0,O.useCallback)(e=>{u&&d({x:m.current.panX+(e.clientX-m.current.x),y:m.current.panY+(e.clientY-m.current.y)})},[u]),w=(0,O.useCallback)(()=>h(!1),[]);return(0,t.jsxs)("div",{className:`relative overflow-hidden ${n??""}`,style:{cursor:u?"grabbing":"grab",height:null!=i?p:void 0},onWheel:y,onPointerDown:b,onPointerMove:v,onPointerUp:w,children:[(0,t.jsx)("div",{ref:g,className:"flex items-center justify-center w-full h-full min-h-full p-4 [&_svg]:max-w-full origin-center select-none",style:{transform:`translate(${c.x}px, ${c.y}px) scale(${a})`},dangerouslySetInnerHTML:{__html:e}}),(0,t.jsxs)("div",{className:"absolute top-2 right-2 flex items-center gap-0.5 rounded-md border border-border bg-card/90 backdrop-blur px-1 py-0.5 shadow-sm",contentEditable:!1,children:[(0,t.jsx)(ii.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>l(e=>Math.max(e-.25,.25)),title:"Zoom out",children:(0,t.jsx)(it,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("button",{type:"button",onClick:()=>{l(1),d({x:0,y:0})},title:"Reset view",className:"text-[11px] text-muted-foreground tabular-nums w-9 text-center select-none hover:text-foreground",children:[Math.round(100*a),"%"]}),(0,t.jsx)(ii.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>l(e=>Math.min(e+.25,5)),title:"Zoom in",children:(0,t.jsx)(ie,{className:"h-3.5 w-3.5"})}),o&&(0,t.jsx)(ii.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:o,title:"Pop out",children:(0,t.jsx)(r7,{className:"h-3.5 w-3.5"})}),s&&(0,t.jsx)(ii.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:s,title:"Close",children:(0,t.jsx)(r8,{className:"h-3.5 w-3.5"})})]})]})}function is({svg:e,className:n,maxHeight:r}){let[i,o]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{if(!i)return;let e=e=>"Escape"===e.key&&o(!1);return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(io,{svg:e,className:n,maxHeight:r,onExpand:()=>o(!0)}),i&&"u">typeof document&&(0,ir.createPortal)((0,t.jsx)("div",{className:"fixed inset-0 z-50 bg-background/95 backdrop-blur",children:(0,t.jsx)(io,{svg:e,className:"w-full h-full",allowPlainWheel:!0,onClose:()=>o(!1)})}),document.body)]})}e.s(["MermaidCanvas",0,is],893030);let ia="rounded-md bg-muted p-4 font-mono text-sm",il=0;function ic(n){let{node:r,editor:i}=n,o="mermaid"===(r.attrs.language??""),s=r.textContent,[a,l]=(0,O.useState)(""),[c,d]=(0,O.useState)(""),u=(0,O.useRef)(null);if((0,O.useEffect)(()=>{if(!o)return;let t=s.trim();if(!t){l(""),d("");return}return u.current&&clearTimeout(u.current),u.current=setTimeout(async()=>{try{let n=(await e.A(890793)).default;n.initialize({startOnLoad:!1,theme:document.documentElement.classList.contains("dark")?"dark":"default",securityLevel:"loose",suppressErrorRendering:!0}),await n.parse(t);let{svg:r}=await n.render(`mermaid-cb-${++il}`,t);l(r),d("")}catch(e){document.querySelectorAll('[id^="dmermaid-cb-"]').forEach(e=>e.remove()),d(e instanceof Error?e.message:"Failed to render")}},300),()=>{u.current&&clearTimeout(u.current)}},[o,s]),!o)return(0,t.jsx)(r6.NodeViewWrapper,{as:"pre",className:ia,children:(0,t.jsx)(r6.NodeViewContent,{as:"code"})});let h=i.isEditable,p=a&&(!h||!c);return(0,t.jsxs)(r6.NodeViewWrapper,{className:"my-3",children:[(0,t.jsx)("pre",{className:ia,style:{display:!h&&p?"none":void 0},children:(0,t.jsx)(r6.NodeViewContent,{as:"code"})}),p&&(0,t.jsx)("div",{className:"mermaid-preview rounded-md border border-border bg-card",contentEditable:!1,children:(0,t.jsx)(is,{svg:a,className:"w-full",maxHeight:600})}),h&&c&&(0,t.jsxs)("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-2 text-xs text-red-500",contentEditable:!1,children:["Mermaid error: ",c]})]})}let id=V.Mark.create({name:"proofSpan",priority:900,inclusive:!1,keepOnSplit:!1,addAttributes:()=>({spanId:{default:null,parseHTML:e=>e.getAttribute("id"),renderHTML:e=>({id:e.spanId})},origin:{default:"ai",parseHTML:e=>e.getAttribute("origin"),renderHTML:e=>({origin:e.origin})},basis:{default:null,parseHTML:e=>e.getAttribute("basis"),renderHTML:e=>({basis:e.basis})},basisDetail:{default:null,parseHTML:e=>e.getAttribute("basis-detail"),renderHTML:e=>({"basis-detail":e.basisDetail})},by:{default:null,parseHTML:e=>e.getAttribute("by"),renderHTML:e=>({by:e.by})},at:{default:null,parseHTML:e=>e.getAttribute("at"),renderHTML:e=>({at:e.at})},inResponseTo:{default:null,parseHTML:e=>e.getAttribute("in-response-to"),renderHTML:e=>({"in-response-to":e.inResponseTo})}}),parseHTML:()=>[{tag:"proof-span"}],renderHTML:({HTMLAttributes:e})=>["proof-span",(0,V.mergeAttributes)(e,{class:"proof-span"}),0]});var iu=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;function ih(e){let{node:n,updateAttributes:r,selected:i,editor:o}=e,s=n.attrs,a=(0,O.useRef)(null),l=(0,O.useRef)(null),[c,d]=(0,O.useState)(null),u=s.align??"center",h=(0,O.useCallback)((e,t)=>{if(!o.isEditable)return;e.preventDefault(),e.stopPropagation();let n=a.current,i=l.current;if(!n||!i)return;let s=e.clientX,c=n.getBoundingClientRect().width,u=i.parentElement?.getBoundingClientRect().width??800,h=e=>{d(Math.max(80,Math.min(u,c+("right"===t?e.clientX-s:s-e.clientX))))},p=()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",p),d(e=>(null!=e&&r({width:Math.round(e)}),null))};window.addEventListener("pointermove",h),window.addEventListener("pointerup",p)},[o.isEditable,r]),p=null!=c?`${Math.round(c)}px`:"number"==typeof s.width?`${s.width}px`:"string"==typeof s.width&&s.width?s.width:void 0,f="left"===u?"mr-auto":"right"===u?"ml-auto":"mx-auto";return(0,t.jsx)(r6.NodeViewWrapper,{as:"div",className:`resizable-image my-3 ${f}`,"data-align":u,style:{width:p??"fit-content",maxWidth:"100%"},children:(0,t.jsxs)("div",{ref:l,className:`relative group inline-block max-w-full ${i?"ring-2 ring-primary rounded-md":""}`,contentEditable:!1,children:[(0,t.jsx)("img",{ref:a,src:s.src,alt:s.alt??"",title:s.title??void 0,className:"block rounded-md max-w-full h-auto",style:{width:p},draggable:!1}),o.isEditable&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-label":"Resize from left",onPointerDown:e=>h(e,"left"),className:"hover-reveal resize-hit absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1 h-8 bg-card border border-border rounded-full shadow"})}),(0,t.jsx)("div",{"aria-label":"Resize from right",onPointerDown:e=>h(e,"right"),className:"hover-reveal resize-hit absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,t.jsx)("div",{className:"w-1 h-8 bg-card border border-border rounded-full shadow"})}),null!=c&&(0,t.jsxs)("div",{className:"absolute top-1 right-1 text-[10px] px-1.5 py-0.5 rounded bg-primary/80 text-primary-foreground font-mono",children:[Math.round(c),"px"]})]})]})})}let ip=V.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,V.mergeAttributes)(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,o,s;let a=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",l=null!=(i=null==(r=e.attrs)?void 0:r.alt)?i:"",c=null!=(s=null==(o=e.attrs)?void 0:o.title)?s:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"<typeof document)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:o,HTMLAttributes:s,editor:a})=>{let l=document.createElement("img");Object.entries(s).forEach(([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}}),l.src=s.src;let c=new V.ResizableNodeView({element:l,editor:a,node:i,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===r}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,V.nodeInputRule)({find:iu,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}).extend({name:"image",draggable:!0,addAttributes(){return{...this.parent?.(),width:{default:null,parseHTML:e=>{let t=e.getAttribute("width")??e.style.width;if(!t)return null;let n=/^(\d+)(px)?$/.exec(t);return n?Number(n[1]):t},renderHTML:e=>{if(!e.width)return{};let t="number"==typeof e.width?`${e.width}px`:e.width;return{style:`width: ${t}`}}},align:{default:null,parseHTML:e=>e.getAttribute("data-align"),renderHTML:e=>e.align?{"data-align":e.align}:{}}}},addNodeView:()=>(0,r6.ReactNodeViewRenderer)(ih)});var im=e.i(246542);let ig=new tm.PluginKey("wikiLinkDecorator"),iy="wikiLinkDecorator:refresh";function ib(e){let{has:t}=im.useWikiSlugsStore.getState(),n=e.schema.marks.wikiLink;if(!n)return tC.DecorationSet.empty;let r=[];return e.doc.descendants((e,i)=>{if(!e.isText)return;let o=e.marks.find(e=>e.type===n);if(!o)return;let s=o.attrs.slug;!s||t(s)||r.push(tC.Decoration.inline(i,i+e.nodeSize,{"data-broken":"true"}))}),tC.DecorationSet.create(e.doc,r)}let iv=/\[\[([a-z0-9-]+)(?:\|([^\]#|]+)|#([a-z0-9-]+))?\]\]$/,iw=V.Mark.create({name:"wikiLink",priority:1e3,keepOnSplit:!1,inclusive:!1,addAttributes:()=>({slug:{default:null,parseHTML:e=>e.getAttribute("data-slug"),renderHTML:e=>({"data-slug":e.slug})},alias:{default:null,parseHTML:e=>e.getAttribute("data-alias"),renderHTML:e=>null!=e.alias?{"data-alias":e.alias}:{}},anchor:{default:null,parseHTML:e=>e.getAttribute("data-anchor"),renderHTML:e=>null!=e.anchor?{"data-anchor":e.anchor}:{}}}),parseHTML:()=>[{tag:'a[data-wiki-link="true"]'}],renderHTML({HTMLAttributes:e}){let t=String(e["data-slug"]??""),n=null!=e["data-anchor"]?String(e["data-anchor"]):null,r=n?`#wiki:${t}#${n}`:`#wiki:${t}`;return["a",(0,V.mergeAttributes)(e,{"data-wiki-link":"true",href:r,class:"wiki-link"}),0]},addInputRules(){return[new V.InputRule({find:iv,handler:({state:e,range:t,match:n})=>{let r=n[1]??"",i=n[2]??null,o=n[3]??null,s=i??(o?`${r}#${o}`:r),{tr:a}=e;a.replaceWith(t.from,t.to,e.schema.text(s,[this.type.create({slug:r,alias:i,anchor:o})]))}})]},addProseMirrorPlugins:()=>[new tm.Plugin({key:ig,state:{init:(e,t)=>ib(t),apply:(e,t,n,r)=>e.getMeta(iy)||e.docChanged?ib(r):t.map(e.mapping,e.doc)},props:{decorations:e=>ig.getState(e)??tC.DecorationSet.empty},view(e){let t=im.useWikiSlugsStore.subscribe(()=>{let t=e.state.tr.setMeta(iy,!0);e.dispatch(t)});return{destroy(){t()}}}})],addCommands(){return{setWikiLink:e=>({commands:t})=>t.setMark(this.name,{slug:e.slug,alias:e.alias??null,anchor:e.anchor??null}),unsetWikiLink:()=>({commands:e})=>e.unsetMark(this.name)}}}),ix=rq({bash:rd,css:rg,go:ry,javascript:rM,json:rN,markdown:rA,python:rT,rust:rR,shell:rO,sql:rD,typescript:rB,xml:rF,yaml:rV}),ik=[rc.configure({heading:{levels:[1,2,3,4]},codeBlock:!1,link:!1,underline:!1}),r4.configure({lowlight:ix,HTMLAttributes:{class:ia}}).extend({addNodeView:()=>(0,r6.ReactNodeViewRenderer)(ic)}),t6.configure({placeholder:"Start writing, or press '/' for commands..."}),ip.configure({HTMLAttributes:{class:"rounded-lg max-w-full"},allowBase64:!1}),nf.configure({resizable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"border-collapse w-full"}}),na,no,ns,nB.configure({HTMLAttributes:{class:"task-list"}}),nH.configure({nested:!0}),tx.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline cursor-pointer"}}).extend({parseHTML:()=>[{tag:'a[href]:not([data-wiki-link="true"])'}],addKeyboardShortcuts(){return{"Mod-e":()=>{let{state:e}=this.editor,{from:t,to:n}=e.selection;if(t===n)return!1;let r=this.editor.getAttributes("link").href??"",i=window.prompt("Link URL",r);return null!==i&&(""===i?this.editor.chain().focus().extendMarkRange("link").unsetLink().run():this.editor.chain().focus().extendMarkRange("link").setLink({href:i}).run())}}}}),rG,id,nF.configure({types:["heading","paragraph"]}),ne,nt,rQ,r2,iw];e.s(["editorExtensions",0,ik],314206);let iS=(0,r9.default)("app-window",[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]);e.s(["AppWindow",0,iS],388503);let iC=(0,r9.default)("file-audio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);e.s(["FileAudio",0,iC],284766);let iE=(0,r9.default)("file-code-2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);e.s(["FileCode2",0,iE],965837);let iM=(0,r9.default)("file-image",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);e.s(["FileImage",0,iM],582966);let iN=(0,r9.default)("file-spreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);e.s(["FileSpreadsheet",0,iN],25688);let iA=(0,r9.default)("file-video",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);e.s(["FileVideo",0,iA],770271)},916767,e=>{"use strict";let t=(0,e.i(605993).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],916767)},845478,e=>{"use strict";let t=(0,e.i(605993).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",0,t],845478)},496668,665794,e=>{"use strict";var t=e.i(44501),n=e.i(388503),r=e.i(284766),i=e.i(965837),o=e.i(582966),s=e.i(25688),a=e.i(764143),l=e.i(770271),c=e.i(916767),d=e.i(845478),u=e.i(605993);let h=(0,u.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var p=e.i(853840),f=e.i(101685),m=e.i(96701),g=e.i(990791),y=e.i(671485);let b="kb-folder-view-mode";function v(e){return"image"===e.type}function w(e){switch(e.type){case"directory":case"cabinet":return c.Folder;case"image":return o.FileImage;case"video":return l.FileVideo;case"audio":return r.FileAudio;case"code":return i.FileCode2;case"csv":case"xlsx":return s.FileSpreadsheet;case"website":return d.Globe;case"app":return n.AppWindow;default:return a.FileText}}function x(e){let{selectPage:t,expandPath:n}=g.useTreeStore.getState(),r=e.split("/");for(let e=1;e<r.length;e++)n(r.slice(0,e).join("/"));t(e),m.useEditorStore.getState().loadPage(e)}e.s(["FolderIndex",0,function({folderPath:e,entries:n}){let r=(0,f.useMemo)(()=>(function(e){if(0===e.length)return!1;let t=e.filter(v).length;return t>=4&&t/e.length>=.6})(n),[n]),[i,o]=(0,f.useState)(()=>{let t=function(e){try{let t=localStorage.getItem(b);if(!t)return null;return JSON.parse(t)[e]??null}catch{return null}}(e);return t||(r?"gallery":"list")}),s=t=>{o(t);try{let n=localStorage.getItem(b),r=n?JSON.parse(n):{};r[e]=t,localStorage.setItem(b,JSON.stringify(r))}catch{}},a=(0,f.useMemo)(()=>{let e=[...n];return e.sort((e,t)=>{let n="directory"===e.type||"cabinet"===e.type;return n!==("directory"===t.type||"cabinet"===t.type)?n?-1:1:e.name.localeCompare(t.name)}),e},[n]);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("p",{className:"text-[11px] uppercase tracking-wider text-muted-foreground/70",children:[a.length," ",1===a.length?"item":"items"]}),(0,t.jsxs)("div",{className:"inline-flex items-center rounded-md border border-border p-0.5 text-[11px]",children:[(0,t.jsxs)("button",{onClick:()=>s("list"),className:`flex items-center gap-1 px-2 py-1 rounded transition-colors ${"list"===i?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":"list"===i,title:"List view",children:[(0,t.jsx)(p.List,{className:"h-3 w-3"}),"List"]}),(0,t.jsxs)("button",{onClick:()=>s("gallery"),className:`flex items-center gap-1 px-2 py-1 rounded transition-colors ${"gallery"===i?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"}`,"aria-pressed":"gallery"===i,title:"Gallery view",children:[(0,t.jsx)(h,{className:"h-3 w-3"}),"Gallery"]})]})]}),"list"===i?(0,t.jsx)("ul",{className:"divide-y divide-border rounded-md border border-border overflow-hidden",children:a.map(e=>{let n=w(e),r=e.frontmatter?.title||e.name;return(0,t.jsx)("li",{children:(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"w-full flex items-center gap-3 px-3 py-2 text-left text-sm hover:bg-accent/50 transition-colors",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate",children:r}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60 capitalize",children:e.type})]})},e.path)})}):(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:a.map(e=>{let n=e.frontmatter?.title||e.name;if(v(e))return(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"group flex flex-col gap-1.5 text-left",title:n,children:[(0,t.jsx)("div",{className:"aspect-square w-full overflow-hidden rounded-md border border-border bg-muted",children:(0,t.jsx)("img",{src:(0,y.withWs)(`/api/assets/${e.path}`),alt:n,loading:"lazy",className:"h-full w-full object-cover transition-transform group-hover:scale-[1.02]"})}),(0,t.jsx)("span",{className:"truncate text-[12px] text-muted-foreground group-hover:text-foreground",children:n})]},e.path);let r=w(e);return(0,t.jsxs)("button",{onClick:()=>x(e.path),className:"group flex flex-col gap-1.5 text-left",title:n,children:[(0,t.jsx)("div",{className:"aspect-square w-full flex items-center justify-center rounded-md border border-border bg-muted/40 group-hover:bg-muted transition-colors",children:(0,t.jsx)(r,{className:"h-8 w-8 text-muted-foreground/60"})}),(0,t.jsx)("span",{className:"truncate text-[12px] text-muted-foreground group-hover:text-foreground",children:n})]},e.path)})})]})}],496668);let k=(0,u.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var S=e.i(891734);e.s(["CommentPip",0,function({anchorKey:e,anchorLabel:n,comments:r,top:i,left:o,onClick:s}){let a;if(0===r.length)return null;let l=r.filter(e=>!e.resolved);if(0===l.length)a="check";else{let e=l[0].turns.at(-1);a=e?.by.startsWith("ai:")?"dot-ai":"ring-human"}return(0,t.jsxs)("button",{type:"button",onClick:s,style:{position:"absolute",top:i,left:o,transform:"translateY(2px)"},className:"z-10 p-2 sm:p-0.5 -m-1.5 sm:m-0 rounded transition-colors hover:bg-accent focus:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":`Comment thread for ${n??e}`,children:["check"===a&&(0,t.jsx)(k,{className:"h-3.5 w-3.5 text-muted-foreground/30"}),"dot-ai"===a&&(0,t.jsx)(S.MessageCircle,{className:"h-3.5 w-3.5 fill-primary text-primary"}),"ring-human"===a&&(0,t.jsx)(S.MessageCircle,{className:"h-3.5 w-3.5 text-muted-foreground/70"})]})}],665794)},926128,803043,589676,294250,955537,e=>{"use strict";var t=e.i(44501),n=e.i(101685),r=e.i(291967),i=e.i(967928),o=e.i(543250),s=e.i(348989),a=e.i(539340),l=e.i(445424),c=e.i(433616),d=e.i(638154),u=e.i(332374),h=e.i(190088),p=e.i(980939),f=e.i(652053),m=e.i(417256),g=e.i(73772),y=e.i(206500),b="Popover",[v,w]=(0,o.createContextScope)(b,[d.createPopperScope]),x=(0,d.createPopperScope)(),[k,S]=v(b),C=e=>{let{__scopePopover:r,children:i,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,u=x(r),h=n.useRef(null),[p,f]=n.useState(!1),[g,y]=(0,m.useControllableState)({prop:o,defaultProp:s??!1,onChange:a,caller:b});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(k,{scope:r,contentId:(0,c.useId)(),triggerRef:h,open:g,onOpenChange:y,onOpenToggle:n.useCallback(()=>y(e=>!e),[y]),hasCustomAnchor:p,onCustomAnchorAdd:n.useCallback(()=>f(!0),[]),onCustomAnchorRemove:n.useCallback(()=>f(!1),[]),modal:l,children:i})})};C.displayName=b;var E="PopoverAnchor",M=n.forwardRef((e,r)=>{let{__scopePopover:i,...o}=e,s=S(E,i),a=x(i),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return n.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...o,ref:r})});M.displayName=E;var N="PopoverTrigger";n.forwardRef((e,n)=>{let{__scopePopover:o,...s}=e,a=S(N,o),l=x(o),c=(0,i.useComposedRefs)(n,a.triggerRef),u=(0,t.jsx)(p.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":H(a.open),...s,ref:c,onClick:(0,r.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})}).displayName=N;var A="PopoverPortal",[T,R]=v(A,{forceMount:void 0}),O=e=>{let{__scopePopover:n,forceMount:r,children:i,container:o}=e,s=S(A,n);return(0,t.jsx)(T,{scope:n,forceMount:r,children:(0,t.jsx)(h.Presence,{present:r||s.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:o,children:i})})})};O.displayName=A;var D="PopoverContent",j=n.forwardRef((e,n)=>{let r=R(D,e.__scopePopover),{forceMount:i=r.forceMount,...o}=e,s=S(D,e.__scopePopover);return(0,t.jsx)(h.Presence,{present:i||s.open,children:s.modal?(0,t.jsx)(P,{...o,ref:n}):(0,t.jsx)(L,{...o,ref:n})})});j.displayName=D;var I=(0,f.createSlot)("PopoverContent.RemoveScroll"),P=n.forwardRef((e,o)=>{let s=S(D,e.__scopePopover),a=n.useRef(null),l=(0,i.useComposedRefs)(o,a),c=n.useRef(!1);return n.useEffect(()=>{let e=a.current;if(e)return(0,g.hideOthers)(e)},[]),(0,t.jsx)(y.RemoveScroll,{as:I,allowPinchZoom:!0,children:(0,t.jsx)(_,{...e,ref:l,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||s.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),L=n.forwardRef((e,r)=>{let i=S(D,e.__scopePopover),o=n.useRef(!1),s=n.useRef(!1);return(0,t.jsx)(_,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||i.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));let n=t.target;i.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})}),_=n.forwardRef((e,n)=>{let{__scopePopover:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,...g}=e,y=S(D,r),b=x(r);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:c,children:(0,t.jsx)(s.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":H(y.open),role:"dialog",id:y.contentId,...b,...g,ref:n,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),z="PopoverClose";n.forwardRef((e,n)=>{let{__scopePopover:i,...o}=e,s=S(z,i);return(0,t.jsx)(p.Primitive.button,{type:"button",...o,ref:n,onClick:(0,r.composeEventHandlers)(e.onClick,()=>s.onOpenChange(!1))})}).displayName=z;var $=n.forwardRef((e,n)=>{let{__scopePopover:r,...i}=e,o=x(r);return(0,t.jsx)(d.Arrow,{...o,...i,ref:n})});function H(e){return e?"open":"closed"}$.displayName="PopoverArrow";var B=e.i(562199),F=e.i(592185),V=e.i(671485);let U=new Intl.RelativeTimeFormat("en",{numeric:"auto"});async function W(e,t,n,r){let i=encodeURIComponent(e).replace(/%2F/g,"/"),o=await (0,V.wsFetch)(`/api/agent/files/${i}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:n,ops:r})});if(409===o.status){let e=await o.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return o.ok?{ok:!0,stale:!1}:{ok:!1,stale:!1}}async function K(e,t,n,r){let i=encodeURIComponent(e).replace(/%2F/g,"/"),o=await (0,V.wsFetch)(`/api/agent/files/${i}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:"human",ops:[{type:n,suggestionId:r}]})});return{ok:o.ok,status:o.status}}async function q(e,t,n){let r=encodeURIComponent(e).replace(/%2F/g,"/"),i=await (0,V.wsFetch)(`/api/agent/files/${r}`,{method:"POST",headers:{"Content-Type":"application/json","Idempotency-Key":crypto.randomUUID(),...(0,B.authHeaders)()},body:JSON.stringify({baseRevision:t,by:"human",ops:n})});if(409===i.status){let e=await i.json();return"STALE_REVISION"===e.code&&e.snapshot?.revision!==void 0?{ok:!1,stale:!0,newRevision:e.snapshot.revision}:{ok:!1,stale:!1}}return i.ok?{ok:!0,stale:!1}:{ok:!1,stale:!1}}e.s(["CommentThread",0,function({path:e,anchorKey:r,anchorLabel:i,anchorRef:o,lineAnchor:s,comments:a,anchorEl:l,onClose:c,readOnly:d}){let[u,h]=(0,n.useState)(null),[p,f]=(0,n.useState)(""),[m,g]=(0,n.useState)(!1),y=(0,n.useRef)(null),b=a.filter(e=>!e.resolved),v=b.length>0,w=b[0]??a[0]??null;if((0,n.useEffect)(()=>{if(!l)return void h(null);let e=l.getBoundingClientRect();h({top:e.bottom+4,left:e.left})},[l]),(0,n.useEffect)(()=>{if(!l)return;let e=e=>{"Escape"===e.key&&c()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[l,c]),(0,n.useEffect)(()=>{u&&setTimeout(()=>y.current?.focus(),50)},[u]),!l||!u)return null;function x(){let t=F.useProofStore.getState().byPath[e];return t?.snapshotRevision??0}async function k(){if(p.trim()&&!m){g(!0);try{let t=w?{type:"comment.reply",commentId:w.id,text:p.trim()}:s?{type:"comment.add",lineAnchor:s,text:p.trim()}:{type:"comment.add",ref:o??r,text:p.trim()},n=x(),i=await W(e,n,"human",[t]);!i.ok&&i.stale&&void 0!==i.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=i.newRevision,i=await W(e,n,"human",[t])),i.ok&&(await F.useProofStore.getState().loadSidecar(e),f(""),c())}finally{g(!1)}}}async function S(){if(w&&!m){g(!0);try{let t=w.resolved?"comment.reopen":"comment.resolve",n=x(),r=await W(e,n,"human",[{type:t,commentId:w.id}]);!r.ok&&r.stale&&void 0!==r.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=r.newRevision,r=await W(e,n,"human",[{type:t,commentId:w.id}])),r.ok&&(await F.useProofStore.getState().loadSidecar(e),c())}finally{g(!1)}}}let E=a.flatMap(e=>e.turns.map(t=>({...t,resolved:e.resolved,commentId:e.id})));return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:u.top,left:u.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:c,className:"z-50 w-[min(18rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground/60 truncate",children:i??r}),w&&!d&&(0,t.jsx)("button",{type:"button",disabled:m,onClick:()=>void S(),className:"ml-2 shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-border hover:bg-accent disabled:opacity-50 transition-colors",children:w.resolved?"Reopen":"Resolve"})]}),E.length>0&&(0,t.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1",children:E.map((e,n)=>(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("p",{className:"text-[10px] text-muted-foreground/60",children:[e.by," · ",function(e){let t=Math.round((Date.now()-new Date(e).getTime())/1e3);if(60>Math.abs(t))return U.format(-t,"second");let n=Math.round(t/60);if(60>Math.abs(n))return U.format(-n,"minute");let r=Math.round(n/60);return 24>Math.abs(r)?U.format(-r,"hour"):U.format(-Math.round(r/24),"day")}(e.at)]}),(0,t.jsx)("p",{className:"text-foreground leading-snug whitespace-pre-wrap",children:e.text})]},n))}),(!w?.resolved||0===a.length)&&(0,t.jsxs)("div",{className:"space-y-1.5 pt-1",children:[(0,t.jsx)("textarea",{ref:y,value:p,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&k()},placeholder:v?"Reply…":"Add a comment…",rows:2,className:"w-full resize-none rounded-md border border-border bg-background px-2 py-1.5 text-[12px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"⌘↵ send"}),(0,t.jsx)("button",{type:"button",disabled:m||!p.trim(),onClick:()=>void k(),className:"px-2.5 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Send"})]})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],926128),e.s(["ProofSpanPopover",0,function({targetEl:e,path:r,onClose:i,onComment:o}){let[s,a]=(0,n.useState)(null),[l,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(!e){a(null),c(null);return}let t=e.getBoundingClientRect();a({top:t.bottom+window.scrollY+4,left:t.left+window.scrollX}),c({spanId:e.getAttribute("id")??"",origin:e.getAttribute("origin"),basis:e.getAttribute("basis"),basisDetail:e.getAttribute("basis-detail"),by:e.getAttribute("by"),at:e.getAttribute("at")})},[e]),(0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,i]),!e||!s||!l)return null;async function h(e){if(!d&&l){u(!0);try{await (0,V.wsFetch)("/api/agent/internal/span",{method:"POST",headers:{"Content-Type":"application/json",...(0,B.authHeaders)()},body:JSON.stringify({path:r,spanId:l.spanId,action:e,idempotencyKey:crypto.randomUUID()})})}finally{u(!1),i()}}}return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:s.top,left:s.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:i,className:"z-50 w-[min(16rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsxs)("p",{className:"font-medium text-foreground truncate",children:[l.by??"unknown"," · ",l.basis??"—"," · ",function(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(l.at)]}),l.basisDetail&&(0,t.jsxs)("p",{className:"text-muted-foreground italic truncate",children:["“",l.basisDetail,"”"]}),l.origin&&(0,t.jsxs)("p",{className:"text-muted-foreground/60",children:["origin: ",l.origin]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 pt-1",children:[(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>void h("accept"),className:"flex-1 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Accept"}),(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>void h("revert"),className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Revert"}),(0,t.jsx)("button",{type:"button",disabled:d,onClick:()=>{o?.(),i()},className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Comment"})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],803043),e.s(["SuggestionCard",0,function({suggestion:e,currentMarkdown:r,path:i,baseRevision:o,getLatestRevision:s,top:a,left:l,width:c,onSettled:d,readOnly:u}){let[h,p]=(0,n.useState)(!1);async function f(){if(!h){p(!0);try{let t=await K(i,o,"suggestion.accept",e.id);t.ok||409!==t.status||(t=await K(i,s(),"suggestion.accept",e.id))}finally{p(!1),d()}}}async function m(){if(!h){p(!0);try{await K(i,o,"suggestion.reject",e.id)}finally{p(!1),d()}}}let g="delete"===e.kind,y="insertAfter"===e.kind||"insertBefore"===e.kind;return(0,t.jsxs)("div",{style:{position:"absolute",top:a,left:l,width:c>0?c:void 0,zIndex:30},className:"my-1 rounded-lg border border-border bg-card shadow-md text-[12px] overflow-hidden",role:"region","aria-label":`Suggestion by ${e.by}`,children:[(0,t.jsx)("div",{className:"flex items-center justify-between px-3 py-2 bg-muted/50 border-b border-border",children:(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[(0,t.jsx)("span",{className:"text-primary",children:e.by})," suggests ",(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e){switch(e){case"replace":return"replacing this block";case"insertAfter":return"inserting content after this block";case"insertBefore":return"inserting content before this block";case"delete":return"deleting this block"}}(e.kind)})]})}),(0,t.jsxs)("div",{className:"p-3 space-y-2",children:["replace"===e.kind&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ current ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground bg-destructive/5 rounded px-2 py-1",children:r||"(empty)"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ proposed ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground bg-primary/5 rounded px-2 py-1",children:e.markdown??"(empty)"})]})]}),y&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ will be inserted ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-foreground bg-primary/5 rounded px-2 py-1",children:e.markdown??"(empty)"})]}),g&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60 mb-1",children:"─ will be deleted ─"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground line-through bg-destructive/5 rounded px-2 py-1",children:r||"(empty)"})]}),e.basisDetail&&(0,t.jsxs)("p",{className:"italic text-muted-foreground/70 text-[11px]",children:["Reason: ",e.basisDetail]})]}),!u&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-t border-border bg-muted/30",children:[(0,t.jsx)("button",{type:"button",disabled:h,onClick:()=>void f(),className:"flex-1 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Accept"}),(0,t.jsx)("button",{type:"button",disabled:h,onClick:()=>void m(),className:"flex-1 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Reject"})]})]})}],589676);let J={replace:"Replace block",insertAfter:"Insert after",insertBefore:"Insert before",delete:"Delete block"};e.s(["SuggestEditPopover",0,function({path:e,blockRef:r,currentMarkdown:i,anchor:o,onClose:s}){let[a,l]=(0,n.useState)("replace"),[c,d]=(0,n.useState)(i),[u,h]=(0,n.useState)(""),[p,f]=(0,n.useState)(!1),m=(0,n.useRef)(null);(0,n.useEffect)(()=>{"replace"===a?d(i):d("")},[a,i]),(0,n.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,n.useEffect)(()=>{setTimeout(()=>m.current?.focus(),50)},[]);let g="delete"!==a,y=!p&&(!g||c.trim().length>0);async function b(){if(y){f(!0);try{let t={type:"suggestion.add",ref:r,kind:a,basis:"suggested"};g&&(t.markdown=c),u.trim()&&(t.basisDetail=u.trim());let n=F.useProofStore.getState().byPath[e]?.snapshotRevision??0,i=await q(e,n,[t]);!i.ok&&i.stale&&void 0!==i.newRevision&&(await F.useProofStore.getState().loadSidecar(e),n=i.newRevision,i=await q(e,n,[t])),i.ok&&(await F.useProofStore.getState().loadSidecar(e),await F.useProofStore.getState().loadSnapshot(e),s())}finally{f(!1)}}}return(0,t.jsxs)(C,{open:!0,children:[(0,t.jsx)(M,{asChild:!0,children:(0,t.jsx)("span",{"aria-hidden":"true",style:{position:"fixed",top:o.top,left:o.left,width:0,height:0,pointerEvents:"none"}})}),(0,t.jsx)(O,{children:(0,t.jsxs)(j,{side:"bottom",align:"start",sideOffset:4,collisionPadding:8,onInteractOutside:s,className:"z-50 w-[min(20rem,calc(100vw-1rem))] bg-popover border border-border rounded-lg shadow-xl p-3 space-y-2.5 text-[12px] focus:outline-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-medium text-foreground",children:"Suggest an edit"}),(0,t.jsx)("span",{className:"text-[11px] font-mono text-muted-foreground/60 truncate ml-2",children:r})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.keys(J).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>l(e),className:`px-2 py-0.5 rounded-md text-[10.5px] border transition-colors ${a===e?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:bg-accent"}`,children:J[e]},e))}),"delete"===a&&(0,t.jsx)("pre",{className:"whitespace-pre-wrap font-mono text-[11px] text-muted-foreground line-through bg-destructive/5 rounded px-2 py-1 max-h-32 overflow-y-auto",children:i||"(empty)"}),g&&(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground/60",children:"replace"===a?"proposed content":"content to insert"}),(0,t.jsx)("textarea",{ref:m,value:c,onChange:e=>d(e.target.value),rows:4,placeholder:"Markdown…",className:"w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 font-mono text-[11px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"})]}),(0,t.jsx)("input",{type:"text",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&b()},placeholder:"Reason (optional)",className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-[12px] focus:outline-none focus-visible:ring-1 focus-visible:ring-ring placeholder:text-muted-foreground/40"}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-0.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground/40",children:"⌘↵ submit"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",disabled:p,onClick:s,className:"px-2.5 py-1 rounded-md border border-border text-[11px] font-medium hover:bg-accent disabled:opacity-50 transition-colors",children:"Cancel"}),(0,t.jsx)("button",{type:"button",disabled:!y,onClick:()=>void b(),className:"px-2.5 py-1 rounded-md bg-primary text-primary-foreground text-[11px] font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors",children:"Suggest"})]})]}),(0,t.jsx)($,{className:"fill-border"})]})})]})}],294250);let G=(0,e.i(605993).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["AlertTriangle",0,G],955537)},73302,e=>{"use strict";let t=(0,e.i(605993).default)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);e.s(["File",0,t],73302)},203195,521470,623616,794469,877031,152555,e=>{"use strict";var t=e.i(44501),n=e.i(955537),r=e.i(987027),i=e.i(674155),o=e.i(73302),s=e.i(395330),a=e.i(398441),l=e.i(977112),c=e.i(799916),d=e.i(605993);let u=(0,d.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var h=e.i(853840),p=e.i(864255),f=e.i(991685),m=e.i(703550);let g=(0,d.default)("sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]),y=(0,d.default)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var b=e.i(109680),v=e.i(978375),w=e.i(101685),x=e.i(975157),k=e.i(96701),S=e.i(512527);let C=[{label:"Text",icon:b.Type,description:"Start writing plain text",category:"basic",action:{type:"direct",run:e=>e.chain().focus().setParagraph().run()}},{label:"Heading 1",icon:s.Heading1,description:"Large section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:1}).run()}},{label:"Heading 2",icon:a.Heading2,description:"Medium section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:2}).run()}},{label:"Heading 3",icon:l.Heading3,description:"Small section heading",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleHeading({level:3}).run()}},{label:"Bullet List",icon:h.List,description:"Create a bullet list",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleBulletList().run()}},{label:"Numbered List",icon:p.ListOrdered,description:"Create a numbered list",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleOrderedList().run()}},{label:"Checklist",icon:r.CheckSquare,description:"Create a task checklist",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleTaskList().run()}},{label:"Code Block",icon:i.Code,description:"Insert a code block",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleCodeBlock().run()}},{label:"Blockquote",icon:m.Quote,description:"Insert a blockquote",category:"basic",action:{type:"direct",run:e=>e.chain().focus().toggleBlockquote().run()}},{label:"Divider",icon:f.Minus,description:"Insert a horizontal rule",category:"basic",action:{type:"direct",run:e=>e.chain().focus().setHorizontalRule().run()}},{label:"Table",icon:y,description:"Insert a 3x3 table",category:"basic",action:{type:"direct",run:e=>e.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}},{label:"Image",icon:c.ImageIcon,description:"Upload, paste URL, or drop an image",category:"media",action:{type:"popover",kind:{type:"media",kind:"image"}}},{label:"Video",icon:v.Video,description:"Upload or paste a video URL",category:"media",action:{type:"popover",kind:{type:"media",kind:"video"}}},{label:"File",icon:o.File,description:"Attach any file to this page",category:"media",action:{type:"popover",kind:{type:"media",kind:"file"}}},{label:"Callout",icon:u,description:"Insert an info callout",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().wrapIn("callout",{type:"info"}).run()}},{label:"Warning",icon:n.AlertTriangle,description:"Insert a warning callout",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().wrapIn("callout",{type:"warning"}).run()}},{label:"Math",icon:g,description:"Insert a LaTeX math expression",category:"advanced",action:{type:"direct",run:e=>e.chain().focus().insertContent("$x=y$").run()}}];function E({cmd:e}){switch(e.label){case"Heading 1":return(0,t.jsx)("p",{className:"font-bold text-[18px] leading-tight text-foreground/80 truncate",children:"Heading 1"});case"Heading 2":return(0,t.jsx)("p",{className:"font-semibold text-[14px] leading-tight text-foreground/80 truncate",children:"Heading 2"});case"Heading 3":return(0,t.jsx)("p",{className:"font-medium text-[12px] leading-tight text-foreground/80 truncate",children:"Heading 3"});case"Text":return(0,t.jsx)("p",{className:"text-[11px] text-foreground/60 leading-snug",children:"The quick brown fox jumps over the lazy dog."});case"Bullet List":return(0,t.jsxs)("ul",{className:"list-disc pl-4 text-[10px] text-foreground/60 space-y-0.5",children:[(0,t.jsx)("li",{children:"First item"}),(0,t.jsx)("li",{children:"Second item"}),(0,t.jsx)("li",{children:"Third item"})]});case"Numbered List":return(0,t.jsxs)("ol",{className:"list-decimal pl-4 text-[10px] text-foreground/60 space-y-0.5",children:[(0,t.jsx)("li",{children:"First item"}),(0,t.jsx)("li",{children:"Second item"}),(0,t.jsx)("li",{children:"Third item"})]});case"Checklist":return(0,t.jsxs)("div",{className:"space-y-0.5 text-[10px] text-foreground/60",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 border border-foreground/30 rounded-sm inline-block shrink-0"}),"Pending task"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"w-3 h-3 border border-foreground/30 rounded-sm bg-foreground/20 inline-block shrink-0"}),"Done task"]})]});case"Code Block":return(0,t.jsx)("pre",{className:"bg-muted rounded px-2 py-1 text-[10px] font-mono text-foreground/70 leading-snug",children:(0,t.jsx)("code",{children:"const x = 42;"})});case"Blockquote":return(0,t.jsx)("div",{className:"border-l-2 border-foreground/30 pl-2 text-[10px] text-foreground/60 italic",children:"A thought worth quoting."});case"Divider":return(0,t.jsx)("hr",{className:"border-foreground/20 w-full"});case"Table":return(0,t.jsxs)("table",{className:"text-[9px] border-collapse w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:["Col A","Col B","Col C"].map(e=>(0,t.jsx)("th",{className:"border border-foreground/20 px-1.5 py-0.5 text-left font-semibold bg-muted/50 text-foreground/70",children:e},e))})}),(0,t.jsx)("tbody",{children:[["1","2","3"],["4","5","6"]].map((e,n)=>(0,t.jsx)("tr",{children:e.map((e,n)=>(0,t.jsx)("td",{className:"border border-foreground/20 px-1.5 py-0.5 text-foreground/50",children:e},n))},n))})]});case"Image":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(c.ImageIcon,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"image.png"})]});case"Video":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(v.Video,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"video.mp4"})]});case"File":return(0,t.jsxs)("div",{className:"flex items-center gap-2 text-foreground/50",children:[(0,t.jsx)(o.File,{className:"h-8 w-8 text-foreground/20"}),(0,t.jsx)("span",{className:"text-[10px]",children:"attachment.pdf"})]});case"Callout":return(0,t.jsxs)("div",{className:"flex items-start gap-1.5 bg-blue-500/10 border border-blue-500/20 rounded px-2 py-1",children:[(0,t.jsx)(u,{className:"h-3 w-3 text-blue-500 shrink-0 mt-0.5"}),(0,t.jsx)("span",{className:"text-[10px] text-foreground/60",children:"Info callout"})]});case"Warning":return(0,t.jsxs)("div",{className:"flex items-start gap-1.5 bg-warning/10 border border-warning/20 rounded px-2 py-1",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-3 w-3 text-warning shrink-0 mt-0.5"}),(0,t.jsx)("span",{className:"text-[10px] text-foreground/60",children:"Warning callout"})]});case"Math":return(0,t.jsx)("p",{className:"font-mono text-[13px] text-foreground/70",children:"E = mc²"});default:return(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground",children:e.description})}}function M(e){let t=[],n=new Map;return e.state.doc.forEach((e,r)=>{if("heading"===e.type.name){let i=e.textContent,o=e.attrs.level,s=i.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"")||"heading",a=(n.get(s)??0)+1;n.set(s,a);let l=1===a?s:`${s}-${a}`;t.push({level:o,text:i,pos:r,uid:l})}}),t}e.s(["SlashCommands",0,function({editor:e}){let[n,r]=(0,w.useState)(!1),[i,o]=(0,w.useState)(""),[s,a]=(0,w.useState)(0),[l,c]=(0,w.useState)({top:0,left:0}),[d,u]=(0,w.useState)(null),h=(0,w.useRef)(null),p=(0,k.useEditorStore)(e=>e.currentPath),f=C.filter(e=>e.label.toLowerCase().includes(i.toLowerCase())||e.description.toLowerCase().includes(i.toLowerCase())),m=(0,w.useCallback)(()=>{r(!1),o(""),a(0)},[]),g=(0,w.useCallback)(t=>{if(!e)return;let{from:n}=e.state.selection,s=n-i.length-1;e.chain().focus().deleteRange({from:s,to:n}).run(),"direct"===t.action.type?(t.action.run(e),m()):(u(t.action.kind),r(!1),o(""))},[e,i,m]);if((0,w.useEffect)(()=>{if(!e)return;let t=t=>{if(!n){if("/"===t.key){let{from:t}=e.state.selection,n=e.state.doc.textBetween(Math.max(0,t-1),t);if(1===t||""===n||"\n"===n||" "===n){let n=e.view.coordsAtPos(t),i=e.view.dom.getBoundingClientRect();c({top:n.bottom-i.top+4,left:n.left-i.left}),r(!0),o(""),a(0)}}return}"Escape"===t.key?(t.preventDefault(),m()):"ArrowDown"===t.key?(t.preventDefault(),a(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),a(e=>Math.max(e-1,0))):"Enter"===t.key?(t.preventDefault(),f[s]&&g(f[s])):"Backspace"===t.key?0===i.length?m():(o(e=>e.slice(0,-1)),a(0)):" "===t.key?m():1!==t.key.length||t.metaKey||t.ctrlKey||(o(e=>e+t.key),a(0))};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,n,i,s,f,m,g]),(0,w.useEffect)(()=>{if(!n)return;let e=e=>{h.current&&!h.current.contains(e.target)&&m()};return window.addEventListener("mousedown",e),()=>window.removeEventListener("mousedown",e)},[n,m]),(!n||0===f.length)&&!d)return null;let y=new Map;for(let e of f){let t=y.get(e.category)??[];t.push(e),y.set(e.category,t)}let b=f[s]??null;return(0,t.jsxs)(t.Fragment,{children:[n&&f.length>0&&(0,t.jsxs)("div",{ref:h,className:"absolute z-50 w-[280px] bg-popover border border-border rounded-lg shadow-lg overflow-hidden",style:{top:l.top,left:l.left},children:[(0,t.jsx)("div",{className:"max-h-[300px] overflow-y-auto py-1",children:[{key:"basic",title:"Basic"},{key:"media",title:"Media"},{key:"advanced",title:"Advanced"}].map(e=>{let n=y.get(e.key);return n&&0!==n.length?(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[9px] uppercase tracking-wider text-muted-foreground px-3 pt-2 pb-1",children:e.title}),n.map(e=>{let n=f.indexOf(e),r=e.icon,i=n===s;return(0,t.jsxs)("button",{onMouseDown:t=>{t.preventDefault(),g(e)},onMouseEnter:()=>a(n),className:(0,x.cn)("flex items-center gap-3 w-full px-3 py-1.5 text-left transition-colors",i?"bg-accent text-accent-foreground ring-1 ring-inset ring-accent-foreground/10":"hover:bg-accent/50"),children:[(0,t.jsx)(r,{className:(0,x.cn)("h-4 w-4 shrink-0 transition-colors",i?"text-accent-foreground":"text-muted-foreground")}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:"text-[12px] font-medium truncate",children:e.label}),(0,t.jsx)("p",{className:(0,x.cn)("text-[10px] truncate transition-colors",i?"text-accent-foreground/70":"text-muted-foreground"),children:e.description})]})]},e.label)})]},e.key):null})}),b&&(0,t.jsx)("div",{className:"border-t border-border bg-muted/30 px-3 py-2 min-h-[52px] flex items-center",children:(0,t.jsx)(E,{cmd:b})})]}),d&&e?"media"===d.type?p?(0,t.jsx)(S.MediaPopover,{kind:d.kind,pagePath:p,anchor:l,onCancel:()=>u(null),onInsert:t=>((t,n)=>{if(!e)return;let{url:r,alt:i,mimeType:o}=n;"image"===t||(o??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|svg|avif)(\?|$)/i.test(r)?e.chain().focus().setImage({src:r,alt:i??""}).run():e.chain().focus().insertContent(`<a href="${r}">${i??r}</a>`).run(),u(null)})(d.kind,t)}):null:null:null]})}],203195),e.s(["DocumentOutline",0,function({editor:e,scrollContainerRef:n}){let[r,i]=(0,w.useState)([]),[o,s]=(0,w.useState)(null),[a,l]=(0,w.useState)(!1),[c,d]=(0,w.useState)(0),u=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=null,n=()=>{t&&clearTimeout(t),t=setTimeout(()=>i(M(e)),250)};return e.on("update",n),i(M(e)),()=>{t&&clearTimeout(t),e.off("update",n)}},[e]),(0,w.useEffect)(()=>{let e=n.current;if(!e)return;let t=0,r=()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>{let t=e.scrollHeight-e.clientHeight;d(t>0?Math.min(1,e.scrollTop/t):0)})};return e.addEventListener("scroll",r,{passive:!0}),()=>{e.removeEventListener("scroll",r),cancelAnimationFrame(t)}},[n]),(0,w.useEffect)(()=>{u.current?.disconnect();let t=n.current;if(!t||!e||0===r.length)return;let i=new IntersectionObserver(e=>{for(let t of e)if(t.isIntersecting){let e=t.target.dataset.outlineId;e&&s(e)}},{root:t,rootMargin:"-8% 0px -72% 0px",threshold:0});for(let t of r)try{let{node:n}=e.view.domAtPos(t.pos+1),r=n.nodeType===Node.ELEMENT_NODE?n.closest("h1,h2,h3,h4,h5,h6")??n:n.parentElement?.closest("h1,h2,h3,h4,h5,h6")??null;r&&(r.dataset.outlineId=t.uid,i.observe(r))}catch{}return u.current=i,()=>{i.disconnect()}},[r,e,n]);let p=(0,w.useCallback)(t=>{if(e)try{let{node:n}=e.view.domAtPos(t.pos+1),r=n.nodeType===Node.ELEMENT_NODE?n.closest("h1,h2,h3,h4,h5,h6")??n:n.parentElement?.closest("h1,h2,h3,h4,h5,h6")??null;r?.scrollIntoView({behavior:"smooth",block:"start"})}catch{}},[e]),f=r.length>=2,[m,g]=(0,w.useState)(!1),y=(0,t.jsx)(t.Fragment,{children:r.map((e,n)=>(0,t.jsx)("button",{onClick:()=>{p(e),g(!1)},title:e.text,className:(0,x.cn)("text-left text-[10.5px] leading-snug py-0.5 rounded truncate transition-colors shrink-0",o===e.uid?"text-primary bg-primary/10 font-medium":"text-muted-foreground/60 hover:text-foreground hover:bg-accent"),style:{paddingLeft:`${(e.level-1)*8+4}px`},children:e.text},`${e.uid}-${n}`))});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":!0,className:"absolute top-0 left-0 right-0 h-0.5 z-30 pointer-events-none",children:(0,t.jsx)("div",{className:"h-full bg-primary/35 transition-[width] duration-100 ease-out",style:{width:`${100*c}%`}})}),f&&(0,t.jsxs)("div",{className:"absolute right-1 top-4 z-20 hidden xl:block w-40",children:[(0,t.jsxs)("button",{onClick:()=>l(e=>!e),className:"flex items-center gap-1 mb-1.5 px-1 py-0.5 rounded text-muted-foreground/40 hover:text-muted-foreground hover:bg-accent transition-colors text-[10px]","aria-label":a?"Expand outline":"Collapse outline",children:[(0,t.jsx)(h.List,{className:"h-3 w-3"}),!a&&(0,t.jsx)("span",{children:"Outline"})]}),!a&&(0,t.jsx)("nav",{"aria-label":"Document outline",className:"flex flex-col gap-px max-h-[50vh] overflow-y-auto pr-1",children:y})]}),f&&(0,t.jsxs)("div",{className:"absolute right-2 top-2 z-30 xl:hidden",children:[(0,t.jsx)("button",{onClick:()=>g(e=>!e),className:"flex items-center gap-1 px-1.5 py-1 rounded bg-background/80 backdrop-blur border border-border/60 text-muted-foreground/60 hover:text-foreground hover:bg-accent transition-colors text-[10px] shadow-sm","aria-label":"Document outline","aria-expanded":m,children:(0,t.jsx)(h.List,{className:"h-3.5 w-3.5"})}),m&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{"aria-hidden":!0,tabIndex:-1,className:"fixed inset-0 z-0 cursor-default",onClick:()=>g(!1)}),(0,t.jsx)("nav",{"aria-label":"Document outline",className:"absolute right-0 top-9 z-10 w-52 max-h-[60vh] overflow-y-auto flex flex-col gap-px rounded-lg border border-border bg-popover p-2 shadow-lg",children:y})]})]})]})}],521470);var N=e.i(367092),A=e.i(10137);let T=(0,d.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),R=(0,d.default)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);var O=e.i(671485),D=e.i(246542);e.s(["BacklinksPanel",0,function({currentPath:e}){let[n,r]=(0,w.useState)([]),[i,o]=(0,w.useState)(!1),[s,a]=(0,w.useState)(!1),l=(0,D.useWikiSlugsStore)(e=>e.has);return((0,w.useEffect)(()=>{if(!e)return;let t=!1;o(!0),r([]);let n=setTimeout(()=>{(async()=>{try{let n=await (0,O.wsFetch)(`/api/wiki/backlinks?path=${encodeURIComponent(e)}`),i=n.ok?await n.json():{backlinks:[]};if(t)return;r(i.backlinks??[])}catch{t||r([])}finally{t||o(!1)}})()},200);return()=>{t=!0,clearTimeout(n)}},[e]),i||0!==n.length)?(0,t.jsx)("div",{className:"max-w-[var(--editor-max-w,48rem)] mx-auto px-4 sm:px-8 pb-8 pt-1",children:(0,t.jsxs)("div",{className:"border-t border-border/60 pt-4",children:[(0,t.jsxs)("button",{onClick:()=>a(e=>!e),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60 hover:text-muted-foreground transition-colors mb-2","aria-expanded":!s,children:[s?(0,t.jsx)(A.ChevronRight,{className:"h-3 w-3 shrink-0"}):(0,t.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(T,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"font-medium",children:"Linked from"}),n.length>0&&(0,t.jsxs)("span",{className:"opacity-50 tabular-nums",children:["(",n.length,")"]}),i&&(0,t.jsx)("span",{className:"opacity-40 ml-1",children:"…"})]}),!s&&n.length>0&&(0,t.jsx)("ul",{className:"flex flex-col gap-1.5",children:n.map(e=>{var n,r;let i,o=l(((n=e.path).split("/").pop()??n).replace(/\.md$/i,""));return(0,t.jsxs)("li",{className:"flex flex-col",children:[(0,t.jsxs)("button",{onClick:()=>o&&k.useEditorStore.getState().loadPage(e.path),className:o?"text-left text-[12px] text-primary/70 hover:text-primary hover:underline underline-offset-2 truncate transition-colors flex items-center gap-1":"text-left text-[12px] text-muted-foreground/40 truncate cursor-default flex items-center gap-1",title:o?e.path:`${e.path} (file not found)`,children:[!o&&(0,t.jsx)(R,{className:"h-2.5 w-2.5 shrink-0 text-muted-foreground/30"}),(i=(r=e.path).replace(/\.md$/i,"").split("/")).length>1?i.slice(-2).join(" / "):i[0]??r]}),e.snippet&&(0,t.jsx)("p",{className:o?"text-[10.5px] text-muted-foreground/50 line-clamp-1 mt-0.5":"text-[10.5px] text-muted-foreground/25 line-clamp-1 mt-0.5",children:e.snippet})]},e.path)})})]})}):null}],623616),e.i(150663);var j=e.i(608926),I=e.i(153840);let P=(0,d.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),L=(0,d.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,L],794469);let _=(0,d.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),z=(0,d.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),$=(0,d.default)("columns-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]),H=(0,d.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);e.s(["PanelLeft",0,H],877031);let B=(0,d.default)("panel-top",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]),F=(0,d.default)("rows-3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var V=e.i(920978);function U({label:e,icon:n,disabled:r,active:i,danger:o,onAction:s}){return(0,t.jsx)("button",{type:"button","aria-label":e,title:e,disabled:r,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.preventDefault(),s()},className:(0,x.cn)("h-7 w-7 inline-flex items-center justify-center rounded text-foreground/80 hover:bg-accent transition-colors disabled:pointer-events-none disabled:opacity-35",i&&"bg-accent text-foreground",o&&"text-destructive hover:bg-destructive/10"),children:(0,t.jsx)(n,{className:"h-3.5 w-3.5"})})}function W(){return(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-border"})}e.s(["TableMenu",0,function({editor:e}){if(!e)return null;let n=()=>{if(!(0,j.isInTable)(e.state))return null;try{return(0,j.selectedRect)(e.state)}catch{return null}},r=t=>{t()&&(e.commands.focus(),e.commands.fixTables())},i=t=>{let r=n();if(!r)return;let i=r.top,o=i+t;o<0||o>=r.map.height||((0,j.moveTableRow)({from:i,to:o})(e.state,e.view.dispatch),e.commands.focus())},o=t=>{let r=n();if(!r)return;let i=r.left,o=i+t;o<0||o>=r.map.width||((0,j.moveTableColumn)({from:i,to:o})(e.state,e.view.dispatch),e.commands.focus())},s=n(),a=!!s&&s.top>0,l=!!s&&s.top<s.map.height-1,c=!!s&&s.left>0,d=!!s&&s.left<s.map.width-1;return(0,t.jsxs)(I.BubbleMenu,{editor:e,pluginKey:"tableMenu",options:{placement:"top",offset:10},shouldShow:({editor:e})=>e.isActive("table"),className:"flex items-center gap-0.5 rounded-md border border-border bg-popover px-1 py-1 shadow-lg",children:[(0,t.jsx)(U,{label:"Select cell text",icon:y,onAction:()=>{let t=(0,j.cellAround)(e.state.selection.$from),n=t?.nodeAfter;t&&n&&e.chain().focus().setTextSelection({from:t.pos+1,to:t.pos+n.nodeSize-1}).run()}}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Add row above",icon:F,onAction:()=>r(()=>e.chain().focus().addRowBefore().run())}),(0,t.jsx)(U,{label:"Add row below",icon:P,onAction:()=>r(()=>e.chain().focus().addRowAfter().run())}),(0,t.jsx)(U,{label:"Move row up",icon:z,disabled:!a,onAction:()=>i(-1)}),(0,t.jsx)(U,{label:"Move row down",icon:P,disabled:!l,onAction:()=>i(1)}),(0,t.jsx)(U,{label:"Delete row",icon:V.Trash2,danger:!0,onAction:()=>r(()=>e.chain().focus().deleteRow().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Add column before",icon:$,onAction:()=>r(()=>e.chain().focus().addColumnBefore().run())}),(0,t.jsx)(U,{label:"Add column after",icon:_,onAction:()=>r(()=>e.chain().focus().addColumnAfter().run())}),(0,t.jsx)(U,{label:"Move column left",icon:L,disabled:!c,onAction:()=>o(-1)}),(0,t.jsx)(U,{label:"Move column right",icon:_,disabled:!d,onAction:()=>o(1)}),(0,t.jsx)(U,{label:"Delete column",icon:V.Trash2,danger:!0,onAction:()=>r(()=>e.chain().focus().deleteColumn().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Toggle header row",icon:B,onAction:()=>r(()=>e.chain().focus().toggleHeaderRow().run())}),(0,t.jsx)(U,{label:"Toggle header column",icon:H,onAction:()=>r(()=>e.chain().focus().toggleHeaderColumn().run())}),(0,t.jsx)(W,{}),(0,t.jsx)(U,{label:"Delete table",icon:V.Trash2,danger:!0,onAction:()=>e.chain().focus().deleteTable().run()})]})}],152555)},46951,e=>{"use strict";var t=e.i(101685),n=e.i(291967),r=e.i(967928),i=e.i(543250),o=e.i(433616),s=e.i(417256),a=e.i(348989),l=e.i(445424),c=e.i(332374),d=e.i(190088),u=e.i(980939),h=e.i(539340),p=e.i(206500),f=e.i(73772),m=e.i(652053),g=e.i(44501),y="Dialog",[b,v]=(0,i.createContextScope)(y),[w,x]=b(y),k=e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=t.useRef(null),u=t.useRef(null),[h,p]=(0,s.useControllableState)({prop:i,defaultProp:a??!1,onChange:l,caller:y});return(0,g.jsx)(w,{scope:n,triggerRef:d,contentRef:u,contentId:(0,o.useId)(),titleId:(0,o.useId)(),descriptionId:(0,o.useId)(),open:h,onOpenChange:p,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),modal:c,children:r})};k.displayName=y;var S="DialogTrigger",C=t.forwardRef((e,t)=>{let{__scopeDialog:i,...o}=e,s=x(S,i),a=(0,r.useComposedRefs)(t,s.triggerRef);return(0,g.jsx)(u.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":U(s.open),...o,ref:a,onClick:(0,n.composeEventHandlers)(e.onClick,s.onOpenToggle)})});C.displayName=S;var E="DialogPortal",[M,N]=b(E,{forceMount:void 0}),A=e=>{let{__scopeDialog:n,forceMount:r,children:i,container:o}=e,s=x(E,n);return(0,g.jsx)(M,{scope:n,forceMount:r,children:t.Children.map(i,e=>(0,g.jsx)(d.Presence,{present:r||s.open,children:(0,g.jsx)(c.Portal,{asChild:!0,container:o,children:e})}))})};A.displayName=E;var T="DialogOverlay",R=t.forwardRef((e,t)=>{let n=N(T,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=x(T,e.__scopeDialog);return o.modal?(0,g.jsx)(d.Presence,{present:r||o.open,children:(0,g.jsx)(D,{...i,ref:t})}):null});R.displayName=T;var O=(0,m.createSlot)("DialogOverlay.RemoveScroll"),D=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(T,n);return(0,g.jsx)(p.RemoveScroll,{as:O,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(u.Primitive.div,{"data-state":U(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),j="DialogContent",I=t.forwardRef((e,t)=>{let n=N(j,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=x(j,e.__scopeDialog);return(0,g.jsx)(d.Presence,{present:r||o.open,children:o.modal?(0,g.jsx)(P,{...i,ref:t}):(0,g.jsx)(L,{...i,ref:t})})});I.displayName=j;var P=t.forwardRef((e,i)=>{let o=x(j,e.__scopeDialog),s=t.useRef(null),a=(0,r.useComposedRefs)(i,o.contentRef,s);return t.useEffect(()=>{let e=s.current;if(e)return(0,f.hideOthers)(e)},[]),(0,g.jsx)(_,{...e,ref:a,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,n.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:(0,n.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),L=t.forwardRef((e,n)=>{let r=x(j,e.__scopeDialog),i=t.useRef(!1),o=t.useRef(!1);return(0,g.jsx)(_,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(o.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&o.current&&t.preventDefault()}})}),_=t.forwardRef((e,n)=>{let{__scopeDialog:i,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,...d}=e,u=x(j,i),p=t.useRef(null),f=(0,r.useComposedRefs)(n,p);return(0,h.useFocusGuards)(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:c,children:(0,g.jsx)(a.DismissableLayer,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":U(u.open),...d,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(J,{titleId:u.titleId}),(0,g.jsx)(G,{contentRef:p,descriptionId:u.descriptionId})]})]})}),z="DialogTitle",$=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(z,n);return(0,g.jsx)(u.Primitive.h2,{id:i.titleId,...r,ref:t})});$.displayName=z;var H="DialogDescription",B=t.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=x(H,n);return(0,g.jsx)(u.Primitive.p,{id:i.descriptionId,...r,ref:t})});B.displayName=H;var F="DialogClose",V=t.forwardRef((e,t)=>{let{__scopeDialog:r,...i}=e,o=x(F,r);return(0,g.jsx)(u.Primitive.button,{type:"button",...i,ref:t,onClick:(0,n.composeEventHandlers)(e.onClick,()=>o.onOpenChange(!1))})});function U(e){return e?"open":"closed"}V.displayName=F;var W="DialogTitleWarning",[K,q]=(0,i.createContext)(W,{contentName:j,titleName:z,docsSlug:"dialog"}),J=({titleId:e})=>{let n=q(W),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
110
110
 
111
111
  If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
112
112
 
113
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},G=({contentRef:e,descriptionId:n})=>{let r=q("DialogDescriptionWarning"),i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");n&&t&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null};e.s(["Close",0,V,"Content",0,I,"Description",0,B,"Overlay",0,R,"Portal",0,A,"Root",0,k,"Title",0,$,"Trigger",0,C])},22245,e=>{"use strict";let t=(0,e.i(605993).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],22245)},776639,e=>{"use strict";var t=e.i(44501),n=e.i(46951),r=e.i(22245),i=e.i(101685),o=e.i(975157);let s=n.Root;n.Trigger;let a=n.Portal;n.Close;let l=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Overlay,{ref:i,className:(0,o.cn)("fixed inset-0 z-40 bg-overlay backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));l.displayName=n.Overlay.displayName;let c=i.forwardRef(({className:e,children:i,...s},c)=>(0,t.jsxs)(a,{children:[(0,t.jsx)(l,{}),(0,t.jsxs)(n.Content,{ref:c,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-golden rounded-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...s,children:[i,(0,t.jsxs)(n.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(r.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));function d({className:e,...n}){return(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left min-w-0",e),...n})}function u({className:e,...n}){return(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n})}c.displayName=n.Content.displayName,d.displayName="DialogHeader",u.displayName="DialogFooter";let h=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Title,{ref:i,className:(0,o.cn)("text-lg font-normal leading-none tracking-tight",e),...r}));h.displayName=n.Title.displayName;let p=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Description,{ref:i,className:(0,o.cn)("text-sm text-muted-foreground break-words",e),...r}));p.displayName=n.Description.displayName,e.s(["Dialog",0,s,"DialogContent",0,c,"DialogDescription",0,p,"DialogFooter",0,u,"DialogHeader",0,d,"DialogTitle",0,h])},912235,110204,66076,e=>{"use strict";var t=e.i(44501);e.i(150663);var n=e.i(608926),r=e.i(885047),i=e.i(425732),o=e.i(43240),s=e.i(313393),a=e.i(530229),l=e.i(691520),c=e.i(231597),d=e.i(101685),u=e.i(417068),h=e.i(797715),p=e.i(660885),f=e.i(490275),m=e.i(24800),g=e.i(96701),y=e.i(990791),b=e.i(395624),v=e.i(246542),w=e.i(592185),x=e.i(926732),k=e.i(671485),S=e.i(417385),C=e.i(582612),E=e.i(240409),M=e.i(314206),N=e.i(496668),A=e.i(665794),T=e.i(926128),R=e.i(803043),O=e.i(589676),D=e.i(294250),j=e.i(203195),I=e.i(521470),P=e.i(623616),L=e.i(152555),_=e.i(519455),z=e.i(776639),$=e.i(793479),H=e.i(750110),B=d.forwardRef((e,n)=>(0,t.jsx)(H.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));B.displayName="Label";var F=e.i(294237),V=e.i(975157);let U=(0,F.cva)("text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),W=d.forwardRef(({className:e,...n},r)=>(0,t.jsx)(B,{ref:r,className:(0,V.cn)(U(),e),...n}));W.displayName=B.displayName,e.s(["Label",0,W],110204);let K=["entities","concepts","comparisons"],q=/^[a-z0-9-]+$/;function J({editor:e,onCreateRequest:n}){let[r,i]=(0,d.useState)(!1),[o,s]=(0,d.useState)(""),[a,l]=(0,d.useState)(0),[c,u]=(0,d.useState)({top:0,left:0}),h=(0,d.useRef)(null),p=(0,d.useRef)(0),f=(0,v.useWikiSlugsStore)(e=>e.slugs),m=(0,v.useWikiSlugsStore)(e=>e.slugDir),g=(0,v.useWikiSlugsStore)(e=>e.has),y=Array.from(f).sort().filter(e=>!o||e.includes(o.toLowerCase())).slice(0,20),b=o.length>0&&q.test(o)&&!g(o),w=y.length+ +!!b,x=(0,d.useCallback)(()=>{i(!1),s(""),l(0)},[]),k=(0,d.useCallback)(t=>{if(!e)return;let{from:n}=e.state.selection,r=p.current-2,i=e.state.schema.marks.wikiLink;if(!i)return;let o=i.create({slug:t,alias:null,anchor:null}),s=e.state.schema.text(t,[o]),a=e.state.tr.replaceWith(r,n,s);e.view.dispatch(a),e.commands.focus(),x()},[e,x]),S=(0,d.useCallback)(async t=>{if(e){if(t<y.length)k(y[t]??"");else if(b){let e=await n(o);e.ok?k(e.slug):x()}}},[e,y,b,o,k,n,x]);return((0,d.useEffect)(()=>{if(!e)return;let t=t=>{if(!r){if("["===t.key){let{from:t}=e.state.selection;if("["!==e.state.doc.textBetween(Math.max(0,t-1),t)||e.state.doc.resolve(t).marks().some(e=>"wikiLink"===e.type.name))return;let n=e.view.coordsAtPos(t),r=e.view.dom.getBoundingClientRect();u({top:n.bottom-r.top+4,left:n.left-r.left}),p.current=t+1,i(!0),s(""),l(0)}return}"ArrowDown"===t.key?(t.preventDefault(),l(e=>w>0?(e+1)%w:0)):"ArrowUp"===t.key?(t.preventDefault(),l(e=>w>0?(e-1+w)%w:0)):"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),w>0&&S(a)):"Escape"===t.key||"]"===t.key?x():"Backspace"===t.key?0===o.length?x():(s(e=>e.slice(0,-1)),l(0)):1!==t.key.length||t.metaKey||t.ctrlKey||(s(e=>e+t.key),l(0))};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,r,o,a,w,x,S]),(0,d.useEffect)(()=>{if(!r)return;let e=e=>{h.current&&!h.current.contains(e.target)&&x()};return window.addEventListener("mousedown",e),()=>window.removeEventListener("mousedown",e)},[r,x]),r&&0!==w)?(0,t.jsxs)("div",{ref:h,className:"absolute z-50 w-[280px] bg-popover border border-border rounded-lg shadow-lg py-1 overflow-hidden max-h-[300px] overflow-y-auto",style:{top:c.top,left:c.left},children:[y.map((e,n)=>{let r=m.get(e);return(0,t.jsxs)("button",{type:"button",onMouseDown:e=>{e.preventDefault(),S(n)},onMouseEnter:()=>l(n),className:(0,V.cn)("flex items-center justify-between w-full px-3 py-1.5 text-left text-sm transition-colors",n===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[(0,t.jsx)("span",{className:"truncate",children:e}),r&&(0,t.jsx)("span",{className:"ml-2 shrink-0 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:r})]},e)}),b&&(0,t.jsx)("button",{type:"button",onMouseDown:e=>{e.preventDefault(),S(y.length)},onMouseEnter:()=>l(y.length),className:(0,V.cn)("flex items-center w-full px-3 py-1.5 text-left text-sm transition-colors",y.length===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:(0,t.jsxs)("span",{className:"text-muted-foreground",children:["+ Create new “",o,"”"]})})]}):null}var G=e.i(367092),X=e.i(10137);let Z=(0,F.cva)("inline-flex items-center rounded-sm border px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-e-1",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-e-1",outline:"text-foreground",accent:"border-transparent bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}});function Y({className:e,variant:n,...r}){return(0,t.jsx)("div",{className:(0,V.cn)(Z({variant:n}),e),...r})}let Q=new Set(["title","type","status","created","updated","date","tags","sources","private","supersedes","superseded_by"]);function ee({data:e}){let[n,r]=(0,d.useState)(!1),i=Object.keys(e);if(0===i.length)return null;let o="string"==typeof e.title?e.title:null,s="string"==typeof e.type?e.type:null,a="string"==typeof e.status?e.status:null,l="string"==typeof e.created?e.created:null,c="string"==typeof e.updated?e.updated:null,u=!0===e.private,h=Array.isArray(e.tags)?e.tags:[],p=Array.isArray(e.sources)?e.sources:[],f="string"==typeof e.superseded_by?e.superseded_by:null,m=i.filter(e=>!Q.has(e));return(0,t.jsxs)("div",{className:"mb-6 rounded-sm border bg-card/40 px-4 py-3 text-xs",children:[o&&(0,t.jsx)("div",{className:"mb-2 text-base font-normal text-foreground",children:o}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-muted-foreground",children:[s&&(0,t.jsx)(Y,{variant:"outline",className:"font-normal",children:s}),a&&(0,t.jsx)(Y,{variant:"outline",className:"font-normal",children:a}),u&&(0,t.jsx)(Y,{variant:"outline",className:"border-warning-ink/40 font-normal text-warning-ink",children:"private"}),f&&(0,t.jsxs)(Y,{variant:"outline",className:"border-destructive/40 font-normal text-destructive",children:["superseded → ",f]}),l&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"opacity-60",children:"created"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:l})]}),c&&c!==l&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"opacity-60",children:"updated"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:c})]})]}),h.length>0&&(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:h.map(e=>(0,t.jsxs)(Y,{variant:"secondary",className:"font-normal text-[11px]",children:["#",e]},e))}),p.length>0&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("span",{className:"opacity-60",children:"sources:"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:p.join(", ")})]}),m.length>0&&(0,t.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:[n?(0,t.jsx)(G.ChevronDown,{className:"h-3 w-3"}):(0,t.jsx)(X.ChevronRight,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:[m.length," more field",1===m.length?"":"s"]})]}),n&&(0,t.jsx)("dl",{className:"mt-1.5 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-0.5",children:m.map(n=>(0,t.jsxs)(d.Fragment,{children:[(0,t.jsx)("dt",{className:"opacity-60",children:n}),(0,t.jsx)("dd",{className:"text-foreground/80 break-words",children:function e(t){if(null==t)return"";if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t))return t.map(e).join(", ");try{return JSON.stringify(t)}catch{return String(t)}}(e[n])})]},n))})]})]})}var et=e.i(891734);function en({containerRef:e,onComment:n,align:r="center"}){let[i,o]=(0,d.useState)(null);return((0,d.useEffect)(()=>{function t(){let t=window.getSelection();if(!t||t.isCollapsed||0===t.rangeCount)return void o(null);let n=t.getRangeAt(0),i=e.current;if(!i||!i.contains(n.commonAncestorContainer))return void o(null);let s=n.getBoundingClientRect();if(0===s.width&&0===s.height)return void o(null);if("left"===r){let e=i.getBoundingClientRect();o({top:s.top,left:e.left+8})}else o({top:s.top-38,left:s.left+s.width/2})}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,r]),i)?(0,t.jsxs)("button",{type:"button",style:{position:"fixed",top:i.top,left:i.left,transform:"left"===r?void 0:"translateX(-50%)",zIndex:50},className:"flex items-center gap-1 px-2 py-1 bg-popover border border-border rounded-sm shadow-lg text-[12px] text-foreground/80 hover:text-foreground hover:bg-accent transition-colors",onMouseDown:e=>e.preventDefault(),onClick:()=>{n(),o(null)},"aria-label":"Add comment",title:"Add comment",children:[(0,t.jsx)(et.MessageCircle,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Comment"})]}):null}async function er(e,t){let n=new FormData;n.append("file",t);try{let r=await (0,k.wsFetch)(`/api/upload/${e}`,{method:"POST",body:n});if(!r.ok)return(0,S.showError)(`Upload failed: ${t.name}`),null;let i=await r.json();return i.url?(0,k.withWs)(i.url):i.url}catch{return(0,S.showError)(`Upload failed: ${t.name}`),null}}function ei(e){let t=[];for(let n of e)t.push({path:n.path,name:n.name}),n.children&&t.push(...ei(n.children));return t}function eo(e,t,n){let r=ei(n).filter(t=>t.name===e||t.path.endsWith(`/${e}`));if(0===r.length)return null;if(1===r.length)return r[0].path;if(t){let n=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",i=r.find(t=>t.path===(n?`${n}/${e}`:e));if(i)return i.path}return r[0].path}function es(e,t,n){let r=e.split("/");for(let e=1;e<r.length;e++)n(r.slice(0,e).join("/"));t(e),g.useEditorStore.getState().loadPage(e),setTimeout(()=>{document.querySelector("[data-editor-scroll]")?.scrollTo(0,0)},0)}e.s(["ViewModeCommentButton",0,en],66076),e.s(["KBEditor",0,function({mode:e}={}){let{currentPath:H,content:B,saveStatus:F,frontmatter:V,isLoading:U,loadStatus:q,createMissingPage:G,editMode:X,setEditMode:Z}=(0,g.useEditorStore)(),Y=e??X,Q="viewing"===Y,et="suggesting"===Y,ea=(0,d.useMemo)(()=>Q?(0,f.parseFrontmatter)(B):{data:{},body:B},[B,Q]),el=(0,y.useTreeStore)(e=>e.nodes),ec=(0,b.useViewWidthStore)(e=>b.VIEW_WIDTH_CSS[e.width]),ed=(0,b.useViewWidthStore)(e=>b.VIEW_ALIGN_ML[e.align]),eu=Q?"rtl"===ea.data.dir:V?.dir==="rtl",{open:eh,clearMessages:ep}=(0,m.useAIPanelStore)(),{open:ef,Dialog:em}=function(){let[e,n]=(0,d.useState)(!1),[r,i]=(0,d.useState)({slug:"",dir:"entities",title:""}),[o,s]=(0,d.useState)(!1),a=(0,d.useRef)(null),l=(0,d.useCallback)(e=>(i({slug:e,dir:"entities",title:e.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}),n(!0),new Promise(e=>{a.current=e})),[]),c=(0,d.useCallback)(()=>{n(!1),a.current?.({ok:!1,slug:r.slug}),a.current=null},[r.slug]),u=(0,d.useCallback)(async()=>{let{slug:e,dir:t,title:i}=r;s(!0);try{let r=await (0,k.wsFetch)("/api/wiki/page",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,dir:t,title:i.trim()||void 0})});if(r.ok||409===r.status){let r=v.useWikiSlugsStore.getState();r.invalidate(),r.load(),n(!1),a.current?.({ok:!0,slug:e,dir:t}),a.current=null}else{let e=await r.json().catch(()=>({})),t=null!==e&&"object"==typeof e&&"error"in e&&"string"==typeof e.error?e.error:"Failed to create page";(0,S.showError)(t)}}catch{(0,S.showError)("Failed to create page")}finally{s(!1)}},[r]);return{open:l,Dialog:(0,t.jsx)(z.Dialog,{open:e,onOpenChange:e=>{e||c()},children:(0,t.jsxs)(z.DialogContent,{children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:"Create wiki page"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{htmlFor:"wiki-create-slug",children:"Slug"}),(0,t.jsx)($.Input,{id:"wiki-create-slug",value:r.slug,readOnly:!0,className:"bg-muted cursor-default select-all"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{children:"Directory"}),(0,t.jsx)("div",{className:"flex gap-4",children:K.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-sm cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"wiki-create-dir",value:e,checked:r.dir===e,onChange:()=>i(t=>({...t,dir:e})),className:"accent-primary"}),e]},e))})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{htmlFor:"wiki-create-title",children:"Title (optional)"}),(0,t.jsx)($.Input,{id:"wiki-create-title",value:r.title,onChange:e=>i(t=>({...t,title:e.target.value})),placeholder:"Humanized title..."})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(_.Button,{variant:"outline",onClick:c,disabled:o,children:"Cancel"}),(0,t.jsx)(_.Button,{onClick:()=>void u(),disabled:o,children:o?"Creating...":"Create"})]})]})})}}(),eg=(0,d.useRef)(ef);eg.current=ef;let ey=(0,d.useRef)(!1),eb=(0,d.useRef)(Q);eb.current=Q;let[ev,ew]=(0,d.useState)(!1),[ex,ek]=(0,d.useState)(""),[eS,eC]=(0,d.useState)("page");(0,d.useEffect)(()=>{eC("page")},[]),(0,d.useEffect)(()=>{v.useWikiSlugsStore.getState().load()},[]),(0,d.useEffect)(()=>{if(!H)return;let e=setTimeout(()=>{w.useProofStore.getState().loadSidecar(H)},200);return()=>clearTimeout(e)},[H]),(0,d.useEffect)(()=>{if(!H||Q||!/\.(md|markdown)$/i.test(H))return;let e=e=>{(0,k.wsFetch)("/api/wiki/presence",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:H,action:e}),keepalive:"close"===e}).catch(()=>{})},t=!1,n=null,r=()=>{t&&"hidden"===document.visibilityState&&e("heartbeat")},i=setTimeout(()=>{t=!0,e("open"),n=setInterval(()=>e("heartbeat"),3e4),document.addEventListener("visibilitychange",r)},200);return()=>{clearTimeout(i),n&&clearInterval(n),document.removeEventListener("visibilitychange",r),t&&e("close")}},[H,Q]),(0,d.useEffect)(()=>{let e=new EventSource((0,k.withWs)("/api/wiki/watch"));return e.onmessage=e=>{try{let t=JSON.parse(e.data),n=g.useEditorStore.getState().currentPath;("change"===t.type||"add"===t.type)&&n&&t.path===n&&(w.useProofStore.getState().loadSnapshot(n).then(()=>w.useProofStore.getState().loadSidecar(n)),eb.current&&g.useEditorStore.getState().loadPage(n))}catch{}},()=>{e.close()}},[]);let[eE,eM]=(0,d.useState)(null),eN=(0,d.useRef)(null),[eA,eT]=(0,d.useState)(new Map),eR=(0,w.useProofStore)(e=>H?e.byPath[H]?.snapshotBlocks:void 0),eO=(0,w.useProofStore)(e=>H?e.byPath[H]?.sidecar?.suggestions:void 0),eD=(0,w.useProofStore)(e=>H?e.byPath[H]?.snapshotRevision??0:0),ej=(0,w.useProofStore)(e=>H?e.byPath[H]?.sidecar?.comments:void 0),eI=(0,d.useMemo)(()=>eR??[],[eR]),eP=(0,d.useMemo)(()=>ej??[],[ej]),eL=(0,d.useMemo)(()=>eO?.filter(e=>"pending"===e.status)??[],[eO]),e_=(0,d.useMemo)(()=>{let e={};for(let t of eP)t.ref&&(e[t.ref]??=[]).push(t);return e},[eP]),[ez,e$]=(0,d.useState)(null),[eH,eB]=(0,d.useState)(null),eF=(0,d.useCallback)(()=>{if(!eY.current)return null;let e=eY.current.view,{from:t}=e.state.selection,n=g.useEditorStore.getState().currentPath??"",r=w.useProofStore.getState().byPath[n]?.snapshotBlocks??[],i=e.state.doc.resolve(t),o=i.depth>0?i.index(0):0,s=eN.current?.querySelector(".ProseMirror"),a=(s?Array.from(s.children):[])[o]??null,l=r[o],c=l?.ref??a?.getAttribute("data-block-ref")??null,d=l?.markdown??"";if(!c&&a){let n=e.domAtPos(t),r=n.node.nodeType===Node.ELEMENT_NODE?n.node:n.node.parentElement,i=r?.closest("[data-block-ref]")??null;c=i?.getAttribute("data-block-ref")??null}return c&&a?{blockRef:c,blockEl:a,markdown:d}:null},[]),eV=(0,d.useCallback)(()=>{let e=eF();if(!e)return;let t=e.blockEl.getBoundingClientRect();eB({blockRef:e.blockRef,markdown:e.markdown,anchor:{top:t.bottom+4,left:t.left}})},[eF]),eU=(0,d.useCallback)(()=>{let e=eF();e&&e$({blockRef:e.blockRef,el:e.blockEl})},[eF]),eW=(0,d.useRef)(!1),eK=(0,d.useRef)(!1),eq=(0,d.useRef)(null),eJ=e=>e.replace(/\s+$/g,"").trimStart(),eG=(0,d.useCallback)(async()=>{if(eK.current||eb.current||"suggesting"!==g.useEditorStore.getState().editMode||!eW.current)return;let e=eY.current,t=g.useEditorStore.getState().currentPath;if(!e||!t)return;let n=eN.current?.querySelector(".ProseMirror");if(!n)return;let r=Array.from(n.children),i=w.useProofStore.getState().byPath[t]?.snapshotBlocks??[];if(0!==i.length){eK.current=!0,eW.current=!1;try{let n=()=>w.useProofStore.getState().byPath[t]?.snapshotRevision??0,o=async()=>{await w.useProofStore.getState().loadSnapshot(t),await w.useProofStore.getState().loadSidecar(t)},s=Math.max(r.length,i.length),a=!1;for(let e=0;e<s;e++){let s=r[e],l=i[e],c=s?(0,p.htmlToMarkdown)(s.outerHTML,t).trim():null;if(l&&null!==c){if(eJ(c)!==eJ(l.markdown)){let e=await (0,x.captureSuggestion)({path:t,ref:l.ref,kind:"replace",markdown:c,getRevision:n,refresh:o});a=a||e}}else if(l&&null===c){let e=await (0,x.captureSuggestion)({path:t,ref:l.ref,kind:"delete",getRevision:n,refresh:o});a=a||e}else if(!l&&null!==c&&c.length>0){let e=i[i.length-1]?.ref;if(e){let r=await (0,x.captureSuggestion)({path:t,ref:e,kind:"insertAfter",markdown:c,getRevision:n,refresh:o});a=a||r}}}if(a){await o();let n=(w.useProofStore.getState().byPath[t]?.snapshotBlocks??i).map(e=>e.markdown).join("\n\n");ey.current=!0;let r=await (0,h.markdownToHtml)(n,t);e.commands.setContent(r),setTimeout(()=>{ey.current=!1},50)}}finally{eK.current=!1}}},[]);(0,d.useEffect)(()=>{if(!H)return;let e=setTimeout(()=>{w.useProofStore.getState().loadSnapshot(H)},200);return()=>clearTimeout(e)},[H]),(0,d.useEffect)(()=>{if(!H||0===eI.length||!eN.current)return;let e=eN.current,t=e.querySelector(".ProseMirror");if(!t)return;let n=Array.from(t.children),r=e.getBoundingClientRect(),i=new Map;for(let t=0;t<Math.min(n.length,eI.length);t++){let o=n[t],s=eI[t];o.setAttribute("data-block-ref",s.ref);let a=o.getBoundingClientRect();i.set(s.ref,{top:a.top-r.top+e.scrollTop,left:a.left-r.left,width:a.width,bottom:a.bottom-r.top+e.scrollTop})}eT(i)},[H,eI]);let eX=(0,d.useCallback)(({editor:e})=>{if(ey.current||eb.current||!e)return;"suggesting"===g.useEditorStore.getState().editMode&&(eW.current=!0);let t=e.getHTML(),n=(0,p.htmlToMarkdown)(t,g.useEditorStore.getState().currentPath??void 0);g.useEditorStore.getState().updateContent(n)},[]),eZ=(0,r.useEditor)({extensions:M.editorExtensions,content:"",editable:!Q,onUpdate:eX,onBlur:()=>{eG()},onSelectionUpdate:({editor:e})=>{if("suggesting"!==g.useEditorStore.getState().editMode)return;let{from:t}=e.state.selection,n=e.state.doc.resolve(t),r=n.depth>0?n.index(0):0,i=eq.current;eq.current=r,null!==i&&i!==r&&eW.current&&eG()},editorProps:{attributes:{class:"focus:outline-none min-h-[calc(100vh-12rem)] px-4 sm:px-8 py-6 max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto"},handleKeyDown:(e,t)=>{if((t.metaKey||t.ctrlKey)&&"a"===t.key.toLowerCase()&&(0,n.isInTable)(e.state)){let r=(0,n.cellAround)(e.state.selection.$from),i=r?.nodeAfter;if(!r||!i)return!1;let o=r.pos+1,s=r.pos+i.nodeSize-1;return(e.state.selection.from!==o||e.state.selection.to!==s)&&(t.preventDefault(),eZ?.chain().focus().setTextSelection({from:o,to:s}).run(),!0)}return!1},handleClick:(e,t,n)=>{let r=n.target.closest("a");if(!r)return!1;let i=r.getAttribute("href");if(!i)return!1;if("true"===r.dataset.wikiLink){n.preventDefault(),n.stopPropagation();let e=r.dataset.slug??"",t=r.dataset.anchor??null;if(!e)return!0;let i=v.useWikiSlugsStore.getState();if(i.has(e)){let n=i.getDir(e),r=null===n||"root"===n?`${e}.md`:`${n}/${e}.md`;g.useEditorStore.getState().loadPage(r),t&&setTimeout(()=>{document.querySelector(`[id="${t}"]`)?.scrollIntoView({behavior:"smooth"})},200)}else{if(eb.current)return!0;eg.current(e).then(e=>{if(e.ok){let t=e.dir??"entities",n=`${t}/${e.slug}.md`;g.useEditorStore.getState().loadPage(n)}})}return!0}if(i.startsWith("#page:")){n.preventDefault(),n.stopPropagation();let e=i.replace("#page:",""),{nodes:t,selectPage:r,expandPath:o}=y.useTreeStore.getState(),s=eo(e,g.useEditorStore.getState().currentPath,t);return s&&es(s,r,o),!0}if(/^https?:\/\//.test(i)||i.startsWith("/api/")||i.startsWith("mailto:")||i.startsWith("tel:"))return!1;n.preventDefault(),n.stopPropagation();let{nodes:o,selectPage:s,expandPath:a}=y.useTreeStore.getState(),l=function(e,t,n){let r=ei(n),i=e.replace(/\.md$/,"").replace(/^\.\//,"").replace(/^\//,""),o=r.find(e=>e.path===i);if(o)return o.path;if(t){let e=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",n=e?`${e}/${i}`:i,o=r.find(e=>e.path===n);if(o)return o.path}return eo(i.includes("/")?i.split("/").pop():i,t,n)}(i,g.useEditorStore.getState().currentPath,o);return l&&es(l,s,a),!0},handlePaste:(e,t)=>{if(eb.current)return!1;let n=t.clipboardData?.files,r=g.useEditorStore.getState().currentPath;if(n&&n.length>0&&r){for(let e of Array.from(n))er(r,e).then(t=>{t&&eZ&&(e.type.startsWith("image/")?eZ.chain().focus().setImage({src:t,alt:e.name}).run():eZ.chain().focus().insertContent(`<a href="${t}">${e.name}</a>`).run())});return!0}return!1},handleDrop:(e,t)=>{if(eb.current)return!1;let n=t.dataTransfer?.files;if(!n||0===n.length)return!1;let r=g.useEditorStore.getState().currentPath;if(!r)return!1;for(let e of(t.preventDefault(),Array.from(n)))er(r,e).then(t=>{t&&eZ&&(e.type.startsWith("image/")?eZ.chain().focus().setImage({src:t,alt:e.name}).run():eZ.chain().focus().insertContent(`<a href="${t}">${e.name}</a>`).run())});return!0}},immediatelyRender:!1}),eY=(0,d.useRef)(eZ);eY.current=eZ,(0,d.useEffect)(()=>{eZ?.setEditable(!Q),Q&&ew(!1)},[eZ,Q]);let eQ=(0,d.useRef)(null),e0=(0,d.useRef)(null),[e1,e2]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!eZ||null===H||g.useEditorStore.getState().isDirty&&H===eQ.current||U&&""===B)return;let e=ea.body,t=`${H} ${e}`;if(e0.current===t){e1!==H&&e2(H);return}eQ.current=H;let n=!1;return(async()=>{ey.current=!0;let r=await (0,h.markdownToHtml)(e,Q?{pagePath:H,sanitize:!0}:H);if(n||g.useEditorStore.getState().currentPath!==H){ey.current=!1;return}eZ.commands.setContent(r),e0.current=t,e2(H),setTimeout(()=>{ey.current=!1},50)})(),()=>{n=!0}},[eZ,B,H,U,e1,ea.body,Q]),(0,d.useEffect)(()=>{if(!Q||!e1)return;let e=eN.current;e&&e.querySelectorAll('input[type="checkbox"]').forEach(e=>{e.disabled=!0})},[Q,e1,ea.body]);let e3=null!==H&&(U||e1!==H),[e5,e4]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{if(!e3)return void e4(!1);let e=setTimeout(()=>e4(!0),150);return()=>clearTimeout(e)},[e3]),null===H)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,t.jsxs)("div",{className:"text-center space-y-3",children:[(0,t.jsx)("p",{className:"text-lg font-medium tracking-[-0.02em]",children:"No page selected"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground/70",children:"Select a page from the sidebar or create a new one"})]})});if("missing"===q){let e=(H.split("/").pop()||H).replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),n=(0,u.findNodeByPath)(el,H),r=n?.children??[],i=r.length>0;return(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-10 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-lg font-medium tracking-[-0.02em] text-foreground",children:e}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground/80",children:["This folder doesn't have an"," ",(0,t.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-[12px]",children:"index.md"}),i?" yet — its contents are listed below.":" yet."]}),(0,t.jsxs)("button",{onClick:()=>void G(e),className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-[13px] font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:[(0,t.jsx)(a.FilePlus,{className:"h-3.5 w-3.5"}),"Create page"]})]}),i&&(0,t.jsx)(N.FolderIndex,{folderPath:H,entries:r},H)]})})}let e6=async()=>{if(ev){if(g.useEditorStore.getState().updateContent(ex),eZ){ey.current=!0;let e=await (0,h.markdownToHtml)(ex,H??void 0);eZ.commands.setContent(e),setTimeout(()=>{ey.current=!1},50)}ew(!1)}else ek(g.useEditorStore.getState().content),ew(!0)},e9=(0,u.findNodeByPath)(el,H),e7=e9?.type==="directory"||e9?.type==="cabinet"?e9.children??[]:[],e8=e7.length>0,te=e8&&"files"===eS;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e8&&(0,t.jsxs)("div",{className:"flex items-center gap-1 px-3 pt-2 border-b border-border",children:[(0,t.jsx)("button",{onClick:()=>eC("page"),className:`px-3 py-1.5 text-[12px] rounded-t-md border-b-2 -mb-px transition-colors ${"page"===eS?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"aria-pressed":"page"===eS,children:"Page"}),(0,t.jsxs)("button",{onClick:()=>eC("files"),className:`px-3 py-1.5 text-[12px] rounded-t-md border-b-2 -mb-px transition-colors ${"files"===eS?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"aria-pressed":"files"===eS,children:["Files",(0,t.jsx)("span",{className:"ml-1.5 text-muted-foreground/60",children:e7.length})]})]}),te?(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)("div",{className:"max-w-3xl mx-auto px-6 py-6",children:(0,t.jsx)(N.FolderIndex,{folderPath:H,entries:e7},H)})}):(0,t.jsxs)(t.Fragment,{children:[!Q&&(0,t.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,t.jsx)("div",{className:"flex-1 min-w-0",children:!ev&&(0,t.jsx)(E.EditorToolbar,{editor:eZ})}),(0,t.jsxs)("button",{onClick:e6,className:`flex items-center gap-1.5 px-3 py-1 mr-2 text-[11px] rounded-md transition-colors border border-border ${ev?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"}`,children:[(0,t.jsx)(s.Code2,{className:"h-3 w-3"}),ev?"Preview":"Markdown"]})]}),ev?(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",dir:eu?"rtl":void 0,children:(0,t.jsx)("textarea",{value:ex,onChange:e=>ek(e.target.value),className:"w-full h-full min-h-[calc(100vh-12rem)] bg-transparent font-mono text-[13px] leading-relaxed resize-none focus:outline-none",spellCheck:!1})}):(0,t.jsxs)("div",{className:"flex-1 relative",dir:eu?"rtl":void 0,children:[et&&(0,t.jsx)("div",{className:"absolute top-0 inset-x-0 z-20 flex items-center justify-center gap-2 px-3 py-1 bg-primary/10 border-b border-primary/20 text-[11px] text-primary pointer-events-none",children:"Suggesting mode · your edits become suggestions for review"}),(0,t.jsx)(I.DocumentOutline,{editor:eZ,scrollContainerRef:eN}),(0,t.jsxs)("div",{ref:eN,className:`absolute inset-0 overflow-y-auto ${et?"pt-7":""}`,style:{"--editor-max-w":ec,"--editor-ml":ed},"data-editor-scroll":!0,children:[(0,t.jsxs)("div",{"aria-hidden":"true",className:"relative pointer-events-none",style:{height:0},children:[Object.entries(e_).map(([e,n])=>{let r=eA.get(e);return r?(0,t.jsx)("div",{style:{pointerEvents:"auto"},children:(0,t.jsx)(A.CommentPip,{anchorKey:e,anchorLabel:e,comments:n,top:r.top+4,left:Math.max(0,r.left-20),onClick:()=>{let t=eN.current?.querySelector(`[data-block-ref="${e}"]`);t&&e$({blockRef:e,el:t})}})},`pip-${e}`):null}),H&&eL.map(e=>{let n=eA.get(e.ref),r=eI.find(t=>t.ref===e.ref);if(!n||!r)return null;let i="insertAfter"===e.kind?n.bottom+4:"insertBefore"===e.kind?Math.max(0,n.top-80):n.top;return(0,t.jsx)("div",{style:{pointerEvents:"auto"},children:(0,t.jsx)(O.SuggestionCard,{path:H,suggestion:e,currentMarkdown:r.markdown,baseRevision:eD,getLatestRevision:()=>w.useProofStore.getState().byPath[H]?.snapshotRevision??0,top:i,left:n.left,width:n.width,onSettled:()=>{w.useProofStore.getState().loadSidecar(H),w.useProofStore.getState().loadSnapshot(H)},readOnly:Q})},`sug-${e.id}`)})]}),ez&&H&&(0,t.jsx)(T.CommentThread,{path:H,anchorKey:ez.blockRef,anchorRef:ez.blockRef,anchorLabel:ez.blockRef,comments:e_[ez.blockRef]??[],anchorEl:ez.el,onClose:()=>e$(null),readOnly:Q}),eH&&H&&(0,t.jsx)(D.SuggestEditPopover,{path:H,blockRef:eH.blockRef,currentMarkdown:eH.markdown,anchor:eH.anchor,onClose:()=>eB(null)}),Q&&Object.keys(ea.data).length>0&&(0,t.jsx)("div",{className:"max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto px-4 sm:px-8 pt-6",children:(0,t.jsx)(ee,{data:ea.data})}),(0,t.jsx)(r.EditorContent,{editor:eZ}),H&&/\.(md|markdown)$/i.test(H)&&(0,t.jsx)(P.BacklinksPanel,{currentPath:H}),(0,t.jsx)("div",{"aria-hidden":"true",className:"contents",onMouseOver:e=>{let t=e.target.closest(".proof-span");t&&t!==eE&&eM(t)},onMouseOut:e=>{let t=e.relatedTarget;t?.closest(".proof-span")||eM(null)}}),H&&(0,t.jsx)(R.ProofSpanPopover,{targetEl:eE,path:H,onClose:()=>eM(null),onComment:()=>{if(!eE)return;let e=eE.closest("[data-block-ref]");if(!e)return;let t=e.getAttribute("data-block-ref");t&&e$({blockRef:t,el:e})}}),!Q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.EditorBubbleMenu,{editor:eZ,onSuggestEdit:eV,onComment:eU}),(0,t.jsx)(L.TableMenu,{editor:eZ}),(0,t.jsx)(j.SlashCommands,{editor:eZ}),(0,t.jsx)(J,{editor:eZ,onCreateRequest:eg.current})]}),Q&&(0,t.jsx)(en,{containerRef:eN,onComment:eU}),(0,t.jsxs)("div",{className:"max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto px-8 pb-8 flex items-center gap-4",children:[(0,t.jsxs)("button",{onClick:()=>{ep(),eh()},className:"group flex items-center gap-2 text-[13px] text-muted-foreground/50 hover:text-muted-foreground transition-colors cursor-pointer",children:[(0,t.jsx)(c.Sparkles,{className:"h-3.5 w-3.5 group-hover:text-primary transition-colors"}),(0,t.jsx)("span",{children:"Edit with AI"})]}),!Q&&(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground/30 select-none",children:[(0,t.jsx)("kbd",{className:"rounded px-1 py-0.5 font-mono text-[10px] ring-1 ring-foreground/10",children:"/"})," ","for commands"]})]})]}),e5&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 backdrop-blur-md z-20 pointer-events-none","aria-hidden":"true",children:(0,t.jsx)(l.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground/70"})})]}),!Q&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-1 border-t border-border text-xs text-muted-foreground/60",children:[(0,t.jsxs)("span",{className:"text-[10.5px] text-muted-foreground/30 select-none hidden sm:block",children:[(0,t.jsx)("kbd",{className:"rounded px-1 font-mono text-[9.5px] ring-1 ring-foreground/10",children:"⌘S"})," ","save",(0,t.jsx)("span",{className:"mx-1.5 opacity-40",children:"·"}),(0,t.jsx)("kbd",{className:"rounded px-1 font-mono text-[9.5px] ring-1 ring-foreground/10",children:"/"})," ","commands"]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center rounded-md border border-border overflow-hidden text-[10.5px]",role:"radiogroup","aria-label":"Edit mode",children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"editing"===X,onClick:()=>Z("editing"),className:`px-2 py-0.5 transition-colors ${"editing"===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:"Editing"}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"suggesting"===X,onClick:()=>Z("suggesting"),className:`px-2 py-0.5 transition-colors ${"suggesting"===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:"Suggesting"})]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] transition-all duration-300 ${"idle"===F?"opacity-0 pointer-events-none":"opacity-100"} ${"saving"===F?"bg-muted text-muted-foreground":"saved"===F?"bg-success/10 text-success":"error"===F?"bg-destructive/10 text-destructive":""}`,children:["saving"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Loader2,{className:"h-2.5 w-2.5 animate-spin"}),"Saving…"]}),"saved"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Check,{className:"h-2.5 w-2.5"}),"Saved"]}),"error"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.AlertCircle,{className:"h-2.5 w-2.5"}),"Save failed"]})]})]})]})]})]}),em]})}],912235)},780569,e=>{"use strict";var t=e.i(44501),n=e.i(43240),r=e.i(792934),i=e.i(519455),o=e.i(755146),s=e.i(395624);e.s(["ViewWidthToggle",0,function({className:e}){let a=(0,s.useViewWidthStore)(e=>e.width),l=(0,s.useViewWidthStore)(e=>e.setWidth),c=(0,s.useViewWidthStore)(e=>e.align),d=(0,s.useViewWidthStore)(e=>e.setAlign);return(0,t.jsxs)(o.DropdownMenu,{children:[(0,t.jsx)(o.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(i.Button,{size:"sm",variant:"ghost",className:`h-7 w-7 p-0 ${e??""}`,title:`Content width: ${s.VIEW_WIDTH_LABEL[a]}`,children:(0,t.jsx)(r.AlignJustify,{className:"h-3.5 w-3.5"})})}),(0,t.jsxs)(o.DropdownMenuContent,{align:"end",className:"w-36",children:[(0,t.jsx)(o.DropdownMenuLabel,{className:"text-[11px] text-muted-foreground",children:"Width"}),s.VIEW_WIDTH_ORDER.map(e=>(0,t.jsxs)(o.DropdownMenuItem,{onClick:()=>l(e),className:"flex items-center justify-between text-xs",children:[s.VIEW_WIDTH_LABEL[e],e===a&&(0,t.jsx)(n.Check,{className:"h-3.5 w-3.5"})]},e)),(0,t.jsx)(o.DropdownMenuSeparator,{}),(0,t.jsx)(o.DropdownMenuLabel,{className:"text-[11px] text-muted-foreground",children:"Alignment"}),s.VIEW_ALIGN_ORDER.map(e=>(0,t.jsxs)(o.DropdownMenuItem,{onClick:()=>d(e),className:"flex items-center justify-between text-xs",children:[s.VIEW_ALIGN_LABEL[e],e===c&&(0,t.jsx)(n.Check,{className:"h-3.5 w-3.5"})]},e))]})]})}])},894013,409082,847463,e=>{"use strict";var t=e.i(44501),n=e.i(605993);let r=(0,n.default)("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);e.s(["Moon",0,r],409082);let i=(0,n.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,i],847463);var o=e.i(917356),s=e.i(519455);e.s(["ThemeToggle",0,function({className:e}){let{resolvedTheme:n,setTheme:a}=(0,o.useTheme)();return(0,t.jsx)(s.Button,{size:"sm",variant:"ghost",className:`h-7 w-7 p-0 ${e??""}`,title:"dark"===n?"Switch to light":"Switch to dark",onClick:()=>a("dark"===n?"light":"dark"),children:"dark"===n?(0,t.jsx)(i,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r,{className:"h-3.5 w-3.5"})})}],894013)}]);
113
+ For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},G=({contentRef:e,descriptionId:n})=>{let r=q("DialogDescriptionWarning"),i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");n&&t&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null};e.s(["Close",0,V,"Content",0,I,"Description",0,B,"Overlay",0,R,"Portal",0,A,"Root",0,k,"Title",0,$,"Trigger",0,C])},22245,e=>{"use strict";let t=(0,e.i(605993).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],22245)},776639,e=>{"use strict";var t=e.i(44501),n=e.i(46951),r=e.i(22245),i=e.i(101685),o=e.i(975157);let s=n.Root;n.Trigger;let a=n.Portal;n.Close;let l=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Overlay,{ref:i,className:(0,o.cn)("fixed inset-0 z-40 bg-overlay backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));l.displayName=n.Overlay.displayName;let c=i.forwardRef(({className:e,children:i,...s},c)=>(0,t.jsxs)(a,{children:[(0,t.jsx)(l,{}),(0,t.jsxs)(n.Content,{ref:c,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-card p-6 shadow-golden rounded-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",e),...s,children:[i,(0,t.jsxs)(n.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(r.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));function d({className:e,...n}){return(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left min-w-0",e),...n})}function u({className:e,...n}){return(0,t.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n})}c.displayName=n.Content.displayName,d.displayName="DialogHeader",u.displayName="DialogFooter";let h=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Title,{ref:i,className:(0,o.cn)("text-lg font-normal leading-none tracking-tight",e),...r}));h.displayName=n.Title.displayName;let p=i.forwardRef(({className:e,...r},i)=>(0,t.jsx)(n.Description,{ref:i,className:(0,o.cn)("text-sm text-muted-foreground break-words",e),...r}));p.displayName=n.Description.displayName,e.s(["Dialog",0,s,"DialogContent",0,c,"DialogDescription",0,p,"DialogFooter",0,u,"DialogHeader",0,d,"DialogTitle",0,h])},912235,110204,66076,e=>{"use strict";var t=e.i(44501);e.i(150663);var n=e.i(608926),r=e.i(885047),i=e.i(425732),o=e.i(43240),s=e.i(313393),a=e.i(530229),l=e.i(691520),c=e.i(231597),d=e.i(101685),u=e.i(417068),h=e.i(797715),p=e.i(660885),f=e.i(490275),m=e.i(24800),g=e.i(96701),y=e.i(990791),b=e.i(395624),v=e.i(246542),w=e.i(592185),x=e.i(926732),k=e.i(671485),S=e.i(417385),C=e.i(582612),E=e.i(240409),M=e.i(314206),N=e.i(496668),A=e.i(665794),T=e.i(926128),R=e.i(803043),O=e.i(589676),D=e.i(294250),j=e.i(203195),I=e.i(521470),P=e.i(623616),L=e.i(152555),_=e.i(519455),z=e.i(776639),$=e.i(793479),H=e.i(750110),B=d.forwardRef((e,n)=>(0,t.jsx)(H.Primitive.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));B.displayName="Label";var F=e.i(294237),V=e.i(975157);let U=(0,F.cva)("text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),W=d.forwardRef(({className:e,...n},r)=>(0,t.jsx)(B,{ref:r,className:(0,V.cn)(U(),e),...n}));W.displayName=B.displayName,e.s(["Label",0,W],110204);let K=["entities","concepts","comparisons"],q=/^[a-z0-9-]+$/;function J({editor:e,onCreateRequest:n}){let[r,i]=(0,d.useState)(!1),[o,s]=(0,d.useState)(""),[a,l]=(0,d.useState)(0),[c,u]=(0,d.useState)({top:0,left:0}),h=(0,d.useRef)(null),p=(0,d.useRef)(0),f=(0,v.useWikiSlugsStore)(e=>e.slugs),m=(0,v.useWikiSlugsStore)(e=>e.slugDir),g=(0,v.useWikiSlugsStore)(e=>e.has),y=Array.from(f).sort().filter(e=>!o||e.includes(o.toLowerCase())).slice(0,20),b=o.length>0&&q.test(o)&&!g(o),w=y.length+ +!!b,x=(0,d.useCallback)(()=>{i(!1),s(""),l(0)},[]),k=(0,d.useCallback)(t=>{if(!e)return;let{from:n}=e.state.selection,r=p.current-2,i=e.state.schema.marks.wikiLink;if(!i)return;let o=i.create({slug:t,alias:null,anchor:null}),s=e.state.schema.text(t,[o]),a=e.state.tr.replaceWith(r,n,s);e.view.dispatch(a),e.commands.focus(),x()},[e,x]),S=(0,d.useCallback)(async t=>{if(e){if(t<y.length)k(y[t]??"");else if(b){let e=await n(o);e.ok?k(e.slug):x()}}},[e,y,b,o,k,n,x]);return((0,d.useEffect)(()=>{if(!e)return;let t=t=>{if(!r){if("["===t.key){let{from:t}=e.state.selection;if("["!==e.state.doc.textBetween(Math.max(0,t-1),t)||e.state.doc.resolve(t).marks().some(e=>"wikiLink"===e.type.name))return;let n=e.view.coordsAtPos(t),r=e.view.dom.getBoundingClientRect();u({top:n.bottom-r.top+4,left:n.left-r.left}),p.current=t+1,i(!0),s(""),l(0)}return}"ArrowDown"===t.key?(t.preventDefault(),l(e=>w>0?(e+1)%w:0)):"ArrowUp"===t.key?(t.preventDefault(),l(e=>w>0?(e-1+w)%w:0)):"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),w>0&&S(a)):"Escape"===t.key||"]"===t.key?x():"Backspace"===t.key?0===o.length?x():(s(e=>e.slice(0,-1)),l(0)):1!==t.key.length||t.metaKey||t.ctrlKey||(s(e=>e+t.key),l(0))};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e,r,o,a,w,x,S]),(0,d.useEffect)(()=>{if(!r)return;let e=e=>{h.current&&!h.current.contains(e.target)&&x()};return window.addEventListener("mousedown",e),()=>window.removeEventListener("mousedown",e)},[r,x]),r&&0!==w)?(0,t.jsxs)("div",{ref:h,className:"absolute z-50 w-[280px] bg-popover border border-border rounded-lg shadow-lg py-1 overflow-hidden max-h-[300px] overflow-y-auto",style:{top:c.top,left:c.left},children:[y.map((e,n)=>{let r=m.get(e);return(0,t.jsxs)("button",{type:"button",onMouseDown:e=>{e.preventDefault(),S(n)},onMouseEnter:()=>l(n),className:(0,V.cn)("flex items-center justify-between w-full px-3 py-1.5 text-left text-sm transition-colors",n===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:[(0,t.jsx)("span",{className:"truncate",children:e}),r&&(0,t.jsx)("span",{className:"ml-2 shrink-0 text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:r})]},e)}),b&&(0,t.jsx)("button",{type:"button",onMouseDown:e=>{e.preventDefault(),S(y.length)},onMouseEnter:()=>l(y.length),className:(0,V.cn)("flex items-center w-full px-3 py-1.5 text-left text-sm transition-colors",y.length===a?"bg-accent text-accent-foreground":"hover:bg-accent/50"),children:(0,t.jsxs)("span",{className:"text-muted-foreground",children:["+ Create new “",o,"”"]})})]}):null}var G=e.i(367092),X=e.i(10137);let Z=(0,F.cva)("inline-flex items-center rounded-sm border px-2.5 py-0.5 text-xs font-normal transition-colors focus:outline-none focus:ring-2 focus:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow-e-1",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow-e-1",outline:"text-foreground",accent:"border-transparent bg-accent text-accent-foreground"}},defaultVariants:{variant:"default"}});function Y({className:e,variant:n,...r}){return(0,t.jsx)("div",{className:(0,V.cn)(Z({variant:n}),e),...r})}let Q=new Set(["title","type","status","created","updated","date","tags","sources","private","supersedes","superseded_by"]);function ee({data:e}){let[n,r]=(0,d.useState)(!1),i=Object.keys(e);if(0===i.length)return null;let o="string"==typeof e.title?e.title:null,s="string"==typeof e.type?e.type:null,a="string"==typeof e.status?e.status:null,l="string"==typeof e.created?e.created:null,c="string"==typeof e.updated?e.updated:null,u=!0===e.private,h=Array.isArray(e.tags)?e.tags:[],p=Array.isArray(e.sources)?e.sources:[],f="string"==typeof e.superseded_by?e.superseded_by:null,m=i.filter(e=>!Q.has(e));return(0,t.jsxs)("div",{className:"mb-6 rounded-sm border bg-card/40 px-4 py-3 text-xs",children:[o&&(0,t.jsx)("div",{className:"mb-2 text-base font-normal text-foreground",children:o}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-muted-foreground",children:[s&&(0,t.jsx)(Y,{variant:"outline",className:"font-normal",children:s}),a&&(0,t.jsx)(Y,{variant:"outline",className:"font-normal",children:a}),u&&(0,t.jsx)(Y,{variant:"outline",className:"border-warning-ink/40 font-normal text-warning-ink",children:"private"}),f&&(0,t.jsxs)(Y,{variant:"outline",className:"border-destructive/40 font-normal text-destructive",children:["superseded → ",f]}),l&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"opacity-60",children:"created"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:l})]}),c&&c!==l&&(0,t.jsxs)("span",{children:[(0,t.jsx)("span",{className:"opacity-60",children:"updated"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:c})]})]}),h.length>0&&(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:h.map(e=>(0,t.jsxs)(Y,{variant:"secondary",className:"font-normal text-[11px]",children:["#",e]},e))}),p.length>0&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("span",{className:"opacity-60",children:"sources:"})," ",(0,t.jsx)("span",{className:"text-foreground/80",children:p.join(", ")})]}),m.length>0&&(0,t.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),className:"flex items-center gap-1 text-muted-foreground hover:text-foreground",children:[n?(0,t.jsx)(G.ChevronDown,{className:"h-3 w-3"}):(0,t.jsx)(X.ChevronRight,{className:"h-3 w-3"}),(0,t.jsxs)("span",{children:[m.length," more field",1===m.length?"":"s"]})]}),n&&(0,t.jsx)("dl",{className:"mt-1.5 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-0.5",children:m.map(n=>(0,t.jsxs)(d.Fragment,{children:[(0,t.jsx)("dt",{className:"opacity-60",children:n}),(0,t.jsx)("dd",{className:"text-foreground/80 break-words",children:function e(t){if(null==t)return"";if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return String(t);if(Array.isArray(t))return t.map(e).join(", ");try{return JSON.stringify(t)}catch{return String(t)}}(e[n])})]},n))})]})]})}var et=e.i(891734);function en({containerRef:e,onComment:n,align:r="center"}){let[i,o]=(0,d.useState)(null);return((0,d.useEffect)(()=>{function t(){let t=window.getSelection();if(!t||t.isCollapsed||0===t.rangeCount)return void o(null);let n=t.getRangeAt(0),i=e.current;if(!i||!i.contains(n.commonAncestorContainer))return void o(null);let s=n.getBoundingClientRect();if(0===s.width&&0===s.height)return void o(null);if("left"===r){let e=i.getBoundingClientRect();o({top:s.top,left:e.left+8})}else o({top:s.top-38,left:s.left+s.width/2})}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)},[e,r]),i)?(0,t.jsxs)("button",{type:"button",style:{position:"fixed",top:i.top,left:i.left,transform:"left"===r?void 0:"translateX(-50%)",zIndex:50},className:"flex items-center gap-1 px-2 py-1 bg-popover border border-border rounded-sm shadow-lg text-[12px] text-foreground/80 hover:text-foreground hover:bg-accent transition-colors",onMouseDown:e=>e.preventDefault(),onClick:()=>{n(),o(null)},"aria-label":"Add comment",title:"Add comment",children:[(0,t.jsx)(et.MessageCircle,{className:"w-3.5 h-3.5"}),(0,t.jsx)("span",{children:"Comment"})]}):null}async function er(e,t){let n=new FormData;n.append("file",t);try{let r=await (0,k.wsFetch)(`/api/upload/${e}`,{method:"POST",body:n});if(!r.ok)return(0,S.showError)(`Upload failed: ${t.name}`),null;let i=await r.json();return i.url?(0,k.withWs)(i.url):i.url}catch{return(0,S.showError)(`Upload failed: ${t.name}`),null}}function ei(e){let t=[];for(let n of e)t.push({path:n.path,name:n.name}),n.children&&t.push(...ei(n.children));return t}function eo(e,t,n){let r=ei(n).filter(t=>t.name===e||t.path.endsWith(`/${e}`));if(0===r.length)return null;if(1===r.length)return r[0].path;if(t){let n=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",i=r.find(t=>t.path===(n?`${n}/${e}`:e));if(i)return i.path}return r[0].path}function es(e,t,n){let r=e.split("/");for(let e=1;e<r.length;e++)n(r.slice(0,e).join("/"));t(e),g.useEditorStore.getState().loadPage(e),setTimeout(()=>{document.querySelector("[data-editor-scroll]")?.scrollTo(0,0)},0)}e.s(["ViewModeCommentButton",0,en],66076),e.s(["KBEditor",0,function({mode:e}={}){let{currentPath:H,content:B,saveStatus:F,frontmatter:V,isLoading:U,loadStatus:q,createMissingPage:G,editMode:X,setEditMode:Z}=(0,g.useEditorStore)(),Y=e??X,Q="viewing"===Y,et="suggesting"===Y,ea=(0,d.useMemo)(()=>Q?(0,f.parseFrontmatter)(B):{data:{},body:B},[B,Q]),el=(0,y.useTreeStore)(e=>e.nodes),ec=(0,b.useViewWidthStore)(e=>b.VIEW_WIDTH_CSS[e.width]),ed=(0,b.useViewWidthStore)(e=>b.VIEW_ALIGN_ML[e.align]),eu=Q?"rtl"===ea.data.dir:V?.dir==="rtl",{open:eh,clearMessages:ep}=(0,m.useAIPanelStore)(),{open:ef,Dialog:em}=function(){let[e,n]=(0,d.useState)(!1),[r,i]=(0,d.useState)({slug:"",dir:"entities",title:""}),[o,s]=(0,d.useState)(!1),a=(0,d.useRef)(null),l=(0,d.useCallback)(e=>(i({slug:e,dir:"entities",title:e.split("-").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}),n(!0),new Promise(e=>{a.current=e})),[]),c=(0,d.useCallback)(()=>{n(!1),a.current?.({ok:!1,slug:r.slug}),a.current=null},[r.slug]),u=(0,d.useCallback)(async()=>{let{slug:e,dir:t,title:i}=r;s(!0);try{let r=await (0,k.wsFetch)("/api/wiki/page",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,dir:t,title:i.trim()||void 0})});if(r.ok||409===r.status){let r=v.useWikiSlugsStore.getState();r.invalidate(),r.load(),n(!1),a.current?.({ok:!0,slug:e,dir:t}),a.current=null}else{let e=await r.json().catch(()=>({})),t=null!==e&&"object"==typeof e&&"error"in e&&"string"==typeof e.error?e.error:"Failed to create page";(0,S.showError)(t)}}catch{(0,S.showError)("Failed to create page")}finally{s(!1)}},[r]);return{open:l,Dialog:(0,t.jsx)(z.Dialog,{open:e,onOpenChange:e=>{e||c()},children:(0,t.jsxs)(z.DialogContent,{children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:"Create wiki page"})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{htmlFor:"wiki-create-slug",children:"Slug"}),(0,t.jsx)($.Input,{id:"wiki-create-slug",value:r.slug,readOnly:!0,className:"bg-muted cursor-default select-all"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{children:"Directory"}),(0,t.jsx)("div",{className:"flex gap-4",children:K.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-sm cursor-pointer",children:[(0,t.jsx)("input",{type:"radio",name:"wiki-create-dir",value:e,checked:r.dir===e,onChange:()=>i(t=>({...t,dir:e})),className:"accent-primary"}),e]},e))})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(W,{htmlFor:"wiki-create-title",children:"Title (optional)"}),(0,t.jsx)($.Input,{id:"wiki-create-title",value:r.title,onChange:e=>i(t=>({...t,title:e.target.value})),placeholder:"Humanized title..."})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(_.Button,{variant:"outline",onClick:c,disabled:o,children:"Cancel"}),(0,t.jsx)(_.Button,{onClick:()=>void u(),disabled:o,children:o?"Creating...":"Create"})]})]})})}}(),eg=(0,d.useRef)(ef);eg.current=ef;let ey=(0,d.useRef)(!1),eb=(0,d.useRef)(Q);eb.current=Q;let[ev,ew]=(0,d.useState)(!1),[ex,ek]=(0,d.useState)(""),[eS,eC]=(0,d.useState)("page");(0,d.useEffect)(()=>{eC("page")},[]),(0,d.useEffect)(()=>{v.useWikiSlugsStore.getState().load()},[]),(0,d.useEffect)(()=>{if(!H)return;let e=setTimeout(()=>{w.useProofStore.getState().loadSidecar(H)},200);return()=>clearTimeout(e)},[H]),(0,d.useEffect)(()=>{if(!H||Q||!/\.(md|markdown)$/i.test(H))return;let e=e=>{(0,k.wsFetch)("/api/wiki/presence",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:H,action:e}),keepalive:"close"===e}).catch(()=>{})},t=!1,n=null,r=()=>{t&&"hidden"===document.visibilityState&&e("heartbeat")},i=setTimeout(()=>{t=!0,e("open"),n=setInterval(()=>e("heartbeat"),3e4),document.addEventListener("visibilitychange",r)},200);return()=>{clearTimeout(i),n&&clearInterval(n),document.removeEventListener("visibilitychange",r),t&&e("close")}},[H,Q]),(0,d.useEffect)(()=>{let e=new EventSource((0,k.withWs)("/api/wiki/watch"));return e.onmessage=e=>{try{let t=JSON.parse(e.data),n=g.useEditorStore.getState().currentPath;("change"===t.type||"add"===t.type)&&n&&t.path===n&&(w.useProofStore.getState().loadSnapshot(n).then(()=>w.useProofStore.getState().loadSidecar(n)),eb.current&&g.useEditorStore.getState().loadPage(n))}catch{}},()=>{e.close()}},[]);let[eE,eM]=(0,d.useState)(null),eN=(0,d.useRef)(null),[eA,eT]=(0,d.useState)(new Map),eR=(0,w.useProofStore)(e=>H?e.byPath[H]?.snapshotBlocks:void 0),eO=(0,w.useProofStore)(e=>H?e.byPath[H]?.sidecar?.suggestions:void 0),eD=(0,w.useProofStore)(e=>H?e.byPath[H]?.snapshotRevision??0:0),ej=(0,w.useProofStore)(e=>H?e.byPath[H]?.sidecar?.comments:void 0),eI=(0,d.useMemo)(()=>eR??[],[eR]),eP=(0,d.useMemo)(()=>ej??[],[ej]),eL=(0,d.useMemo)(()=>eO?.filter(e=>"pending"===e.status)??[],[eO]),e_=(0,d.useMemo)(()=>{let e={};for(let t of eP)t.ref&&(e[t.ref]??=[]).push(t);return e},[eP]),[ez,e$]=(0,d.useState)(null),[eH,eB]=(0,d.useState)(null),eF=(0,d.useCallback)(()=>{if(!eY.current)return null;let e=eY.current.view,{from:t}=e.state.selection,n=g.useEditorStore.getState().currentPath??"",r=w.useProofStore.getState().byPath[n]?.snapshotBlocks??[],i=e.state.doc.resolve(t),o=i.depth>0?i.index(0):0,s=eN.current?.querySelector(".ProseMirror"),a=(s?Array.from(s.children):[])[o]??null,l=r[o],c=l?.ref??a?.getAttribute("data-block-ref")??null,d=l?.markdown??"";if(!c&&a){let n=e.domAtPos(t),r=n.node.nodeType===Node.ELEMENT_NODE?n.node:n.node.parentElement,i=r?.closest("[data-block-ref]")??null;c=i?.getAttribute("data-block-ref")??null}return c&&a?{blockRef:c,blockEl:a,markdown:d}:null},[]),eV=(0,d.useCallback)(()=>{let e=eF();if(!e)return;let t=e.blockEl.getBoundingClientRect();eB({blockRef:e.blockRef,markdown:e.markdown,anchor:{top:t.bottom+4,left:t.left}})},[eF]),eU=(0,d.useCallback)(()=>{let e=eF();e&&e$({blockRef:e.blockRef,el:e.blockEl})},[eF]),eW=(0,d.useRef)(!1),eK=(0,d.useRef)(!1),eq=(0,d.useRef)(null),eJ=e=>e.replace(/\s+$/g,"").trimStart(),eG=(0,d.useCallback)(async()=>{if(eK.current||eb.current||"suggesting"!==g.useEditorStore.getState().editMode||!eW.current)return;let e=eY.current,t=g.useEditorStore.getState().currentPath;if(!e||!t)return;let n=eN.current?.querySelector(".ProseMirror");if(!n)return;let r=Array.from(n.children),i=w.useProofStore.getState().byPath[t]?.snapshotBlocks??[];if(0!==i.length){eK.current=!0,eW.current=!1;try{let n=()=>w.useProofStore.getState().byPath[t]?.snapshotRevision??0,o=async()=>{await w.useProofStore.getState().loadSnapshot(t),await w.useProofStore.getState().loadSidecar(t)},s=Math.max(r.length,i.length),a=!1;for(let e=0;e<s;e++){let s=r[e],l=i[e],c=s?(0,p.htmlToMarkdown)(s.outerHTML,t).trim():null;if(l&&null!==c){if(eJ(c)!==eJ(l.markdown)){let e=await (0,x.captureSuggestion)({path:t,ref:l.ref,kind:"replace",markdown:c,getRevision:n,refresh:o});a=a||e}}else if(l&&null===c){let e=await (0,x.captureSuggestion)({path:t,ref:l.ref,kind:"delete",getRevision:n,refresh:o});a=a||e}else if(!l&&null!==c&&c.length>0){let e=i[i.length-1]?.ref;if(e){let r=await (0,x.captureSuggestion)({path:t,ref:e,kind:"insertAfter",markdown:c,getRevision:n,refresh:o});a=a||r}}}if(a){await o();let n=(w.useProofStore.getState().byPath[t]?.snapshotBlocks??i).map(e=>e.markdown).join("\n\n");ey.current=!0;let r=await (0,h.markdownToHtml)(n,t);e.commands.setContent(r),setTimeout(()=>{ey.current=!1},50)}}finally{eK.current=!1}}},[]);(0,d.useEffect)(()=>{if(!H)return;let e=setTimeout(()=>{w.useProofStore.getState().loadSnapshot(H)},200);return()=>clearTimeout(e)},[H]),(0,d.useEffect)(()=>{if(!H||0===eI.length||!eN.current)return;let e=eN.current,t=e.querySelector(".ProseMirror");if(!t)return;let n=Array.from(t.children),r=e.getBoundingClientRect(),i=new Map;for(let t=0;t<Math.min(n.length,eI.length);t++){let o=n[t],s=eI[t];o.setAttribute("data-block-ref",s.ref);let a=o.getBoundingClientRect();i.set(s.ref,{top:a.top-r.top+e.scrollTop,left:a.left-r.left,width:a.width,bottom:a.bottom-r.top+e.scrollTop})}eT(i)},[H,eI]);let eX=(0,d.useCallback)(({editor:e})=>{if(ey.current||eb.current||!e)return;"suggesting"===g.useEditorStore.getState().editMode&&(eW.current=!0);let t=e.getHTML(),n=(0,p.htmlToMarkdown)(t,g.useEditorStore.getState().currentPath??void 0);g.useEditorStore.getState().updateContent(n)},[]),eZ=(0,r.useEditor)({extensions:M.editorExtensions,content:"",editable:!Q,onUpdate:eX,onBlur:()=>{eG()},onSelectionUpdate:({editor:e})=>{if("suggesting"!==g.useEditorStore.getState().editMode)return;let{from:t}=e.state.selection,n=e.state.doc.resolve(t),r=n.depth>0?n.index(0):0,i=eq.current;eq.current=r,null!==i&&i!==r&&eW.current&&eG()},editorProps:{attributes:{class:"focus:outline-none min-h-[calc(100vh-12rem)] px-4 sm:px-8 py-6 max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto"},handleKeyDown:(e,t)=>{if((t.metaKey||t.ctrlKey)&&"a"===t.key.toLowerCase()&&(0,n.isInTable)(e.state)){let r=(0,n.cellAround)(e.state.selection.$from),i=r?.nodeAfter;if(!r||!i)return!1;let o=r.pos+1,s=r.pos+i.nodeSize-1;return(e.state.selection.from!==o||e.state.selection.to!==s)&&(t.preventDefault(),eZ?.chain().focus().setTextSelection({from:o,to:s}).run(),!0)}return!1},handleClick:(e,t,n)=>{let r=n.target.closest("a");if(!r)return!1;let i=r.getAttribute("href");if(!i)return!1;if("true"===r.dataset.wikiLink){n.preventDefault(),n.stopPropagation();let e=r.dataset.slug??"",t=r.dataset.anchor??null;if(!e)return!0;let i=v.useWikiSlugsStore.getState();if(i.has(e)){let n=i.getDir(e),r=null===n||"root"===n?`${e}.md`:`${n}/${e}.md`;g.useEditorStore.getState().loadPage(r),t&&setTimeout(()=>{document.querySelector(`[id="${t}"]`)?.scrollIntoView({behavior:"smooth"})},200)}else{if(eb.current)return!0;eg.current(e).then(e=>{if(e.ok){let t=e.dir??"entities",n=`${t}/${e.slug}.md`;g.useEditorStore.getState().loadPage(n)}})}return!0}if(i.startsWith("#page:")){n.preventDefault(),n.stopPropagation();let e=i.replace("#page:",""),{nodes:t,selectPage:r,expandPath:o}=y.useTreeStore.getState(),s=eo(e,g.useEditorStore.getState().currentPath,t);return s&&es(s,r,o),!0}if(/^https?:\/\//.test(i)||i.startsWith("/api/")||i.startsWith("mailto:")||i.startsWith("tel:"))return!1;n.preventDefault(),n.stopPropagation();let{nodes:o,selectPage:s,expandPath:a}=y.useTreeStore.getState(),l=function(e,t,n){let r=ei(n),i=e.replace(/\.md$/,"").replace(/^\.\//,"").replace(/^\//,""),o=r.find(e=>e.path===i);if(o)return o.path;if(t){let e=t.includes("/")?t.substring(0,t.lastIndexOf("/")):"",n=e?`${e}/${i}`:i,o=r.find(e=>e.path===n);if(o)return o.path}return eo(i.includes("/")?i.split("/").pop():i,t,n)}(i,g.useEditorStore.getState().currentPath,o);return l&&es(l,s,a),!0},handlePaste:(e,t)=>{if(eb.current)return!1;let n=t.clipboardData?.files,r=g.useEditorStore.getState().currentPath;if(n&&n.length>0&&r){for(let e of Array.from(n))er(r,e).then(t=>{t&&eZ&&(e.type.startsWith("image/")?eZ.chain().focus().setImage({src:t,alt:e.name}).run():eZ.chain().focus().insertContent(`<a href="${t}">${e.name}</a>`).run())});return!0}return!1},handleDrop:(e,t)=>{if(eb.current)return!1;let n=t.dataTransfer?.files;if(!n||0===n.length)return!1;let r=g.useEditorStore.getState().currentPath;if(!r)return!1;for(let e of(t.preventDefault(),Array.from(n)))er(r,e).then(t=>{t&&eZ&&(e.type.startsWith("image/")?eZ.chain().focus().setImage({src:t,alt:e.name}).run():eZ.chain().focus().insertContent(`<a href="${t}">${e.name}</a>`).run())});return!0}},immediatelyRender:!1}),eY=(0,d.useRef)(eZ);eY.current=eZ,(0,d.useEffect)(()=>{eZ?.setEditable(!Q),Q&&ew(!1)},[eZ,Q]);let eQ=(0,d.useRef)(null),e0=(0,d.useRef)(null),[e1,e2]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!eZ||null===H||g.useEditorStore.getState().isDirty&&H===eQ.current||U&&""===B)return;let e=ea.body,t=`${H} ${e}`;if(e0.current===t){e1!==H&&e2(H);return}eQ.current=H;let n=!1;return(async()=>{ey.current=!0;let r=await (0,h.markdownToHtml)(e,Q?{pagePath:H,sanitize:!0}:H);if(n||g.useEditorStore.getState().currentPath!==H){ey.current=!1;return}eZ.commands.setContent(r),e0.current=t,e2(H),setTimeout(()=>{ey.current=!1},50)})(),()=>{n=!0}},[eZ,B,H,U,e1,ea.body,Q]),(0,d.useEffect)(()=>{if(!Q||!e1)return;let e=eN.current;e&&e.querySelectorAll('input[type="checkbox"]').forEach(e=>{e.disabled=!0})},[Q,e1,ea.body]);let e3=null!==H&&(U||e1!==H),[e5,e4]=(0,d.useState)(!1);if((0,d.useEffect)(()=>{if(!e3)return void e4(!1);let e=setTimeout(()=>e4(!0),150);return()=>clearTimeout(e)},[e3]),null===H)return(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,t.jsxs)("div",{className:"text-center space-y-3",children:[(0,t.jsx)("p",{className:"text-lg font-medium tracking-[-0.02em]",children:"No page selected"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground/70",children:"Select a page from the sidebar or create a new one"})]})});if("missing"===q){let e=(H.split("/").pop()||H).replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()),n=(0,u.findNodeByPath)(el,H),r=n?.children??[],i=r.length>0;return(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto px-6 py-10 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-lg font-medium tracking-[-0.02em] text-foreground",children:e}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground/80",children:["This folder doesn't have an"," ",(0,t.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-[12px]",children:"index.md"}),i?" yet — its contents are listed below.":" yet."]}),(0,t.jsxs)("button",{onClick:()=>void G(e),className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-[13px] font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:[(0,t.jsx)(a.FilePlus,{className:"h-3.5 w-3.5"}),"Create page"]})]}),i&&(0,t.jsx)(N.FolderIndex,{folderPath:H,entries:r},H)]})})}let e6=async()=>{if(ev){if(g.useEditorStore.getState().updateContent(ex),eZ){ey.current=!0;let e=await (0,h.markdownToHtml)(ex,H??void 0);eZ.commands.setContent(e),setTimeout(()=>{ey.current=!1},50)}ew(!1)}else ek(g.useEditorStore.getState().content),ew(!0)},e9=(0,u.findNodeByPath)(el,H),e7=e9?.type==="directory"||e9?.type==="cabinet"?e9.children??[]:[],e8=e7.length>0,te=e8&&"files"===eS;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e8&&(0,t.jsxs)("div",{className:"flex items-center gap-1 px-3 pt-2 border-b border-border",children:[(0,t.jsx)("button",{onClick:()=>eC("page"),className:`px-3 py-1.5 text-[12px] rounded-t-md border-b-2 -mb-px transition-colors ${"page"===eS?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"aria-pressed":"page"===eS,children:"Page"}),(0,t.jsxs)("button",{onClick:()=>eC("files"),className:`px-3 py-1.5 text-[12px] rounded-t-md border-b-2 -mb-px transition-colors ${"files"===eS?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"aria-pressed":"files"===eS,children:["Files",(0,t.jsx)("span",{className:"ml-1.5 text-muted-foreground/60",children:e7.length})]})]}),te?(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)("div",{className:"max-w-3xl mx-auto px-6 py-6",children:(0,t.jsx)(N.FolderIndex,{folderPath:H,entries:e7},H)})}):(0,t.jsxs)(t.Fragment,{children:[!Q&&(0,t.jsxs)("div",{className:"flex items-center min-w-0",children:[(0,t.jsx)("div",{className:"flex-1 min-w-0",children:!ev&&(0,t.jsx)(E.EditorToolbar,{editor:eZ})}),(0,t.jsxs)("button",{onClick:e6,className:`flex items-center gap-1.5 px-3 py-1 mr-2 text-[11px] rounded-md transition-colors border border-border ${ev?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent"}`,children:[(0,t.jsx)(s.Code2,{className:"h-3 w-3"}),ev?"Preview":"Markdown"]})]}),ev?(0,t.jsx)("div",{className:"flex-1 overflow-y-auto p-4",dir:eu?"rtl":void 0,children:(0,t.jsx)("textarea",{value:ex,onChange:e=>ek(e.target.value),className:"w-full h-full min-h-[calc(100vh-12rem)] bg-transparent font-mono text-[13px] leading-relaxed resize-none focus:outline-none",spellCheck:!1})}):(0,t.jsxs)("div",{className:"flex-1 relative",dir:eu?"rtl":void 0,children:[et&&(0,t.jsx)("div",{className:"absolute top-0 inset-x-0 z-20 flex items-center justify-center gap-2 px-3 py-1 bg-primary/10 border-b border-primary/20 text-[11px] text-primary pointer-events-none",children:"Suggesting mode · your edits become suggestions for review"}),(0,t.jsx)(I.DocumentOutline,{editor:eZ,scrollContainerRef:eN}),(0,t.jsxs)("div",{ref:eN,className:`absolute inset-0 overflow-y-auto ${et?"pt-7":""}`,style:{"--editor-max-w":ec,"--editor-ml":ed},"data-editor-scroll":!0,children:[(0,t.jsxs)("div",{"aria-hidden":"true",className:"relative pointer-events-none",style:{height:0},children:[Object.entries(e_).map(([e,n])=>{let r=eA.get(e);return r?(0,t.jsx)("div",{style:{pointerEvents:"auto"},children:(0,t.jsx)(A.CommentPip,{anchorKey:e,anchorLabel:e,comments:n,top:r.top+4,left:Math.max(0,r.left-20),onClick:()=>{let t=eN.current?.querySelector(`[data-block-ref="${e}"]`);t&&e$({blockRef:e,el:t})}})},`pip-${e}`):null}),H&&eL.map(e=>{let n=eA.get(e.ref),r=eI.find(t=>t.ref===e.ref);if(!n||!r)return null;let i="insertAfter"===e.kind?n.bottom+4:"insertBefore"===e.kind?Math.max(0,n.top-80):n.top;return(0,t.jsx)("div",{style:{pointerEvents:"auto"},children:(0,t.jsx)(O.SuggestionCard,{path:H,suggestion:e,currentMarkdown:r.markdown,baseRevision:eD,getLatestRevision:()=>w.useProofStore.getState().byPath[H]?.snapshotRevision??0,top:i,left:n.left,width:n.width,onSettled:()=>{w.useProofStore.getState().loadSidecar(H),w.useProofStore.getState().loadSnapshot(H)},readOnly:Q})},`sug-${e.id}`)})]}),ez&&H&&(0,t.jsx)(T.CommentThread,{path:H,anchorKey:ez.blockRef,anchorRef:ez.blockRef,anchorLabel:ez.blockRef,comments:e_[ez.blockRef]??[],anchorEl:ez.el,onClose:()=>e$(null),readOnly:Q}),eH&&H&&(0,t.jsx)(D.SuggestEditPopover,{path:H,blockRef:eH.blockRef,currentMarkdown:eH.markdown,anchor:eH.anchor,onClose:()=>eB(null)}),Q&&Object.keys(ea.data).length>0&&(0,t.jsx)("div",{className:"max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto px-4 sm:px-8 pt-6",children:(0,t.jsx)(ee,{data:ea.data})}),(0,t.jsx)(r.EditorContent,{editor:eZ}),H&&/\.(md|markdown)$/i.test(H)&&(0,t.jsx)(P.BacklinksPanel,{currentPath:H}),(0,t.jsx)("div",{"aria-hidden":"true",className:"contents",onMouseOver:e=>{let t=e.target.closest(".proof-span");t&&t!==eE&&eM(t)},onMouseOut:e=>{let t=e.relatedTarget;t?.closest(".proof-span")||eM(null)}}),H&&(0,t.jsx)(R.ProofSpanPopover,{targetEl:eE,path:H,onClose:()=>eM(null),onComment:()=>{if(!eE)return;let e=eE.closest("[data-block-ref]");if(!e)return;let t=e.getAttribute("data-block-ref");t&&e$({blockRef:t,el:e})}}),!Q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C.EditorBubbleMenu,{editor:eZ,onSuggestEdit:eV,onComment:eU}),(0,t.jsx)(L.TableMenu,{editor:eZ}),(0,t.jsx)(j.SlashCommands,{editor:eZ}),(0,t.jsx)(J,{editor:eZ,onCreateRequest:eg.current})]}),Q&&(0,t.jsx)(en,{containerRef:eN,onComment:eU}),(0,t.jsxs)("div",{className:"max-w-[var(--editor-max-w,48rem)] ml-[var(--editor-ml,auto)] mr-auto px-8 pb-8 flex items-center gap-4",children:[(0,t.jsxs)("button",{onClick:()=>{ep(),eh()},className:"group flex items-center gap-2 text-[13px] text-muted-foreground/50 hover:text-muted-foreground transition-colors cursor-pointer",children:[(0,t.jsx)(c.Sparkles,{className:"h-3.5 w-3.5 group-hover:text-primary transition-colors"}),(0,t.jsx)("span",{children:"Edit with AI"})]}),!Q&&(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground/30 select-none",children:[(0,t.jsx)("kbd",{className:"rounded px-1 py-0.5 font-mono text-[10px] ring-1 ring-foreground/10",children:"/"})," ","for commands"]})]})]}),e5&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/80 backdrop-blur-md z-20 pointer-events-none","aria-hidden":"true",children:(0,t.jsx)(l.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground/70"})})]}),!Q&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-1 border-t border-border text-xs text-muted-foreground/60",children:[(0,t.jsxs)("span",{className:"text-[10.5px] text-muted-foreground/30 select-none hidden sm:block",children:[(0,t.jsx)("kbd",{className:"rounded px-1 font-mono text-[9.5px] ring-1 ring-foreground/10",children:"⌘S"})," ","save",(0,t.jsx)("span",{className:"mx-1.5 opacity-40",children:"·"}),(0,t.jsx)("kbd",{className:"rounded px-1 font-mono text-[9.5px] ring-1 ring-foreground/10",children:"/"})," ","commands"]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center rounded-md border border-border overflow-hidden text-[10.5px]",role:"radiogroup","aria-label":"Edit mode",children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"editing"===X,onClick:()=>Z("editing"),className:`px-2 py-0.5 transition-colors ${"editing"===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:"Editing"}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"suggesting"===X,onClick:()=>Z("suggesting"),className:`px-2 py-0.5 transition-colors ${"suggesting"===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"}`,children:"Suggesting"})]}),(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] transition-all duration-300 ${"idle"===F?"opacity-0 pointer-events-none":"opacity-100"} ${"saving"===F?"bg-muted text-muted-foreground":"saved"===F?"bg-success/10 text-success":"error"===F?"bg-destructive/10 text-destructive":""}`,children:["saving"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Loader2,{className:"h-2.5 w-2.5 animate-spin"}),"Saving…"]}),"saved"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Check,{className:"h-2.5 w-2.5"}),"Saved"]}),"error"===F&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.AlertCircle,{className:"h-2.5 w-2.5"}),"Save failed"]})]})]})]})]})]}),em]})}],912235)},409082,e=>{"use strict";let t=(0,e.i(605993).default)("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);e.s(["Moon",0,t],409082)},847463,e=>{"use strict";let t=(0,e.i(605993).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],847463)}]);