@profoundlogic/coderflow-server 0.5.6 → 0.5.7

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 (167) hide show
  1. package/dist/coder-server.js +1 -1
  2. package/dist/config.js +1 -1
  3. package/dist/lib/agent-keepalive.js +1 -1
  4. package/dist/lib/agent-models.js +1 -1
  5. package/dist/lib/api-keys.js +1 -1
  6. package/dist/lib/apiKeys.js +1 -1
  7. package/dist/lib/app-server-ports.js +1 -1
  8. package/dist/lib/auto-judge.js +1 -1
  9. package/dist/lib/automation-service.js +1 -1
  10. package/dist/lib/basic-auth.js +1 -1
  11. package/dist/lib/bindings.js +1 -1
  12. package/dist/lib/build-history.js +1 -1
  13. package/dist/lib/build-output-service.js +1 -1
  14. package/dist/lib/build-scheduler.js +1 -1
  15. package/dist/lib/build-service.js +1 -1
  16. package/dist/lib/ca-certificates.js +1 -1
  17. package/dist/lib/claude-oauth-refresh.js +1 -1
  18. package/dist/lib/cli/build.js +1 -1
  19. package/dist/lib/cli/cleanup-users.js +1 -1
  20. package/dist/lib/cli/config-command.js +1 -1
  21. package/dist/lib/cli/config.js +1 -1
  22. package/dist/lib/cli/create-user.js +1 -1
  23. package/dist/lib/cli/grant-admin.js +1 -1
  24. package/dist/lib/cli/init.js +1 -1
  25. package/dist/lib/cli/jira.js +1 -1
  26. package/dist/lib/cli/license.js +1 -1
  27. package/dist/lib/cli/list-roles.js +1 -1
  28. package/dist/lib/cli/list-users.js +1 -1
  29. package/dist/lib/cli/server-manager.js +1 -1
  30. package/dist/lib/cli/set-password.js +1 -1
  31. package/dist/lib/config-migration.js +1 -1
  32. package/dist/lib/container-credential-sync.js +1 -1
  33. package/dist/lib/container-tokens.js +1 -1
  34. package/dist/lib/data-dir.js +1 -1
  35. package/dist/lib/deployment-history.js +1 -1
  36. package/dist/lib/deployment-service.js +1 -1
  37. package/dist/lib/docker-utils.js +1 -1
  38. package/dist/lib/email.js +1 -1
  39. package/dist/lib/emailTemplates.js +1 -1
  40. package/dist/lib/entitlement.js +1 -1
  41. package/dist/lib/external-connections.js +1 -1
  42. package/dist/lib/fetch-utils.js +1 -1
  43. package/dist/lib/git-commit-details-route.js +1 -1
  44. package/dist/lib/git-history-diff-guardrails.js +1 -1
  45. package/dist/lib/git-provider-service.js +1 -1
  46. package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
  47. package/dist/lib/git-provider-setup/index.js +1 -1
  48. package/dist/lib/git-provider-setup/setup-factory.js +1 -1
  49. package/dist/lib/git-provider-setup/setup-interface.js +1 -1
  50. package/dist/lib/git-providers/azure-devops-provider.js +1 -1
  51. package/dist/lib/git-providers/github-app-provider.js +1 -1
  52. package/dist/lib/git-providers/index.js +1 -1
  53. package/dist/lib/git-providers/provider-factory.js +1 -1
  54. package/dist/lib/git-providers/provider-interface.js +1 -1
  55. package/dist/lib/github-urls.js +1 -1
  56. package/dist/lib/group-objective-linking.js +1 -1
  57. package/dist/lib/ibmi-sync.js +1 -1
  58. package/dist/lib/jira-client.js +1 -1
  59. package/dist/lib/judge-blinding.js +1 -1
  60. package/dist/lib/logger.js +1 -1
  61. package/dist/lib/migration-to-scoped-rbac.js +1 -1
  62. package/dist/lib/model-fetcher.js +1 -1
  63. package/dist/lib/notifications.js +1 -1
  64. package/dist/lib/objective-context.js +1 -1
  65. package/dist/lib/oidc-auth.js +1 -1
  66. package/dist/lib/oidc-device-flow.js +1 -1
  67. package/dist/lib/passwordTokens.js +1 -1
  68. package/dist/lib/permission-resolver.js +1 -1
  69. package/dist/lib/pin-cascade.js +1 -1
  70. package/dist/lib/provider-accounts.js +1 -1
  71. package/dist/lib/provider-oauth.js +1 -1
  72. package/dist/lib/provider-profile.js +1 -1
  73. package/dist/lib/provider-token-refresh.js +1 -1
  74. package/dist/lib/rbac-user-state.js +1 -1
  75. package/dist/lib/request-url.js +1 -1
  76. package/dist/lib/rewind.js +1 -1
  77. package/dist/lib/role-definitions.js +1 -1
  78. package/dist/lib/roles.js +1 -1
  79. package/dist/lib/secrets.js +1 -1
  80. package/dist/lib/setup-repo-git-auth.js +1 -1
  81. package/dist/lib/state-capture.js +1 -1
  82. package/dist/lib/static-files.js +1 -1
  83. package/dist/lib/task-name-format.js +1 -1
  84. package/dist/lib/task-name-generator.js +1 -1
  85. package/dist/lib/task-source-metadata.js +1 -1
  86. package/dist/lib/teams.js +1 -1
  87. package/dist/lib/user-git-oauth.js +1 -1
  88. package/dist/lib/user-git-tokens.js +1 -1
  89. package/dist/lib/users.js +1 -1
  90. package/dist/middleware/requireAuth.js +1 -1
  91. package/dist/middleware/requireInit.js +1 -1
  92. package/dist/middleware/requirePermission.js +1 -1
  93. package/dist/package.json +1 -1
  94. package/dist/playwright.config.js +1 -1
  95. package/dist/routes/apiKeys.js +1 -1
  96. package/dist/routes/auth-oidc.js +1 -1
  97. package/dist/routes/auth.js +1 -1
  98. package/dist/routes/automations.js +1 -1
  99. package/dist/routes/bindings.js +1 -1
  100. package/dist/routes/build.js +1 -1
  101. package/dist/routes/containers.js +1 -1
  102. package/dist/routes/deploy-task.js +1 -1
  103. package/dist/routes/environment-management.js +1 -1
  104. package/dist/routes/environments.js +1 -1
  105. package/dist/routes/external-skills.js +1 -1
  106. package/dist/routes/git-credentials.js +1 -1
  107. package/dist/routes/git-oauth.js +1 -1
  108. package/dist/routes/git-provider-setup.js +1 -1
  109. package/dist/routes/health.js +1 -1
  110. package/dist/routes/jira.js +1 -1
  111. package/dist/routes/objective-management.js +1 -1
  112. package/dist/routes/password.js +1 -1
  113. package/dist/routes/prompt.js +1 -1
  114. package/dist/routes/provider-auth.js +1 -1
  115. package/dist/routes/qa.js +1 -1
  116. package/dist/routes/roles.js +1 -1
  117. package/dist/routes/settings.js +1 -1
  118. package/dist/routes/skill-management.js +1 -1
  119. package/dist/routes/skills.js +1 -1
  120. package/dist/routes/tasks.js +1 -1
  121. package/dist/routes/teams.js +1 -1
  122. package/dist/routes/templates.js +1 -1
  123. package/dist/routes/test-task.js +1 -1
  124. package/dist/routes/test.js +1 -1
  125. package/dist/routes/users.js +1 -1
  126. package/dist/routes/visualizations.js +1 -1
  127. package/dist/scripts/create-user.js +1 -1
  128. package/dist/scripts/migrate-config-to-data-dir.js +1 -1
  129. package/dist/start.js +1 -1
  130. package/dist/web-ui/public/activity-detail-modal.js +1 -1
  131. package/dist/web-ui/public/activity-feed.js +1 -1
  132. package/dist/web-ui/public/activity-formatters.js +1 -1
  133. package/dist/web-ui/public/agent-event-parser.js +1 -1
  134. package/dist/web-ui/public/app.js +1 -1
  135. package/dist/web-ui/public/approve-dialog.js +1 -1
  136. package/dist/web-ui/public/automation-links.js +1 -1
  137. package/dist/web-ui/public/automation-schedule.js +1 -1
  138. package/dist/web-ui/public/comments-widget.js +1 -1
  139. package/dist/web-ui/public/diff-utils.js +1 -1
  140. package/dist/web-ui/public/environments.js +1 -1
  141. package/dist/web-ui/public/feedback-widget.css +6 -4
  142. package/dist/web-ui/public/feedback-widget.js +1 -1
  143. package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
  144. package/dist/web-ui/public/git-history.js +1 -1
  145. package/dist/web-ui/public/git-status.js +1 -1
  146. package/dist/web-ui/public/index.js +1 -1
  147. package/dist/web-ui/public/login.js +1 -1
  148. package/dist/web-ui/public/markdown-editor.js +1 -1
  149. package/dist/web-ui/public/markdown-file-editor.js +1 -1
  150. package/dist/web-ui/public/modal-maximize.js +1 -1
  151. package/dist/web-ui/public/notifications.js +1 -1
  152. package/dist/web-ui/public/pr-dialog.js +1 -1
  153. package/dist/web-ui/public/roles.js +1 -1
  154. package/dist/web-ui/public/server-health.js +1 -1
  155. package/dist/web-ui/public/settings.js +1 -1
  156. package/dist/web-ui/public/setup-password.js +1 -1
  157. package/dist/web-ui/public/skills.js +1 -1
  158. package/dist/web-ui/public/sse-client.js +1 -1
  159. package/dist/web-ui/public/sse-shared-worker.js +1 -1
  160. package/dist/web-ui/public/styles.css +34 -4
  161. package/dist/web-ui/public/task.js +1 -1
  162. package/dist/web-ui/public/teams.js +1 -1
  163. package/dist/web-ui/public/terminal.js +1 -1
  164. package/dist/web-ui/public/theme.js +1 -1
  165. package/dist/web-ui/public/users.js +1 -1
  166. package/dist/web-ui/public/variant-grouping.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- import{initTheme,mountThemeToggle}from'./theme.js';const OIDC_ERRORS={'oidc_init_failed':'Failed\x20to\x20connect\x20to\x20the\x20identity\x20provider.\x20Please\x20try\x20again.','oidc_not_configured':'Single\x20sign-on\x20is\x20not\x20configured.\x20Please\x20use\x20local\x20login.','oidc_error':'Authentication\x20was\x20cancelled\x20or\x20failed.','oidc_invalid_callback':'Invalid\x20authentication\x20response.\x20Please\x20try\x20again.','oidc_no_email':'Your\x20identity\x20provider\x20did\x20not\x20provide\x20an\x20email\x20address.\x20Please\x20contact\x20your\x20administrator.','oidc_user_not_found':'Your\x20account\x20is\x20not\x20authorized\x20to\x20access\x20this\x20application.\x20Please\x20contact\x20your\x20administrator.','oidc_invalid_state':'Authentication\x20session\x20expired.\x20Please\x20try\x20again.','oidc_session_expired':'Authentication\x20session\x20expired.\x20Please\x20try\x20again.','oidc_callback_failed':'Authentication\x20failed.\x20Please\x20try\x20again.','session_failed':'Failed\x20to\x20create\x20session.\x20Please\x20try\x20again.'};async function loadOidcConfig(){try{const _0x172031=await fetch('/auth/oidc/config');if(_0x172031['ok'])return await _0x172031['json']();}catch(_0x593371){console['error']('Failed\x20to\x20load\x20OIDC\x20configuration:',_0x593371);}return{'enabled':![]};}function initializeSsoUi(_0x24ea66){const _0x485e68=document['getElementById']('sso-section'),_0x507198=document['getElementById']('sso-divider'),_0xa1943e=document['getElementById']('sso-button-text'),_0x3a680c=document['getElementById']('sso-button'),_0x369108=document['querySelector']('.local-auth-section');_0x24ea66['enabled']&&(_0x485e68['classList']['add']('visible'),_0xa1943e['textContent']=_0x24ea66['display_name']||'Sign\x20in\x20with\x20SSO',_0x3a680c['addEventListener']('click',()=>{window['location']['href']='/auth/oidc/login';}),!_0x24ea66['allow_local_auth']&&(_0x369108['classList']['add']('hidden'),_0x507198['style']['display']='none'));}function checkOidcErrors(){const _0x4d4826=new URLSearchParams(window['location']['search']),_0x4a47f0=_0x4d4826['get']('error'),_0x26e795=_0x4d4826['get']('message');if(_0x4a47f0){const _0x5cc63c=document['getElementById']('login-error'),_0x5a4169=_0x26e795||OIDC_ERRORS[_0x4a47f0]||'Authentication\x20error:\x20'+_0x4a47f0;_0x5cc63c['textContent']=_0x5a4169,_0x5cc63c['classList']['add']('visible'),window['history']['replaceState']({},document['title'],window['location']['pathname']);}}async function handleLogin(_0x3ec97a){_0x3ec97a['preventDefault']();const _0x516407=_0x3ec97a['target'],_0x4e539d=_0x516407['username']['value']['trim'](),_0x2cd7b8=_0x516407['password']['value'],_0x5a550d=_0x516407['querySelector']('button[type=\x22submit\x22]'),_0x3df54d=document['getElementById']('login-error');_0x3df54d['classList']['remove']('visible'),_0x3df54d['textContent']='',_0x5a550d['disabled']=!![],_0x5a550d['textContent']='Signing\x20in...';try{const _0x321f65=await fetch('/auth/login',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'username':_0x4e539d,'password':_0x2cd7b8})}),_0x1bb55c=await _0x321f65['json']();if(!_0x321f65['ok'])throw new Error(_0x1bb55c['message']||'Login\x20failed');window['location']['href']='index.html';}catch(_0xc67bbe){_0x3df54d['textContent']=_0xc67bbe['message']||'An\x20error\x20occurred\x20during\x20login',_0x3df54d['classList']['add']('visible'),_0x5a550d['disabled']=![],_0x5a550d['textContent']='Sign\x20In',_0x516407['password']['value']='',_0x516407['password']['focus']();}}document['addEventListener']('DOMContentLoaded',async()=>{initTheme(),mountThemeToggle(),checkOidcErrors();const _0x36f2a4=await loadOidcConfig();initializeSsoUi(_0x36f2a4);const _0x32aca9=document['getElementById']('login-form');_0x32aca9&&_0x32aca9['addEventListener']('submit',handleLogin);});
1
+ import{initTheme,mountThemeToggle}from'./theme.js';const OIDC_ERRORS={'oidc_init_failed':'Failed\x20to\x20connect\x20to\x20the\x20identity\x20provider.\x20Please\x20try\x20again.','oidc_not_configured':'Single\x20sign-on\x20is\x20not\x20configured.\x20Please\x20use\x20local\x20login.','oidc_error':'Authentication\x20was\x20cancelled\x20or\x20failed.','oidc_invalid_callback':'Invalid\x20authentication\x20response.\x20Please\x20try\x20again.','oidc_no_email':'Your\x20identity\x20provider\x20did\x20not\x20provide\x20an\x20email\x20address.\x20Please\x20contact\x20your\x20administrator.','oidc_user_not_found':'Your\x20account\x20is\x20not\x20authorized\x20to\x20access\x20this\x20application.\x20Please\x20contact\x20your\x20administrator.','oidc_invalid_state':'Authentication\x20session\x20expired.\x20Please\x20try\x20again.','oidc_session_expired':'Authentication\x20session\x20expired.\x20Please\x20try\x20again.','oidc_callback_failed':'Authentication\x20failed.\x20Please\x20try\x20again.','session_failed':'Failed\x20to\x20create\x20session.\x20Please\x20try\x20again.'};async function loadOidcConfig(){try{const _0x275acf=await fetch('/auth/oidc/config');if(_0x275acf['ok'])return await _0x275acf['json']();}catch(_0x20b234){console['error']('Failed\x20to\x20load\x20OIDC\x20configuration:',_0x20b234);}return{'enabled':![]};}function initializeSsoUi(_0x13d6d0){const _0x44ef00=document['getElementById']('sso-section'),_0x16b81c=document['getElementById']('sso-divider'),_0x41cac7=document['getElementById']('sso-button-text'),_0x385eb6=document['getElementById']('sso-button'),_0xe7dbbe=document['querySelector']('.local-auth-section');_0x13d6d0['enabled']&&(_0x44ef00['classList']['add']('visible'),_0x41cac7['textContent']=_0x13d6d0['display_name']||'Sign\x20in\x20with\x20SSO',_0x385eb6['addEventListener']('click',()=>{window['location']['href']='/auth/oidc/login';}),!_0x13d6d0['allow_local_auth']&&(_0xe7dbbe['classList']['add']('hidden'),_0x16b81c['style']['display']='none'));}function checkOidcErrors(){const _0x40d611=new URLSearchParams(window['location']['search']),_0x435909=_0x40d611['get']('error'),_0x1f58b2=_0x40d611['get']('message');if(_0x435909){const _0x3d4e89=document['getElementById']('login-error'),_0x40a81e=_0x1f58b2||OIDC_ERRORS[_0x435909]||'Authentication\x20error:\x20'+_0x435909;_0x3d4e89['textContent']=_0x40a81e,_0x3d4e89['classList']['add']('visible'),window['history']['replaceState']({},document['title'],window['location']['pathname']);}}async function handleLogin(_0x3a0d85){_0x3a0d85['preventDefault']();const _0x30cd34=_0x3a0d85['target'],_0x5d615b=_0x30cd34['username']['value']['trim'](),_0x4059fe=_0x30cd34['password']['value'],_0x58d649=_0x30cd34['querySelector']('button[type=\x22submit\x22]'),_0x3d3ce5=document['getElementById']('login-error');_0x3d3ce5['classList']['remove']('visible'),_0x3d3ce5['textContent']='',_0x58d649['disabled']=!![],_0x58d649['textContent']='Signing\x20in...';try{const _0x3c05a8=await fetch('/auth/login',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'username':_0x5d615b,'password':_0x4059fe})}),_0x29a185=await _0x3c05a8['json']();if(!_0x3c05a8['ok'])throw new Error(_0x29a185['message']||'Login\x20failed');window['location']['href']='index.html';}catch(_0x348687){_0x3d3ce5['textContent']=_0x348687['message']||'An\x20error\x20occurred\x20during\x20login',_0x3d3ce5['classList']['add']('visible'),_0x58d649['disabled']=![],_0x58d649['textContent']='Sign\x20In',_0x30cd34['password']['value']='',_0x30cd34['password']['focus']();}}document['addEventListener']('DOMContentLoaded',async()=>{initTheme(),mountThemeToggle(),checkOidcErrors();const _0x5d2caf=await loadOidcConfig();initializeSsoUi(_0x5d2caf);const _0x2e9366=document['getElementById']('login-form');_0x2e9366&&_0x2e9366['addEventListener']('submit',handleLogin);});
@@ -1 +1 @@
1
- const ATTACHMENT_SCHEME='attachment:',INTERNAL_DRAG_MIME='application/x-profound-editor-image',LINK_DIALOG_STYLE_ID='markdown-editor-link-dialog-styles',ICONS={'bold':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M6\x204h8a4\x204\x200\x200\x201\x204\x204\x204\x204\x200\x200\x201-4\x204H6z\x22></path><path\x20d=\x22M6\x2012h9a4\x204\x200\x200\x201\x204\x204\x204\x204\x200\x200\x201-4\x204H6z\x22></path></svg>','italic':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x2219\x22\x20y1=\x224\x22\x20x2=\x2210\x22\x20y2=\x224\x22></line><line\x20x1=\x2214\x22\x20y1=\x2220\x22\x20x2=\x225\x22\x20y2=\x2220\x22></line><line\x20x1=\x2215\x22\x20y1=\x224\x22\x20x2=\x229\x22\x20y2=\x2220\x22></line></svg>','strike':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x225\x22\x20y1=\x2212\x22\x20x2=\x2219\x22\x20y2=\x2212\x22></line><path\x20d=\x22M16\x206a4\x204\x200\x200\x200-4-4c-2.48\x200-4\x201.79-4\x204\x200\x201.25.5\x202.5\x201.5\x203\x22></path><path\x20d=\x22M9\x2018c0\x201.79\x201.79\x203\x204\x203\x202.48\x200\x204-1.79\x204-4\x200-1.25-.5-2.5-1.5-3\x22></path></svg>','link':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M10\x2013a5\x205\x200\x200\x200\x207.54.54l3-3a5\x205\x200\x200\x200-7.07-7.07l-1.72\x201.71\x22></path><path\x20d=\x22M14\x2011a5\x205\x200\x200\x200-7.54-.54l-3\x203a5\x205\x200\x200\x200\x207.07\x207.07l1.71-1.71\x22></path></svg>','code':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><polyline\x20points=\x2216\x2018\x2022\x2012\x2016\x206\x22></polyline><polyline\x20points=\x228\x206\x202\x2012\x208\x2018\x22></polyline></svg>','listBullet':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x228\x22\x20y1=\x226\x22\x20x2=\x2221\x22\x20y2=\x226\x22></line><line\x20x1=\x228\x22\x20y1=\x2212\x22\x20x2=\x2221\x22\x20y2=\x2212\x22></line><line\x20x1=\x228\x22\x20y1=\x2218\x22\x20x2=\x2221\x22\x20y2=\x2218\x22></line><line\x20x1=\x223\x22\x20y1=\x226\x22\x20x2=\x223.01\x22\x20y2=\x226\x22></line><line\x20x1=\x223\x22\x20y1=\x2212\x22\x20x2=\x223.01\x22\x20y2=\x2212\x22></line><line\x20x1=\x223\x22\x20y1=\x2218\x22\x20x2=\x223.01\x22\x20y2=\x2218\x22></line></svg>','listOrdered':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x2210\x22\x20y1=\x226\x22\x20x2=\x2221\x22\x20y2=\x226\x22></line><line\x20x1=\x2210\x22\x20y1=\x2212\x22\x20x2=\x2221\x22\x20y2=\x2212\x22></line><line\x20x1=\x2210\x22\x20y1=\x2218\x22\x20x2=\x2221\x22\x20y2=\x2218\x22></line><path\x20d=\x22M4\x206h1v4\x22></path><path\x20d=\x22M4\x2010h2\x22></path><path\x20d=\x22M6\x2018H4c0-1\x202-2\x202-3s-1-1.5-2-1\x22></path></svg>','blockquote':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path></svg>','codeBlock':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><rect\x20x=\x223\x22\x20y=\x223\x22\x20width=\x2218\x22\x20height=\x2218\x22\x20rx=\x222\x22\x20ry=\x222\x22></rect><polyline\x20points=\x229\x208\x205\x2012\x209\x2016\x22></polyline><polyline\x20points=\x2215\x208\x2019\x2012\x2015\x2016\x22></polyline></svg>','header':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M4\x2012h8\x22></path><path\x20d=\x22M4\x2018V6\x22></path><path\x20d=\x22M12\x2018V6\x22></path><path\x20d=\x22M17\x2012l3-2v8\x22></path></svg>','color':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M4\x2020h16\x22></path><path\x20d=\x22M6\x2016l6-14\x206\x2014\x22></path><path\x20d=\x22M8\x2012h8\x22></path></svg>'},LINK_DIALOG_STYLES='\x0a.markdown-editor-link-modal\x20{\x0a\x20\x20position:\x20fixed;\x0a\x20\x20inset:\x200;\x0a\x20\x20display:\x20flex;\x0a\x20\x20align-items:\x20center;\x0a\x20\x20justify-content:\x20center;\x0a\x20\x20z-index:\x2010020;\x0a}\x0a\x0a.markdown-editor-link-modal[hidden]\x20{\x0a\x20\x20display:\x20none\x20!important;\x0a}\x0a\x0a.markdown-editor-link-backdrop\x20{\x0a\x20\x20position:\x20absolute;\x0a\x20\x20inset:\x200;\x0a\x20\x20background:\x20rgba(15,\x2023,\x2042,\x200.45);\x0a}\x0a\x0a.markdown-editor-link-dialog\x20{\x0a\x20\x20position:\x20relative;\x0a\x20\x20width:\x20min(460px,\x20calc(100vw\x20-\x2024px));\x0a\x20\x20background:\x20var(--color-surface,\x20var(--feedback-surface,\x20#ffffff));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20border:\x201px\x20solid\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a\x20\x20border-radius:\x20var(--radius-medium,\x2010px);\x0a\x20\x20box-shadow:\x200\x2018px\x2042px\x20rgba(15,\x2023,\x2042,\x200.25);\x0a\x20\x20padding:\x2014px;\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x2012px;\x0a}\x0a\x0a.markdown-editor-link-header\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20align-items:\x20center;\x0a\x20\x20justify-content:\x20space-between;\x0a\x20\x20gap:\x208px;\x0a}\x0a\x0a.markdown-editor-link-title\x20{\x0a\x20\x20margin:\x200;\x0a\x20\x20font-size:\x2016px;\x0a\x20\x20font-weight:\x20600;\x0a}\x0a\x0a.markdown-editor-link-close\x20{\x0a\x20\x20width:\x2028px;\x0a\x20\x20height:\x2028px;\x0a\x20\x20border:\x20none;\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20background:\x20transparent;\x0a\x20\x20color:\x20var(--color-text-muted,\x20var(--feedback-text-muted,\x20#6b7280));\x0a\x20\x20font-size:\x2020px;\x0a\x20\x20line-height:\x201;\x0a\x20\x20cursor:\x20pointer;\x0a}\x0a\x0a.markdown-editor-link-close:hover\x20{\x0a\x20\x20background:\x20var(--color-surface-muted,\x20var(--feedback-surface-muted,\x20#f3f4f6));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a}\x0a\x0a.markdown-editor-link-form\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x2010px;\x0a}\x0a\x0a.markdown-editor-link-field-grid\x20{\x0a\x20\x20display:\x20grid;\x0a\x20\x20gap:\x2010px;\x0a}\x0a\x0a.markdown-editor-link-label\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x206px;\x0a\x20\x20font-size:\x2012px;\x0a\x20\x20font-weight:\x20600;\x0a\x20\x20color:\x20var(--color-text-muted,\x20var(--feedback-text-muted,\x20#4b5563));\x0a}\x0a\x0a.markdown-editor-link-input\x20{\x0a\x20\x20width:\x20100%;\x0a\x20\x20padding:\x209px\x2010px;\x0a\x20\x20border:\x201px\x20solid\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20background:\x20var(--color-surface,\x20var(--feedback-surface,\x20#ffffff));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20font-size:\x2014px;\x0a}\x0a\x0a.markdown-editor-link-input:focus\x20{\x0a\x20\x20outline:\x20none;\x0a\x20\x20border-color:\x20var(--color-primary,\x20#3f72ff);\x0a\x20\x20box-shadow:\x200\x200\x200\x203px\x20rgba(63,\x20114,\x20255,\x200.2);\x0a}\x0a\x0a.markdown-editor-link-actions\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20justify-content:\x20flex-end;\x0a\x20\x20gap:\x208px;\x0a}\x0a\x0a.markdown-editor-link-btn\x20{\x0a\x20\x20border:\x201px\x20solid\x20transparent;\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20padding:\x207px\x2012px;\x0a\x20\x20font-size:\x2013px;\x0a\x20\x20font-weight:\x20600;\x0a\x20\x20cursor:\x20pointer;\x0a}\x0a\x0a.markdown-editor-link-btn-secondary\x20{\x0a\x20\x20background:\x20var(--color-surface-muted,\x20var(--feedback-surface-muted,\x20#f3f4f6));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20border-color:\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a}\x0a\x0a.markdown-editor-link-btn-secondary:hover\x20{\x0a\x20\x20background:\x20var(--color-bg-secondary,\x20var(--feedback-surface-hover,\x20#e5e7eb));\x0a}\x0a\x0a.markdown-editor-link-btn-danger\x20{\x0a\x20\x20background:\x20transparent;\x0a\x20\x20color:\x20var(--color-danger,\x20#dc2626);\x0a\x20\x20border-color:\x20rgba(220,\x2038,\x2038,\x200.35);\x0a}\x0a\x0a.markdown-editor-link-btn-danger:hover\x20{\x0a\x20\x20background:\x20rgba(220,\x2038,\x2038,\x200.08);\x0a}\x0a\x0a.markdown-editor-link-btn-primary\x20{\x0a\x20\x20background:\x20var(--color-primary,\x20#3f72ff);\x0a\x20\x20color:\x20#ffffff;\x0a}\x0a\x0a.markdown-editor-link-btn-primary:hover\x20{\x0a\x20\x20background:\x20var(--color-accent,\x20#2563eb);\x0a}\x0a\x0a[data-theme=\x22dark\x22]\x20.markdown-editor-link-backdrop\x20{\x0a\x20\x20background:\x20rgba(2,\x206,\x2023,\x200.65);\x0a}\x0a\x0a[data-theme=\x22dark\x22]\x20.markdown-editor-link-dialog\x20{\x0a\x20\x20box-shadow:\x200\x2018px\x2042px\x20rgba(0,\x200,\x200,\x200.5);\x0a}\x0a\x0a@media\x20(max-width:\x20480px)\x20{\x0a\x20\x20.markdown-editor-link-dialog\x20{\x0a\x20\x20\x20\x20width:\x20calc(100vw\x20-\x2016px);\x0a\x20\x20\x20\x20padding:\x2012px;\x0a\x20\x20}\x0a\x0a\x20\x20.markdown-editor-link-actions\x20{\x0a\x20\x20\x20\x20flex-wrap:\x20wrap;\x0a\x20\x20}\x0a\x0a\x20\x20.markdown-editor-link-btn\x20{\x0a\x20\x20\x20\x20flex:\x201\x201\x20calc(50%\x20-\x206px);\x0a\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20}\x0a}\x0a';export class MarkdownEditor{constructor(_0x32846f,_0x5ce235={}){this['element']=_0x32846f,this['options']={'placeholder':_0x5ce235['placeholder']||'Start\x20typing...','editable':_0x5ce235['editable']!==![],'onChange':_0x5ce235['onChange']||null,'minHeight':_0x5ce235['minHeight']||'100px','toolbar':_0x5ce235['toolbar']||![],'onAddAttachments':_0x5ce235['onAddAttachments']||null,'resolveAttachmentUrl':_0x5ce235['resolveAttachmentUrl']||null,'isAttachmentNameTaken':_0x5ce235['isAttachmentNameTaken']||null,'fetchUsers':_0x5ce235['fetchUsers']||null},this['mentionState']={'active':![],'query':'','startOffset':0x0,'startNode':null,'users':[],'filteredUsers':[],'selectedIndex':0x0},this['mentionDropdown']=null,this['usersCache']=null,this['linkDialog']=null,this['linkDialogContext']=null;const _0x507d09=window['TurndownService'];this['turndownService']=new _0x507d09({'headingStyle':'atx','codeBlockStyle':'fenced','emDelimiter':'_','bulletListMarker':'-'}),this['attachmentObjectUrls']=new Map(),this['registerTurndownRules'](),this['init']();}['registerTurndownRules'](){this['turndownService']['addRule']('profoundAttachmentImage',{'filter':_0x26df17=>{return _0x26df17&&_0x26df17['nodeName']==='IMG'&&_0x26df17['getAttribute']&&_0x26df17['getAttribute']('data-attachment-name');},'replacement':(_0x30eb61,_0x3af532)=>{const _0x228300=_0x3af532['getAttribute']('data-attachment-name')||'',_0x589d9b=_0x3af532['getAttribute']('alt')||'',_0x5a254d=_0x228300['trim'](),_0x1cabff=this['escapeAltText'](_0x589d9b||_0x5a254d),_0x363aa4=encodeURIComponent(_0x5a254d);return'!['+_0x1cabff+']('+ATTACHMENT_SCHEME+_0x363aa4+')';}}),this['turndownService']['addRule']('profoundMention',{'filter':_0x4bade9=>{return _0x4bade9&&_0x4bade9['nodeName']==='SPAN'&&_0x4bade9['getAttribute']&&_0x4bade9['getAttribute']('data-mention-user-id');},'replacement':(_0x4b396d,_0x508c76)=>{const _0x4062a3=_0x508c76['getAttribute']('data-mention-user-id')||'',_0x55a68f=_0x508c76['textContent']||'',_0x2d9ed1=_0x55a68f['startsWith']('@')?_0x55a68f['slice'](0x1):_0x55a68f;return'['+_0x2d9ed1+'](mention:'+_0x4062a3+')';}}),this['turndownService']['addRule']('profoundColoredText',{'filter':_0x1c11a6=>{if(!_0x1c11a6)return![];if(_0x1c11a6['nodeName']==='FONT'&&_0x1c11a6['getAttribute']&&_0x1c11a6['getAttribute']('color'))return!![];if(_0x1c11a6['nodeName']==='SPAN'&&_0x1c11a6['style']&&_0x1c11a6['style']['color']){if(_0x1c11a6['getAttribute']&&_0x1c11a6['getAttribute']('data-mention-user-id'))return![];return!![];}return![];},'replacement':(_0x2320db,_0x241460)=>{if(!_0x2320db['trim']())return _0x2320db;let _0x8f21b5='';if(_0x241460['nodeName']==='FONT')_0x8f21b5=_0x241460['getAttribute']('color')||'';else _0x241460['style']&&_0x241460['style']['color']&&(_0x8f21b5=this['rgbToHex'](_0x241460['style']['color']));if(!_0x8f21b5)return _0x2320db;return'{color:'+_0x8f21b5+'}'+_0x2320db+'{/color}';}});}['rgbToHex'](_0x1153a1){if(!_0x1153a1)return'';if(_0x1153a1['startsWith']('#'))return _0x1153a1;const _0x2cd51e=_0x1153a1['match'](/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(!_0x2cd51e)return _0x1153a1;const _0x574a6c=parseInt(_0x2cd51e[0x1],0xa),_0x1f1e0f=parseInt(_0x2cd51e[0x2],0xa),_0x26f3a8=parseInt(_0x2cd51e[0x3],0xa);return'#'+[_0x574a6c,_0x1f1e0f,_0x26f3a8]['map'](_0x8ade4d=>_0x8ade4d['toString'](0x10)['padStart'](0x2,'0'))['join']('')['toUpperCase']();}['escapeAltText'](_0x558f01){return String(_0x558f01||'')['replace'](/\]/g,'\x5c]');}['init'](){this['editor']=document['createElement']('div'),this['editor']['className']='markdown-editor',this['editor']['contentEditable']=this['options']['editable'],this['editor']['setAttribute']('role','textbox'),this['editor']['setAttribute']('aria-multiline','true'),this['editor']['style']['minHeight']=this['options']['minHeight'];this['options']['placeholder']&&this['editor']['setAttribute']('data-placeholder',this['options']['placeholder']);this['options']['toolbar']?(this['container']=document['createElement']('div'),this['container']['className']='markdown-editor-wrapper',this['container']['style']['display']='flex',this['container']['style']['flexDirection']='column',this['createToolbar'](),this['container']['appendChild'](this['toolbar']),this['container']['appendChild'](this['editor']),this['element']['parentNode']['insertBefore'](this['container'],this['element'])):this['element']['parentNode']['insertBefore'](this['editor'],this['element']);this['element']['style']['display']='none',this['isMac']=navigator['platform']['toUpperCase']()['indexOf']('MAC')>=0x0,this['linkHintText']=this['isMac']?'⌘+click\x20to\x20follow':'Ctrl+click\x20to\x20follow';this['options']['editable']&&this['bindEvents']();const _0x538f58=this['element']['textContent']||this['element']['value']||'';_0x538f58['trim']()&&this['setMarkdown'](_0x538f58);}['createToolbar'](){this['toolbar']=document['createElement']('div'),this['toolbar']['className']='markdown-editor-toolbar',this['toolbarButtons']={};const _0x426614=[{'id':'header','icon':ICONS['header'],'title':'Heading','action':'header','isDropdown':!![]},{'separator':!![]},{'id':'bold','icon':ICONS['bold'],'title':'Bold\x20(Ctrl+B)','action':'bold','command':'bold'},{'id':'italic','icon':ICONS['italic'],'title':'Italic\x20(Ctrl+I)','action':'italic','command':'italic'},{'id':'strike','icon':ICONS['strike'],'title':'Strikethrough','action':'strikeThrough','command':'strikeThrough'},{'id':'color','icon':ICONS['color'],'title':'Text\x20Color','action':'color','isDropdown':!![]},{'separator':!![]},{'id':'link','icon':ICONS['link'],'title':'Link\x20(Ctrl+K)','action':'link','tagName':'A'},{'id':'code','icon':ICONS['code'],'title':'Inline\x20Code','action':'code','tagName':'CODE'},{'id':'codeBlock','icon':ICONS['codeBlock'],'title':'Code\x20Block','action':'codeBlock','tagName':'PRE'},{'separator':!![]},{'id':'list-bullet','icon':ICONS['listBullet'],'title':'Bullet\x20List','action':'insertUnorderedList','command':'insertUnorderedList'},{'id':'list-ordered','icon':ICONS['listOrdered'],'title':'Numbered\x20List','action':'insertOrderedList','command':'insertOrderedList'}];_0x426614['forEach'](_0x418dd1=>{if(_0x418dd1['separator']){const _0x4c4b02=document['createElement']('div');_0x4c4b02['className']='markdown-toolbar-separator',_0x4c4b02['style']['width']='1px',_0x4c4b02['style']['height']='16px',_0x4c4b02['style']['background']='var(--color-border)',_0x4c4b02['style']['margin']='0\x206px',_0x4c4b02['style']['alignSelf']='center',this['toolbar']['appendChild'](_0x4c4b02);}else{if(_0x418dd1['isDropdown']){const _0x5543da=document['createElement']('div');_0x5543da['className']='markdown-toolbar-dropdown',_0x5543da['style']['position']='relative';const _0x1e62ac=document['createElement']('button');_0x1e62ac['type']='button',_0x1e62ac['className']='markdown-editor-toolbar-btn\x20markdown-toolbar-dropdown-btn',_0x1e62ac['tabIndex']=-0x1,_0x1e62ac['innerHTML']=_0x418dd1['icon']+'<svg\x20class=\x22dropdown-arrow\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2210\x22\x20height=\x2210\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline></svg>',_0x1e62ac['title']=_0x418dd1['title'],_0x1e62ac['dataset']['action']=_0x418dd1['action'];const _0x3c1b89=document['createElement']('div');_0x3c1b89['className']='markdown-toolbar-dropdown-menu',_0x3c1b89['style']['display']='none';if(_0x418dd1['action']==='header')this['createHeaderDropdown'](_0x3c1b89);else _0x418dd1['action']==='color'&&this['createColorDropdown'](_0x3c1b89);_0x1e62ac['addEventListener']('click',_0x29f04f=>{_0x29f04f['preventDefault'](),_0x29f04f['stopPropagation'](),this['toggleDropdown'](_0x3c1b89,_0x1e62ac);}),_0x5543da['appendChild'](_0x1e62ac),_0x5543da['appendChild'](_0x3c1b89),this['toolbar']['appendChild'](_0x5543da),this['toolbarButtons'][_0x418dd1['id']]={'button':_0x1e62ac,'dropdown':_0x3c1b89,'command':_0x418dd1['command'],'tagName':_0x418dd1['tagName']};}else{const _0x2ce767=document['createElement']('button');_0x2ce767['type']='button',_0x2ce767['className']='markdown-editor-toolbar-btn',_0x2ce767['tabIndex']=-0x1,_0x2ce767['innerHTML']=_0x418dd1['icon'],_0x2ce767['title']=_0x418dd1['title'],_0x2ce767['dataset']['action']=_0x418dd1['action'],_0x2ce767['addEventListener']('click',_0x575755=>{_0x575755['preventDefault'](),this['handleToolbarAction'](_0x418dd1['action']);}),this['toolbar']['appendChild'](_0x2ce767),this['toolbarButtons'][_0x418dd1['id']]={'button':_0x2ce767,'command':_0x418dd1['command'],'tagName':_0x418dd1['tagName']};}}}),document['addEventListener']('click',_0x4c2e1a=>{!this['toolbar']['contains'](_0x4c2e1a['target'])&&this['closeAllDropdowns']();});}['createHeaderDropdown'](_0x4f6bfa){const _0x1f46a1=[{'level':0x1,'label':'Heading\x201','tag':'H1'},{'level':0x2,'label':'Heading\x202','tag':'H2'},{'level':0x3,'label':'Heading\x203','tag':'H3'},{'level':0x4,'label':'Heading\x204','tag':'H4'},{'level':0x0,'label':'Normal\x20Text','tag':'P'}];_0x1f46a1['forEach'](_0x37ef14=>{const _0x5609d1=document['createElement']('button');_0x5609d1['type']='button',_0x5609d1['className']='markdown-dropdown-item',_0x5609d1['tabIndex']=-0x1,_0x5609d1['innerHTML']='<span\x20style=\x22font-size:\x20'+(_0x37ef14['level']===0x0?'14px':0x14-_0x37ef14['level']*0x2+'px')+';\x20font-weight:\x20'+(_0x37ef14['level']===0x0?'normal':'bold')+'\x22>'+_0x37ef14['label']+'</span>',_0x5609d1['addEventListener']('click',_0x4e0eab=>{_0x4e0eab['preventDefault'](),_0x4e0eab['stopPropagation'](),this['applyHeader'](_0x37ef14['level']),this['closeAllDropdowns']();}),_0x4f6bfa['appendChild'](_0x5609d1);});}['createColorDropdown'](_0x366d38){const _0x270a0c=[{'value':'#000000','label':'Black'},{'value':'#374151','label':'Gray'},{'value':'#DC2626','label':'Red'},{'value':'#EA580C','label':'Orange'},{'value':'#CA8A04','label':'Yellow'},{'value':'#16A34A','label':'Green'},{'value':'#2563EB','label':'Blue'},{'value':'#7C3AED','label':'Purple'},{'value':'#DB2777','label':'Pink'}],_0x99e016=document['createElement']('div');_0x99e016['className']='markdown-color-grid',_0x99e016['style']['display']='grid',_0x99e016['style']['gridTemplateColumns']='repeat(3,\x201fr)',_0x99e016['style']['gap']='4px',_0x99e016['style']['padding']='8px',_0x270a0c['forEach'](_0x3841a6=>{const _0x1d52e2=document['createElement']('button');_0x1d52e2['type']='button',_0x1d52e2['className']='markdown-color-btn',_0x1d52e2['tabIndex']=-0x1,_0x1d52e2['style']['width']='24px',_0x1d52e2['style']['height']='24px',_0x1d52e2['style']['backgroundColor']=_0x3841a6['value'],_0x1d52e2['style']['border']='1px\x20solid\x20var(--color-border)',_0x1d52e2['style']['borderRadius']='4px',_0x1d52e2['style']['cursor']='pointer',_0x1d52e2['title']=_0x3841a6['label'],_0x1d52e2['addEventListener']('click',_0x21ca77=>{_0x21ca77['preventDefault'](),_0x21ca77['stopPropagation'](),this['applyColor'](_0x3841a6['value']),this['closeAllDropdowns']();}),_0x99e016['appendChild'](_0x1d52e2);}),_0x366d38['appendChild'](_0x99e016);const _0x480408=document['createElement']('button');_0x480408['type']='button',_0x480408['className']='markdown-dropdown-item',_0x480408['innerHTML']='<span>Remove\x20Color</span>',_0x480408['style']['borderTop']='1px\x20solid\x20var(--color-border)',_0x480408['style']['marginTop']='4px',_0x480408['style']['paddingTop']='8px',_0x480408['addEventListener']('click',_0x1ef876=>{_0x1ef876['preventDefault'](),_0x1ef876['stopPropagation'](),this['removeColor'](),this['closeAllDropdowns']();}),_0x366d38['appendChild'](_0x480408);}['toggleDropdown'](_0x53123a,_0x3d9821){const _0x5920a4=_0x53123a['style']['display']!=='none';this['toolbar']&&this['closeAllDropdowns'](),!_0x5920a4&&(_0x53123a['style']['display']='block',_0x3d9821['classList']['add']('active'));}['closeAllDropdowns'](){const _0x21c4fe=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-menu');_0x21c4fe['forEach'](_0x241c73=>_0x241c73['style']['display']='none');const _0x34fd3d=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-btn');_0x34fd3d['forEach'](_0x1b0db5=>_0x1b0db5['classList']['remove']('active'));}['applyHeader'](_0x16a0d6){this['editor']['focus']();const _0x2e0b9a=window['getSelection']();if(!_0x2e0b9a||_0x2e0b9a['rangeCount']===0x0)return;const _0x6bfbc4=_0x2e0b9a['getRangeAt'](0x0);let _0x1774ab=_0x6bfbc4['startContainer'];while(_0x1774ab&&_0x1774ab!==this['editor']){if(_0x1774ab['nodeType']===Node['ELEMENT_NODE']){const _0x5ac44b=window['getComputedStyle'](_0x1774ab)['display'];if(_0x5ac44b==='block'||['P','H1','H2','H3','H4','H5','H6','DIV']['includes'](_0x1774ab['tagName']))break;}_0x1774ab=_0x1774ab['parentNode'];}_0x16a0d6===0x0?document['execCommand']('formatBlock',![],'p'):document['execCommand']('formatBlock',![],'h'+_0x16a0d6),this['editor']['dispatchEvent'](new Event('input'));}['applyColor'](_0x3c6ff1){this['editor']['focus'](),document['execCommand']('foreColor',![],_0x3c6ff1),this['editor']['dispatchEvent'](new Event('input'));}['removeColor'](){this['editor']['focus'](),document['execCommand']('removeFormat',![],null),this['editor']['dispatchEvent'](new Event('input'));}['handleToolbarAction'](_0x4af33a){this['editor']['focus']();switch(_0x4af33a){case'bold':case'italic':case'strikeThrough':case'insertUnorderedList':case'insertOrderedList':document['execCommand'](_0x4af33a,![],null);break;case'link':this['openLinkDialog']();return;case'code':this['toggleInlineCode']();break;case'codeBlock':this['insertCodeBlock']();break;}this['updateToolbarState'](),this['editor']['dispatchEvent'](new Event('input'));}['ensureLinkDialog'](){if(this['linkDialog'])return;this['ensureLinkDialogStyles']();const _0x475d77=document['createElement']('div');_0x475d77['className']='markdown-editor-link-modal',_0x475d77['hidden']=!![],_0x475d77['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-dialog\x22\x20role=\x22dialog\x22\x20aria-modal=\x22true\x22\x20aria-label=\x22Edit\x20link\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22markdown-editor-link-title\x22>Insert\x20Link</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-close\x22\x20aria-label=\x22Close\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<form\x20class=\x22markdown-editor-link-form\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-field-grid\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22markdown-editor-link-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20URL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20class=\x22markdown-editor-link-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-link-field=\x22url\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22https://example.com\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autocomplete=\x22off\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20spellcheck=\x22false\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22markdown-editor-link-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Display\x20text\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20class=\x22markdown-editor-link-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-link-field=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Text\x20shown\x20to\x20readers\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autocomplete=\x22off\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20spellcheck=\x22false\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-secondary\x22\x20data-action=\x22cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-danger\x22\x20data-action=\x22remove\x22\x20hidden>Remove\x20Link</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22submit\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-primary\x22>Insert\x20Link</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</form>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20',document['body']['appendChild'](_0x475d77),this['linkDialog']=_0x475d77,this['linkDialogElements']={'backdrop':_0x475d77['querySelector']('.markdown-editor-link-backdrop'),'title':_0x475d77['querySelector']('.markdown-editor-link-title'),'close':_0x475d77['querySelector']('.markdown-editor-link-close'),'form':_0x475d77['querySelector']('.markdown-editor-link-form'),'urlInput':_0x475d77['querySelector']('[data-link-field=\x22url\x22]'),'textInput':_0x475d77['querySelector']('[data-link-field=\x22text\x22]'),'remove':_0x475d77['querySelector']('[data-action=\x22remove\x22]'),'cancel':_0x475d77['querySelector']('[data-action=\x22cancel\x22]'),'submit':_0x475d77['querySelector']('.markdown-editor-link-btn-primary')},this['linkDialogElements']['backdrop']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['close']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['cancel']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['remove']['addEventListener']('click',()=>{this['applyLinkDialogResult']({'remove':!![]});}),this['linkDialogElements']['form']['addEventListener']('submit',_0x114182=>{_0x114182['preventDefault'](),this['applyLinkDialogResult']();}),this['linkDialog']['addEventListener']('keydown',_0xbb8d9e=>{_0xbb8d9e['key']==='Escape'&&(_0xbb8d9e['preventDefault'](),this['closeLinkDialog']({'restoreSelection':!![]}));});}['openLinkDialog'](){const _0x17603f=window['getSelection']();if(!_0x17603f||_0x17603f['rangeCount']===0x0)return;const _0x5ba5d2=_0x17603f['getRangeAt'](0x0),_0x4f7d6d=this['editor']['contains'](_0x5ba5d2['commonAncestorContainer'])||this['editor']===_0x5ba5d2['commonAncestorContainer'];if(!_0x4f7d6d)return;this['toolbar']&&this['closeAllDropdowns']();this['ensureLinkDialog']();const _0x1a900d=_0x5ba5d2['cloneRange'](),_0x4a5b80=this['findLinkAtRange'](_0x1a900d),_0x5bf35f=_0x4a5b80?_0x4a5b80['getAttribute']('href')||'':'',_0x202002=_0x4a5b80?_0x4a5b80['textContent']||'':_0x1a900d['toString']();this['linkDialogContext']={'range':_0x1a900d,'existingLink':_0x4a5b80,'selectedText':_0x202002},this['linkDialogElements']['title']['textContent']=_0x4a5b80?'Edit\x20Link':'Insert\x20Link',this['linkDialogElements']['submit']['textContent']=_0x4a5b80?'Save\x20Link':'Insert\x20Link',this['linkDialogElements']['remove']['hidden']=!_0x4a5b80,this['linkDialogElements']['urlInput']['value']=_0x5bf35f,this['linkDialogElements']['textInput']['value']=_0x202002,this['linkDialog']['hidden']=![],this['linkDialogElements']['urlInput']['focus'](),this['linkDialogElements']['urlInput']['select']();}['closeLinkDialog']({restoreSelection:restoreSelection=![]}={}){if(!this['linkDialog'])return;const _0x364a88=this['linkDialogContext'];this['linkDialog']['hidden']=!![],restoreSelection&&_0x364a88?.['range']&&(this['editor']['focus'](),this['restoreRange'](_0x364a88['range'])),this['linkDialogContext']=null;}['applyLinkDialogResult']({remove:remove=![]}={}){if(!this['linkDialog']||!this['linkDialogContext'])return;const _0x2f211a=this['linkDialogContext'],_0x35adf5=(this['linkDialogElements']['urlInput']['value']||'')['trim'](),_0x3b3b04=this['linkDialogElements']['textInput']['value']||'',_0x370f0c=_0x3b3b04['trim']();if(!remove&&!_0x35adf5){this['linkDialogElements']['urlInput']['focus']();return;}this['closeLinkDialog'](),this['editor']['focus'](),this['restoreRange'](_0x2f211a['range']);if(remove)_0x2f211a['existingLink']&&_0x2f211a['existingLink']['parentNode']?this['unwrapLinkElement'](_0x2f211a['existingLink']):document['execCommand']('unlink',![],null);else{if(_0x2f211a['existingLink']&&_0x2f211a['existingLink']['parentNode'])_0x2f211a['existingLink']['setAttribute']('href',_0x35adf5),_0x2f211a['existingLink']['textContent']=_0x370f0c||_0x35adf5;else{const _0xe72831=window['getSelection']();if(!_0xe72831||_0xe72831['rangeCount']===0x0)return;const _0x25d120=_0xe72831['getRangeAt'](0x0),_0x9f29c2=(_0x2f211a['selectedText']||'')['trim'](),_0x2cc677=_0x370f0c||_0x9f29c2||_0x35adf5;_0x25d120['deleteContents']();const _0x302fbb=document['createElement']('a');_0x302fbb['href']=_0x35adf5,_0x302fbb['textContent']=_0x2cc677,_0x25d120['insertNode'](_0x302fbb),_0x25d120['setStartAfter'](_0x302fbb),_0x25d120['collapse'](!![]),_0xe72831['removeAllRanges'](),_0xe72831['addRange'](_0x25d120);}}this['addLinkHints'](),this['updateToolbarState'](),this['editor']['dispatchEvent'](new Event('input'));}['ensureLinkDialogStyles'](){if(document['getElementById'](LINK_DIALOG_STYLE_ID))return;const _0x5c8eba=document['createElement']('style');_0x5c8eba['id']=LINK_DIALOG_STYLE_ID,_0x5c8eba['textContent']=LINK_DIALOG_STYLES,document['head']['appendChild'](_0x5c8eba);}['restoreRange'](_0x3294fb){const _0x455195=window['getSelection']();if(!_0x455195)return;try{_0x455195['removeAllRanges'](),_0x455195['addRange'](_0x3294fb);return;}catch(_0x27a93c){}const _0x1cbe72=document['createRange']();_0x1cbe72['selectNodeContents'](this['editor']),_0x1cbe72['collapse'](![]),_0x455195['removeAllRanges'](),_0x455195['addRange'](_0x1cbe72);}['findLinkAtRange'](_0x11f27f){if(!_0x11f27f)return null;const _0x284c77=this['findParentLink'](_0x11f27f['startContainer']);if(_0x11f27f['collapsed'])return _0x284c77;const _0x282633=this['findParentLink'](_0x11f27f['endContainer']);if(_0x284c77&&_0x284c77===_0x282633)return _0x284c77;if(_0x284c77&&_0x284c77['contains'](_0x11f27f['endContainer']))return _0x284c77;if(_0x282633&&_0x282633['contains'](_0x11f27f['startContainer']))return _0x282633;return null;}['findParentLink'](_0x3c8025){let _0x133029=_0x3c8025;while(_0x133029&&_0x133029!==this['editor']){if(_0x133029['nodeType']===Node['ELEMENT_NODE']&&_0x133029['tagName']==='A'){const _0x298782=_0x133029['getAttribute']('href')||'';if(_0x298782['startsWith']('mention:'))return null;return _0x133029;}_0x133029=_0x133029['parentNode'];}return null;}['unwrapLinkElement'](_0x2f3d3b){const _0x243e01=_0x2f3d3b['parentNode'];if(!_0x243e01)return;while(_0x2f3d3b['firstChild']){_0x243e01['insertBefore'](_0x2f3d3b['firstChild'],_0x2f3d3b);}_0x243e01['removeChild'](_0x2f3d3b);}['isSelectionInTag'](_0xf3a597){const _0x5b4486=window['getSelection']();if(!_0x5b4486||_0x5b4486['rangeCount']===0x0)return![];let _0x550328=_0x5b4486['anchorNode'];while(_0x550328&&_0x550328!==this['editor']){if(_0x550328['nodeType']===Node['ELEMENT_NODE']&&_0x550328['tagName']===_0xf3a597)return!![];_0x550328=_0x550328['parentNode'];}return![];}['updateToolbarState'](){if(!this['toolbarButtons'])return;for(const [_0x4a9eb7,_0x46e779]of Object['entries'](this['toolbarButtons'])){let _0x54ed23=![];if(_0x46e779['command'])try{_0x54ed23=document['queryCommandState'](_0x46e779['command']);}catch(_0x402458){_0x54ed23=![];}else _0x46e779['tagName']&&(_0x54ed23=this['isSelectionInTag'](_0x46e779['tagName']));_0x46e779['button']['classList']['toggle']('active',_0x54ed23);}}['bindEvents'](){this['editor']['addEventListener']('keydown',_0xdac6e2=>this['handleKeydown'](_0xdac6e2)),this['editor']['addEventListener']('input',_0x2f5541=>{this['handleMentionInput'](_0x2f5541),this['handleAutoFormat'](_0x2f5541);}),this['editor']['addEventListener']('input',()=>{const _0x4782f1=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');!_0x4782f1&&(this['editor']['innerHTML']='');this['updatePlaceholder']();const _0x41cb4e=this['getMarkdown']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0x41cb4e:this['element']['textContent']=_0x41cb4e,this['options']['onChange']&&this['options']['onChange'](_0x41cb4e);}),this['editor']['addEventListener']('paste',_0x23871b=>this['handlePaste'](_0x23871b)),this['editor']['addEventListener']('dragover',_0x1c7bd1=>this['handleDragOver'](_0x1c7bd1)),this['editor']['addEventListener']('drop',_0x1a3e42=>this['handleDrop'](_0x1a3e42)),this['editor']['addEventListener']('dragstart',_0x1b5775=>this['handleDragStart'](_0x1b5775)),this['options']['toolbar']&&(this['selectionChangeHandler']=()=>{(this['editor']['contains'](document['activeElement'])||this['editor']===document['activeElement'])&&this['updateToolbarState']();},document['addEventListener']('selectionchange',this['selectionChangeHandler']),this['editor']['addEventListener']('keyup',()=>this['updateToolbarState']()),this['editor']['addEventListener']('mouseup',()=>this['updateToolbarState']()),this['editor']['addEventListener']('focus',()=>this['updateToolbarState']())),this['linkClickHandler']=_0x11ded4=>this['handleLinkClick'](_0x11ded4),this['editor']['addEventListener']('click',this['linkClickHandler']),this['linkMouseEnterHandler']=_0x140754=>this['handleLinkMouseEnter'](_0x140754),this['linkMouseLeaveHandler']=_0x3fa060=>this['handleLinkMouseLeave'](_0x3fa060),this['editor']['addEventListener']('mouseover',this['linkMouseEnterHandler']),this['editor']['addEventListener']('mouseout',this['linkMouseLeaveHandler']),this['updatePlaceholder']();}['handleAutoFormat'](_0x5915c7){if(_0x5915c7['inputType']==='deleteContentBackward')return;const _0x5876a9=window['getSelection']();if(!_0x5876a9||_0x5876a9['rangeCount']===0x0)return;const _0xa4ffc9=_0x5876a9['getRangeAt'](0x0),_0x599cdc=_0xa4ffc9['startContainer'];if(_0x599cdc['nodeType']!==Node['TEXT_NODE'])return;if(this['isSelectionInTag']('CODE')||this['isSelectionInTag']('PRE'))return;const _0x5c172a=_0x599cdc['textContent'],_0x5e514f=_0xa4ffc9['startOffset'],_0x2a7b47=_0x5c172a['slice'](0x0,_0x5e514f);if(_0x2a7b47['endsWith']('```')){_0xa4ffc9['setStart'](_0x599cdc,_0x5e514f-0x3),_0xa4ffc9['setEnd'](_0x599cdc,_0x5e514f),_0xa4ffc9['deleteContents'](),this['insertCodeBlock']();return;}const _0x58638b=/`([^`]+)`$/,_0x452a4c=_0x2a7b47['match'](_0x58638b);if(_0x452a4c){const _0x16db8e=_0x452a4c[0x1];if(_0x16db8e){const _0x5d1735=_0x452a4c['index'],_0x4afc24=_0x5d1735+_0x16db8e['length']+0x2;_0xa4ffc9['setStart'](_0x599cdc,_0x5d1735),_0xa4ffc9['setEnd'](_0x599cdc,_0x5e514f),_0xa4ffc9['deleteContents']();const _0x185961=document['createElement']('code');_0x185961['textContent']=_0x16db8e,_0xa4ffc9['insertNode'](_0x185961),_0xa4ffc9['setStartAfter'](_0x185961),_0xa4ffc9['setEndAfter'](_0x185961);const _0x3ee459=document['createTextNode']('​');_0xa4ffc9['insertNode'](_0x3ee459),_0xa4ffc9['setStartAfter'](_0x3ee459),_0xa4ffc9['setEndAfter'](_0x3ee459),_0x5876a9['removeAllRanges'](),_0x5876a9['addRange'](_0xa4ffc9);return;}}const _0x32e1bc=_0x2a7b47['match'](/^[-*][\s\u00A0]$/);if(_0x32e1bc&&this['isAtStartOfBlock'](_0x599cdc)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0xa4ffc9['setStart'](_0x599cdc,Math['max'](_0x5e514f-0x2,0x0)),_0xa4ffc9['setEnd'](_0x599cdc,_0x5e514f),_0xa4ffc9['deleteContents']();const _0x8ef7c1=this['ensureListInsertionAnchor'](_0x599cdc);document['execCommand']('insertUnorderedList',![],null);_0x8ef7c1&&_0x8ef7c1['parentNode']&&_0x8ef7c1['parentNode']['removeChild'](_0x8ef7c1);this['updateToolbarState']();return;}const _0x5244d8=_0x2a7b47['match'](/^1\.[\s\u00A0]$/);if(_0x5244d8&&this['isAtStartOfBlock'](_0x599cdc)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0xa4ffc9['setStart'](_0x599cdc,Math['max'](_0x5e514f-0x3,0x0)),_0xa4ffc9['setEnd'](_0x599cdc,_0x5e514f),_0xa4ffc9['deleteContents']();const _0x354831=this['ensureListInsertionAnchor'](_0x599cdc);document['execCommand']('insertOrderedList',![],null);_0x354831&&_0x354831['parentNode']&&_0x354831['parentNode']['removeChild'](_0x354831);this['updateToolbarState']();return;}}['isAtStartOfBlock'](_0x24a500){let _0x520211=_0x24a500;while(_0x520211&&_0x520211!==this['editor']){const _0x15aae2=_0x520211['parentNode'];if(!_0x15aae2)break;const _0x5318db=_0x15aae2['tagName'];if(_0x5318db==='DIV'||_0x5318db==='P'||_0x5318db==='LI'||_0x15aae2===this['editor']){let _0x1cb244=_0x15aae2['firstChild'];while(_0x1cb244&&(_0x1cb244['nodeType']===Node['TEXT_NODE']&&_0x1cb244['textContent']===''||_0x1cb244['nodeType']===Node['ELEMENT_NODE']&&_0x1cb244['tagName']==='BR')){_0x1cb244=_0x1cb244['nextSibling'];}return _0x1cb244===_0x24a500||_0x1cb244===_0x520211;}_0x520211=_0x15aae2;}if(_0x520211===this['editor']||_0x24a500['parentNode']===this['editor']){let _0x203ce5=this['editor']['firstChild'];while(_0x203ce5&&(_0x203ce5['nodeType']===Node['TEXT_NODE']&&_0x203ce5['textContent']===''||_0x203ce5['nodeType']===Node['ELEMENT_NODE']&&_0x203ce5['tagName']==='BR')){_0x203ce5=_0x203ce5['nextSibling'];}return _0x203ce5===_0x24a500;}return![];}['getClosestBlockElement'](_0x466530){let _0x4e3337=_0x466530;while(_0x4e3337&&_0x4e3337!==this['editor']){const _0x3400ac=_0x4e3337['parentNode'];if(!_0x3400ac)break;const _0x4934ca=_0x3400ac['tagName'];if(_0x4934ca==='DIV'||_0x4934ca==='P'||_0x4934ca==='LI'||_0x3400ac===this['editor'])return _0x3400ac;_0x4e3337=_0x3400ac;}return this['editor'];}['ensureListInsertionAnchor'](_0x151983){const _0x1ae9ae=window['getSelection']();if(!_0x1ae9ae||_0x1ae9ae['rangeCount']===0x0)return null;const _0x6c0c7c=this['getClosestBlockElement'](_0x151983);if(!_0x6c0c7c||_0x6c0c7c===this['editor'])return null;const _0x1906b3=_0x6c0c7c['textContent']['replace'](/\u200B/g,'');if(_0x1906b3!=='')return null;const _0x2de86a=document['createTextNode']('​');_0x6c0c7c['appendChild'](_0x2de86a);const _0x4e89ff=document['createRange']();return _0x4e89ff['setStart'](_0x2de86a,0x1),_0x4e89ff['setEnd'](_0x2de86a,0x1),_0x1ae9ae['removeAllRanges'](),_0x1ae9ae['addRange'](_0x4e89ff),_0x2de86a;}['getContainingListItem'](){const _0x2a3dbd=window['getSelection']();if(!_0x2a3dbd||_0x2a3dbd['rangeCount']===0x0)return null;let _0x104c58=_0x2a3dbd['anchorNode'];while(_0x104c58&&_0x104c58!==this['editor']){if(_0x104c58['nodeType']===Node['ELEMENT_NODE']&&_0x104c58['tagName']==='LI')return _0x104c58;_0x104c58=_0x104c58['parentNode'];}return null;}['isEmptyListItem'](_0x1bf89e){if(!_0x1bf89e)return![];const _0x209f79=_0x1bf89e['textContent']['replace'](/\u200B/g,'')['trim']();if(_0x209f79!=='')return![];const _0x5657fb=_0x1bf89e['querySelector']('img');if(_0x5657fb)return![];const _0x4917b0=_0x1bf89e['querySelector']('ul,\x20ol');if(_0x4917b0)return![];return!![];}['isCursorAtStartOfListItem'](_0x3d4865){if(!_0x3d4865)return![];const _0x236165=window['getSelection']();if(!_0x236165||_0x236165['rangeCount']===0x0||!_0x236165['isCollapsed'])return![];const _0x3a7f00=_0x236165['getRangeAt'](0x0),_0x21ae36=_0x3a7f00['startContainer'];if(_0x21ae36!==_0x3d4865&&!_0x3d4865['contains'](_0x21ae36))return![];const _0x515322=_0x3a7f00['cloneRange']();_0x515322['setStart'](_0x3d4865,0x0),_0x515322['setEnd'](_0x21ae36,_0x3a7f00['startOffset']);const _0x2ad657=_0x515322['toString']()['replace'](/\u200B/g,'')['replace'](/\u00A0/g,'\x20');return _0x2ad657['trim']()==='';}['indentListItem'](_0x1f32a2){const _0x1ea09d=_0x1f32a2['previousElementSibling'];if(!_0x1ea09d||_0x1ea09d['tagName']!=='LI')return;const _0x54d0c5=_0x1f32a2['parentNode'],_0x5cb5bf=_0x54d0c5['tagName'];let _0x38a3d9=_0x1ea09d['querySelector'](':scope\x20>\x20ul,\x20:scope\x20>\x20ol');!_0x38a3d9&&(_0x38a3d9=document['createElement'](_0x5cb5bf),_0x1ea09d['appendChild'](_0x38a3d9)),_0x38a3d9['appendChild'](_0x1f32a2),this['placeCursorInListItem'](_0x1f32a2);}['outdentListItem'](_0x2d4f18){const _0x822af4=_0x2d4f18['parentNode'];if(!_0x822af4||_0x822af4['tagName']!=='UL'&&_0x822af4['tagName']!=='OL')return;const _0x422de5=_0x822af4['parentNode'];if(_0x422de5&&_0x422de5['tagName']==='LI'){const _0x2013fa=_0x422de5['parentNode'];_0x2013fa['insertBefore'](_0x2d4f18,_0x422de5['nextSibling']),_0x822af4['children']['length']===0x0&&_0x822af4['remove'](),this['placeCursorInListItem'](_0x2d4f18);}else return;}['exitListOnEmptyBullet'](_0x1bea31){const _0x43a6e6=_0x1bea31['parentNode'];if(!_0x43a6e6)return;const _0x297d17=_0x43a6e6['parentNode'];if(_0x297d17&&_0x297d17['tagName']==='LI'){this['outdentListItem'](_0x1bea31);return;}const _0x55ce9e=_0x43a6e6['parentNode'],_0x44c211=document['createElement']('p');_0x44c211['innerHTML']='<br>',_0x55ce9e['insertBefore'](_0x44c211,_0x43a6e6['nextSibling']),_0x1bea31['remove']();_0x43a6e6['children']['length']===0x0&&_0x43a6e6['remove']();const _0x1df3be=window['getSelection'](),_0xc8ef57=document['createRange']();_0xc8ef57['setStart'](_0x44c211,0x0),_0xc8ef57['collapse'](!![]),_0x1df3be['removeAllRanges'](),_0x1df3be['addRange'](_0xc8ef57);}['placeCursorInListItem'](_0x5a4c8c){const _0x4a6333=window['getSelection'](),_0x3fd497=document['createRange'](),_0xea9dc8=document['createTreeWalker'](_0x5a4c8c,NodeFilter['SHOW_TEXT'],null,![]),_0x3eeeac=_0xea9dc8['nextNode']();_0x3eeeac?_0x3fd497['setStart'](_0x3eeeac,0x0):_0x3fd497['setStart'](_0x5a4c8c,0x0),_0x3fd497['collapse'](!![]),_0x4a6333['removeAllRanges'](),_0x4a6333['addRange'](_0x3fd497);}['handleLinkClick'](_0x505043){const _0x9424e6=this['isMac']?_0x505043['metaKey']:_0x505043['ctrlKey'];if(!_0x9424e6)return;let _0x1b27b7=_0x505043['target'];while(_0x1b27b7&&_0x1b27b7!==this['editor']){if(_0x1b27b7['tagName']==='A'){_0x505043['preventDefault'](),_0x505043['stopPropagation']();const _0x4c4683=_0x1b27b7['getAttribute']('href');if(!_0x4c4683)return;if(_0x4c4683['startsWith']('mention:'))return;const _0x278f58=/^https?:\/\//i['test'](_0x4c4683);_0x278f58?window['open'](_0x4c4683,'_blank','noopener,noreferrer'):window['location']['href']=_0x4c4683;return;}_0x1b27b7=_0x1b27b7['parentNode'];}}['handleLinkMouseEnter'](_0x2c58da){const _0x236528=_0x2c58da['target'];if(_0x236528['tagName']!=='A')return;const _0x360bfc=_0x236528['getAttribute']('href')||'';if(_0x360bfc['startsWith']('mention:'))return;this['linkTooltipTimeout']&&clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=setTimeout(()=>{this['showLinkTooltip'](_0x236528);},0x12c);}['handleLinkMouseLeave'](_0x1b7530){const _0x2b28c4=_0x1b7530['target'];if(_0x2b28c4['tagName']!=='A')return;this['linkTooltipTimeout']&&(clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=null),this['hideLinkTooltip']();}['showLinkTooltip'](_0x238d07){!this['linkTooltip']&&(this['linkTooltip']=document['createElement']('div'),this['linkTooltip']['className']='markdown-editor-link-tooltip',document['body']['appendChild'](this['linkTooltip']));this['linkTooltip']['textContent']=this['linkHintText']||'Ctrl+click\x20to\x20follow';const _0x495501=_0x238d07['getBoundingClientRect'](),_0x2fc608=this['linkTooltip']['getBoundingClientRect']();let _0x926dce=_0x495501['bottom']+0x4,_0x5070a1=_0x495501['left']+_0x495501['width']/0x2;_0x926dce+0x1e>window['innerHeight']&&(_0x926dce=_0x495501['top']-0x1e);const _0x2fd280=0x78;if(_0x5070a1-_0x2fd280/0x2<0xa)_0x5070a1=_0x2fd280/0x2+0xa;else _0x5070a1+_0x2fd280/0x2>window['innerWidth']-0xa&&(_0x5070a1=window['innerWidth']-_0x2fd280/0x2-0xa);this['linkTooltip']['style']['top']=_0x926dce+'px',this['linkTooltip']['style']['left']=_0x5070a1+'px',this['linkTooltip']['style']['transform']='translateX(-50%)',this['linkTooltip']['classList']['add']('visible');}['hideLinkTooltip'](){this['linkTooltip']&&this['linkTooltip']['classList']['remove']('visible');}['handleKeydown'](_0x5468f7){if(this['mentionState']['active']){if(_0x5468f7['key']==='ArrowDown'){_0x5468f7['preventDefault'](),this['mentionNavigate'](0x1);return;}if(_0x5468f7['key']==='ArrowUp'){_0x5468f7['preventDefault'](),this['mentionNavigate'](-0x1);return;}if(_0x5468f7['key']==='Enter'||_0x5468f7['key']==='Tab'){if(this['mentionState']['filteredUsers']['length']>0x0){_0x5468f7['preventDefault'](),this['insertMention'](this['mentionState']['filteredUsers'][this['mentionState']['selectedIndex']]);return;}}if(_0x5468f7['key']==='Escape'){_0x5468f7['preventDefault'](),this['closeMentionDropdown']();return;}}if(_0x5468f7['key']==='Tab'&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x5e72bd=this['getContainingListItem']();if(_0x5e72bd&&this['isCursorAtStartOfListItem'](_0x5e72bd)){_0x5468f7['preventDefault']();_0x5468f7['shiftKey']?this['outdentListItem'](_0x5e72bd):this['indentListItem'](_0x5e72bd);this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x5468f7['key']==='Enter'&&!_0x5468f7['shiftKey']&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x4665d3=this['getContainingListItem']();if(_0x4665d3&&this['isEmptyListItem'](_0x4665d3)){_0x5468f7['preventDefault'](),this['exitListOnEmptyBullet'](_0x4665d3),this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x5468f7['key']==='Enter'&&!_0x5468f7['shiftKey']&&this['isSelectionInTag']('PRE')){_0x5468f7['preventDefault']();const _0x515247=window['getSelection']();if(_0x515247['rangeCount']>0x0){const _0x41739d=_0x515247['getRangeAt'](0x0);_0x41739d['deleteContents']();const _0x136c29=document['createTextNode']('\x0a');_0x41739d['insertNode'](_0x136c29),_0x41739d['setStartAfter'](_0x136c29),_0x41739d['setEndAfter'](_0x136c29),_0x515247['removeAllRanges'](),_0x515247['addRange'](_0x41739d),this['handleInput']();}return;}(_0x5468f7['ctrlKey']||_0x5468f7['metaKey'])&&_0x5468f7['key']==='b'&&(_0x5468f7['preventDefault'](),document['execCommand']('bold',![],null));(_0x5468f7['ctrlKey']||_0x5468f7['metaKey'])&&_0x5468f7['key']==='i'&&(_0x5468f7['preventDefault'](),document['execCommand']('italic',![],null));if((_0x5468f7['ctrlKey']||_0x5468f7['metaKey'])&&_0x5468f7['key']==='k'){_0x5468f7['preventDefault'](),this['openLinkDialog']();return;}}['handlePaste'](_0x107f96){const _0x45e82b=_0x107f96['clipboardData'];if(_0x45e82b&&this['options']['onAddAttachments']){const _0x4ee871=this['extractImageFilesFromClipboard'](_0x45e82b);if(_0x4ee871['length']>0x0){_0x107f96['preventDefault'](),this['addAndInsertImages'](_0x4ee871);return;}}_0x107f96['preventDefault']();const _0x537d65=_0x107f96['clipboardData']['getData']('text/html');if(_0x537d65&&_0x537d65['trim']()){const _0x36b42d=this['convertPastedHtmlToMarkdown'](_0x537d65);if(_0x36b42d&&_0x36b42d['trim']()){this['insertMarkdownAsRichText'](_0x36b42d);return;}}const _0x4ce674=_0x107f96['clipboardData']['getData']('text/plain');document['execCommand']('insertText',![],_0x4ce674);}['convertPastedHtmlToMarkdown'](_0x1377a6){const _0xa41c1e=document['createElement']('div');_0xa41c1e['innerHTML']=_0x1377a6;const _0x41a8b3=_0xa41c1e['querySelectorAll']('style,\x20script,\x20meta,\x20link,\x20head,\x20title');_0x41a8b3['forEach'](_0x4054f8=>_0x4054f8['remove']());const _0x3bebf0=_0xa41c1e['querySelectorAll']('*');_0x3bebf0['forEach'](_0x24233b=>{const _0x1292ab=Array['from'](_0x24233b['attributes']);_0x1292ab['forEach'](_0x3a91be=>{_0x3a91be['name']['startsWith']('data-')&&_0x3a91be['name']!=='data-attachment-name'&&_0x3a91be['name']!=='data-mention-user-id'&&_0x24233b['removeAttribute'](_0x3a91be['name']);});}),_0xa41c1e['querySelectorAll']('font[color]')['forEach'](_0x1aa318=>{_0x1aa318['replaceWith'](..._0x1aa318['childNodes']);}),_0xa41c1e['querySelectorAll']('span')['forEach'](_0x48ceca=>{_0x48ceca['style']['color']&&_0x48ceca['style']['removeProperty']('color'),!_0x48ceca['getAttribute']('style')&&!_0x48ceca['getAttribute']('data-mention-user-id')&&!_0x48ceca['getAttribute']('data-attachment-name')&&_0x48ceca['replaceWith'](..._0x48ceca['childNodes']);});try{return this['turndownService']['turndown'](_0xa41c1e['innerHTML']);}catch(_0x5b22ca){return console['warn']('Failed\x20to\x20convert\x20HTML\x20to\x20markdown:',_0x5b22ca),null;}}['insertMarkdownAsRichText'](_0x3e979d){const _0x1b7a9e=window['marked'];if(!_0x1b7a9e){document['execCommand']('insertText',![],_0x3e979d);return;}try{const _0x3927d0=this['preprocessColorSyntax'](_0x3e979d),_0x121c43=_0x1b7a9e['parse'](_0x3927d0),_0x123858=document['createElement']('div');_0x123858['innerHTML']=_0x121c43,this['processHtmlForEditor'](_0x123858),document['execCommand']('insertHTML',![],_0x123858['innerHTML']);}catch(_0x2acd44){console['warn']('Failed\x20to\x20convert\x20markdown\x20to\x20HTML:',_0x2acd44),document['execCommand']('insertText',![],_0x3e979d);}}['processHtmlForEditor'](_0x2da2c2){const _0x86ee33=_0x2da2c2['querySelectorAll']('pre');_0x86ee33['forEach'](_0x5bef75=>{const _0x1ad759=_0x5bef75['querySelector']('code');if(_0x1ad759){const _0x454cc1=Array['from'](_0x1ad759['classList'])['find'](_0x44407b=>_0x44407b['startsWith']('language-')),_0x4c545f=_0x454cc1?_0x454cc1['replace']('language-',''):'',_0x1c8b1f=document['createElement']('pre');_0x4c545f&&_0x1c8b1f['setAttribute']('data-language',_0x4c545f),_0x1c8b1f['textContent']=_0x1ad759['textContent'],_0x5bef75['replaceWith'](_0x1c8b1f);}});const _0x3fd472=_0x2da2c2['querySelectorAll']('a');_0x3fd472['forEach'](_0x99284a=>{_0x99284a['setAttribute']('target','_blank'),_0x99284a['setAttribute']('rel','noopener\x20noreferrer');});}['handleDragStart'](_0x205f0f){const _0x401408=_0x205f0f['target'];if(!_0x401408||_0x401408['tagName']!=='IMG')return;if(!_0x205f0f['dataTransfer'])return;const _0x2698df=_0x401408['getAttribute']('data-attachment-name')||'';try{_0x205f0f['dataTransfer']['setData'](INTERNAL_DRAG_MIME,_0x2698df||'1');}catch{}_0x205f0f['dataTransfer']['effectAllowed']='move';}['handleDragOver'](_0xfbf55){if(!this['isExternalFileTransfer'](_0xfbf55['dataTransfer']))return;_0xfbf55['preventDefault'](),_0xfbf55['dataTransfer']['dropEffect']='copy';}['handleDrop'](_0x1be61f){if(!this['isExternalFileTransfer'](_0x1be61f['dataTransfer']))return;const _0x30668a=_0x1be61f['dataTransfer'],_0x43378c=Array['from'](_0x30668a['files']||[])['filter'](_0x731a64=>_0x731a64&&typeof _0x731a64['type']==='string'),_0x5e5733=_0x43378c['filter'](_0x40a46a=>_0x40a46a['type']['startsWith']('image/'));if(_0x5e5733['length']===0x0)return;_0x1be61f['preventDefault'](),_0x1be61f['stopPropagation'](),this['cleanupParentDragState'](),this['moveSelectionToDropPoint'](_0x1be61f),this['addAndInsertImages'](_0x5e5733);}['cleanupParentDragState'](){let _0xe9d177=this['editor']['parentElement'];while(_0xe9d177){_0xe9d177['classList']&&_0xe9d177['classList']['contains']('drag-over')&&_0xe9d177['classList']['remove']('drag-over'),_0xe9d177=_0xe9d177['parentElement'];}}['isExternalFileTransfer'](_0x4d3824){if(!_0x4d3824)return![];const _0x5be5fc=Array['from'](_0x4d3824['types']||[]);if(!_0x5be5fc['includes']('Files'))return![];if(_0x5be5fc['includes'](INTERNAL_DRAG_MIME))return![];if(_0x4d3824['files']&&_0x4d3824['files']['length']>0x0)return!![];if(_0x4d3824['items']&&Array['from'](_0x4d3824['items'])['some'](_0x1657fb=>_0x1657fb['kind']==='file'))return!![];return![];}['moveSelectionToDropPoint'](_0x5e7137){const _0x3931b3=_0x5e7137['clientX'],_0x2864b5=_0x5e7137['clientY'];let _0x3ecb72=null;if(document['caretRangeFromPoint'])_0x3ecb72=document['caretRangeFromPoint'](_0x3931b3,_0x2864b5);else{if(document['caretPositionFromPoint']){const _0xfc80a7=document['caretPositionFromPoint'](_0x3931b3,_0x2864b5);_0xfc80a7&&(_0x3ecb72=document['createRange'](),_0x3ecb72['setStart'](_0xfc80a7['offsetNode'],_0xfc80a7['offset']),_0x3ecb72['collapse'](!![]));}}if(_0x3ecb72){const _0x1aaf6b=window['getSelection']();_0x1aaf6b['removeAllRanges'](),_0x1aaf6b['addRange'](_0x3ecb72);}}['extractImageFilesFromClipboard'](_0x1b189f){const _0x335c69=Array['from'](_0x1b189f['items']||[]),_0x45742f=[];for(const _0x24badc of _0x335c69){if(_0x24badc['kind']==='file'&&_0x24badc['type']&&_0x24badc['type']['startsWith']('image/')){const _0x47bb75=_0x24badc['getAsFile']();if(_0x47bb75)_0x45742f['push'](_0x47bb75);}}return _0x45742f;}['addAndInsertImages'](_0x511284){const _0x164563=_0x511284['map'](_0x2a14e7=>this['prepareAttachmentFile'](_0x2a14e7))['filter'](Boolean);if(_0x164563['length']===0x0)return;const _0x4ae277=_0x164563['map'](_0x123c1d=>_0x123c1d['file']);try{this['options']['onAddAttachments'](_0x4ae277);}catch(_0x4aa7bd){console['error']('Failed\x20to\x20add\x20attachments:',_0x4aa7bd);}for(const {name:_0x2b7a5c,objectUrl:_0x365c29}of _0x164563){this['insertAttachmentImage'](_0x2b7a5c,_0x365c29);}this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));}['prepareAttachmentFile'](_0x4eb6ef){const _0x93684d=this['sanitizeFilename'](_0x4eb6ef['name']||this['defaultImageName'](_0x4eb6ef['type']));if(!_0x93684d)return null;const _0x22fb1e=this['getUniqueAttachmentName'](_0x93684d),_0x3db75e=_0x22fb1e===_0x4eb6ef['name']?_0x4eb6ef:new File([_0x4eb6ef],_0x22fb1e,{'type':_0x4eb6ef['type'],'lastModified':_0x4eb6ef['lastModified']}),_0x1f7f0a=URL['createObjectURL'](_0x3db75e);return this['attachmentObjectUrls']['set'](_0x22fb1e,_0x1f7f0a),{'name':_0x22fb1e,'file':_0x3db75e,'objectUrl':_0x1f7f0a};}['getUniqueAttachmentName'](_0x8fae3c){const _0x240454=_0x58bf5d=>{if(this['attachmentObjectUrls']['has'](_0x58bf5d))return!![];if(this['options']['isAttachmentNameTaken'])try{return Boolean(this['options']['isAttachmentNameTaken'](_0x58bf5d));}catch{return![];}return![];};if(!_0x240454(_0x8fae3c))return _0x8fae3c;const {stem:_0x3caaa0,ext:_0x13a86f}=this['splitFilename'](_0x8fae3c);for(let _0x5b1702=0x2;_0x5b1702<0x3e8;_0x5b1702++){const _0x3c5256=_0x3caaa0+'-'+_0x5b1702+_0x13a86f;if(!_0x240454(_0x3c5256))return _0x3c5256;}return _0x3caaa0+'-'+Date['now']()+_0x13a86f;}['splitFilename'](_0x28dfa1){const _0x59887c=_0x28dfa1['lastIndexOf']('.');if(_0x59887c<=0x0||_0x59887c===_0x28dfa1['length']-0x1)return{'stem':_0x28dfa1,'ext':''};return{'stem':_0x28dfa1['slice'](0x0,_0x59887c),'ext':_0x28dfa1['slice'](_0x59887c)};}['sanitizeFilename'](_0x10d2f0){const _0x39ea1a=String(_0x10d2f0||'')['split']('/')['pop']()['split']('\x5c')['pop']();return _0x39ea1a['replace'](/[\u0000-\u001F\u007F]/g,'')['trim']();}['defaultImageName'](_0x11f6b2){const _0x14a372=this['extensionForMime'](_0x11f6b2);return'pasted-image-'+Date['now']()+_0x14a372;}['extensionForMime'](_0x398394){switch(_0x398394){case'image/png':return'.png';case'image/jpeg':return'.jpg';case'image/gif':return'.gif';case'image/webp':return'.webp';case'image/svg+xml':return'.svg';default:return'.png';}}['insertAttachmentImage'](_0x2e2536,_0x5e3cf3){const _0x57a3ce=document['createElement']('img');_0x57a3ce['src']=_0x5e3cf3,_0x57a3ce['alt']=_0x2e2536,_0x57a3ce['setAttribute']('data-attachment-name',_0x2e2536),_0x57a3ce['draggable']=!![];const _0x3902c3=window['getSelection']();let _0x5f2850=![];if(_0x3902c3&&_0x3902c3['rangeCount']>0x0){const _0x1082c5=_0x3902c3['getRangeAt'](0x0);_0x5f2850=this['editor']['contains'](_0x1082c5['commonAncestorContainer'])||this['editor']===_0x1082c5['commonAncestorContainer'];}if(!_0x5f2850){this['editor']['appendChild'](_0x57a3ce);const _0x18877b=document['createRange']();_0x18877b['setStartAfter'](_0x57a3ce),_0x18877b['collapse'](!![]),_0x3902c3['removeAllRanges'](),_0x3902c3['addRange'](_0x18877b);return;}const _0x4cfb61=_0x3902c3['getRangeAt'](0x0);_0x4cfb61['deleteContents'](),_0x4cfb61['insertNode'](_0x57a3ce),_0x4cfb61['setStartAfter'](_0x57a3ce),_0x4cfb61['collapse'](!![]),_0x3902c3['removeAllRanges'](),_0x3902c3['addRange'](_0x4cfb61);}['toggleInlineCode'](){const _0x1bee63=window['getSelection']();if(_0x1bee63['rangeCount']===0x0)return;const _0x475f15=_0x1bee63['getRangeAt'](0x0),_0x5a95d1=_0x475f15['toString']();if(_0x5a95d1){const _0x12a89f=document['createElement']('code');_0x12a89f['textContent']=_0x5a95d1,_0x475f15['deleteContents'](),_0x475f15['insertNode'](_0x12a89f),_0x475f15['setStartAfter'](_0x12a89f),_0x475f15['setEndAfter'](_0x12a89f),_0x1bee63['removeAllRanges'](),_0x1bee63['addRange'](_0x475f15);}}['insertCodeBlock'](){const _0x32961e=window['getSelection']();if(_0x32961e['rangeCount']===0x0)return;const _0x57b00b=_0x32961e['getRangeAt'](0x0),_0x2186c1=_0x57b00b['toString'](),_0x24bbe3=document['createElement']('pre'),_0x31c504=document['createElement']('code');_0x31c504['textContent']=_0x2186c1||'\x0a',_0x24bbe3['appendChild'](_0x31c504),_0x57b00b['deleteContents'](),_0x57b00b['insertNode'](_0x24bbe3);const _0x164066=document['createElement']('p');_0x164066['innerHTML']='<br>',_0x24bbe3['parentNode']['insertBefore'](_0x164066,_0x24bbe3['nextSibling']);const _0xdd44af=document['createRange']();!_0x2186c1?(_0xdd44af['setStart'](_0x31c504['firstChild'],0x0),_0xdd44af['setEnd'](_0x31c504['firstChild'],0x0)):(_0xdd44af['selectNodeContents'](_0x31c504),_0xdd44af['collapse'](![])),_0x32961e['removeAllRanges'](),_0x32961e['addRange'](_0xdd44af);}['updatePlaceholder'](){const _0x445447=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');_0x445447?this['editor']['classList']['remove']('empty'):this['editor']['classList']['add']('empty');}['setMarkdown'](_0x32361f){if(!_0x32361f||!_0x32361f['trim']()){this['editor']['innerHTML']='',this['updatePlaceholder']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']='':this['element']['textContent']='';return;}const _0x28c8e2=this['preprocessColorSyntax'](_0x32361f),_0x28e1ba=window['marked']['parse'](_0x28c8e2);this['editor']['innerHTML']=_0x28e1ba,this['rewriteAttachmentImages'](),this['rewriteMentionLinks'](),this['addLinkHints'](),this['updatePlaceholder'](),this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0x32361f:this['element']['textContent']=_0x32361f;}['rewriteAttachmentImages'](){const _0x1e2f59=this['editor']['querySelectorAll']('img');_0x1e2f59['forEach'](_0x3f65b1=>{const _0x538101=_0x3f65b1['getAttribute']('data-attachment-name'),_0x378899=_0x3f65b1['getAttribute']('src')||'',_0x476094=this['parseAttachmentReference'](_0x378899)||this['parseTaskAttachmentUrl'](_0x378899),_0x1fe9bb=_0x538101||(_0x476094?_0x476094['name']:null);if(!_0x1fe9bb)return;_0x3f65b1['setAttribute']('data-attachment-name',_0x1fe9bb);const _0x197158=this['attachmentObjectUrls']['get'](_0x1fe9bb)||(this['options']['resolveAttachmentUrl']?this['options']['resolveAttachmentUrl'](_0x1fe9bb):null);_0x197158&&(_0x3f65b1['src']=_0x197158);});}['rewriteMentionLinks'](){const _0x4d9bbb=this['editor']['querySelectorAll']('a[href^=\x22mention:\x22]');_0x4d9bbb['forEach'](_0xa12f00=>{const _0x5124ff=_0xa12f00['getAttribute']('href')||'',_0x13e13a=_0x5124ff['replace']('mention:',''),_0x40b6ad=_0xa12f00['textContent']||'',_0x832d2b=document['createElement']('span');_0x832d2b['className']='mention',_0x832d2b['setAttribute']('data-mention-user-id',_0x13e13a),_0x832d2b['setAttribute']('contenteditable','false'),_0x832d2b['textContent']='@'+_0x40b6ad;const _0x51723d=_0xa12f00['previousSibling'];_0x51723d&&_0x51723d['nodeType']===Node['TEXT_NODE']&&_0x51723d['textContent']['endsWith']('@')&&(_0x51723d['textContent']=_0x51723d['textContent']['slice'](0x0,-0x1)),_0xa12f00['parentNode']['replaceChild'](_0x832d2b,_0xa12f00);});}['addLinkHints'](){if(!this['options']['editable'])return;const _0x470897=this['editor']['querySelectorAll']('a');_0x470897['forEach'](_0x2dc3cf=>{const _0x24b9c=_0x2dc3cf['getAttribute']('href')||'';if(_0x24b9c['startsWith']('mention:'))return;const _0x3005e5=_0x2dc3cf['textContent']||_0x24b9c,_0x2b9b64=_0x3005e5+'\x20('+(this['linkHintText']||'Ctrl+click\x20to\x20follow')+')';_0x2dc3cf['setAttribute']('aria-label',_0x2b9b64);});}['preprocessColorSyntax'](_0x5e81e0){if(!_0x5e81e0)return _0x5e81e0;const _0x5155c1=_0x1239f2=>{return String(_0x1239f2)['replace'](/\{color:(#[0-9A-Fa-f]{3,6})\}([\s\S]*?)\{\/color\}/g,(_0x2bf3ff,_0x183744,_0x527021)=>{const _0xd8a499=_0x5155c1(_0x527021);return'<span\x20style=\x22color:\x20'+_0x183744+'\x22>'+_0xd8a499+'</span>';});};return _0x5155c1(_0x5e81e0);}['parseAttachmentReference'](_0x36c716){if(!_0x36c716||typeof _0x36c716!=='string')return null;if(!_0x36c716['startsWith'](ATTACHMENT_SCHEME)&&!_0x36c716['startsWith'](ATTACHMENT_SCHEME+'//'))return null;const _0x4ecb6e=_0x36c716['replace'](ATTACHMENT_SCHEME+'//','')['replace'](ATTACHMENT_SCHEME,'');if(!_0x4ecb6e)return null;try{return{'name':decodeURIComponent(_0x4ecb6e)};}catch{return{'name':_0x4ecb6e};}}['parseTaskAttachmentUrl'](_0x1d8599){if(!_0x1d8599||typeof _0x1d8599!=='string')return null;const _0x5c4b6d=_0x1d8599['match'](/\/tasks\/[^/]+\/attachments\/([^?#]+)/);if(!_0x5c4b6d)return null;const _0xc649a3=_0x5c4b6d[0x1];try{return{'name':decodeURIComponent(_0xc649a3)};}catch{return{'name':_0xc649a3};}}['updateAttachmentFile'](_0xd1bb76,_0x2f26d8){const _0x3938be=this['attachmentObjectUrls']['get'](_0xd1bb76);if(_0x3938be)try{URL['revokeObjectURL'](_0x3938be);}catch{}const _0x200287=URL['createObjectURL'](_0x2f26d8);this['attachmentObjectUrls']['set'](_0xd1bb76,_0x200287);const _0xf1c636=this['editor']['querySelector']('img[data-attachment-name=\x22'+CSS['escape'](_0xd1bb76)+'\x22]');return _0xf1c636&&(_0xf1c636['src']=_0x200287),_0x200287;}['getMarkdown'](){const _0x4a3f88=this['editor']['innerHTML'];if(!_0x4a3f88||_0x4a3f88['trim']()===''||_0x4a3f88==='<br>')return'';return this['turndownService']['turndown'](_0x4a3f88)['replace'](/\u200B/g,'');}['getValue'](){return this['getMarkdown']();}['setValue'](_0x5161a2){this['setMarkdown'](_0x5161a2);}['focus'](){this['editor']['focus']();}['clear'](){this['editor']['innerHTML']='',this['updatePlaceholder']();}['setEditable'](_0x409e62){this['editor']['contentEditable']=_0x409e62,this['options']['editable']=_0x409e62;}['handleMentionInput'](_0x54153d){if(!this['options']['fetchUsers'])return;const _0x10c4e1=window['getSelection']();if(!_0x10c4e1||_0x10c4e1['rangeCount']===0x0){this['closeMentionDropdown']();return;}const _0x13400c=_0x10c4e1['getRangeAt'](0x0),_0x69b313=_0x13400c['startContainer'];if(_0x69b313['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0x12185c=_0x69b313['textContent']||'',_0x6dcd76=_0x13400c['startOffset'],_0x36a002=_0x12185c['slice'](0x0,_0x6dcd76),_0x571499=_0x36a002['lastIndexOf']('@');if(_0x571499===-0x1){this['closeMentionDropdown']();return;}const _0x1bfebe=_0x571499>0x0?_0x36a002[_0x571499-0x1]:'\x20';if(!/\s/['test'](_0x1bfebe)&&_0x571499!==0x0){this['closeMentionDropdown']();return;}const _0x3cce2f=_0x36a002['slice'](_0x571499+0x1);if(/[\s\n]/['test'](_0x3cce2f)){this['closeMentionDropdown']();return;}this['mentionState']['active']=!![],this['mentionState']['query']=_0x3cce2f['toLowerCase'](),this['mentionState']['startOffset']=_0x571499,this['mentionState']['startNode']=_0x69b313,this['showMentionDropdown']();}async['showMentionDropdown'](){if(!this['usersCache'])try{const _0x262586=await this['options']['fetchUsers']();this['usersCache']=_0x262586['users']||_0x262586||[];}catch(_0x48ddbc){console['error']('Failed\x20to\x20fetch\x20users\x20for\x20@mention:',_0x48ddbc),this['closeMentionDropdown']();return;}this['mentionState']['users']=this['usersCache'];const _0x40a173=this['mentionState']['query'];this['mentionState']['filteredUsers']=this['mentionState']['users']['filter'](_0x3772fa=>{const _0x563158=(_0x3772fa['name']||'')['toLowerCase'](),_0x5b96cb=(_0x3772fa['username']||'')['toLowerCase']();return _0x563158['includes'](_0x40a173)||_0x5b96cb['includes'](_0x40a173);})['slice'](0x0,0x8),this['mentionState']['selectedIndex']=0x0;if(this['mentionState']['filteredUsers']['length']===0x0){this['closeMentionDropdown']();return;}this['renderMentionDropdown'](),this['positionMentionDropdown']();}['renderMentionDropdown'](){!this['mentionDropdown']&&(this['mentionDropdown']=document['createElement']('div'),this['mentionDropdown']['className']='mention-dropdown',document['body']['appendChild'](this['mentionDropdown']),this['mentionClickOutsideHandler']=_0x522e2c=>{!this['mentionDropdown']['contains'](_0x522e2c['target'])&&!this['editor']['contains'](_0x522e2c['target'])&&this['closeMentionDropdown']();},document['addEventListener']('click',this['mentionClickOutsideHandler']),this['mentionScrollHandler']=()=>{this['mentionState']['active']&&this['positionMentionDropdown']();},window['addEventListener']('scroll',this['mentionScrollHandler'],!![]));const _0x1c08c7=this['mentionState']['filteredUsers'];this['mentionDropdown']['innerHTML']=_0x1c08c7['map']((_0x891a7,_0xc405d3)=>{const _0x6a659d=_0xc405d3===this['mentionState']['selectedIndex'],_0x4244ce=_0x891a7['name']||_0x891a7['username']||'Unknown',_0x3ce00e=_0x891a7['username']||'',_0x28e30a=this['getInitials'](_0x4244ce),_0x38f3d0=this['getAvatarColorIndex'](_0x3ce00e||_0x891a7['id']||_0x4244ce);return'\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22mention-option\x20'+(_0x6a659d?'mention-option-selected':'')+'\x22\x20data-index=\x22'+_0xc405d3+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-avatar\x20avatar-color-'+_0x38f3d0+'\x22>'+this['escapeHtmlForMention'](_0x28e30a)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-option-name\x22>'+this['escapeHtmlForMention'](_0x4244ce)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3ce00e?'<span\x20class=\x22mention-option-username\x22>@'+this['escapeHtmlForMention'](_0x3ce00e)+'</span>':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';})['join'](''),this['mentionDropdown']['querySelectorAll']('.mention-option')['forEach'](_0x29f1cf=>{_0x29f1cf['addEventListener']('mousedown',_0x24da9c=>{_0x24da9c['preventDefault']();const _0x59ff24=parseInt(_0x29f1cf['dataset']['index'],0xa);this['insertMention'](this['mentionState']['filteredUsers'][_0x59ff24]);}),_0x29f1cf['addEventListener']('mouseenter',()=>{const _0x52726d=parseInt(_0x29f1cf['dataset']['index'],0xa);this['mentionState']['selectedIndex']=_0x52726d,this['updateMentionSelection']();});}),this['mentionDropdown']['style']['display']='block';}['positionMentionDropdown'](){if(!this['mentionDropdown'])return;const _0x4dbb39=window['getSelection']();if(!_0x4dbb39||_0x4dbb39['rangeCount']===0x0)return;const _0xa09240=_0x4dbb39['getRangeAt'](0x0),_0x3cd29e=_0xa09240['getBoundingClientRect'](),_0x2817d5=0x104,_0x47cbc0=Math['min'](0xf0,this['mentionState']['filteredUsers']['length']*0x24+0x8),_0x2a247d=window['innerWidth'],_0x1b984a=window['innerHeight'],_0x220597=_0x1b984a-_0x3cd29e['bottom'],_0x222c32=_0x3cd29e['top'],_0x2307e6=_0x220597<_0x47cbc0+0xa&&_0x222c32>_0x220597;let _0x51c6ff,_0x14a3dd;_0x2307e6?_0x51c6ff=_0x3cd29e['top']+window['scrollY']-_0x47cbc0-0x4:_0x51c6ff=_0x3cd29e['bottom']+window['scrollY']+0x4,_0x14a3dd=_0x3cd29e['left']+window['scrollX'],_0x14a3dd+_0x2817d5>_0x2a247d-0xa&&(_0x14a3dd=_0x2a247d-_0x2817d5-0xa),_0x14a3dd<0xa&&(_0x14a3dd=0xa),this['mentionDropdown']['style']['position']='absolute',this['mentionDropdown']['style']['top']=_0x51c6ff+'px',this['mentionDropdown']['style']['left']=_0x14a3dd+'px';}['mentionNavigate'](_0x4c8f82){const _0x293eb0=this['mentionState']['filteredUsers']['length'];if(_0x293eb0===0x0)return;this['mentionState']['selectedIndex']=(this['mentionState']['selectedIndex']+_0x4c8f82+_0x293eb0)%_0x293eb0,this['updateMentionSelection']();}['updateMentionSelection'](){if(!this['mentionDropdown'])return;const _0x5b7d31=this['mentionDropdown']['querySelectorAll']('.mention-option');_0x5b7d31['forEach']((_0x28098c,_0x3f905a)=>{_0x3f905a===this['mentionState']['selectedIndex']?(_0x28098c['classList']['add']('mention-option-selected'),_0x28098c['scrollIntoView']({'block':'nearest'})):_0x28098c['classList']['remove']('mention-option-selected');});}['insertMention'](_0x44c9dd){if(!_0x44c9dd)return;const _0xd12b96=window['getSelection']();if(!_0xd12b96||_0xd12b96['rangeCount']===0x0)return;const _0x293d98=_0xd12b96['getRangeAt'](0x0),_0x7d2c7d=this['mentionState']['startNode'];if(!_0x7d2c7d||_0x7d2c7d['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0x18c501=_0x7d2c7d['textContent']||'',_0x50277a=this['mentionState']['startOffset'],_0x5e5bac=_0x293d98['startOffset'],_0x42ca4f=_0x18c501['slice'](0x0,_0x50277a),_0xec2a62=_0x18c501['slice'](_0x5e5bac),_0x4d01e4=document['createElement']('span');_0x4d01e4['className']='mention',_0x4d01e4['setAttribute']('data-mention-user-id',_0x44c9dd['id']),_0x4d01e4['setAttribute']('contenteditable','false'),_0x4d01e4['textContent']='@'+(_0x44c9dd['name']||_0x44c9dd['username']);const _0x1ef2ba=document['createTextNode'](_0x42ca4f),_0x2511c4=document['createTextNode']('\x20'+_0xec2a62),_0x300648=_0x7d2c7d['parentNode'];_0x300648['insertBefore'](_0x1ef2ba,_0x7d2c7d),_0x300648['insertBefore'](_0x4d01e4,_0x7d2c7d),_0x300648['insertBefore'](_0x2511c4,_0x7d2c7d),_0x300648['removeChild'](_0x7d2c7d);const _0x360c4a=document['createRange']();_0x360c4a['setStart'](_0x2511c4,0x1),_0x360c4a['collapse'](!![]),_0xd12b96['removeAllRanges'](),_0xd12b96['addRange'](_0x360c4a),this['closeMentionDropdown'](),this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));}['closeMentionDropdown'](){this['mentionState']['active']=![],this['mentionState']['query']='',this['mentionState']['filteredUsers']=[],this['mentionState']['selectedIndex']=0x0,this['mentionDropdown']&&(this['mentionDropdown']['style']['display']='none');}['escapeHtmlForMention'](_0x446520){const _0x52d91f=document['createElement']('div');return _0x52d91f['textContent']=_0x446520,_0x52d91f['innerHTML'];}['getInitials'](_0x3ea85c){if(!_0x3ea85c)return'?';const _0x5161ab=_0x3ea85c['trim']()['split'](/\s+/);if(_0x5161ab['length']>=0x2)return(_0x5161ab[0x0][0x0]+_0x5161ab[_0x5161ab['length']-0x1][0x0])['toUpperCase']();return _0x3ea85c['substring'](0x0,0x2)['toUpperCase']();}['getAvatarColorIndex'](_0x5a80a1){if(!_0x5a80a1)return 0x6;let _0x5cb0c2=0x0;for(let _0x24b1bd=0x0;_0x24b1bd<_0x5a80a1['length'];_0x24b1bd++){_0x5cb0c2=_0x5a80a1['charCodeAt'](_0x24b1bd)+((_0x5cb0c2<<0x5)-_0x5cb0c2);}return Math['abs'](_0x5cb0c2)%0xa;}['destroy'](){this['selectionChangeHandler']&&document['removeEventListener']('selectionchange',this['selectionChangeHandler']);this['linkClickHandler']&&this['editor']['removeEventListener']('click',this['linkClickHandler']);this['linkMouseEnterHandler']&&this['editor']['removeEventListener']('mouseover',this['linkMouseEnterHandler']);this['linkMouseLeaveHandler']&&this['editor']['removeEventListener']('mouseout',this['linkMouseLeaveHandler']);this['linkTooltipTimeout']&&clearTimeout(this['linkTooltipTimeout']);this['linkTooltip']&&(this['linkTooltip']['remove'](),this['linkTooltip']=null);this['linkDialog']&&(this['linkDialog']['remove'](),this['linkDialog']=null,this['linkDialogContext']=null,this['linkDialogElements']=null);this['mentionDropdown']&&(this['mentionDropdown']['remove'](),this['mentionDropdown']=null);this['mentionClickOutsideHandler']&&document['removeEventListener']('click',this['mentionClickOutsideHandler']);this['mentionScrollHandler']&&window['removeEventListener']('scroll',this['mentionScrollHandler'],!![]);for(const _0x1367c2 of this['attachmentObjectUrls']['values']()){try{URL['revokeObjectURL'](_0x1367c2);}catch{}}this['attachmentObjectUrls']['clear'](),this['container']?this['container']['remove']():this['editor']['remove'](),this['element']['style']['display']='';}}typeof window!=='undefined'&&(window['MarkdownEditor']=MarkdownEditor);
1
+ const ATTACHMENT_SCHEME='attachment:',INTERNAL_DRAG_MIME='application/x-profound-editor-image',LINK_DIALOG_STYLE_ID='markdown-editor-link-dialog-styles',ICONS={'bold':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M6\x204h8a4\x204\x200\x200\x201\x204\x204\x204\x204\x200\x200\x201-4\x204H6z\x22></path><path\x20d=\x22M6\x2012h9a4\x204\x200\x200\x201\x204\x204\x204\x204\x200\x200\x201-4\x204H6z\x22></path></svg>','italic':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x2219\x22\x20y1=\x224\x22\x20x2=\x2210\x22\x20y2=\x224\x22></line><line\x20x1=\x2214\x22\x20y1=\x2220\x22\x20x2=\x225\x22\x20y2=\x2220\x22></line><line\x20x1=\x2215\x22\x20y1=\x224\x22\x20x2=\x229\x22\x20y2=\x2220\x22></line></svg>','strike':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x225\x22\x20y1=\x2212\x22\x20x2=\x2219\x22\x20y2=\x2212\x22></line><path\x20d=\x22M16\x206a4\x204\x200\x200\x200-4-4c-2.48\x200-4\x201.79-4\x204\x200\x201.25.5\x202.5\x201.5\x203\x22></path><path\x20d=\x22M9\x2018c0\x201.79\x201.79\x203\x204\x203\x202.48\x200\x204-1.79\x204-4\x200-1.25-.5-2.5-1.5-3\x22></path></svg>','link':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M10\x2013a5\x205\x200\x200\x200\x207.54.54l3-3a5\x205\x200\x200\x200-7.07-7.07l-1.72\x201.71\x22></path><path\x20d=\x22M14\x2011a5\x205\x200\x200\x200-7.54-.54l-3\x203a5\x205\x200\x200\x200\x207.07\x207.07l1.71-1.71\x22></path></svg>','code':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><polyline\x20points=\x2216\x2018\x2022\x2012\x2016\x206\x22></polyline><polyline\x20points=\x228\x206\x202\x2012\x208\x2018\x22></polyline></svg>','listBullet':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x228\x22\x20y1=\x226\x22\x20x2=\x2221\x22\x20y2=\x226\x22></line><line\x20x1=\x228\x22\x20y1=\x2212\x22\x20x2=\x2221\x22\x20y2=\x2212\x22></line><line\x20x1=\x228\x22\x20y1=\x2218\x22\x20x2=\x2221\x22\x20y2=\x2218\x22></line><line\x20x1=\x223\x22\x20y1=\x226\x22\x20x2=\x223.01\x22\x20y2=\x226\x22></line><line\x20x1=\x223\x22\x20y1=\x2212\x22\x20x2=\x223.01\x22\x20y2=\x2212\x22></line><line\x20x1=\x223\x22\x20y1=\x2218\x22\x20x2=\x223.01\x22\x20y2=\x2218\x22></line></svg>','listOrdered':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><line\x20x1=\x2210\x22\x20y1=\x226\x22\x20x2=\x2221\x22\x20y2=\x226\x22></line><line\x20x1=\x2210\x22\x20y1=\x2212\x22\x20x2=\x2221\x22\x20y2=\x2212\x22></line><line\x20x1=\x2210\x22\x20y1=\x2218\x22\x20x2=\x2221\x22\x20y2=\x2218\x22></line><path\x20d=\x22M4\x206h1v4\x22></path><path\x20d=\x22M4\x2010h2\x22></path><path\x20d=\x22M6\x2018H4c0-1\x202-2\x202-3s-1-1.5-2-1\x22></path></svg>','blockquote':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path></svg>','codeBlock':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><rect\x20x=\x223\x22\x20y=\x223\x22\x20width=\x2218\x22\x20height=\x2218\x22\x20rx=\x222\x22\x20ry=\x222\x22></rect><polyline\x20points=\x229\x208\x205\x2012\x209\x2016\x22></polyline><polyline\x20points=\x2215\x208\x2019\x2012\x2015\x2016\x22></polyline></svg>','header':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M4\x2012h8\x22></path><path\x20d=\x22M4\x2018V6\x22></path><path\x20d=\x22M12\x2018V6\x22></path><path\x20d=\x22M17\x2012l3-2v8\x22></path></svg>','color':'<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2216\x22\x20height=\x2216\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22><path\x20d=\x22M4\x2020h16\x22></path><path\x20d=\x22M6\x2016l6-14\x206\x2014\x22></path><path\x20d=\x22M8\x2012h8\x22></path></svg>'},LINK_DIALOG_STYLES='\x0a.markdown-editor-link-modal\x20{\x0a\x20\x20position:\x20fixed;\x0a\x20\x20inset:\x200;\x0a\x20\x20display:\x20flex;\x0a\x20\x20align-items:\x20center;\x0a\x20\x20justify-content:\x20center;\x0a\x20\x20z-index:\x2010020;\x0a}\x0a\x0a.markdown-editor-link-modal[hidden]\x20{\x0a\x20\x20display:\x20none\x20!important;\x0a}\x0a\x0a.markdown-editor-link-backdrop\x20{\x0a\x20\x20position:\x20absolute;\x0a\x20\x20inset:\x200;\x0a\x20\x20background:\x20rgba(15,\x2023,\x2042,\x200.45);\x0a}\x0a\x0a.markdown-editor-link-dialog\x20{\x0a\x20\x20position:\x20relative;\x0a\x20\x20width:\x20min(460px,\x20calc(100vw\x20-\x2024px));\x0a\x20\x20background:\x20var(--color-surface,\x20var(--feedback-surface,\x20#ffffff));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20border:\x201px\x20solid\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a\x20\x20border-radius:\x20var(--radius-medium,\x2010px);\x0a\x20\x20box-shadow:\x200\x2018px\x2042px\x20rgba(15,\x2023,\x2042,\x200.25);\x0a\x20\x20padding:\x2014px;\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x2012px;\x0a}\x0a\x0a.markdown-editor-link-header\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20align-items:\x20center;\x0a\x20\x20justify-content:\x20space-between;\x0a\x20\x20gap:\x208px;\x0a}\x0a\x0a.markdown-editor-link-title\x20{\x0a\x20\x20margin:\x200;\x0a\x20\x20font-size:\x2016px;\x0a\x20\x20font-weight:\x20600;\x0a}\x0a\x0a.markdown-editor-link-close\x20{\x0a\x20\x20width:\x2028px;\x0a\x20\x20height:\x2028px;\x0a\x20\x20border:\x20none;\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20background:\x20transparent;\x0a\x20\x20color:\x20var(--color-text-muted,\x20var(--feedback-text-muted,\x20#6b7280));\x0a\x20\x20font-size:\x2020px;\x0a\x20\x20line-height:\x201;\x0a\x20\x20cursor:\x20pointer;\x0a}\x0a\x0a.markdown-editor-link-close:hover\x20{\x0a\x20\x20background:\x20var(--color-surface-muted,\x20var(--feedback-surface-muted,\x20#f3f4f6));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a}\x0a\x0a.markdown-editor-link-form\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x2010px;\x0a}\x0a\x0a.markdown-editor-link-field-grid\x20{\x0a\x20\x20display:\x20grid;\x0a\x20\x20gap:\x2010px;\x0a}\x0a\x0a.markdown-editor-link-label\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20flex-direction:\x20column;\x0a\x20\x20gap:\x206px;\x0a\x20\x20font-size:\x2012px;\x0a\x20\x20font-weight:\x20600;\x0a\x20\x20color:\x20var(--color-text-muted,\x20var(--feedback-text-muted,\x20#4b5563));\x0a}\x0a\x0a.markdown-editor-link-input\x20{\x0a\x20\x20width:\x20100%;\x0a\x20\x20padding:\x209px\x2010px;\x0a\x20\x20border:\x201px\x20solid\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20background:\x20var(--color-surface,\x20var(--feedback-surface,\x20#ffffff));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20font-size:\x2014px;\x0a}\x0a\x0a.markdown-editor-link-input:focus\x20{\x0a\x20\x20outline:\x20none;\x0a\x20\x20border-color:\x20var(--color-primary,\x20#3f72ff);\x0a\x20\x20box-shadow:\x200\x200\x200\x203px\x20rgba(63,\x20114,\x20255,\x200.2);\x0a}\x0a\x0a.markdown-editor-link-actions\x20{\x0a\x20\x20display:\x20flex;\x0a\x20\x20justify-content:\x20flex-end;\x0a\x20\x20gap:\x208px;\x0a}\x0a\x0a.markdown-editor-link-btn\x20{\x0a\x20\x20border:\x201px\x20solid\x20transparent;\x0a\x20\x20border-radius:\x20var(--radius-small,\x208px);\x0a\x20\x20padding:\x207px\x2012px;\x0a\x20\x20font-size:\x2013px;\x0a\x20\x20font-weight:\x20600;\x0a\x20\x20cursor:\x20pointer;\x0a}\x0a\x0a.markdown-editor-link-btn-secondary\x20{\x0a\x20\x20background:\x20var(--color-surface-muted,\x20var(--feedback-surface-muted,\x20#f3f4f6));\x0a\x20\x20color:\x20var(--color-text,\x20var(--feedback-text,\x20#111827));\x0a\x20\x20border-color:\x20var(--color-border,\x20var(--feedback-border,\x20#d1d5db));\x0a}\x0a\x0a.markdown-editor-link-btn-secondary:hover\x20{\x0a\x20\x20background:\x20var(--color-bg-secondary,\x20var(--feedback-surface-hover,\x20#e5e7eb));\x0a}\x0a\x0a.markdown-editor-link-btn-danger\x20{\x0a\x20\x20background:\x20transparent;\x0a\x20\x20color:\x20var(--color-danger,\x20#dc2626);\x0a\x20\x20border-color:\x20rgba(220,\x2038,\x2038,\x200.35);\x0a}\x0a\x0a.markdown-editor-link-btn-danger:hover\x20{\x0a\x20\x20background:\x20rgba(220,\x2038,\x2038,\x200.08);\x0a}\x0a\x0a.markdown-editor-link-btn-primary\x20{\x0a\x20\x20background:\x20var(--color-primary,\x20#3f72ff);\x0a\x20\x20color:\x20#ffffff;\x0a}\x0a\x0a.markdown-editor-link-btn-primary:hover\x20{\x0a\x20\x20background:\x20var(--color-accent,\x20#2563eb);\x0a}\x0a\x0a[data-theme=\x22dark\x22]\x20.markdown-editor-link-backdrop\x20{\x0a\x20\x20background:\x20rgba(2,\x206,\x2023,\x200.65);\x0a}\x0a\x0a[data-theme=\x22dark\x22]\x20.markdown-editor-link-dialog\x20{\x0a\x20\x20box-shadow:\x200\x2018px\x2042px\x20rgba(0,\x200,\x200,\x200.5);\x0a}\x0a\x0a@media\x20(max-width:\x20480px)\x20{\x0a\x20\x20.markdown-editor-link-dialog\x20{\x0a\x20\x20\x20\x20width:\x20calc(100vw\x20-\x2016px);\x0a\x20\x20\x20\x20padding:\x2012px;\x0a\x20\x20}\x0a\x0a\x20\x20.markdown-editor-link-actions\x20{\x0a\x20\x20\x20\x20flex-wrap:\x20wrap;\x0a\x20\x20}\x0a\x0a\x20\x20.markdown-editor-link-btn\x20{\x0a\x20\x20\x20\x20flex:\x201\x201\x20calc(50%\x20-\x206px);\x0a\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20}\x0a}\x0a';export class MarkdownEditor{constructor(_0x37d079,_0x95e555={}){this['element']=_0x37d079,this['options']={'placeholder':_0x95e555['placeholder']||'Start\x20typing...','editable':_0x95e555['editable']!==![],'onChange':_0x95e555['onChange']||null,'minHeight':_0x95e555['minHeight']||'100px','toolbar':_0x95e555['toolbar']||![],'onAddAttachments':_0x95e555['onAddAttachments']||null,'resolveAttachmentUrl':_0x95e555['resolveAttachmentUrl']||null,'isAttachmentNameTaken':_0x95e555['isAttachmentNameTaken']||null,'fetchUsers':_0x95e555['fetchUsers']||null},this['mentionState']={'active':![],'query':'','startOffset':0x0,'startNode':null,'users':[],'filteredUsers':[],'selectedIndex':0x0},this['mentionDropdown']=null,this['usersCache']=null,this['linkDialog']=null,this['linkDialogContext']=null;const _0x2f9969=window['TurndownService'];this['turndownService']=new _0x2f9969({'headingStyle':'atx','codeBlockStyle':'fenced','emDelimiter':'_','bulletListMarker':'-'}),this['attachmentObjectUrls']=new Map(),this['registerTurndownRules'](),this['init']();}['registerTurndownRules'](){this['turndownService']['addRule']('profoundAttachmentImage',{'filter':_0x4085cf=>{return _0x4085cf&&_0x4085cf['nodeName']==='IMG'&&_0x4085cf['getAttribute']&&_0x4085cf['getAttribute']('data-attachment-name');},'replacement':(_0x581397,_0x1144d2)=>{const _0x47a932=_0x1144d2['getAttribute']('data-attachment-name')||'',_0x3fccf4=_0x1144d2['getAttribute']('alt')||'',_0x2e9148=_0x47a932['trim'](),_0x90effa=this['escapeAltText'](_0x3fccf4||_0x2e9148),_0x33a4ba=encodeURIComponent(_0x2e9148);return'!['+_0x90effa+']('+ATTACHMENT_SCHEME+_0x33a4ba+')';}}),this['turndownService']['addRule']('profoundMention',{'filter':_0x17c596=>{return _0x17c596&&_0x17c596['nodeName']==='SPAN'&&_0x17c596['getAttribute']&&_0x17c596['getAttribute']('data-mention-user-id');},'replacement':(_0x378ddc,_0x598ab7)=>{const _0x471281=_0x598ab7['getAttribute']('data-mention-user-id')||'',_0xdcdb80=_0x598ab7['textContent']||'',_0x1233b1=_0xdcdb80['startsWith']('@')?_0xdcdb80['slice'](0x1):_0xdcdb80;return'['+_0x1233b1+'](mention:'+_0x471281+')';}}),this['turndownService']['addRule']('profoundColoredText',{'filter':_0x2c3f6b=>{if(!_0x2c3f6b)return![];if(_0x2c3f6b['nodeName']==='FONT'&&_0x2c3f6b['getAttribute']&&_0x2c3f6b['getAttribute']('color'))return!![];if(_0x2c3f6b['nodeName']==='SPAN'&&_0x2c3f6b['style']&&_0x2c3f6b['style']['color']){if(_0x2c3f6b['getAttribute']&&_0x2c3f6b['getAttribute']('data-mention-user-id'))return![];return!![];}return![];},'replacement':(_0x370a61,_0x2739c9)=>{if(!_0x370a61['trim']())return _0x370a61;let _0x459e7b='';if(_0x2739c9['nodeName']==='FONT')_0x459e7b=_0x2739c9['getAttribute']('color')||'';else _0x2739c9['style']&&_0x2739c9['style']['color']&&(_0x459e7b=this['rgbToHex'](_0x2739c9['style']['color']));if(!_0x459e7b)return _0x370a61;return'{color:'+_0x459e7b+'}'+_0x370a61+'{/color}';}});}['rgbToHex'](_0x4bc8b1){if(!_0x4bc8b1)return'';if(_0x4bc8b1['startsWith']('#'))return _0x4bc8b1;const _0x3756af=_0x4bc8b1['match'](/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(!_0x3756af)return _0x4bc8b1;const _0x3a2553=parseInt(_0x3756af[0x1],0xa),_0x294978=parseInt(_0x3756af[0x2],0xa),_0x166585=parseInt(_0x3756af[0x3],0xa);return'#'+[_0x3a2553,_0x294978,_0x166585]['map'](_0x2283c9=>_0x2283c9['toString'](0x10)['padStart'](0x2,'0'))['join']('')['toUpperCase']();}['escapeAltText'](_0x5de62b){return String(_0x5de62b||'')['replace'](/\]/g,'\x5c]');}['init'](){this['editor']=document['createElement']('div'),this['editor']['className']='markdown-editor',this['editor']['contentEditable']=this['options']['editable'],this['editor']['setAttribute']('role','textbox'),this['editor']['setAttribute']('aria-multiline','true'),this['editor']['style']['minHeight']=this['options']['minHeight'];this['options']['placeholder']&&this['editor']['setAttribute']('data-placeholder',this['options']['placeholder']);this['options']['toolbar']?(this['container']=document['createElement']('div'),this['container']['className']='markdown-editor-wrapper',this['container']['style']['display']='flex',this['container']['style']['flexDirection']='column',this['createToolbar'](),this['container']['appendChild'](this['toolbar']),this['container']['appendChild'](this['editor']),this['element']['parentNode']['insertBefore'](this['container'],this['element'])):this['element']['parentNode']['insertBefore'](this['editor'],this['element']);this['element']['style']['display']='none',this['isMac']=navigator['platform']['toUpperCase']()['indexOf']('MAC')>=0x0,this['linkHintText']=this['isMac']?'⌘+click\x20to\x20follow':'Ctrl+click\x20to\x20follow';this['options']['editable']&&this['bindEvents']();const _0x5b0226=this['element']['textContent']||this['element']['value']||'';_0x5b0226['trim']()&&this['setMarkdown'](_0x5b0226);}['createToolbar'](){this['toolbar']=document['createElement']('div'),this['toolbar']['className']='markdown-editor-toolbar',this['toolbarButtons']={};const _0x184926=[{'id':'header','icon':ICONS['header'],'title':'Heading','action':'header','isDropdown':!![]},{'separator':!![]},{'id':'bold','icon':ICONS['bold'],'title':'Bold\x20(Ctrl+B)','action':'bold','command':'bold'},{'id':'italic','icon':ICONS['italic'],'title':'Italic\x20(Ctrl+I)','action':'italic','command':'italic'},{'id':'strike','icon':ICONS['strike'],'title':'Strikethrough','action':'strikeThrough','command':'strikeThrough'},{'id':'color','icon':ICONS['color'],'title':'Text\x20Color','action':'color','isDropdown':!![]},{'separator':!![]},{'id':'link','icon':ICONS['link'],'title':'Link\x20(Ctrl+K)','action':'link','tagName':'A'},{'id':'code','icon':ICONS['code'],'title':'Inline\x20Code','action':'code','tagName':'CODE'},{'id':'codeBlock','icon':ICONS['codeBlock'],'title':'Code\x20Block','action':'codeBlock','tagName':'PRE'},{'separator':!![]},{'id':'list-bullet','icon':ICONS['listBullet'],'title':'Bullet\x20List','action':'insertUnorderedList','command':'insertUnorderedList'},{'id':'list-ordered','icon':ICONS['listOrdered'],'title':'Numbered\x20List','action':'insertOrderedList','command':'insertOrderedList'}];_0x184926['forEach'](_0x4ceed=>{if(_0x4ceed['separator']){const _0x1d2f2a=document['createElement']('div');_0x1d2f2a['className']='markdown-toolbar-separator',_0x1d2f2a['style']['width']='1px',_0x1d2f2a['style']['height']='16px',_0x1d2f2a['style']['background']='var(--color-border)',_0x1d2f2a['style']['margin']='0\x206px',_0x1d2f2a['style']['alignSelf']='center',this['toolbar']['appendChild'](_0x1d2f2a);}else{if(_0x4ceed['isDropdown']){const _0x46d44a=document['createElement']('div');_0x46d44a['className']='markdown-toolbar-dropdown',_0x46d44a['style']['position']='relative';const _0x203385=document['createElement']('button');_0x203385['type']='button',_0x203385['className']='markdown-editor-toolbar-btn\x20markdown-toolbar-dropdown-btn',_0x203385['tabIndex']=-0x1,_0x203385['innerHTML']=_0x4ceed['icon']+'<svg\x20class=\x22dropdown-arrow\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2210\x22\x20height=\x2210\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline></svg>',_0x203385['title']=_0x4ceed['title'],_0x203385['dataset']['action']=_0x4ceed['action'];const _0x13c270=document['createElement']('div');_0x13c270['className']='markdown-toolbar-dropdown-menu',_0x13c270['style']['display']='none';if(_0x4ceed['action']==='header')this['createHeaderDropdown'](_0x13c270);else _0x4ceed['action']==='color'&&this['createColorDropdown'](_0x13c270);_0x203385['addEventListener']('click',_0x9fcca5=>{_0x9fcca5['preventDefault'](),_0x9fcca5['stopPropagation'](),this['toggleDropdown'](_0x13c270,_0x203385);}),_0x46d44a['appendChild'](_0x203385),_0x46d44a['appendChild'](_0x13c270),this['toolbar']['appendChild'](_0x46d44a),this['toolbarButtons'][_0x4ceed['id']]={'button':_0x203385,'dropdown':_0x13c270,'command':_0x4ceed['command'],'tagName':_0x4ceed['tagName']};}else{const _0x573af8=document['createElement']('button');_0x573af8['type']='button',_0x573af8['className']='markdown-editor-toolbar-btn',_0x573af8['tabIndex']=-0x1,_0x573af8['innerHTML']=_0x4ceed['icon'],_0x573af8['title']=_0x4ceed['title'],_0x573af8['dataset']['action']=_0x4ceed['action'],_0x573af8['addEventListener']('click',_0x477a83=>{_0x477a83['preventDefault'](),this['handleToolbarAction'](_0x4ceed['action']);}),this['toolbar']['appendChild'](_0x573af8),this['toolbarButtons'][_0x4ceed['id']]={'button':_0x573af8,'command':_0x4ceed['command'],'tagName':_0x4ceed['tagName']};}}}),document['addEventListener']('click',_0x37103e=>{!this['toolbar']['contains'](_0x37103e['target'])&&this['closeAllDropdowns']();});}['createHeaderDropdown'](_0x1b46b3){const _0x2d4ec2=[{'level':0x1,'label':'Heading\x201','tag':'H1'},{'level':0x2,'label':'Heading\x202','tag':'H2'},{'level':0x3,'label':'Heading\x203','tag':'H3'},{'level':0x4,'label':'Heading\x204','tag':'H4'},{'level':0x0,'label':'Normal\x20Text','tag':'P'}];_0x2d4ec2['forEach'](_0x59ffa3=>{const _0x418e6f=document['createElement']('button');_0x418e6f['type']='button',_0x418e6f['className']='markdown-dropdown-item',_0x418e6f['tabIndex']=-0x1,_0x418e6f['innerHTML']='<span\x20style=\x22font-size:\x20'+(_0x59ffa3['level']===0x0?'14px':0x14-_0x59ffa3['level']*0x2+'px')+';\x20font-weight:\x20'+(_0x59ffa3['level']===0x0?'normal':'bold')+'\x22>'+_0x59ffa3['label']+'</span>',_0x418e6f['addEventListener']('click',_0x333044=>{_0x333044['preventDefault'](),_0x333044['stopPropagation'](),this['applyHeader'](_0x59ffa3['level']),this['closeAllDropdowns']();}),_0x1b46b3['appendChild'](_0x418e6f);});}['createColorDropdown'](_0x1019f0){const _0x3d111f=[{'value':'#000000','label':'Black'},{'value':'#374151','label':'Gray'},{'value':'#DC2626','label':'Red'},{'value':'#EA580C','label':'Orange'},{'value':'#CA8A04','label':'Yellow'},{'value':'#16A34A','label':'Green'},{'value':'#2563EB','label':'Blue'},{'value':'#7C3AED','label':'Purple'},{'value':'#DB2777','label':'Pink'}],_0xb5ab7=document['createElement']('div');_0xb5ab7['className']='markdown-color-grid',_0xb5ab7['style']['display']='grid',_0xb5ab7['style']['gridTemplateColumns']='repeat(3,\x201fr)',_0xb5ab7['style']['gap']='4px',_0xb5ab7['style']['padding']='8px',_0x3d111f['forEach'](_0x199919=>{const _0x1f0f5e=document['createElement']('button');_0x1f0f5e['type']='button',_0x1f0f5e['className']='markdown-color-btn',_0x1f0f5e['tabIndex']=-0x1,_0x1f0f5e['style']['width']='24px',_0x1f0f5e['style']['height']='24px',_0x1f0f5e['style']['backgroundColor']=_0x199919['value'],_0x1f0f5e['style']['border']='1px\x20solid\x20var(--color-border)',_0x1f0f5e['style']['borderRadius']='4px',_0x1f0f5e['style']['cursor']='pointer',_0x1f0f5e['title']=_0x199919['label'],_0x1f0f5e['addEventListener']('click',_0x551cc8=>{_0x551cc8['preventDefault'](),_0x551cc8['stopPropagation'](),this['applyColor'](_0x199919['value']),this['closeAllDropdowns']();}),_0xb5ab7['appendChild'](_0x1f0f5e);}),_0x1019f0['appendChild'](_0xb5ab7);const _0x2f2b25=document['createElement']('button');_0x2f2b25['type']='button',_0x2f2b25['className']='markdown-dropdown-item',_0x2f2b25['innerHTML']='<span>Remove\x20Color</span>',_0x2f2b25['style']['borderTop']='1px\x20solid\x20var(--color-border)',_0x2f2b25['style']['marginTop']='4px',_0x2f2b25['style']['paddingTop']='8px',_0x2f2b25['addEventListener']('click',_0x175365=>{_0x175365['preventDefault'](),_0x175365['stopPropagation'](),this['removeColor'](),this['closeAllDropdowns']();}),_0x1019f0['appendChild'](_0x2f2b25);}['toggleDropdown'](_0xb175a5,_0x14c619){const _0x293363=_0xb175a5['style']['display']!=='none';this['toolbar']&&this['closeAllDropdowns'](),!_0x293363&&(_0xb175a5['style']['display']='block',_0x14c619['classList']['add']('active'));}['closeAllDropdowns'](){const _0x235de5=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-menu');_0x235de5['forEach'](_0x701680=>_0x701680['style']['display']='none');const _0xd72756=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-btn');_0xd72756['forEach'](_0x431cc1=>_0x431cc1['classList']['remove']('active'));}['applyHeader'](_0x13c0ab){this['editor']['focus']();const _0x50cb73=window['getSelection']();if(!_0x50cb73||_0x50cb73['rangeCount']===0x0)return;const _0x1f9aff=_0x50cb73['getRangeAt'](0x0);let _0x44f8eb=_0x1f9aff['startContainer'];while(_0x44f8eb&&_0x44f8eb!==this['editor']){if(_0x44f8eb['nodeType']===Node['ELEMENT_NODE']){const _0x2f56e9=window['getComputedStyle'](_0x44f8eb)['display'];if(_0x2f56e9==='block'||['P','H1','H2','H3','H4','H5','H6','DIV']['includes'](_0x44f8eb['tagName']))break;}_0x44f8eb=_0x44f8eb['parentNode'];}_0x13c0ab===0x0?document['execCommand']('formatBlock',![],'p'):document['execCommand']('formatBlock',![],'h'+_0x13c0ab),this['editor']['dispatchEvent'](new Event('input'));}['applyColor'](_0x2c1794){this['editor']['focus'](),document['execCommand']('foreColor',![],_0x2c1794),this['editor']['dispatchEvent'](new Event('input'));}['removeColor'](){this['editor']['focus'](),document['execCommand']('removeFormat',![],null),this['editor']['dispatchEvent'](new Event('input'));}['handleToolbarAction'](_0x2acdfd){this['editor']['focus']();switch(_0x2acdfd){case'bold':case'italic':case'strikeThrough':case'insertUnorderedList':case'insertOrderedList':document['execCommand'](_0x2acdfd,![],null);break;case'link':this['openLinkDialog']();return;case'code':this['toggleInlineCode']();break;case'codeBlock':this['insertCodeBlock']();break;}this['updateToolbarState'](),this['editor']['dispatchEvent'](new Event('input'));}['ensureLinkDialog'](){if(this['linkDialog'])return;this['ensureLinkDialogStyles']();const _0x105da5=document['createElement']('div');_0x105da5['className']='markdown-editor-link-modal',_0x105da5['hidden']=!![],_0x105da5['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-dialog\x22\x20role=\x22dialog\x22\x20aria-modal=\x22true\x22\x20aria-label=\x22Edit\x20link\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22markdown-editor-link-title\x22>Insert\x20Link</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-close\x22\x20aria-label=\x22Close\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<form\x20class=\x22markdown-editor-link-form\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-field-grid\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22markdown-editor-link-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20URL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20class=\x22markdown-editor-link-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-link-field=\x22url\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22https://example.com\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autocomplete=\x22off\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20spellcheck=\x22false\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22markdown-editor-link-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Display\x20text\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20class=\x22markdown-editor-link-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data-link-field=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type=\x22text\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Text\x20shown\x20to\x20readers\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20autocomplete=\x22off\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20spellcheck=\x22false\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22markdown-editor-link-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-secondary\x22\x20data-action=\x22cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-danger\x22\x20data-action=\x22remove\x22\x20hidden>Remove\x20Link</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22submit\x22\x20class=\x22markdown-editor-link-btn\x20markdown-editor-link-btn-primary\x22>Insert\x20Link</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</form>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20',document['body']['appendChild'](_0x105da5),this['linkDialog']=_0x105da5,this['linkDialogElements']={'backdrop':_0x105da5['querySelector']('.markdown-editor-link-backdrop'),'title':_0x105da5['querySelector']('.markdown-editor-link-title'),'close':_0x105da5['querySelector']('.markdown-editor-link-close'),'form':_0x105da5['querySelector']('.markdown-editor-link-form'),'urlInput':_0x105da5['querySelector']('[data-link-field=\x22url\x22]'),'textInput':_0x105da5['querySelector']('[data-link-field=\x22text\x22]'),'remove':_0x105da5['querySelector']('[data-action=\x22remove\x22]'),'cancel':_0x105da5['querySelector']('[data-action=\x22cancel\x22]'),'submit':_0x105da5['querySelector']('.markdown-editor-link-btn-primary')},this['linkDialogElements']['backdrop']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['close']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['cancel']['addEventListener']('click',()=>{this['closeLinkDialog']({'restoreSelection':!![]});}),this['linkDialogElements']['remove']['addEventListener']('click',()=>{this['applyLinkDialogResult']({'remove':!![]});}),this['linkDialogElements']['form']['addEventListener']('submit',_0x41650a=>{_0x41650a['preventDefault'](),this['applyLinkDialogResult']();}),this['linkDialog']['addEventListener']('keydown',_0x351a68=>{_0x351a68['key']==='Escape'&&(_0x351a68['preventDefault'](),this['closeLinkDialog']({'restoreSelection':!![]}));});}['openLinkDialog'](){const _0x4f7448=window['getSelection']();if(!_0x4f7448||_0x4f7448['rangeCount']===0x0)return;const _0x408e35=_0x4f7448['getRangeAt'](0x0),_0x1d9989=this['editor']['contains'](_0x408e35['commonAncestorContainer'])||this['editor']===_0x408e35['commonAncestorContainer'];if(!_0x1d9989)return;this['toolbar']&&this['closeAllDropdowns']();this['ensureLinkDialog']();const _0x1d1501=_0x408e35['cloneRange'](),_0x4d14de=this['findLinkAtRange'](_0x1d1501),_0x14fe3f=_0x4d14de?_0x4d14de['getAttribute']('href')||'':'',_0x522320=_0x4d14de?_0x4d14de['textContent']||'':_0x1d1501['toString']();this['linkDialogContext']={'range':_0x1d1501,'existingLink':_0x4d14de,'selectedText':_0x522320},this['linkDialogElements']['title']['textContent']=_0x4d14de?'Edit\x20Link':'Insert\x20Link',this['linkDialogElements']['submit']['textContent']=_0x4d14de?'Save\x20Link':'Insert\x20Link',this['linkDialogElements']['remove']['hidden']=!_0x4d14de,this['linkDialogElements']['urlInput']['value']=_0x14fe3f,this['linkDialogElements']['textInput']['value']=_0x522320,this['linkDialog']['hidden']=![],this['linkDialogElements']['urlInput']['focus'](),this['linkDialogElements']['urlInput']['select']();}['closeLinkDialog']({restoreSelection:restoreSelection=![]}={}){if(!this['linkDialog'])return;const _0x226da1=this['linkDialogContext'];this['linkDialog']['hidden']=!![],restoreSelection&&_0x226da1?.['range']&&(this['editor']['focus'](),this['restoreRange'](_0x226da1['range'])),this['linkDialogContext']=null;}['applyLinkDialogResult']({remove:remove=![]}={}){if(!this['linkDialog']||!this['linkDialogContext'])return;const _0x27990b=this['linkDialogContext'],_0x47e774=(this['linkDialogElements']['urlInput']['value']||'')['trim'](),_0x25d56e=this['linkDialogElements']['textInput']['value']||'',_0x1ae76e=_0x25d56e['trim']();if(!remove&&!_0x47e774){this['linkDialogElements']['urlInput']['focus']();return;}this['closeLinkDialog'](),this['editor']['focus'](),this['restoreRange'](_0x27990b['range']);if(remove)_0x27990b['existingLink']&&_0x27990b['existingLink']['parentNode']?this['unwrapLinkElement'](_0x27990b['existingLink']):document['execCommand']('unlink',![],null);else{if(_0x27990b['existingLink']&&_0x27990b['existingLink']['parentNode'])_0x27990b['existingLink']['setAttribute']('href',_0x47e774),_0x27990b['existingLink']['textContent']=_0x1ae76e||_0x47e774;else{const _0x2361db=window['getSelection']();if(!_0x2361db||_0x2361db['rangeCount']===0x0)return;const _0x1c3185=_0x2361db['getRangeAt'](0x0),_0x50d6df=(_0x27990b['selectedText']||'')['trim'](),_0x3fa209=_0x1ae76e||_0x50d6df||_0x47e774;_0x1c3185['deleteContents']();const _0x8d326e=document['createElement']('a');_0x8d326e['href']=_0x47e774,_0x8d326e['textContent']=_0x3fa209,_0x1c3185['insertNode'](_0x8d326e),_0x1c3185['setStartAfter'](_0x8d326e),_0x1c3185['collapse'](!![]),_0x2361db['removeAllRanges'](),_0x2361db['addRange'](_0x1c3185);}}this['addLinkHints'](),this['updateToolbarState'](),this['editor']['dispatchEvent'](new Event('input'));}['ensureLinkDialogStyles'](){if(document['getElementById'](LINK_DIALOG_STYLE_ID))return;const _0x541d24=document['createElement']('style');_0x541d24['id']=LINK_DIALOG_STYLE_ID,_0x541d24['textContent']=LINK_DIALOG_STYLES,document['head']['appendChild'](_0x541d24);}['restoreRange'](_0x208e4b){const _0x1fcddd=window['getSelection']();if(!_0x1fcddd)return;try{_0x1fcddd['removeAllRanges'](),_0x1fcddd['addRange'](_0x208e4b);return;}catch(_0x3d849c){}const _0x1eff6f=document['createRange']();_0x1eff6f['selectNodeContents'](this['editor']),_0x1eff6f['collapse'](![]),_0x1fcddd['removeAllRanges'](),_0x1fcddd['addRange'](_0x1eff6f);}['findLinkAtRange'](_0x345dde){if(!_0x345dde)return null;const _0x276b41=this['findParentLink'](_0x345dde['startContainer']);if(_0x345dde['collapsed'])return _0x276b41;const _0x3e9673=this['findParentLink'](_0x345dde['endContainer']);if(_0x276b41&&_0x276b41===_0x3e9673)return _0x276b41;if(_0x276b41&&_0x276b41['contains'](_0x345dde['endContainer']))return _0x276b41;if(_0x3e9673&&_0x3e9673['contains'](_0x345dde['startContainer']))return _0x3e9673;return null;}['findParentLink'](_0xde49cf){let _0x48df7a=_0xde49cf;while(_0x48df7a&&_0x48df7a!==this['editor']){if(_0x48df7a['nodeType']===Node['ELEMENT_NODE']&&_0x48df7a['tagName']==='A'){const _0x5f4f06=_0x48df7a['getAttribute']('href')||'';if(_0x5f4f06['startsWith']('mention:'))return null;return _0x48df7a;}_0x48df7a=_0x48df7a['parentNode'];}return null;}['unwrapLinkElement'](_0x57e353){const _0x5e8aab=_0x57e353['parentNode'];if(!_0x5e8aab)return;while(_0x57e353['firstChild']){_0x5e8aab['insertBefore'](_0x57e353['firstChild'],_0x57e353);}_0x5e8aab['removeChild'](_0x57e353);}['isSelectionInTag'](_0x40ed6e){const _0x585cca=window['getSelection']();if(!_0x585cca||_0x585cca['rangeCount']===0x0)return![];let _0xccf088=_0x585cca['anchorNode'];while(_0xccf088&&_0xccf088!==this['editor']){if(_0xccf088['nodeType']===Node['ELEMENT_NODE']&&_0xccf088['tagName']===_0x40ed6e)return!![];_0xccf088=_0xccf088['parentNode'];}return![];}['updateToolbarState'](){if(!this['toolbarButtons'])return;for(const [_0x35b9b3,_0x35980f]of Object['entries'](this['toolbarButtons'])){let _0x1d9a03=![];if(_0x35980f['command'])try{_0x1d9a03=document['queryCommandState'](_0x35980f['command']);}catch(_0x398125){_0x1d9a03=![];}else _0x35980f['tagName']&&(_0x1d9a03=this['isSelectionInTag'](_0x35980f['tagName']));_0x35980f['button']['classList']['toggle']('active',_0x1d9a03);}}['bindEvents'](){this['editor']['addEventListener']('keydown',_0x4646a2=>this['handleKeydown'](_0x4646a2)),this['editor']['addEventListener']('input',_0x1fbfe0=>{this['handleMentionInput'](_0x1fbfe0),this['handleAutoFormat'](_0x1fbfe0);}),this['editor']['addEventListener']('input',()=>{const _0x495d04=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');!_0x495d04&&(this['editor']['innerHTML']='');this['updatePlaceholder']();const _0x43451b=this['getMarkdown']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0x43451b:this['element']['textContent']=_0x43451b,this['options']['onChange']&&this['options']['onChange'](_0x43451b);}),this['editor']['addEventListener']('paste',_0x18e7c9=>this['handlePaste'](_0x18e7c9)),this['editor']['addEventListener']('dragover',_0x41e0ce=>this['handleDragOver'](_0x41e0ce)),this['editor']['addEventListener']('drop',_0x15801b=>this['handleDrop'](_0x15801b)),this['editor']['addEventListener']('dragstart',_0x37ba44=>this['handleDragStart'](_0x37ba44)),this['options']['toolbar']&&(this['selectionChangeHandler']=()=>{(this['editor']['contains'](document['activeElement'])||this['editor']===document['activeElement'])&&this['updateToolbarState']();},document['addEventListener']('selectionchange',this['selectionChangeHandler']),this['editor']['addEventListener']('keyup',()=>this['updateToolbarState']()),this['editor']['addEventListener']('mouseup',()=>this['updateToolbarState']()),this['editor']['addEventListener']('focus',()=>this['updateToolbarState']())),this['linkClickHandler']=_0x128a18=>this['handleLinkClick'](_0x128a18),this['editor']['addEventListener']('click',this['linkClickHandler']),this['linkMouseEnterHandler']=_0xe818f3=>this['handleLinkMouseEnter'](_0xe818f3),this['linkMouseLeaveHandler']=_0x14c397=>this['handleLinkMouseLeave'](_0x14c397),this['editor']['addEventListener']('mouseover',this['linkMouseEnterHandler']),this['editor']['addEventListener']('mouseout',this['linkMouseLeaveHandler']),this['updatePlaceholder']();}['handleAutoFormat'](_0xeae64d){if(_0xeae64d['inputType']==='deleteContentBackward')return;const _0x33bf5e=window['getSelection']();if(!_0x33bf5e||_0x33bf5e['rangeCount']===0x0)return;const _0x3ed5fd=_0x33bf5e['getRangeAt'](0x0),_0x2531ce=_0x3ed5fd['startContainer'];if(_0x2531ce['nodeType']!==Node['TEXT_NODE'])return;if(this['isSelectionInTag']('CODE')||this['isSelectionInTag']('PRE'))return;const _0x47be7c=_0x2531ce['textContent'],_0x41d72f=_0x3ed5fd['startOffset'],_0x24bc4b=_0x47be7c['slice'](0x0,_0x41d72f);if(_0x24bc4b['endsWith']('```')){_0x3ed5fd['setStart'](_0x2531ce,_0x41d72f-0x3),_0x3ed5fd['setEnd'](_0x2531ce,_0x41d72f),_0x3ed5fd['deleteContents'](),this['insertCodeBlock']();return;}const _0x57f6bd=/`([^`]+)`$/,_0x567ce6=_0x24bc4b['match'](_0x57f6bd);if(_0x567ce6){const _0x35d443=_0x567ce6[0x1];if(_0x35d443){const _0x399f42=_0x567ce6['index'],_0x2225ef=_0x399f42+_0x35d443['length']+0x2;_0x3ed5fd['setStart'](_0x2531ce,_0x399f42),_0x3ed5fd['setEnd'](_0x2531ce,_0x41d72f),_0x3ed5fd['deleteContents']();const _0x2cec29=document['createElement']('code');_0x2cec29['textContent']=_0x35d443,_0x3ed5fd['insertNode'](_0x2cec29),_0x3ed5fd['setStartAfter'](_0x2cec29),_0x3ed5fd['setEndAfter'](_0x2cec29);const _0x5d3a25=document['createTextNode']('​');_0x3ed5fd['insertNode'](_0x5d3a25),_0x3ed5fd['setStartAfter'](_0x5d3a25),_0x3ed5fd['setEndAfter'](_0x5d3a25),_0x33bf5e['removeAllRanges'](),_0x33bf5e['addRange'](_0x3ed5fd);return;}}const _0x145000=_0x24bc4b['match'](/^[-*][\s\u00A0]$/);if(_0x145000&&this['isAtStartOfBlock'](_0x2531ce)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0x3ed5fd['setStart'](_0x2531ce,Math['max'](_0x41d72f-0x2,0x0)),_0x3ed5fd['setEnd'](_0x2531ce,_0x41d72f),_0x3ed5fd['deleteContents']();const _0x2ad12b=this['ensureListInsertionAnchor'](_0x2531ce);document['execCommand']('insertUnorderedList',![],null);_0x2ad12b&&_0x2ad12b['parentNode']&&_0x2ad12b['parentNode']['removeChild'](_0x2ad12b);this['updateToolbarState']();return;}const _0x5a6719=_0x24bc4b['match'](/^1\.[\s\u00A0]$/);if(_0x5a6719&&this['isAtStartOfBlock'](_0x2531ce)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0x3ed5fd['setStart'](_0x2531ce,Math['max'](_0x41d72f-0x3,0x0)),_0x3ed5fd['setEnd'](_0x2531ce,_0x41d72f),_0x3ed5fd['deleteContents']();const _0xee6229=this['ensureListInsertionAnchor'](_0x2531ce);document['execCommand']('insertOrderedList',![],null);_0xee6229&&_0xee6229['parentNode']&&_0xee6229['parentNode']['removeChild'](_0xee6229);this['updateToolbarState']();return;}}['isAtStartOfBlock'](_0x3e8513){let _0x3e7fca=_0x3e8513;while(_0x3e7fca&&_0x3e7fca!==this['editor']){const _0x65a299=_0x3e7fca['parentNode'];if(!_0x65a299)break;const _0x3367fc=_0x65a299['tagName'];if(_0x3367fc==='DIV'||_0x3367fc==='P'||_0x3367fc==='LI'||_0x65a299===this['editor']){let _0x157c01=_0x65a299['firstChild'];while(_0x157c01&&(_0x157c01['nodeType']===Node['TEXT_NODE']&&_0x157c01['textContent']===''||_0x157c01['nodeType']===Node['ELEMENT_NODE']&&_0x157c01['tagName']==='BR')){_0x157c01=_0x157c01['nextSibling'];}return _0x157c01===_0x3e8513||_0x157c01===_0x3e7fca;}_0x3e7fca=_0x65a299;}if(_0x3e7fca===this['editor']||_0x3e8513['parentNode']===this['editor']){let _0x14ed54=this['editor']['firstChild'];while(_0x14ed54&&(_0x14ed54['nodeType']===Node['TEXT_NODE']&&_0x14ed54['textContent']===''||_0x14ed54['nodeType']===Node['ELEMENT_NODE']&&_0x14ed54['tagName']==='BR')){_0x14ed54=_0x14ed54['nextSibling'];}return _0x14ed54===_0x3e8513;}return![];}['getClosestBlockElement'](_0x56e4c2){let _0x5c61fe=_0x56e4c2;while(_0x5c61fe&&_0x5c61fe!==this['editor']){const _0x46cd76=_0x5c61fe['parentNode'];if(!_0x46cd76)break;const _0x308f0d=_0x46cd76['tagName'];if(_0x308f0d==='DIV'||_0x308f0d==='P'||_0x308f0d==='LI'||_0x46cd76===this['editor'])return _0x46cd76;_0x5c61fe=_0x46cd76;}return this['editor'];}['ensureListInsertionAnchor'](_0x5bd4e4){const _0xbad84a=window['getSelection']();if(!_0xbad84a||_0xbad84a['rangeCount']===0x0)return null;const _0x71a0c5=this['getClosestBlockElement'](_0x5bd4e4);if(!_0x71a0c5||_0x71a0c5===this['editor'])return null;const _0x2266cf=_0x71a0c5['textContent']['replace'](/\u200B/g,'');if(_0x2266cf!=='')return null;const _0x3e4de8=document['createTextNode']('​');_0x71a0c5['appendChild'](_0x3e4de8);const _0x35c630=document['createRange']();return _0x35c630['setStart'](_0x3e4de8,0x1),_0x35c630['setEnd'](_0x3e4de8,0x1),_0xbad84a['removeAllRanges'](),_0xbad84a['addRange'](_0x35c630),_0x3e4de8;}['getContainingListItem'](){const _0x4a33c3=window['getSelection']();if(!_0x4a33c3||_0x4a33c3['rangeCount']===0x0)return null;let _0x2c69c9=_0x4a33c3['anchorNode'];while(_0x2c69c9&&_0x2c69c9!==this['editor']){if(_0x2c69c9['nodeType']===Node['ELEMENT_NODE']&&_0x2c69c9['tagName']==='LI')return _0x2c69c9;_0x2c69c9=_0x2c69c9['parentNode'];}return null;}['isEmptyListItem'](_0x1b74ac){if(!_0x1b74ac)return![];const _0x54b173=_0x1b74ac['textContent']['replace'](/\u200B/g,'')['trim']();if(_0x54b173!=='')return![];const _0x55a9d5=_0x1b74ac['querySelector']('img');if(_0x55a9d5)return![];const _0x5e5ed3=_0x1b74ac['querySelector']('ul,\x20ol');if(_0x5e5ed3)return![];return!![];}['isCursorAtStartOfListItem'](_0x54c2e1){if(!_0x54c2e1)return![];const _0x4dec4f=window['getSelection']();if(!_0x4dec4f||_0x4dec4f['rangeCount']===0x0||!_0x4dec4f['isCollapsed'])return![];const _0x367c4a=_0x4dec4f['getRangeAt'](0x0),_0x1f31a2=_0x367c4a['startContainer'];if(_0x1f31a2!==_0x54c2e1&&!_0x54c2e1['contains'](_0x1f31a2))return![];const _0x452d62=_0x367c4a['cloneRange']();_0x452d62['setStart'](_0x54c2e1,0x0),_0x452d62['setEnd'](_0x1f31a2,_0x367c4a['startOffset']);const _0x42f352=_0x452d62['toString']()['replace'](/\u200B/g,'')['replace'](/\u00A0/g,'\x20');return _0x42f352['trim']()==='';}['indentListItem'](_0x193d71){const _0xb8fbd0=_0x193d71['previousElementSibling'];if(!_0xb8fbd0||_0xb8fbd0['tagName']!=='LI')return;const _0x242aff=_0x193d71['parentNode'],_0x463c84=_0x242aff['tagName'];let _0x52e34f=_0xb8fbd0['querySelector'](':scope\x20>\x20ul,\x20:scope\x20>\x20ol');!_0x52e34f&&(_0x52e34f=document['createElement'](_0x463c84),_0xb8fbd0['appendChild'](_0x52e34f)),_0x52e34f['appendChild'](_0x193d71),this['placeCursorInListItem'](_0x193d71);}['outdentListItem'](_0x58c3a5){const _0x1b1379=_0x58c3a5['parentNode'];if(!_0x1b1379||_0x1b1379['tagName']!=='UL'&&_0x1b1379['tagName']!=='OL')return;const _0x173acd=_0x1b1379['parentNode'];if(_0x173acd&&_0x173acd['tagName']==='LI'){const _0x2279d7=_0x173acd['parentNode'];_0x2279d7['insertBefore'](_0x58c3a5,_0x173acd['nextSibling']),_0x1b1379['children']['length']===0x0&&_0x1b1379['remove'](),this['placeCursorInListItem'](_0x58c3a5);}else return;}['exitListOnEmptyBullet'](_0x4f2645){const _0x160195=_0x4f2645['parentNode'];if(!_0x160195)return;const _0x53890e=_0x160195['parentNode'];if(_0x53890e&&_0x53890e['tagName']==='LI'){this['outdentListItem'](_0x4f2645);return;}const _0x1a3b9f=_0x160195['parentNode'],_0x4b40f6=document['createElement']('p');_0x4b40f6['innerHTML']='<br>',_0x1a3b9f['insertBefore'](_0x4b40f6,_0x160195['nextSibling']),_0x4f2645['remove']();_0x160195['children']['length']===0x0&&_0x160195['remove']();const _0x4c0896=window['getSelection'](),_0x59146a=document['createRange']();_0x59146a['setStart'](_0x4b40f6,0x0),_0x59146a['collapse'](!![]),_0x4c0896['removeAllRanges'](),_0x4c0896['addRange'](_0x59146a);}['placeCursorInListItem'](_0x1acf5c){const _0x497482=window['getSelection'](),_0x559ba1=document['createRange'](),_0x14d025=document['createTreeWalker'](_0x1acf5c,NodeFilter['SHOW_TEXT'],null,![]),_0x504a2c=_0x14d025['nextNode']();_0x504a2c?_0x559ba1['setStart'](_0x504a2c,0x0):_0x559ba1['setStart'](_0x1acf5c,0x0),_0x559ba1['collapse'](!![]),_0x497482['removeAllRanges'](),_0x497482['addRange'](_0x559ba1);}['handleLinkClick'](_0x460a61){const _0x24922d=this['isMac']?_0x460a61['metaKey']:_0x460a61['ctrlKey'];if(!_0x24922d)return;let _0x65b80c=_0x460a61['target'];while(_0x65b80c&&_0x65b80c!==this['editor']){if(_0x65b80c['tagName']==='A'){_0x460a61['preventDefault'](),_0x460a61['stopPropagation']();const _0x5878b4=_0x65b80c['getAttribute']('href');if(!_0x5878b4)return;if(_0x5878b4['startsWith']('mention:'))return;const _0x4b4577=/^https?:\/\//i['test'](_0x5878b4);_0x4b4577?window['open'](_0x5878b4,'_blank','noopener,noreferrer'):window['location']['href']=_0x5878b4;return;}_0x65b80c=_0x65b80c['parentNode'];}}['handleLinkMouseEnter'](_0x3fc9e9){const _0x1fa78d=_0x3fc9e9['target'];if(_0x1fa78d['tagName']!=='A')return;const _0x2ec169=_0x1fa78d['getAttribute']('href')||'';if(_0x2ec169['startsWith']('mention:'))return;this['linkTooltipTimeout']&&clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=setTimeout(()=>{this['showLinkTooltip'](_0x1fa78d);},0x12c);}['handleLinkMouseLeave'](_0x421c29){const _0x38b809=_0x421c29['target'];if(_0x38b809['tagName']!=='A')return;this['linkTooltipTimeout']&&(clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=null),this['hideLinkTooltip']();}['showLinkTooltip'](_0x152547){!this['linkTooltip']&&(this['linkTooltip']=document['createElement']('div'),this['linkTooltip']['className']='markdown-editor-link-tooltip',document['body']['appendChild'](this['linkTooltip']));this['linkTooltip']['textContent']=this['linkHintText']||'Ctrl+click\x20to\x20follow';const _0x494612=_0x152547['getBoundingClientRect'](),_0x41c40e=this['linkTooltip']['getBoundingClientRect']();let _0xb2549b=_0x494612['bottom']+0x4,_0x5a6df6=_0x494612['left']+_0x494612['width']/0x2;_0xb2549b+0x1e>window['innerHeight']&&(_0xb2549b=_0x494612['top']-0x1e);const _0xbe96ee=0x78;if(_0x5a6df6-_0xbe96ee/0x2<0xa)_0x5a6df6=_0xbe96ee/0x2+0xa;else _0x5a6df6+_0xbe96ee/0x2>window['innerWidth']-0xa&&(_0x5a6df6=window['innerWidth']-_0xbe96ee/0x2-0xa);this['linkTooltip']['style']['top']=_0xb2549b+'px',this['linkTooltip']['style']['left']=_0x5a6df6+'px',this['linkTooltip']['style']['transform']='translateX(-50%)',this['linkTooltip']['classList']['add']('visible');}['hideLinkTooltip'](){this['linkTooltip']&&this['linkTooltip']['classList']['remove']('visible');}['handleKeydown'](_0x31174c){if(this['mentionState']['active']){if(_0x31174c['key']==='ArrowDown'){_0x31174c['preventDefault'](),this['mentionNavigate'](0x1);return;}if(_0x31174c['key']==='ArrowUp'){_0x31174c['preventDefault'](),this['mentionNavigate'](-0x1);return;}if(_0x31174c['key']==='Enter'||_0x31174c['key']==='Tab'){if(this['mentionState']['filteredUsers']['length']>0x0){_0x31174c['preventDefault'](),this['insertMention'](this['mentionState']['filteredUsers'][this['mentionState']['selectedIndex']]);return;}}if(_0x31174c['key']==='Escape'){_0x31174c['preventDefault'](),this['closeMentionDropdown']();return;}}if(_0x31174c['key']==='Tab'&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x3dc4b0=this['getContainingListItem']();if(_0x3dc4b0&&this['isCursorAtStartOfListItem'](_0x3dc4b0)){_0x31174c['preventDefault']();_0x31174c['shiftKey']?this['outdentListItem'](_0x3dc4b0):this['indentListItem'](_0x3dc4b0);this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x31174c['key']==='Enter'&&!_0x31174c['shiftKey']&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x2d487b=this['getContainingListItem']();if(_0x2d487b&&this['isEmptyListItem'](_0x2d487b)){_0x31174c['preventDefault'](),this['exitListOnEmptyBullet'](_0x2d487b),this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x31174c['key']==='Enter'&&!_0x31174c['shiftKey']&&this['isSelectionInTag']('PRE')){_0x31174c['preventDefault']();const _0x3fa6f4=window['getSelection']();if(_0x3fa6f4['rangeCount']>0x0){const _0x95249e=_0x3fa6f4['getRangeAt'](0x0);_0x95249e['deleteContents']();const _0x5be9f9=document['createTextNode']('\x0a');_0x95249e['insertNode'](_0x5be9f9),_0x95249e['setStartAfter'](_0x5be9f9),_0x95249e['setEndAfter'](_0x5be9f9),_0x3fa6f4['removeAllRanges'](),_0x3fa6f4['addRange'](_0x95249e),this['handleInput']();}return;}(_0x31174c['ctrlKey']||_0x31174c['metaKey'])&&_0x31174c['key']==='b'&&(_0x31174c['preventDefault'](),document['execCommand']('bold',![],null));(_0x31174c['ctrlKey']||_0x31174c['metaKey'])&&_0x31174c['key']==='i'&&(_0x31174c['preventDefault'](),document['execCommand']('italic',![],null));if((_0x31174c['ctrlKey']||_0x31174c['metaKey'])&&_0x31174c['key']==='k'){_0x31174c['preventDefault'](),this['openLinkDialog']();return;}}['handlePaste'](_0x35617e){const _0x40c98c=_0x35617e['clipboardData'];if(_0x40c98c&&this['options']['onAddAttachments']){const _0x351c26=this['extractImageFilesFromClipboard'](_0x40c98c);if(_0x351c26['length']>0x0){_0x35617e['preventDefault'](),this['addAndInsertImages'](_0x351c26);return;}}_0x35617e['preventDefault']();const _0x3e968e=_0x35617e['clipboardData']['getData']('text/html');if(_0x3e968e&&_0x3e968e['trim']()){const _0x5f7195=this['convertPastedHtmlToMarkdown'](_0x3e968e);if(_0x5f7195&&_0x5f7195['trim']()){this['insertMarkdownAsRichText'](_0x5f7195);return;}}const _0x1f9f22=_0x35617e['clipboardData']['getData']('text/plain');document['execCommand']('insertText',![],_0x1f9f22);}['convertPastedHtmlToMarkdown'](_0x1a9f55){const _0x4f14ef=document['createElement']('div');_0x4f14ef['innerHTML']=_0x1a9f55;const _0x1ea21d=_0x4f14ef['querySelectorAll']('style,\x20script,\x20meta,\x20link,\x20head,\x20title');_0x1ea21d['forEach'](_0x2e4f32=>_0x2e4f32['remove']());const _0x5126b7=_0x4f14ef['querySelectorAll']('*');_0x5126b7['forEach'](_0x4fd180=>{const _0xe42a84=Array['from'](_0x4fd180['attributes']);_0xe42a84['forEach'](_0x1e882f=>{_0x1e882f['name']['startsWith']('data-')&&_0x1e882f['name']!=='data-attachment-name'&&_0x1e882f['name']!=='data-mention-user-id'&&_0x4fd180['removeAttribute'](_0x1e882f['name']);});}),_0x4f14ef['querySelectorAll']('font[color]')['forEach'](_0x5f4246=>{_0x5f4246['replaceWith'](..._0x5f4246['childNodes']);}),_0x4f14ef['querySelectorAll']('span')['forEach'](_0xb733eb=>{_0xb733eb['style']['color']&&_0xb733eb['style']['removeProperty']('color'),!_0xb733eb['getAttribute']('style')&&!_0xb733eb['getAttribute']('data-mention-user-id')&&!_0xb733eb['getAttribute']('data-attachment-name')&&_0xb733eb['replaceWith'](..._0xb733eb['childNodes']);});try{return this['turndownService']['turndown'](_0x4f14ef['innerHTML']);}catch(_0x40488d){return console['warn']('Failed\x20to\x20convert\x20HTML\x20to\x20markdown:',_0x40488d),null;}}['insertMarkdownAsRichText'](_0x18ad11){const _0x1f5b18=window['marked'];if(!_0x1f5b18){document['execCommand']('insertText',![],_0x18ad11);return;}try{const _0x54d5cb=this['preprocessColorSyntax'](_0x18ad11),_0x55090d=_0x1f5b18['parse'](_0x54d5cb),_0x169735=document['createElement']('div');_0x169735['innerHTML']=_0x55090d,this['processHtmlForEditor'](_0x169735),document['execCommand']('insertHTML',![],_0x169735['innerHTML']);}catch(_0x4b2b20){console['warn']('Failed\x20to\x20convert\x20markdown\x20to\x20HTML:',_0x4b2b20),document['execCommand']('insertText',![],_0x18ad11);}}['processHtmlForEditor'](_0x5a7d66){const _0x896f5e=_0x5a7d66['querySelectorAll']('pre');_0x896f5e['forEach'](_0x3866c2=>{const _0x53a930=_0x3866c2['querySelector']('code');if(_0x53a930){const _0xf93176=Array['from'](_0x53a930['classList'])['find'](_0x4e97f5=>_0x4e97f5['startsWith']('language-')),_0x199ff5=_0xf93176?_0xf93176['replace']('language-',''):'',_0x5264eb=document['createElement']('pre');_0x199ff5&&_0x5264eb['setAttribute']('data-language',_0x199ff5),_0x5264eb['textContent']=_0x53a930['textContent'],_0x3866c2['replaceWith'](_0x5264eb);}});const _0x1c8d02=_0x5a7d66['querySelectorAll']('a');_0x1c8d02['forEach'](_0x45a15a=>{_0x45a15a['setAttribute']('target','_blank'),_0x45a15a['setAttribute']('rel','noopener\x20noreferrer');});}['handleDragStart'](_0xee7e08){const _0x5d0a4d=_0xee7e08['target'];if(!_0x5d0a4d||_0x5d0a4d['tagName']!=='IMG')return;if(!_0xee7e08['dataTransfer'])return;const _0x6b9cd7=_0x5d0a4d['getAttribute']('data-attachment-name')||'';try{_0xee7e08['dataTransfer']['setData'](INTERNAL_DRAG_MIME,_0x6b9cd7||'1');}catch{}_0xee7e08['dataTransfer']['effectAllowed']='move';}['handleDragOver'](_0x1c09c5){if(!this['isExternalFileTransfer'](_0x1c09c5['dataTransfer']))return;_0x1c09c5['preventDefault'](),_0x1c09c5['dataTransfer']['dropEffect']='copy';}['handleDrop'](_0x31d591){if(!this['isExternalFileTransfer'](_0x31d591['dataTransfer']))return;const _0x53e416=_0x31d591['dataTransfer'],_0xccc9a6=Array['from'](_0x53e416['files']||[])['filter'](_0x5127d9=>_0x5127d9&&typeof _0x5127d9['type']==='string'),_0x458d65=_0xccc9a6['filter'](_0x49c8be=>_0x49c8be['type']['startsWith']('image/'));if(_0x458d65['length']===0x0)return;_0x31d591['preventDefault'](),_0x31d591['stopPropagation'](),this['cleanupParentDragState'](),this['moveSelectionToDropPoint'](_0x31d591),this['addAndInsertImages'](_0x458d65);}['cleanupParentDragState'](){let _0x473882=this['editor']['parentElement'];while(_0x473882){_0x473882['classList']&&_0x473882['classList']['contains']('drag-over')&&_0x473882['classList']['remove']('drag-over'),_0x473882=_0x473882['parentElement'];}}['isExternalFileTransfer'](_0x16d7a9){if(!_0x16d7a9)return![];const _0x2cd7c4=Array['from'](_0x16d7a9['types']||[]);if(!_0x2cd7c4['includes']('Files'))return![];if(_0x2cd7c4['includes'](INTERNAL_DRAG_MIME))return![];if(_0x16d7a9['files']&&_0x16d7a9['files']['length']>0x0)return!![];if(_0x16d7a9['items']&&Array['from'](_0x16d7a9['items'])['some'](_0x4f4ec4=>_0x4f4ec4['kind']==='file'))return!![];return![];}['moveSelectionToDropPoint'](_0x420021){const _0x2c6024=_0x420021['clientX'],_0x21d2f3=_0x420021['clientY'];let _0x4b0940=null;if(document['caretRangeFromPoint'])_0x4b0940=document['caretRangeFromPoint'](_0x2c6024,_0x21d2f3);else{if(document['caretPositionFromPoint']){const _0x4c5082=document['caretPositionFromPoint'](_0x2c6024,_0x21d2f3);_0x4c5082&&(_0x4b0940=document['createRange'](),_0x4b0940['setStart'](_0x4c5082['offsetNode'],_0x4c5082['offset']),_0x4b0940['collapse'](!![]));}}if(_0x4b0940){const _0x175a02=window['getSelection']();_0x175a02['removeAllRanges'](),_0x175a02['addRange'](_0x4b0940);}}['extractImageFilesFromClipboard'](_0x555462){const _0x2ea13a=Array['from'](_0x555462['items']||[]),_0x4daaca=[];for(const _0x303c10 of _0x2ea13a){if(_0x303c10['kind']==='file'&&_0x303c10['type']&&_0x303c10['type']['startsWith']('image/')){const _0x5f1e5b=_0x303c10['getAsFile']();if(_0x5f1e5b)_0x4daaca['push'](_0x5f1e5b);}}return _0x4daaca;}['addAndInsertImages'](_0x12a57a){const _0x33a20d=_0x12a57a['map'](_0x262d61=>this['prepareAttachmentFile'](_0x262d61))['filter'](Boolean);if(_0x33a20d['length']===0x0)return;const _0x4c697f=_0x33a20d['map'](_0x4f0eb2=>_0x4f0eb2['file']);try{this['options']['onAddAttachments'](_0x4c697f);}catch(_0x4034fe){console['error']('Failed\x20to\x20add\x20attachments:',_0x4034fe);}for(const {name:_0x1db744,objectUrl:_0x45914e}of _0x33a20d){this['insertAttachmentImage'](_0x1db744,_0x45914e);}this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));}['prepareAttachmentFile'](_0xf5485a){const _0x103099=this['sanitizeFilename'](_0xf5485a['name']||this['defaultImageName'](_0xf5485a['type']));if(!_0x103099)return null;const _0x2b7ab5=this['getUniqueAttachmentName'](_0x103099),_0x135b9a=_0x2b7ab5===_0xf5485a['name']?_0xf5485a:new File([_0xf5485a],_0x2b7ab5,{'type':_0xf5485a['type'],'lastModified':_0xf5485a['lastModified']}),_0x21c1d1=URL['createObjectURL'](_0x135b9a);return this['attachmentObjectUrls']['set'](_0x2b7ab5,_0x21c1d1),{'name':_0x2b7ab5,'file':_0x135b9a,'objectUrl':_0x21c1d1};}['getUniqueAttachmentName'](_0x46fdb8){const _0x28b9ea=_0x2caebc=>{if(this['attachmentObjectUrls']['has'](_0x2caebc))return!![];if(this['options']['isAttachmentNameTaken'])try{return Boolean(this['options']['isAttachmentNameTaken'](_0x2caebc));}catch{return![];}return![];};if(!_0x28b9ea(_0x46fdb8))return _0x46fdb8;const {stem:_0x520cde,ext:_0x34c268}=this['splitFilename'](_0x46fdb8);for(let _0x191bf7=0x2;_0x191bf7<0x3e8;_0x191bf7++){const _0x44d81e=_0x520cde+'-'+_0x191bf7+_0x34c268;if(!_0x28b9ea(_0x44d81e))return _0x44d81e;}return _0x520cde+'-'+Date['now']()+_0x34c268;}['splitFilename'](_0x20e626){const _0x3ecd1e=_0x20e626['lastIndexOf']('.');if(_0x3ecd1e<=0x0||_0x3ecd1e===_0x20e626['length']-0x1)return{'stem':_0x20e626,'ext':''};return{'stem':_0x20e626['slice'](0x0,_0x3ecd1e),'ext':_0x20e626['slice'](_0x3ecd1e)};}['sanitizeFilename'](_0xe148c1){const _0x28647e=String(_0xe148c1||'')['split']('/')['pop']()['split']('\x5c')['pop']();return _0x28647e['replace'](/[\u0000-\u001F\u007F]/g,'')['trim']();}['defaultImageName'](_0x2d4c57){const _0xd0f760=this['extensionForMime'](_0x2d4c57);return'pasted-image-'+Date['now']()+_0xd0f760;}['extensionForMime'](_0x455834){switch(_0x455834){case'image/png':return'.png';case'image/jpeg':return'.jpg';case'image/gif':return'.gif';case'image/webp':return'.webp';case'image/svg+xml':return'.svg';default:return'.png';}}['insertAttachmentImage'](_0x140ecd,_0x2f18ee){const _0x3ab035=document['createElement']('img');_0x3ab035['src']=_0x2f18ee,_0x3ab035['alt']=_0x140ecd,_0x3ab035['setAttribute']('data-attachment-name',_0x140ecd),_0x3ab035['draggable']=!![];const _0x5c0305=window['getSelection']();let _0x44dcfc=![];if(_0x5c0305&&_0x5c0305['rangeCount']>0x0){const _0x27ba3c=_0x5c0305['getRangeAt'](0x0);_0x44dcfc=this['editor']['contains'](_0x27ba3c['commonAncestorContainer'])||this['editor']===_0x27ba3c['commonAncestorContainer'];}if(!_0x44dcfc){this['editor']['appendChild'](_0x3ab035);const _0x3cf7b3=document['createRange']();_0x3cf7b3['setStartAfter'](_0x3ab035),_0x3cf7b3['collapse'](!![]),_0x5c0305['removeAllRanges'](),_0x5c0305['addRange'](_0x3cf7b3);return;}const _0x450c39=_0x5c0305['getRangeAt'](0x0);_0x450c39['deleteContents'](),_0x450c39['insertNode'](_0x3ab035),_0x450c39['setStartAfter'](_0x3ab035),_0x450c39['collapse'](!![]),_0x5c0305['removeAllRanges'](),_0x5c0305['addRange'](_0x450c39);}['toggleInlineCode'](){const _0x468334=window['getSelection']();if(_0x468334['rangeCount']===0x0)return;const _0x4742ae=_0x468334['getRangeAt'](0x0),_0xc15d2f=_0x4742ae['toString']();if(_0xc15d2f){const _0x198397=document['createElement']('code');_0x198397['textContent']=_0xc15d2f,_0x4742ae['deleteContents'](),_0x4742ae['insertNode'](_0x198397),_0x4742ae['setStartAfter'](_0x198397),_0x4742ae['setEndAfter'](_0x198397),_0x468334['removeAllRanges'](),_0x468334['addRange'](_0x4742ae);}}['insertCodeBlock'](){const _0x123327=window['getSelection']();if(_0x123327['rangeCount']===0x0)return;const _0x4ec9eb=_0x123327['getRangeAt'](0x0),_0x3fab03=_0x4ec9eb['toString'](),_0x5c9b3b=document['createElement']('pre'),_0x7e265d=document['createElement']('code');_0x7e265d['textContent']=_0x3fab03||'\x0a',_0x5c9b3b['appendChild'](_0x7e265d),_0x4ec9eb['deleteContents'](),_0x4ec9eb['insertNode'](_0x5c9b3b);const _0x2547bc=document['createElement']('p');_0x2547bc['innerHTML']='<br>',_0x5c9b3b['parentNode']['insertBefore'](_0x2547bc,_0x5c9b3b['nextSibling']);const _0x22ab0f=document['createRange']();!_0x3fab03?(_0x22ab0f['setStart'](_0x7e265d['firstChild'],0x0),_0x22ab0f['setEnd'](_0x7e265d['firstChild'],0x0)):(_0x22ab0f['selectNodeContents'](_0x7e265d),_0x22ab0f['collapse'](![])),_0x123327['removeAllRanges'](),_0x123327['addRange'](_0x22ab0f);}['updatePlaceholder'](){const _0x2b924d=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');_0x2b924d?this['editor']['classList']['remove']('empty'):this['editor']['classList']['add']('empty');}['setMarkdown'](_0x306669){if(!_0x306669||!_0x306669['trim']()){this['editor']['innerHTML']='',this['updatePlaceholder']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']='':this['element']['textContent']='';return;}const _0x5e1261=this['preprocessColorSyntax'](_0x306669),_0x24b2ff=window['marked']['parse'](_0x5e1261);this['editor']['innerHTML']=_0x24b2ff,this['rewriteAttachmentImages'](),this['rewriteMentionLinks'](),this['addLinkHints'](),this['updatePlaceholder'](),this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0x306669:this['element']['textContent']=_0x306669;}['rewriteAttachmentImages'](){const _0x570038=this['editor']['querySelectorAll']('img');_0x570038['forEach'](_0x2fac5f=>{const _0x93cadf=_0x2fac5f['getAttribute']('data-attachment-name'),_0x277da2=_0x2fac5f['getAttribute']('src')||'',_0xd1ffcb=this['parseAttachmentReference'](_0x277da2)||this['parseTaskAttachmentUrl'](_0x277da2),_0x4a2014=_0x93cadf||(_0xd1ffcb?_0xd1ffcb['name']:null);if(!_0x4a2014)return;_0x2fac5f['setAttribute']('data-attachment-name',_0x4a2014);const _0x3ee82c=this['attachmentObjectUrls']['get'](_0x4a2014)||(this['options']['resolveAttachmentUrl']?this['options']['resolveAttachmentUrl'](_0x4a2014):null);_0x3ee82c&&(_0x2fac5f['src']=_0x3ee82c);});}['rewriteMentionLinks'](){const _0x1c17c0=this['editor']['querySelectorAll']('a[href^=\x22mention:\x22]');_0x1c17c0['forEach'](_0x72e0ce=>{const _0x42d172=_0x72e0ce['getAttribute']('href')||'',_0x10ac6d=_0x42d172['replace']('mention:',''),_0x237aa8=_0x72e0ce['textContent']||'',_0x10a2fc=document['createElement']('span');_0x10a2fc['className']='mention',_0x10a2fc['setAttribute']('data-mention-user-id',_0x10ac6d),_0x10a2fc['setAttribute']('contenteditable','false'),_0x10a2fc['textContent']='@'+_0x237aa8;const _0x463755=_0x72e0ce['previousSibling'];_0x463755&&_0x463755['nodeType']===Node['TEXT_NODE']&&_0x463755['textContent']['endsWith']('@')&&(_0x463755['textContent']=_0x463755['textContent']['slice'](0x0,-0x1)),_0x72e0ce['parentNode']['replaceChild'](_0x10a2fc,_0x72e0ce);});}['addLinkHints'](){if(!this['options']['editable'])return;const _0x237910=this['editor']['querySelectorAll']('a');_0x237910['forEach'](_0xff84af=>{const _0x58bb7b=_0xff84af['getAttribute']('href')||'';if(_0x58bb7b['startsWith']('mention:'))return;const _0x5e2545=_0xff84af['textContent']||_0x58bb7b,_0x4a7b89=_0x5e2545+'\x20('+(this['linkHintText']||'Ctrl+click\x20to\x20follow')+')';_0xff84af['setAttribute']('aria-label',_0x4a7b89);});}['preprocessColorSyntax'](_0x5cae8d){if(!_0x5cae8d)return _0x5cae8d;const _0x69957f=_0x1e07df=>{return String(_0x1e07df)['replace'](/\{color:(#[0-9A-Fa-f]{3,6})\}([\s\S]*?)\{\/color\}/g,(_0x27622f,_0x413076,_0x10a277)=>{const _0x320750=_0x69957f(_0x10a277);return'<span\x20style=\x22color:\x20'+_0x413076+'\x22>'+_0x320750+'</span>';});};return _0x69957f(_0x5cae8d);}['parseAttachmentReference'](_0x13a3d3){if(!_0x13a3d3||typeof _0x13a3d3!=='string')return null;if(!_0x13a3d3['startsWith'](ATTACHMENT_SCHEME)&&!_0x13a3d3['startsWith'](ATTACHMENT_SCHEME+'//'))return null;const _0x495545=_0x13a3d3['replace'](ATTACHMENT_SCHEME+'//','')['replace'](ATTACHMENT_SCHEME,'');if(!_0x495545)return null;try{return{'name':decodeURIComponent(_0x495545)};}catch{return{'name':_0x495545};}}['parseTaskAttachmentUrl'](_0x1ead11){if(!_0x1ead11||typeof _0x1ead11!=='string')return null;const _0xfd7f67=_0x1ead11['match'](/\/tasks\/[^/]+\/attachments\/([^?#]+)/);if(!_0xfd7f67)return null;const _0x2b60c9=_0xfd7f67[0x1];try{return{'name':decodeURIComponent(_0x2b60c9)};}catch{return{'name':_0x2b60c9};}}['updateAttachmentFile'](_0x32d74d,_0x376ed0){const _0x465c9f=this['attachmentObjectUrls']['get'](_0x32d74d);if(_0x465c9f)try{URL['revokeObjectURL'](_0x465c9f);}catch{}const _0x1dd676=URL['createObjectURL'](_0x376ed0);this['attachmentObjectUrls']['set'](_0x32d74d,_0x1dd676);const _0x212d03=this['editor']['querySelector']('img[data-attachment-name=\x22'+CSS['escape'](_0x32d74d)+'\x22]');return _0x212d03&&(_0x212d03['src']=_0x1dd676),_0x1dd676;}['getMarkdown'](){const _0x2d0067=this['editor']['innerHTML'];if(!_0x2d0067||_0x2d0067['trim']()===''||_0x2d0067==='<br>')return'';return this['turndownService']['turndown'](_0x2d0067)['replace'](/\u200B/g,'');}['getValue'](){return this['getMarkdown']();}['setValue'](_0x3c5a3b){this['setMarkdown'](_0x3c5a3b);}['focus'](){this['editor']['focus']();}['clear'](){this['editor']['innerHTML']='',this['updatePlaceholder']();}['setEditable'](_0x5d275f){this['editor']['contentEditable']=_0x5d275f,this['options']['editable']=_0x5d275f;}['handleMentionInput'](_0xb4520f){if(!this['options']['fetchUsers'])return;const _0xba5c9d=window['getSelection']();if(!_0xba5c9d||_0xba5c9d['rangeCount']===0x0){this['closeMentionDropdown']();return;}const _0x1a307c=_0xba5c9d['getRangeAt'](0x0),_0x11f9cd=_0x1a307c['startContainer'];if(_0x11f9cd['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0x3aba23=_0x11f9cd['textContent']||'',_0x1bbc88=_0x1a307c['startOffset'],_0x33308a=_0x3aba23['slice'](0x0,_0x1bbc88),_0x523773=_0x33308a['lastIndexOf']('@');if(_0x523773===-0x1){this['closeMentionDropdown']();return;}const _0x55f917=_0x523773>0x0?_0x33308a[_0x523773-0x1]:'\x20';if(!/\s/['test'](_0x55f917)&&_0x523773!==0x0){this['closeMentionDropdown']();return;}const _0x3bc0e5=_0x33308a['slice'](_0x523773+0x1);if(/[\s\n]/['test'](_0x3bc0e5)){this['closeMentionDropdown']();return;}this['mentionState']['active']=!![],this['mentionState']['query']=_0x3bc0e5['toLowerCase'](),this['mentionState']['startOffset']=_0x523773,this['mentionState']['startNode']=_0x11f9cd,this['showMentionDropdown']();}async['showMentionDropdown'](){if(!this['usersCache'])try{const _0xc685aa=await this['options']['fetchUsers']();this['usersCache']=_0xc685aa['users']||_0xc685aa||[];}catch(_0x2e9bf8){console['error']('Failed\x20to\x20fetch\x20users\x20for\x20@mention:',_0x2e9bf8),this['closeMentionDropdown']();return;}this['mentionState']['users']=this['usersCache'];const _0x15afea=this['mentionState']['query'];this['mentionState']['filteredUsers']=this['mentionState']['users']['filter'](_0x3554ec=>{const _0x2e0f5d=(_0x3554ec['name']||'')['toLowerCase'](),_0x17b0e4=(_0x3554ec['username']||'')['toLowerCase']();return _0x2e0f5d['includes'](_0x15afea)||_0x17b0e4['includes'](_0x15afea);})['slice'](0x0,0x8),this['mentionState']['selectedIndex']=0x0;if(this['mentionState']['filteredUsers']['length']===0x0){this['closeMentionDropdown']();return;}this['renderMentionDropdown'](),this['positionMentionDropdown']();}['renderMentionDropdown'](){!this['mentionDropdown']&&(this['mentionDropdown']=document['createElement']('div'),this['mentionDropdown']['className']='mention-dropdown',document['body']['appendChild'](this['mentionDropdown']),this['mentionClickOutsideHandler']=_0x85bc10=>{!this['mentionDropdown']['contains'](_0x85bc10['target'])&&!this['editor']['contains'](_0x85bc10['target'])&&this['closeMentionDropdown']();},document['addEventListener']('click',this['mentionClickOutsideHandler']),this['mentionScrollHandler']=()=>{this['mentionState']['active']&&this['positionMentionDropdown']();},window['addEventListener']('scroll',this['mentionScrollHandler'],!![]));const _0x3f36be=this['mentionState']['filteredUsers'];this['mentionDropdown']['innerHTML']=_0x3f36be['map']((_0x22c62a,_0xc84950)=>{const _0xbc0090=_0xc84950===this['mentionState']['selectedIndex'],_0xe3d85e=_0x22c62a['name']||_0x22c62a['username']||'Unknown',_0x39c2e7=_0x22c62a['username']||'',_0x449b62=this['getInitials'](_0xe3d85e),_0x5a91fe=this['getAvatarColorIndex'](_0x39c2e7||_0x22c62a['id']||_0xe3d85e);return'\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22mention-option\x20'+(_0xbc0090?'mention-option-selected':'')+'\x22\x20data-index=\x22'+_0xc84950+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-avatar\x20avatar-color-'+_0x5a91fe+'\x22>'+this['escapeHtmlForMention'](_0x449b62)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-option-name\x22>'+this['escapeHtmlForMention'](_0xe3d85e)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x39c2e7?'<span\x20class=\x22mention-option-username\x22>@'+this['escapeHtmlForMention'](_0x39c2e7)+'</span>':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';})['join'](''),this['mentionDropdown']['querySelectorAll']('.mention-option')['forEach'](_0x2db676=>{_0x2db676['addEventListener']('mousedown',_0x4cb96b=>{_0x4cb96b['preventDefault']();const _0x5958db=parseInt(_0x2db676['dataset']['index'],0xa);this['insertMention'](this['mentionState']['filteredUsers'][_0x5958db]);}),_0x2db676['addEventListener']('mouseenter',()=>{const _0x588fbf=parseInt(_0x2db676['dataset']['index'],0xa);this['mentionState']['selectedIndex']=_0x588fbf,this['updateMentionSelection']();});}),this['mentionDropdown']['style']['display']='block';}['positionMentionDropdown'](){if(!this['mentionDropdown'])return;const _0x1af20=window['getSelection']();if(!_0x1af20||_0x1af20['rangeCount']===0x0)return;const _0x3d04b3=_0x1af20['getRangeAt'](0x0),_0x48c7dd=_0x3d04b3['getBoundingClientRect'](),_0x4a10de=0x104,_0x52a04c=Math['min'](0xf0,this['mentionState']['filteredUsers']['length']*0x24+0x8),_0x4037f6=window['innerWidth'],_0xdcf36=window['innerHeight'],_0x40c67b=_0xdcf36-_0x48c7dd['bottom'],_0x5a4ac3=_0x48c7dd['top'],_0x47cf09=_0x40c67b<_0x52a04c+0xa&&_0x5a4ac3>_0x40c67b;let _0x2f5c9a,_0x386b19;_0x47cf09?_0x2f5c9a=_0x48c7dd['top']+window['scrollY']-_0x52a04c-0x4:_0x2f5c9a=_0x48c7dd['bottom']+window['scrollY']+0x4,_0x386b19=_0x48c7dd['left']+window['scrollX'],_0x386b19+_0x4a10de>_0x4037f6-0xa&&(_0x386b19=_0x4037f6-_0x4a10de-0xa),_0x386b19<0xa&&(_0x386b19=0xa),this['mentionDropdown']['style']['position']='absolute',this['mentionDropdown']['style']['top']=_0x2f5c9a+'px',this['mentionDropdown']['style']['left']=_0x386b19+'px';}['mentionNavigate'](_0x50ae1a){const _0x8421ff=this['mentionState']['filteredUsers']['length'];if(_0x8421ff===0x0)return;this['mentionState']['selectedIndex']=(this['mentionState']['selectedIndex']+_0x50ae1a+_0x8421ff)%_0x8421ff,this['updateMentionSelection']();}['updateMentionSelection'](){if(!this['mentionDropdown'])return;const _0x39a6fc=this['mentionDropdown']['querySelectorAll']('.mention-option');_0x39a6fc['forEach']((_0x1f04ca,_0x54d78f)=>{_0x54d78f===this['mentionState']['selectedIndex']?(_0x1f04ca['classList']['add']('mention-option-selected'),_0x1f04ca['scrollIntoView']({'block':'nearest'})):_0x1f04ca['classList']['remove']('mention-option-selected');});}['insertMention'](_0x405b0a){if(!_0x405b0a)return;const _0x3f604c=window['getSelection']();if(!_0x3f604c||_0x3f604c['rangeCount']===0x0)return;const _0x34439b=_0x3f604c['getRangeAt'](0x0),_0x386862=this['mentionState']['startNode'];if(!_0x386862||_0x386862['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0x1e55c8=_0x386862['textContent']||'',_0x3e171b=this['mentionState']['startOffset'],_0x208414=_0x34439b['startOffset'],_0xfd9b61=_0x1e55c8['slice'](0x0,_0x3e171b),_0x5e8519=_0x1e55c8['slice'](_0x208414),_0x179108=document['createElement']('span');_0x179108['className']='mention',_0x179108['setAttribute']('data-mention-user-id',_0x405b0a['id']),_0x179108['setAttribute']('contenteditable','false'),_0x179108['textContent']='@'+(_0x405b0a['name']||_0x405b0a['username']);const _0x2c2e27=document['createTextNode'](_0xfd9b61),_0x469f2b=document['createTextNode']('\x20'+_0x5e8519),_0x1900bc=_0x386862['parentNode'];_0x1900bc['insertBefore'](_0x2c2e27,_0x386862),_0x1900bc['insertBefore'](_0x179108,_0x386862),_0x1900bc['insertBefore'](_0x469f2b,_0x386862),_0x1900bc['removeChild'](_0x386862);const _0x25dc54=document['createRange']();_0x25dc54['setStart'](_0x469f2b,0x1),_0x25dc54['collapse'](!![]),_0x3f604c['removeAllRanges'](),_0x3f604c['addRange'](_0x25dc54),this['closeMentionDropdown'](),this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));}['closeMentionDropdown'](){this['mentionState']['active']=![],this['mentionState']['query']='',this['mentionState']['filteredUsers']=[],this['mentionState']['selectedIndex']=0x0,this['mentionDropdown']&&(this['mentionDropdown']['style']['display']='none');}['escapeHtmlForMention'](_0x5a465a){const _0xa51a72=document['createElement']('div');return _0xa51a72['textContent']=_0x5a465a,_0xa51a72['innerHTML'];}['getInitials'](_0x16a655){if(!_0x16a655)return'?';const _0x352264=_0x16a655['trim']()['split'](/\s+/);if(_0x352264['length']>=0x2)return(_0x352264[0x0][0x0]+_0x352264[_0x352264['length']-0x1][0x0])['toUpperCase']();return _0x16a655['substring'](0x0,0x2)['toUpperCase']();}['getAvatarColorIndex'](_0x8d8205){if(!_0x8d8205)return 0x6;let _0x319e05=0x0;for(let _0x3bc116=0x0;_0x3bc116<_0x8d8205['length'];_0x3bc116++){_0x319e05=_0x8d8205['charCodeAt'](_0x3bc116)+((_0x319e05<<0x5)-_0x319e05);}return Math['abs'](_0x319e05)%0xa;}['destroy'](){this['selectionChangeHandler']&&document['removeEventListener']('selectionchange',this['selectionChangeHandler']);this['linkClickHandler']&&this['editor']['removeEventListener']('click',this['linkClickHandler']);this['linkMouseEnterHandler']&&this['editor']['removeEventListener']('mouseover',this['linkMouseEnterHandler']);this['linkMouseLeaveHandler']&&this['editor']['removeEventListener']('mouseout',this['linkMouseLeaveHandler']);this['linkTooltipTimeout']&&clearTimeout(this['linkTooltipTimeout']);this['linkTooltip']&&(this['linkTooltip']['remove'](),this['linkTooltip']=null);this['linkDialog']&&(this['linkDialog']['remove'](),this['linkDialog']=null,this['linkDialogContext']=null,this['linkDialogElements']=null);this['mentionDropdown']&&(this['mentionDropdown']['remove'](),this['mentionDropdown']=null);this['mentionClickOutsideHandler']&&document['removeEventListener']('click',this['mentionClickOutsideHandler']);this['mentionScrollHandler']&&window['removeEventListener']('scroll',this['mentionScrollHandler'],!![]);for(const _0x4fc158 of this['attachmentObjectUrls']['values']()){try{URL['revokeObjectURL'](_0x4fc158);}catch{}}this['attachmentObjectUrls']['clear'](),this['container']?this['container']['remove']():this['editor']['remove'](),this['element']['style']['display']='';}}typeof window!=='undefined'&&(window['MarkdownEditor']=MarkdownEditor);
@@ -1 +1 @@
1
- let monacoLoadPromise=null;async function ensureMonacoLoaded(){if(typeof monaco!=='undefined')return;if(monacoLoadPromise)return monacoLoadPromise;const _0x15e585=document['querySelector']('script[src*=\x22monaco-editor\x22][src*=\x22loader.min.js\x22]');if(_0x15e585)return monacoLoadPromise=new Promise((_0x4bc296,_0x33b887)=>{const _0x1ce845=setInterval(()=>{typeof monaco!=='undefined'&&(clearInterval(_0x1ce845),_0x4bc296());},0x32);setTimeout(()=>{clearInterval(_0x1ce845),_0x33b887(new Error('Monaco\x20loading\x20timeout'));},0x2710);}),monacoLoadPromise;return monacoLoadPromise=new Promise((_0x5d5267,_0x30fd7c)=>{const _0x288d0a=document['createElement']('script');_0x288d0a['src']='https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js',_0x288d0a['onload']=()=>{require['config']({'paths':{'vs':'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs'}}),require(['vs/editor/editor.main'],()=>{_0x5d5267();});},_0x288d0a['onerror']=()=>_0x30fd7c(new Error('Failed\x20to\x20load\x20Monaco\x20Editor')),document['head']['appendChild'](_0x288d0a);}),monacoLoadPromise;}function getMonacoTheme(){const _0x3b60a9=document['documentElement']['getAttribute']('data-theme')==='dark';return _0x3b60a9?'vs-dark':'vs';}function isMarkdownFile(_0xd8a1d1){if(!_0xd8a1d1)return![];const _0x49cc36=_0xd8a1d1['split']('.')['pop']()['toLowerCase']();return _0x49cc36==='md'||_0x49cc36==='markdown';}function createMarkdownFileEditor(_0x320bc3){const {container:_0x3b8f39,content:content='',readOnly:readOnly=![],height:height='400px',onChange:onChange=null,placeholder:placeholder='Enter\x20markdown\x20content...',enableModeToggle:enableModeToggle=!![],initialMode:initialMode='visual'}=_0x320bc3;_0x3b8f39['innerHTML']='';let _0x59a080='visual',_0x210507=content,_0x1c8929=null,_0x4d2f01=null,_0x218b7f=![],_0xabac5b=initialMode==='source';const _0x5455ec=document['createElement']('div');_0x5455ec['className']='markdown-file-editor-wrapper',_0x5455ec['style']['height']=height,_0x5455ec['style']['display']='flex',_0x5455ec['style']['flexDirection']='column',_0x5455ec['style']['border']='1px\x20solid\x20var(--color-border)',_0x5455ec['style']['borderRadius']='var(--radius-small)',_0x5455ec['style']['overflow']='hidden';let _0x5652f0=null,_0x16a8c4=null,_0x4dea36=null;!readOnly&&enableModeToggle&&(_0x5652f0=document['createElement']('div'),_0x5652f0['className']='markdown-editor-mode-toggle',_0x5652f0['style']['display']='flex',_0x5652f0['style']['alignItems']='center',_0x5652f0['style']['padding']='4px\x208px',_0x5652f0['style']['borderBottom']='1px\x20solid\x20var(--color-border)',_0x5652f0['style']['background']='var(--color-surface-secondary)',_0x5652f0['style']['gap']='4px',_0x5652f0['style']['flexShrink']='0',_0x16a8c4=document['createElement']('button'),_0x16a8c4['type']='button',_0x16a8c4['className']='markdown-mode-btn',_0x16a8c4['innerHTML']='<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><path\x20d=\x22M1\x2012s4-8\x2011-8\x2011\x208\x2011\x208-4\x208-11\x208-11-8-11-8z\x22></path><circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x223\x22></circle></svg>\x20Visual',_0x16a8c4['title']='Visual\x20editing\x20mode\x20(WYSIWYG)',_0x4dea36=document['createElement']('button'),_0x4dea36['type']='button',_0x4dea36['className']='markdown-mode-btn',_0x4dea36['innerHTML']='<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><polyline\x20points=\x2216\x2018\x2022\x2012\x2016\x206\x22></polyline><polyline\x20points=\x228\x206\x202\x2012\x208\x2018\x22></polyline></svg>\x20Source',_0x4dea36['title']='Source\x20editing\x20mode\x20(Monaco\x20Editor)',_0x5652f0['appendChild'](_0x16a8c4),_0x5652f0['appendChild'](_0x4dea36),_0x5455ec['appendChild'](_0x5652f0));const _0x386ddd=document['createElement']('div');_0x386ddd['className']='markdown-visual-container',_0x386ddd['style']['flex']='1',_0x386ddd['style']['display']='flex',_0x386ddd['style']['flexDirection']='column',_0x386ddd['style']['overflow']='hidden',_0x386ddd['style']['minHeight']='0';const _0x4211ea=document['createElement']('textarea');_0x4211ea['style']['display']='none',_0x4211ea['value']=content,_0x386ddd['appendChild'](_0x4211ea),_0x5455ec['appendChild'](_0x386ddd);const _0xe440f2=document['createElement']('div');_0xe440f2['className']='markdown-source-container',_0xe440f2['style']['flex']='1',_0xe440f2['style']['display']='none',_0xe440f2['style']['overflow']='hidden',_0xe440f2['style']['minHeight']='0',_0x5455ec['appendChild'](_0xe440f2),_0x3b8f39['appendChild'](_0x5455ec),_0x1c8929=new window['MarkdownEditor'](_0x4211ea,{'placeholder':placeholder,'editable':!readOnly,'minHeight':'100%','toolbar':!readOnly,'onChange':_0x17f0db=>{_0x210507=_0x17f0db,onChange&&onChange(_0x17f0db);}});_0x1c8929['container']&&(_0x1c8929['container']['style']['flex']='1',_0x1c8929['container']['style']['display']='flex',_0x1c8929['container']['style']['flexDirection']='column',_0x1c8929['container']['style']['overflow']='hidden');_0x1c8929['editor']&&(_0x1c8929['editor']['style']['flex']='1',_0x1c8929['editor']['style']['overflow']='auto',_0x1c8929['editor']['style']['minHeight']='0',_0x1c8929['editor']['style']['border']='none',_0x1c8929['editor']['style']['borderRadius']='0',_0x1c8929['editor']['style']['padding']='16px',_0x1c8929['editor']['style']['fontSize']='14px',_0x1c8929['editor']['style']['lineHeight']='1.6');_0x1c8929['toolbar']&&(_0x1c8929['toolbar']['style']['borderRadius']='0',_0x1c8929['toolbar']['style']['flexShrink']='0');content&&_0x1c8929['setMarkdown'](content);function _0x3a1fe1(){if(!_0x16a8c4||!_0x4dea36)return;_0x59a080==='visual'?(_0x16a8c4['classList']['add']('active'),_0x4dea36['classList']['remove']('active')):(_0x16a8c4['classList']['remove']('active'),_0x4dea36['classList']['add']('active'));}async function _0x2c2df2(){if(_0x218b7f)return;try{await ensureMonacoLoaded(),_0x4d2f01=monaco['editor']['create'](_0xe440f2,{'value':_0x210507,'language':'markdown','theme':getMonacoTheme(),'readOnly':readOnly,'minimap':{'enabled':![]},'automaticLayout':!![],'wordWrap':'on','lineNumbers':'on','scrollBeyondLastLine':![],'fontSize':0xe,'lineHeight':0x16,'padding':{'top':0x10,'bottom':0x10},'renderWhitespace':'selection','tabSize':0x2,'insertSpaces':!![]}),_0x4d2f01['onDidChangeModelContent'](()=>{_0x210507=_0x4d2f01['getValue'](),onChange&&onChange(_0x210507);}),_0x218b7f=!![];}catch(_0x4a3647){console['error']('Failed\x20to\x20initialize\x20Monaco\x20editor:',_0x4a3647);throw _0x4a3647;}}async function _0x2e44ab(_0x3394b8){if(_0x3394b8===_0x59a080)return;if(_0x59a080==='visual')_0x210507=_0x1c8929['getMarkdown']();else _0x4d2f01&&(_0x210507=_0x4d2f01['getValue']());_0x59a080=_0x3394b8;if(_0x3394b8==='visual')_0xe440f2['style']['display']='none',_0x386ddd['style']['display']='flex',_0x1c8929['setMarkdown'](_0x210507),_0x1c8929['focus']();else{_0x386ddd['style']['display']='none',_0xe440f2['style']['display']='block';if(!_0x218b7f)try{await _0x2c2df2();}catch(_0x30238f){console['error']('Failed\x20to\x20switch\x20to\x20source\x20mode:',_0x30238f),_0x59a080='visual',_0xe440f2['style']['display']='none',_0x386ddd['style']['display']='flex',_0x3a1fe1();return;}_0x4d2f01&&(_0x4d2f01['setValue'](_0x210507),_0x4d2f01['focus'](),_0x4d2f01['layout']());}_0x3a1fe1();}_0x16a8c4&&_0x4dea36&&(_0x16a8c4['addEventListener']('click',_0xcd9f8f=>{_0xcd9f8f['preventDefault'](),_0x2e44ab('visual');}),_0x4dea36['addEventListener']('click',_0x1f49a6=>{_0x1f49a6['preventDefault'](),_0x2e44ab('source');}),_0x3a1fe1());_0xabac5b&&setTimeout(()=>_0x2e44ab('source'),0x0);const _0x380562={'getValue':()=>{if(_0x59a080==='visual')return _0x1c8929['getMarkdown']();else{if(_0x4d2f01)return _0x4d2f01['getValue']();}return _0x210507;},'setValue':_0x38e547=>{_0x210507=_0x38e547||'';if(_0x59a080==='visual')_0x1c8929['setMarkdown'](_0x210507);else _0x4d2f01&&_0x4d2f01['setValue'](_0x210507);},'focus':()=>{if(_0x59a080==='visual')_0x1c8929['focus']();else _0x4d2f01&&_0x4d2f01['focus']();},'setEditable':_0x55f83d=>{_0x1c8929['setEditable'](_0x55f83d),_0x4d2f01&&_0x4d2f01['updateOptions']({'readOnly':!_0x55f83d});},'destroy':()=>{_0x1c8929['destroy'](),_0x4d2f01&&(_0x4d2f01['dispose'](),_0x4d2f01=null),_0x3b8f39['innerHTML']='';},'getMode':()=>_0x59a080,'setMode':_0x5ddc21=>_0x2e44ab(_0x5ddc21),'toggleMode':()=>_0x2e44ab(_0x59a080==='visual'?'source':'visual'),'_visualEditor':_0x1c8929,'_getSourceEditor':()=>_0x4d2f01,'_container':_0x3b8f39,'_isMarkdownFileEditor':!![],'_hasModeToggle':enableModeToggle};return _0x380562;}const markdownFileEditors=new Map();function getOrCreateMarkdownFileEditor(_0x14c6d6,_0x3250dd,_0x3c24bf=![],_0x2199cf='400px',_0x5c9203=null,_0xb0777={}){const _0x41b57a=document['getElementById'](_0x14c6d6);if(!_0x41b57a)return console['error']('Container\x20not\x20found:\x20'+_0x14c6d6),null;const _0x5a323b=markdownFileEditors['get'](_0x14c6d6);if(_0x5a323b){try{_0x5a323b['destroy']();}catch(_0x177e22){console['warn']('Failed\x20to\x20destroy\x20existing\x20markdown\x20editor:',_0x177e22);}markdownFileEditors['delete'](_0x14c6d6);}const _0x3f2b0a=createMarkdownFileEditor({'container':_0x41b57a,'content':_0x3250dd,'readOnly':_0x3c24bf,'height':_0x2199cf,'onChange':_0x5c9203,..._0xb0777});return markdownFileEditors['set'](_0x14c6d6,_0x3f2b0a),_0x3f2b0a;}function getMarkdownFileEditorValue(_0x4724b5){const _0x4a64a9=markdownFileEditors['get'](_0x4724b5);if(!_0x4a64a9)return null;return _0x4a64a9['getValue']();}function setMarkdownFileEditorValue(_0x4ce7e0,_0x153074){const _0x4a6f9d=markdownFileEditors['get'](_0x4ce7e0);_0x4a6f9d&&_0x4a6f9d['setValue'](_0x153074||'');}function disposeMarkdownFileEditor(_0x4ab9ed){const _0x212440=markdownFileEditors['get'](_0x4ab9ed);if(_0x212440){try{_0x212440['destroy']();}catch(_0x1e74e5){console['warn']('Failed\x20to\x20dispose\x20markdown\x20editor:',_0x1e74e5);}markdownFileEditors['delete'](_0x4ab9ed);}}function hasMarkdownFileEditor(_0x50a144){return markdownFileEditors['has'](_0x50a144);}function getMarkdownFileEditorMode(_0x4ab262){const _0x3b2c5d=markdownFileEditors['get'](_0x4ab262);if(!_0x3b2c5d||!_0x3b2c5d['getMode'])return null;return _0x3b2c5d['getMode']();}function setMarkdownFileEditorMode(_0x13b600,_0x29cf1b){const _0x2a7d98=markdownFileEditors['get'](_0x13b600);_0x2a7d98&&_0x2a7d98['setMode']&&_0x2a7d98['setMode'](_0x29cf1b);}typeof window!=='undefined'&&(window['MarkdownFileEditor']={'isMarkdownFile':isMarkdownFile,'create':createMarkdownFileEditor,'getOrCreate':getOrCreateMarkdownFileEditor,'getValue':getMarkdownFileEditorValue,'setValue':setMarkdownFileEditorValue,'dispose':disposeMarkdownFileEditor,'has':hasMarkdownFileEditor,'getMode':getMarkdownFileEditorMode,'setMode':setMarkdownFileEditorMode,'editors':markdownFileEditors,'ensureMonacoLoaded':ensureMonacoLoaded});
1
+ let monacoLoadPromise=null;async function ensureMonacoLoaded(){if(typeof monaco!=='undefined')return;if(monacoLoadPromise)return monacoLoadPromise;const _0x2346e0=document['querySelector']('script[src*=\x22monaco-editor\x22][src*=\x22loader.min.js\x22]');if(_0x2346e0)return monacoLoadPromise=new Promise((_0x27cad4,_0x21c3c9)=>{const _0x14c08b=setInterval(()=>{typeof monaco!=='undefined'&&(clearInterval(_0x14c08b),_0x27cad4());},0x32);setTimeout(()=>{clearInterval(_0x14c08b),_0x21c3c9(new Error('Monaco\x20loading\x20timeout'));},0x2710);}),monacoLoadPromise;return monacoLoadPromise=new Promise((_0x579bea,_0x290eef)=>{const _0x4b3e57=document['createElement']('script');_0x4b3e57['src']='https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js',_0x4b3e57['onload']=()=>{require['config']({'paths':{'vs':'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs'}}),require(['vs/editor/editor.main'],()=>{_0x579bea();});},_0x4b3e57['onerror']=()=>_0x290eef(new Error('Failed\x20to\x20load\x20Monaco\x20Editor')),document['head']['appendChild'](_0x4b3e57);}),monacoLoadPromise;}function getMonacoTheme(){const _0x4df5a1=document['documentElement']['getAttribute']('data-theme')==='dark';return _0x4df5a1?'vs-dark':'vs';}function isMarkdownFile(_0xfed996){if(!_0xfed996)return![];const _0x332bb1=_0xfed996['split']('.')['pop']()['toLowerCase']();return _0x332bb1==='md'||_0x332bb1==='markdown';}function createMarkdownFileEditor(_0x4aaebd){const {container:_0x1de795,content:content='',readOnly:readOnly=![],height:height='400px',onChange:onChange=null,placeholder:placeholder='Enter\x20markdown\x20content...',enableModeToggle:enableModeToggle=!![],initialMode:initialMode='visual'}=_0x4aaebd;_0x1de795['innerHTML']='';let _0x342496='visual',_0x57f91f=content,_0x567a41=null,_0x3d3bd2=null,_0x5d448a=![],_0x194ca2=initialMode==='source';const _0x2b8c7e=document['createElement']('div');_0x2b8c7e['className']='markdown-file-editor-wrapper',_0x2b8c7e['style']['height']=height,_0x2b8c7e['style']['display']='flex',_0x2b8c7e['style']['flexDirection']='column',_0x2b8c7e['style']['border']='1px\x20solid\x20var(--color-border)',_0x2b8c7e['style']['borderRadius']='var(--radius-small)',_0x2b8c7e['style']['overflow']='hidden';let _0x1a1fe2=null,_0x1dbcce=null,_0x3e4835=null;!readOnly&&enableModeToggle&&(_0x1a1fe2=document['createElement']('div'),_0x1a1fe2['className']='markdown-editor-mode-toggle',_0x1a1fe2['style']['display']='flex',_0x1a1fe2['style']['alignItems']='center',_0x1a1fe2['style']['padding']='4px\x208px',_0x1a1fe2['style']['borderBottom']='1px\x20solid\x20var(--color-border)',_0x1a1fe2['style']['background']='var(--color-surface-secondary)',_0x1a1fe2['style']['gap']='4px',_0x1a1fe2['style']['flexShrink']='0',_0x1dbcce=document['createElement']('button'),_0x1dbcce['type']='button',_0x1dbcce['className']='markdown-mode-btn',_0x1dbcce['innerHTML']='<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><path\x20d=\x22M1\x2012s4-8\x2011-8\x2011\x208\x2011\x208-4\x208-11\x208-11-8-11-8z\x22></path><circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x223\x22></circle></svg>\x20Visual',_0x1dbcce['title']='Visual\x20editing\x20mode\x20(WYSIWYG)',_0x3e4835=document['createElement']('button'),_0x3e4835['type']='button',_0x3e4835['className']='markdown-mode-btn',_0x3e4835['innerHTML']='<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22><polyline\x20points=\x2216\x2018\x2022\x2012\x2016\x206\x22></polyline><polyline\x20points=\x228\x206\x202\x2012\x208\x2018\x22></polyline></svg>\x20Source',_0x3e4835['title']='Source\x20editing\x20mode\x20(Monaco\x20Editor)',_0x1a1fe2['appendChild'](_0x1dbcce),_0x1a1fe2['appendChild'](_0x3e4835),_0x2b8c7e['appendChild'](_0x1a1fe2));const _0x4ac100=document['createElement']('div');_0x4ac100['className']='markdown-visual-container',_0x4ac100['style']['flex']='1',_0x4ac100['style']['display']='flex',_0x4ac100['style']['flexDirection']='column',_0x4ac100['style']['overflow']='hidden',_0x4ac100['style']['minHeight']='0';const _0x3952a8=document['createElement']('textarea');_0x3952a8['style']['display']='none',_0x3952a8['value']=content,_0x4ac100['appendChild'](_0x3952a8),_0x2b8c7e['appendChild'](_0x4ac100);const _0x20fce9=document['createElement']('div');_0x20fce9['className']='markdown-source-container',_0x20fce9['style']['flex']='1',_0x20fce9['style']['display']='none',_0x20fce9['style']['overflow']='hidden',_0x20fce9['style']['minHeight']='0',_0x2b8c7e['appendChild'](_0x20fce9),_0x1de795['appendChild'](_0x2b8c7e),_0x567a41=new window['MarkdownEditor'](_0x3952a8,{'placeholder':placeholder,'editable':!readOnly,'minHeight':'100%','toolbar':!readOnly,'onChange':_0x2dfdb7=>{_0x57f91f=_0x2dfdb7,onChange&&onChange(_0x2dfdb7);}});_0x567a41['container']&&(_0x567a41['container']['style']['flex']='1',_0x567a41['container']['style']['display']='flex',_0x567a41['container']['style']['flexDirection']='column',_0x567a41['container']['style']['overflow']='hidden');_0x567a41['editor']&&(_0x567a41['editor']['style']['flex']='1',_0x567a41['editor']['style']['overflow']='auto',_0x567a41['editor']['style']['minHeight']='0',_0x567a41['editor']['style']['border']='none',_0x567a41['editor']['style']['borderRadius']='0',_0x567a41['editor']['style']['padding']='16px',_0x567a41['editor']['style']['fontSize']='14px',_0x567a41['editor']['style']['lineHeight']='1.6');_0x567a41['toolbar']&&(_0x567a41['toolbar']['style']['borderRadius']='0',_0x567a41['toolbar']['style']['flexShrink']='0');content&&_0x567a41['setMarkdown'](content);function _0x11ae34(){if(!_0x1dbcce||!_0x3e4835)return;_0x342496==='visual'?(_0x1dbcce['classList']['add']('active'),_0x3e4835['classList']['remove']('active')):(_0x1dbcce['classList']['remove']('active'),_0x3e4835['classList']['add']('active'));}async function _0x10f029(){if(_0x5d448a)return;try{await ensureMonacoLoaded(),_0x3d3bd2=monaco['editor']['create'](_0x20fce9,{'value':_0x57f91f,'language':'markdown','theme':getMonacoTheme(),'readOnly':readOnly,'minimap':{'enabled':![]},'automaticLayout':!![],'wordWrap':'on','lineNumbers':'on','scrollBeyondLastLine':![],'fontSize':0xe,'lineHeight':0x16,'padding':{'top':0x10,'bottom':0x10},'renderWhitespace':'selection','tabSize':0x2,'insertSpaces':!![]}),_0x3d3bd2['onDidChangeModelContent'](()=>{_0x57f91f=_0x3d3bd2['getValue'](),onChange&&onChange(_0x57f91f);}),_0x5d448a=!![];}catch(_0x44020b){console['error']('Failed\x20to\x20initialize\x20Monaco\x20editor:',_0x44020b);throw _0x44020b;}}async function _0x267a71(_0x3b4554){if(_0x3b4554===_0x342496)return;if(_0x342496==='visual')_0x57f91f=_0x567a41['getMarkdown']();else _0x3d3bd2&&(_0x57f91f=_0x3d3bd2['getValue']());_0x342496=_0x3b4554;if(_0x3b4554==='visual')_0x20fce9['style']['display']='none',_0x4ac100['style']['display']='flex',_0x567a41['setMarkdown'](_0x57f91f),_0x567a41['focus']();else{_0x4ac100['style']['display']='none',_0x20fce9['style']['display']='block';if(!_0x5d448a)try{await _0x10f029();}catch(_0x1daa58){console['error']('Failed\x20to\x20switch\x20to\x20source\x20mode:',_0x1daa58),_0x342496='visual',_0x20fce9['style']['display']='none',_0x4ac100['style']['display']='flex',_0x11ae34();return;}_0x3d3bd2&&(_0x3d3bd2['setValue'](_0x57f91f),_0x3d3bd2['focus'](),_0x3d3bd2['layout']());}_0x11ae34();}_0x1dbcce&&_0x3e4835&&(_0x1dbcce['addEventListener']('click',_0x54ee11=>{_0x54ee11['preventDefault'](),_0x267a71('visual');}),_0x3e4835['addEventListener']('click',_0x10de32=>{_0x10de32['preventDefault'](),_0x267a71('source');}),_0x11ae34());_0x194ca2&&setTimeout(()=>_0x267a71('source'),0x0);const _0xb41c95={'getValue':()=>{if(_0x342496==='visual')return _0x567a41['getMarkdown']();else{if(_0x3d3bd2)return _0x3d3bd2['getValue']();}return _0x57f91f;},'setValue':_0x5f2cca=>{_0x57f91f=_0x5f2cca||'';if(_0x342496==='visual')_0x567a41['setMarkdown'](_0x57f91f);else _0x3d3bd2&&_0x3d3bd2['setValue'](_0x57f91f);},'focus':()=>{if(_0x342496==='visual')_0x567a41['focus']();else _0x3d3bd2&&_0x3d3bd2['focus']();},'setEditable':_0x1eaf66=>{_0x567a41['setEditable'](_0x1eaf66),_0x3d3bd2&&_0x3d3bd2['updateOptions']({'readOnly':!_0x1eaf66});},'destroy':()=>{_0x567a41['destroy'](),_0x3d3bd2&&(_0x3d3bd2['dispose'](),_0x3d3bd2=null),_0x1de795['innerHTML']='';},'getMode':()=>_0x342496,'setMode':_0xf5ad81=>_0x267a71(_0xf5ad81),'toggleMode':()=>_0x267a71(_0x342496==='visual'?'source':'visual'),'_visualEditor':_0x567a41,'_getSourceEditor':()=>_0x3d3bd2,'_container':_0x1de795,'_isMarkdownFileEditor':!![],'_hasModeToggle':enableModeToggle};return _0xb41c95;}const markdownFileEditors=new Map();function getOrCreateMarkdownFileEditor(_0x14a381,_0x326433,_0x23dd4a=![],_0x110cc3='400px',_0x59d600=null,_0x45b070={}){const _0x58feca=document['getElementById'](_0x14a381);if(!_0x58feca)return console['error']('Container\x20not\x20found:\x20'+_0x14a381),null;const _0x1061b7=markdownFileEditors['get'](_0x14a381);if(_0x1061b7){try{_0x1061b7['destroy']();}catch(_0x523f10){console['warn']('Failed\x20to\x20destroy\x20existing\x20markdown\x20editor:',_0x523f10);}markdownFileEditors['delete'](_0x14a381);}const _0xa0b9e6=createMarkdownFileEditor({'container':_0x58feca,'content':_0x326433,'readOnly':_0x23dd4a,'height':_0x110cc3,'onChange':_0x59d600,..._0x45b070});return markdownFileEditors['set'](_0x14a381,_0xa0b9e6),_0xa0b9e6;}function getMarkdownFileEditorValue(_0x120766){const _0x145ef3=markdownFileEditors['get'](_0x120766);if(!_0x145ef3)return null;return _0x145ef3['getValue']();}function setMarkdownFileEditorValue(_0x320f48,_0x1fc44f){const _0x5f2988=markdownFileEditors['get'](_0x320f48);_0x5f2988&&_0x5f2988['setValue'](_0x1fc44f||'');}function disposeMarkdownFileEditor(_0x433cd6){const _0x311bf0=markdownFileEditors['get'](_0x433cd6);if(_0x311bf0){try{_0x311bf0['destroy']();}catch(_0x975bb3){console['warn']('Failed\x20to\x20dispose\x20markdown\x20editor:',_0x975bb3);}markdownFileEditors['delete'](_0x433cd6);}}function hasMarkdownFileEditor(_0x17202f){return markdownFileEditors['has'](_0x17202f);}function getMarkdownFileEditorMode(_0x25bf45){const _0x206864=markdownFileEditors['get'](_0x25bf45);if(!_0x206864||!_0x206864['getMode'])return null;return _0x206864['getMode']();}function setMarkdownFileEditorMode(_0x3f5a77,_0xeb2d1c){const _0x4e8578=markdownFileEditors['get'](_0x3f5a77);_0x4e8578&&_0x4e8578['setMode']&&_0x4e8578['setMode'](_0xeb2d1c);}typeof window!=='undefined'&&(window['MarkdownFileEditor']={'isMarkdownFile':isMarkdownFile,'create':createMarkdownFileEditor,'getOrCreate':getOrCreateMarkdownFileEditor,'getValue':getMarkdownFileEditorValue,'setValue':setMarkdownFileEditorValue,'dispose':disposeMarkdownFileEditor,'has':hasMarkdownFileEditor,'getMode':getMarkdownFileEditorMode,'setMode':setMarkdownFileEditorMode,'editors':markdownFileEditors,'ensureMonacoLoaded':ensureMonacoLoaded});