@profoundlogic/coderflow-server 0.5.5 → 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 _0x2df92e=await fetch('/auth/oidc/config');if(_0x2df92e['ok'])return await _0x2df92e['json']();}catch(_0xb3e125){console['error']('Failed\x20to\x20load\x20OIDC\x20configuration:',_0xb3e125);}return{'enabled':![]};}function initializeSsoUi(_0xca7978){const _0x2fe10f=document['getElementById']('sso-section'),_0x3a84a0=document['getElementById']('sso-divider'),_0x51a27f=document['getElementById']('sso-button-text'),_0x5bcfaa=document['getElementById']('sso-button'),_0x63f57b=document['querySelector']('.local-auth-section');_0xca7978['enabled']&&(_0x2fe10f['classList']['add']('visible'),_0x51a27f['textContent']=_0xca7978['display_name']||'Sign\x20in\x20with\x20SSO',_0x5bcfaa['addEventListener']('click',()=>{window['location']['href']='/auth/oidc/login';}),!_0xca7978['allow_local_auth']&&(_0x63f57b['classList']['add']('hidden'),_0x3a84a0['style']['display']='none'));}function checkOidcErrors(){const _0x322429=new URLSearchParams(window['location']['search']),_0x1d8c3a=_0x322429['get']('error'),_0x4254f8=_0x322429['get']('message');if(_0x1d8c3a){const _0x2c9e15=document['getElementById']('login-error'),_0x591c88=_0x4254f8||OIDC_ERRORS[_0x1d8c3a]||'Authentication\x20error:\x20'+_0x1d8c3a;_0x2c9e15['textContent']=_0x591c88,_0x2c9e15['classList']['add']('visible'),window['history']['replaceState']({},document['title'],window['location']['pathname']);}}async function handleLogin(_0x55cfb3){_0x55cfb3['preventDefault']();const _0x129bee=_0x55cfb3['target'],_0x44cfcf=_0x129bee['username']['value']['trim'](),_0x67c60=_0x129bee['password']['value'],_0x1466bc=_0x129bee['querySelector']('button[type=\x22submit\x22]'),_0x22cd65=document['getElementById']('login-error');_0x22cd65['classList']['remove']('visible'),_0x22cd65['textContent']='',_0x1466bc['disabled']=!![],_0x1466bc['textContent']='Signing\x20in...';try{const _0x20b281=await fetch('/auth/login',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'username':_0x44cfcf,'password':_0x67c60})}),_0x5548c0=await _0x20b281['json']();if(!_0x20b281['ok'])throw new Error(_0x5548c0['message']||'Login\x20failed');window['location']['href']='index.html';}catch(_0x45630c){_0x22cd65['textContent']=_0x45630c['message']||'An\x20error\x20occurred\x20during\x20login',_0x22cd65['classList']['add']('visible'),_0x1466bc['disabled']=![],_0x1466bc['textContent']='Sign\x20In',_0x129bee['password']['value']='',_0x129bee['password']['focus']();}}document['addEventListener']('DOMContentLoaded',async()=>{initTheme(),mountThemeToggle(),checkOidcErrors();const _0x258551=await loadOidcConfig();initializeSsoUi(_0x258551);const _0x145122=document['getElementById']('login-form');_0x145122&&_0x145122['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(_0x9f4123,_0x27ed93={}){this['element']=_0x9f4123,this['options']={'placeholder':_0x27ed93['placeholder']||'Start\x20typing...','editable':_0x27ed93['editable']!==![],'onChange':_0x27ed93['onChange']||null,'minHeight':_0x27ed93['minHeight']||'100px','toolbar':_0x27ed93['toolbar']||![],'onAddAttachments':_0x27ed93['onAddAttachments']||null,'resolveAttachmentUrl':_0x27ed93['resolveAttachmentUrl']||null,'isAttachmentNameTaken':_0x27ed93['isAttachmentNameTaken']||null,'fetchUsers':_0x27ed93['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 _0x27209a=window['TurndownService'];this['turndownService']=new _0x27209a({'headingStyle':'atx','codeBlockStyle':'fenced','emDelimiter':'_','bulletListMarker':'-'}),this['attachmentObjectUrls']=new Map(),this['registerTurndownRules'](),this['init']();}['registerTurndownRules'](){this['turndownService']['addRule']('profoundAttachmentImage',{'filter':_0x3eb554=>{return _0x3eb554&&_0x3eb554['nodeName']==='IMG'&&_0x3eb554['getAttribute']&&_0x3eb554['getAttribute']('data-attachment-name');},'replacement':(_0x5a416b,_0x51dbae)=>{const _0xf1ee15=_0x51dbae['getAttribute']('data-attachment-name')||'',_0x130ac0=_0x51dbae['getAttribute']('alt')||'',_0x49a280=_0xf1ee15['trim'](),_0x4d0894=this['escapeAltText'](_0x130ac0||_0x49a280),_0x57afbe=encodeURIComponent(_0x49a280);return'!['+_0x4d0894+']('+ATTACHMENT_SCHEME+_0x57afbe+')';}}),this['turndownService']['addRule']('profoundMention',{'filter':_0x7f4a62=>{return _0x7f4a62&&_0x7f4a62['nodeName']==='SPAN'&&_0x7f4a62['getAttribute']&&_0x7f4a62['getAttribute']('data-mention-user-id');},'replacement':(_0x16d670,_0x4acfb8)=>{const _0x15204e=_0x4acfb8['getAttribute']('data-mention-user-id')||'',_0x42d145=_0x4acfb8['textContent']||'',_0x48d504=_0x42d145['startsWith']('@')?_0x42d145['slice'](0x1):_0x42d145;return'['+_0x48d504+'](mention:'+_0x15204e+')';}}),this['turndownService']['addRule']('profoundColoredText',{'filter':_0x12019a=>{if(!_0x12019a)return![];if(_0x12019a['nodeName']==='FONT'&&_0x12019a['getAttribute']&&_0x12019a['getAttribute']('color'))return!![];if(_0x12019a['nodeName']==='SPAN'&&_0x12019a['style']&&_0x12019a['style']['color']){if(_0x12019a['getAttribute']&&_0x12019a['getAttribute']('data-mention-user-id'))return![];return!![];}return![];},'replacement':(_0x496a1e,_0x5d87b)=>{if(!_0x496a1e['trim']())return _0x496a1e;let _0x42a01c='';if(_0x5d87b['nodeName']==='FONT')_0x42a01c=_0x5d87b['getAttribute']('color')||'';else _0x5d87b['style']&&_0x5d87b['style']['color']&&(_0x42a01c=this['rgbToHex'](_0x5d87b['style']['color']));if(!_0x42a01c)return _0x496a1e;return'{color:'+_0x42a01c+'}'+_0x496a1e+'{/color}';}});}['rgbToHex'](_0x5607da){if(!_0x5607da)return'';if(_0x5607da['startsWith']('#'))return _0x5607da;const _0x56cf7d=_0x5607da['match'](/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(!_0x56cf7d)return _0x5607da;const _0x11136e=parseInt(_0x56cf7d[0x1],0xa),_0x578264=parseInt(_0x56cf7d[0x2],0xa),_0x2ca26d=parseInt(_0x56cf7d[0x3],0xa);return'#'+[_0x11136e,_0x578264,_0x2ca26d]['map'](_0x3b735d=>_0x3b735d['toString'](0x10)['padStart'](0x2,'0'))['join']('')['toUpperCase']();}['escapeAltText'](_0x12d6ca){return String(_0x12d6ca||'')['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 _0x5a1524=this['element']['textContent']||this['element']['value']||'';_0x5a1524['trim']()&&this['setMarkdown'](_0x5a1524);}['createToolbar'](){this['toolbar']=document['createElement']('div'),this['toolbar']['className']='markdown-editor-toolbar',this['toolbarButtons']={};const _0x2e55cd=[{'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'}];_0x2e55cd['forEach'](_0x431469=>{if(_0x431469['separator']){const _0x4e7983=document['createElement']('div');_0x4e7983['className']='markdown-toolbar-separator',_0x4e7983['style']['width']='1px',_0x4e7983['style']['height']='16px',_0x4e7983['style']['background']='var(--color-border)',_0x4e7983['style']['margin']='0\x206px',_0x4e7983['style']['alignSelf']='center',this['toolbar']['appendChild'](_0x4e7983);}else{if(_0x431469['isDropdown']){const _0x2179e5=document['createElement']('div');_0x2179e5['className']='markdown-toolbar-dropdown',_0x2179e5['style']['position']='relative';const _0x305cb9=document['createElement']('button');_0x305cb9['type']='button',_0x305cb9['className']='markdown-editor-toolbar-btn\x20markdown-toolbar-dropdown-btn',_0x305cb9['tabIndex']=-0x1,_0x305cb9['innerHTML']=_0x431469['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>',_0x305cb9['title']=_0x431469['title'],_0x305cb9['dataset']['action']=_0x431469['action'];const _0x2d06d8=document['createElement']('div');_0x2d06d8['className']='markdown-toolbar-dropdown-menu',_0x2d06d8['style']['display']='none';if(_0x431469['action']==='header')this['createHeaderDropdown'](_0x2d06d8);else _0x431469['action']==='color'&&this['createColorDropdown'](_0x2d06d8);_0x305cb9['addEventListener']('click',_0x2a0c5f=>{_0x2a0c5f['preventDefault'](),_0x2a0c5f['stopPropagation'](),this['toggleDropdown'](_0x2d06d8,_0x305cb9);}),_0x2179e5['appendChild'](_0x305cb9),_0x2179e5['appendChild'](_0x2d06d8),this['toolbar']['appendChild'](_0x2179e5),this['toolbarButtons'][_0x431469['id']]={'button':_0x305cb9,'dropdown':_0x2d06d8,'command':_0x431469['command'],'tagName':_0x431469['tagName']};}else{const _0x1bc7c6=document['createElement']('button');_0x1bc7c6['type']='button',_0x1bc7c6['className']='markdown-editor-toolbar-btn',_0x1bc7c6['tabIndex']=-0x1,_0x1bc7c6['innerHTML']=_0x431469['icon'],_0x1bc7c6['title']=_0x431469['title'],_0x1bc7c6['dataset']['action']=_0x431469['action'],_0x1bc7c6['addEventListener']('click',_0x2690a6=>{_0x2690a6['preventDefault'](),this['handleToolbarAction'](_0x431469['action']);}),this['toolbar']['appendChild'](_0x1bc7c6),this['toolbarButtons'][_0x431469['id']]={'button':_0x1bc7c6,'command':_0x431469['command'],'tagName':_0x431469['tagName']};}}}),document['addEventListener']('click',_0x57a0ed=>{!this['toolbar']['contains'](_0x57a0ed['target'])&&this['closeAllDropdowns']();});}['createHeaderDropdown'](_0x564149){const _0x3c4142=[{'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'}];_0x3c4142['forEach'](_0xfa940d=>{const _0x21b071=document['createElement']('button');_0x21b071['type']='button',_0x21b071['className']='markdown-dropdown-item',_0x21b071['tabIndex']=-0x1,_0x21b071['innerHTML']='<span\x20style=\x22font-size:\x20'+(_0xfa940d['level']===0x0?'14px':0x14-_0xfa940d['level']*0x2+'px')+';\x20font-weight:\x20'+(_0xfa940d['level']===0x0?'normal':'bold')+'\x22>'+_0xfa940d['label']+'</span>',_0x21b071['addEventListener']('click',_0x766372=>{_0x766372['preventDefault'](),_0x766372['stopPropagation'](),this['applyHeader'](_0xfa940d['level']),this['closeAllDropdowns']();}),_0x564149['appendChild'](_0x21b071);});}['createColorDropdown'](_0x515d2d){const _0x4d5ba2=[{'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'}],_0x29789c=document['createElement']('div');_0x29789c['className']='markdown-color-grid',_0x29789c['style']['display']='grid',_0x29789c['style']['gridTemplateColumns']='repeat(3,\x201fr)',_0x29789c['style']['gap']='4px',_0x29789c['style']['padding']='8px',_0x4d5ba2['forEach'](_0x327b72=>{const _0x43583c=document['createElement']('button');_0x43583c['type']='button',_0x43583c['className']='markdown-color-btn',_0x43583c['tabIndex']=-0x1,_0x43583c['style']['width']='24px',_0x43583c['style']['height']='24px',_0x43583c['style']['backgroundColor']=_0x327b72['value'],_0x43583c['style']['border']='1px\x20solid\x20var(--color-border)',_0x43583c['style']['borderRadius']='4px',_0x43583c['style']['cursor']='pointer',_0x43583c['title']=_0x327b72['label'],_0x43583c['addEventListener']('click',_0x2c33c6=>{_0x2c33c6['preventDefault'](),_0x2c33c6['stopPropagation'](),this['applyColor'](_0x327b72['value']),this['closeAllDropdowns']();}),_0x29789c['appendChild'](_0x43583c);}),_0x515d2d['appendChild'](_0x29789c);const _0xb9c466=document['createElement']('button');_0xb9c466['type']='button',_0xb9c466['className']='markdown-dropdown-item',_0xb9c466['innerHTML']='<span>Remove\x20Color</span>',_0xb9c466['style']['borderTop']='1px\x20solid\x20var(--color-border)',_0xb9c466['style']['marginTop']='4px',_0xb9c466['style']['paddingTop']='8px',_0xb9c466['addEventListener']('click',_0x53c754=>{_0x53c754['preventDefault'](),_0x53c754['stopPropagation'](),this['removeColor'](),this['closeAllDropdowns']();}),_0x515d2d['appendChild'](_0xb9c466);}['toggleDropdown'](_0x4dcf65,_0x596053){const _0x5a9cc2=_0x4dcf65['style']['display']!=='none';this['toolbar']&&this['closeAllDropdowns'](),!_0x5a9cc2&&(_0x4dcf65['style']['display']='block',_0x596053['classList']['add']('active'));}['closeAllDropdowns'](){const _0x35afcd=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-menu');_0x35afcd['forEach'](_0x5bd8c8=>_0x5bd8c8['style']['display']='none');const _0x4961f0=this['toolbar']['querySelectorAll']('.markdown-toolbar-dropdown-btn');_0x4961f0['forEach'](_0x48bb47=>_0x48bb47['classList']['remove']('active'));}['applyHeader'](_0xe8661b){this['editor']['focus']();const _0xafea58=window['getSelection']();if(!_0xafea58||_0xafea58['rangeCount']===0x0)return;const _0x5312d9=_0xafea58['getRangeAt'](0x0);let _0x2d80b1=_0x5312d9['startContainer'];while(_0x2d80b1&&_0x2d80b1!==this['editor']){if(_0x2d80b1['nodeType']===Node['ELEMENT_NODE']){const _0x3182cd=window['getComputedStyle'](_0x2d80b1)['display'];if(_0x3182cd==='block'||['P','H1','H2','H3','H4','H5','H6','DIV']['includes'](_0x2d80b1['tagName']))break;}_0x2d80b1=_0x2d80b1['parentNode'];}_0xe8661b===0x0?document['execCommand']('formatBlock',![],'p'):document['execCommand']('formatBlock',![],'h'+_0xe8661b),this['editor']['dispatchEvent'](new Event('input'));}['applyColor'](_0xe7f9be){this['editor']['focus'](),document['execCommand']('foreColor',![],_0xe7f9be),this['editor']['dispatchEvent'](new Event('input'));}['removeColor'](){this['editor']['focus'](),document['execCommand']('removeFormat',![],null),this['editor']['dispatchEvent'](new Event('input'));}['handleToolbarAction'](_0x382687){this['editor']['focus']();switch(_0x382687){case'bold':case'italic':case'strikeThrough':case'insertUnorderedList':case'insertOrderedList':document['execCommand'](_0x382687,![],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 _0xb3abe9=document['createElement']('div');_0xb3abe9['className']='markdown-editor-link-modal',_0xb3abe9['hidden']=!![],_0xb3abe9['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'](_0xb3abe9),this['linkDialog']=_0xb3abe9,this['linkDialogElements']={'backdrop':_0xb3abe9['querySelector']('.markdown-editor-link-backdrop'),'title':_0xb3abe9['querySelector']('.markdown-editor-link-title'),'close':_0xb3abe9['querySelector']('.markdown-editor-link-close'),'form':_0xb3abe9['querySelector']('.markdown-editor-link-form'),'urlInput':_0xb3abe9['querySelector']('[data-link-field=\x22url\x22]'),'textInput':_0xb3abe9['querySelector']('[data-link-field=\x22text\x22]'),'remove':_0xb3abe9['querySelector']('[data-action=\x22remove\x22]'),'cancel':_0xb3abe9['querySelector']('[data-action=\x22cancel\x22]'),'submit':_0xb3abe9['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',_0x3b0c3f=>{_0x3b0c3f['preventDefault'](),this['applyLinkDialogResult']();}),this['linkDialog']['addEventListener']('keydown',_0x562a13=>{_0x562a13['key']==='Escape'&&(_0x562a13['preventDefault'](),this['closeLinkDialog']({'restoreSelection':!![]}));});}['openLinkDialog'](){const _0x562593=window['getSelection']();if(!_0x562593||_0x562593['rangeCount']===0x0)return;const _0x3fe848=_0x562593['getRangeAt'](0x0),_0x548c26=this['editor']['contains'](_0x3fe848['commonAncestorContainer'])||this['editor']===_0x3fe848['commonAncestorContainer'];if(!_0x548c26)return;this['toolbar']&&this['closeAllDropdowns']();this['ensureLinkDialog']();const _0x210f00=_0x3fe848['cloneRange'](),_0x4f17f0=this['findLinkAtRange'](_0x210f00),_0x40780f=_0x4f17f0?_0x4f17f0['getAttribute']('href')||'':'',_0x4822c5=_0x4f17f0?_0x4f17f0['textContent']||'':_0x210f00['toString']();this['linkDialogContext']={'range':_0x210f00,'existingLink':_0x4f17f0,'selectedText':_0x4822c5},this['linkDialogElements']['title']['textContent']=_0x4f17f0?'Edit\x20Link':'Insert\x20Link',this['linkDialogElements']['submit']['textContent']=_0x4f17f0?'Save\x20Link':'Insert\x20Link',this['linkDialogElements']['remove']['hidden']=!_0x4f17f0,this['linkDialogElements']['urlInput']['value']=_0x40780f,this['linkDialogElements']['textInput']['value']=_0x4822c5,this['linkDialog']['hidden']=![],this['linkDialogElements']['urlInput']['focus'](),this['linkDialogElements']['urlInput']['select']();}['closeLinkDialog']({restoreSelection:restoreSelection=![]}={}){if(!this['linkDialog'])return;const _0x55d72c=this['linkDialogContext'];this['linkDialog']['hidden']=!![],restoreSelection&&_0x55d72c?.['range']&&(this['editor']['focus'](),this['restoreRange'](_0x55d72c['range'])),this['linkDialogContext']=null;}['applyLinkDialogResult']({remove:remove=![]}={}){if(!this['linkDialog']||!this['linkDialogContext'])return;const _0x253c5f=this['linkDialogContext'],_0x3839b1=(this['linkDialogElements']['urlInput']['value']||'')['trim'](),_0x38a990=this['linkDialogElements']['textInput']['value']||'',_0x1635ae=_0x38a990['trim']();if(!remove&&!_0x3839b1){this['linkDialogElements']['urlInput']['focus']();return;}this['closeLinkDialog'](),this['editor']['focus'](),this['restoreRange'](_0x253c5f['range']);if(remove)_0x253c5f['existingLink']&&_0x253c5f['existingLink']['parentNode']?this['unwrapLinkElement'](_0x253c5f['existingLink']):document['execCommand']('unlink',![],null);else{if(_0x253c5f['existingLink']&&_0x253c5f['existingLink']['parentNode'])_0x253c5f['existingLink']['setAttribute']('href',_0x3839b1),_0x253c5f['existingLink']['textContent']=_0x1635ae||_0x3839b1;else{const _0x1d3815=window['getSelection']();if(!_0x1d3815||_0x1d3815['rangeCount']===0x0)return;const _0x1252c3=_0x1d3815['getRangeAt'](0x0),_0x4da38e=(_0x253c5f['selectedText']||'')['trim'](),_0x1e2496=_0x1635ae||_0x4da38e||_0x3839b1;_0x1252c3['deleteContents']();const _0x58dab4=document['createElement']('a');_0x58dab4['href']=_0x3839b1,_0x58dab4['textContent']=_0x1e2496,_0x1252c3['insertNode'](_0x58dab4),_0x1252c3['setStartAfter'](_0x58dab4),_0x1252c3['collapse'](!![]),_0x1d3815['removeAllRanges'](),_0x1d3815['addRange'](_0x1252c3);}}this['addLinkHints'](),this['updateToolbarState'](),this['editor']['dispatchEvent'](new Event('input'));}['ensureLinkDialogStyles'](){if(document['getElementById'](LINK_DIALOG_STYLE_ID))return;const _0x4e13ea=document['createElement']('style');_0x4e13ea['id']=LINK_DIALOG_STYLE_ID,_0x4e13ea['textContent']=LINK_DIALOG_STYLES,document['head']['appendChild'](_0x4e13ea);}['restoreRange'](_0x504baf){const _0x468c42=window['getSelection']();if(!_0x468c42)return;try{_0x468c42['removeAllRanges'](),_0x468c42['addRange'](_0x504baf);return;}catch(_0xf772bc){}const _0x55ec79=document['createRange']();_0x55ec79['selectNodeContents'](this['editor']),_0x55ec79['collapse'](![]),_0x468c42['removeAllRanges'](),_0x468c42['addRange'](_0x55ec79);}['findLinkAtRange'](_0x1f9049){if(!_0x1f9049)return null;const _0x2551aa=this['findParentLink'](_0x1f9049['startContainer']);if(_0x1f9049['collapsed'])return _0x2551aa;const _0x287472=this['findParentLink'](_0x1f9049['endContainer']);if(_0x2551aa&&_0x2551aa===_0x287472)return _0x2551aa;if(_0x2551aa&&_0x2551aa['contains'](_0x1f9049['endContainer']))return _0x2551aa;if(_0x287472&&_0x287472['contains'](_0x1f9049['startContainer']))return _0x287472;return null;}['findParentLink'](_0x344107){let _0x24a8a6=_0x344107;while(_0x24a8a6&&_0x24a8a6!==this['editor']){if(_0x24a8a6['nodeType']===Node['ELEMENT_NODE']&&_0x24a8a6['tagName']==='A'){const _0x2460b9=_0x24a8a6['getAttribute']('href')||'';if(_0x2460b9['startsWith']('mention:'))return null;return _0x24a8a6;}_0x24a8a6=_0x24a8a6['parentNode'];}return null;}['unwrapLinkElement'](_0x234482){const _0x60aa3e=_0x234482['parentNode'];if(!_0x60aa3e)return;while(_0x234482['firstChild']){_0x60aa3e['insertBefore'](_0x234482['firstChild'],_0x234482);}_0x60aa3e['removeChild'](_0x234482);}['isSelectionInTag'](_0x56d715){const _0x37fe1c=window['getSelection']();if(!_0x37fe1c||_0x37fe1c['rangeCount']===0x0)return![];let _0x3a43d2=_0x37fe1c['anchorNode'];while(_0x3a43d2&&_0x3a43d2!==this['editor']){if(_0x3a43d2['nodeType']===Node['ELEMENT_NODE']&&_0x3a43d2['tagName']===_0x56d715)return!![];_0x3a43d2=_0x3a43d2['parentNode'];}return![];}['updateToolbarState'](){if(!this['toolbarButtons'])return;for(const [_0x53a18d,_0xdf4dd2]of Object['entries'](this['toolbarButtons'])){let _0x1d9ee8=![];if(_0xdf4dd2['command'])try{_0x1d9ee8=document['queryCommandState'](_0xdf4dd2['command']);}catch(_0x122639){_0x1d9ee8=![];}else _0xdf4dd2['tagName']&&(_0x1d9ee8=this['isSelectionInTag'](_0xdf4dd2['tagName']));_0xdf4dd2['button']['classList']['toggle']('active',_0x1d9ee8);}}['bindEvents'](){this['editor']['addEventListener']('keydown',_0x1c1928=>this['handleKeydown'](_0x1c1928)),this['editor']['addEventListener']('input',_0x2e5ecb=>{this['handleMentionInput'](_0x2e5ecb),this['handleAutoFormat'](_0x2e5ecb);}),this['editor']['addEventListener']('input',()=>{const _0x228430=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');!_0x228430&&(this['editor']['innerHTML']='');this['updatePlaceholder']();const _0xedd811=this['getMarkdown']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0xedd811:this['element']['textContent']=_0xedd811,this['options']['onChange']&&this['options']['onChange'](_0xedd811);}),this['editor']['addEventListener']('paste',_0x509926=>this['handlePaste'](_0x509926)),this['editor']['addEventListener']('dragover',_0x4050f2=>this['handleDragOver'](_0x4050f2)),this['editor']['addEventListener']('drop',_0x1c00e5=>this['handleDrop'](_0x1c00e5)),this['editor']['addEventListener']('dragstart',_0x4a3d1a=>this['handleDragStart'](_0x4a3d1a)),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']=_0x2b218a=>this['handleLinkClick'](_0x2b218a),this['editor']['addEventListener']('click',this['linkClickHandler']),this['linkMouseEnterHandler']=_0x202aaa=>this['handleLinkMouseEnter'](_0x202aaa),this['linkMouseLeaveHandler']=_0x1b1359=>this['handleLinkMouseLeave'](_0x1b1359),this['editor']['addEventListener']('mouseover',this['linkMouseEnterHandler']),this['editor']['addEventListener']('mouseout',this['linkMouseLeaveHandler']),this['updatePlaceholder']();}['handleAutoFormat'](_0x188263){if(_0x188263['inputType']==='deleteContentBackward')return;const _0xd38659=window['getSelection']();if(!_0xd38659||_0xd38659['rangeCount']===0x0)return;const _0x465ec0=_0xd38659['getRangeAt'](0x0),_0x22fdb4=_0x465ec0['startContainer'];if(_0x22fdb4['nodeType']!==Node['TEXT_NODE'])return;if(this['isSelectionInTag']('CODE')||this['isSelectionInTag']('PRE'))return;const _0x8b8519=_0x22fdb4['textContent'],_0x2071f8=_0x465ec0['startOffset'],_0x101ef5=_0x8b8519['slice'](0x0,_0x2071f8);if(_0x101ef5['endsWith']('```')){_0x465ec0['setStart'](_0x22fdb4,_0x2071f8-0x3),_0x465ec0['setEnd'](_0x22fdb4,_0x2071f8),_0x465ec0['deleteContents'](),this['insertCodeBlock']();return;}const _0x3dc70d=/`([^`]+)`$/,_0x3471d4=_0x101ef5['match'](_0x3dc70d);if(_0x3471d4){const _0x5eaa03=_0x3471d4[0x1];if(_0x5eaa03){const _0x3faf94=_0x3471d4['index'],_0x1de92a=_0x3faf94+_0x5eaa03['length']+0x2;_0x465ec0['setStart'](_0x22fdb4,_0x3faf94),_0x465ec0['setEnd'](_0x22fdb4,_0x2071f8),_0x465ec0['deleteContents']();const _0x187e60=document['createElement']('code');_0x187e60['textContent']=_0x5eaa03,_0x465ec0['insertNode'](_0x187e60),_0x465ec0['setStartAfter'](_0x187e60),_0x465ec0['setEndAfter'](_0x187e60);const _0x10335b=document['createTextNode']('​');_0x465ec0['insertNode'](_0x10335b),_0x465ec0['setStartAfter'](_0x10335b),_0x465ec0['setEndAfter'](_0x10335b),_0xd38659['removeAllRanges'](),_0xd38659['addRange'](_0x465ec0);return;}}const _0x2c639a=_0x101ef5['match'](/^[-*][\s\u00A0]$/);if(_0x2c639a&&this['isAtStartOfBlock'](_0x22fdb4)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0x465ec0['setStart'](_0x22fdb4,Math['max'](_0x2071f8-0x2,0x0)),_0x465ec0['setEnd'](_0x22fdb4,_0x2071f8),_0x465ec0['deleteContents']();const _0x4d38a3=this['ensureListInsertionAnchor'](_0x22fdb4);document['execCommand']('insertUnorderedList',![],null);_0x4d38a3&&_0x4d38a3['parentNode']&&_0x4d38a3['parentNode']['removeChild'](_0x4d38a3);this['updateToolbarState']();return;}const _0x11811b=_0x101ef5['match'](/^1\.[\s\u00A0]$/);if(_0x11811b&&this['isAtStartOfBlock'](_0x22fdb4)){if(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))return;_0x465ec0['setStart'](_0x22fdb4,Math['max'](_0x2071f8-0x3,0x0)),_0x465ec0['setEnd'](_0x22fdb4,_0x2071f8),_0x465ec0['deleteContents']();const _0x45363e=this['ensureListInsertionAnchor'](_0x22fdb4);document['execCommand']('insertOrderedList',![],null);_0x45363e&&_0x45363e['parentNode']&&_0x45363e['parentNode']['removeChild'](_0x45363e);this['updateToolbarState']();return;}}['isAtStartOfBlock'](_0x2416f9){let _0xeeb6ce=_0x2416f9;while(_0xeeb6ce&&_0xeeb6ce!==this['editor']){const _0x4c423f=_0xeeb6ce['parentNode'];if(!_0x4c423f)break;const _0x49b87e=_0x4c423f['tagName'];if(_0x49b87e==='DIV'||_0x49b87e==='P'||_0x49b87e==='LI'||_0x4c423f===this['editor']){let _0x35e01a=_0x4c423f['firstChild'];while(_0x35e01a&&(_0x35e01a['nodeType']===Node['TEXT_NODE']&&_0x35e01a['textContent']===''||_0x35e01a['nodeType']===Node['ELEMENT_NODE']&&_0x35e01a['tagName']==='BR')){_0x35e01a=_0x35e01a['nextSibling'];}return _0x35e01a===_0x2416f9||_0x35e01a===_0xeeb6ce;}_0xeeb6ce=_0x4c423f;}if(_0xeeb6ce===this['editor']||_0x2416f9['parentNode']===this['editor']){let _0x3e9ab1=this['editor']['firstChild'];while(_0x3e9ab1&&(_0x3e9ab1['nodeType']===Node['TEXT_NODE']&&_0x3e9ab1['textContent']===''||_0x3e9ab1['nodeType']===Node['ELEMENT_NODE']&&_0x3e9ab1['tagName']==='BR')){_0x3e9ab1=_0x3e9ab1['nextSibling'];}return _0x3e9ab1===_0x2416f9;}return![];}['getClosestBlockElement'](_0x1f409e){let _0x127d69=_0x1f409e;while(_0x127d69&&_0x127d69!==this['editor']){const _0x317ad7=_0x127d69['parentNode'];if(!_0x317ad7)break;const _0x58fb3c=_0x317ad7['tagName'];if(_0x58fb3c==='DIV'||_0x58fb3c==='P'||_0x58fb3c==='LI'||_0x317ad7===this['editor'])return _0x317ad7;_0x127d69=_0x317ad7;}return this['editor'];}['ensureListInsertionAnchor'](_0x5d8899){const _0x585f91=window['getSelection']();if(!_0x585f91||_0x585f91['rangeCount']===0x0)return null;const _0x42e5ef=this['getClosestBlockElement'](_0x5d8899);if(!_0x42e5ef||_0x42e5ef===this['editor'])return null;const _0x3ddd57=_0x42e5ef['textContent']['replace'](/\u200B/g,'');if(_0x3ddd57!=='')return null;const _0x504689=document['createTextNode']('​');_0x42e5ef['appendChild'](_0x504689);const _0xc94d59=document['createRange']();return _0xc94d59['setStart'](_0x504689,0x1),_0xc94d59['setEnd'](_0x504689,0x1),_0x585f91['removeAllRanges'](),_0x585f91['addRange'](_0xc94d59),_0x504689;}['getContainingListItem'](){const _0x2ee489=window['getSelection']();if(!_0x2ee489||_0x2ee489['rangeCount']===0x0)return null;let _0x5c66da=_0x2ee489['anchorNode'];while(_0x5c66da&&_0x5c66da!==this['editor']){if(_0x5c66da['nodeType']===Node['ELEMENT_NODE']&&_0x5c66da['tagName']==='LI')return _0x5c66da;_0x5c66da=_0x5c66da['parentNode'];}return null;}['isEmptyListItem'](_0x3c1050){if(!_0x3c1050)return![];const _0x47f721=_0x3c1050['textContent']['replace'](/\u200B/g,'')['trim']();if(_0x47f721!=='')return![];const _0x10b709=_0x3c1050['querySelector']('img');if(_0x10b709)return![];const _0x48e8f5=_0x3c1050['querySelector']('ul,\x20ol');if(_0x48e8f5)return![];return!![];}['isCursorAtStartOfListItem'](_0x5ea4fb){if(!_0x5ea4fb)return![];const _0x2a5176=window['getSelection']();if(!_0x2a5176||_0x2a5176['rangeCount']===0x0||!_0x2a5176['isCollapsed'])return![];const _0x3acaf0=_0x2a5176['getRangeAt'](0x0),_0x1c2515=_0x3acaf0['startContainer'];if(_0x1c2515!==_0x5ea4fb&&!_0x5ea4fb['contains'](_0x1c2515))return![];const _0x4df2c8=_0x3acaf0['cloneRange']();_0x4df2c8['setStart'](_0x5ea4fb,0x0),_0x4df2c8['setEnd'](_0x1c2515,_0x3acaf0['startOffset']);const _0xfb486a=_0x4df2c8['toString']()['replace'](/\u200B/g,'')['replace'](/\u00A0/g,'\x20');return _0xfb486a['trim']()==='';}['indentListItem'](_0x21eb50){const _0xb90887=_0x21eb50['previousElementSibling'];if(!_0xb90887||_0xb90887['tagName']!=='LI')return;const _0x568b66=_0x21eb50['parentNode'],_0x2ace14=_0x568b66['tagName'];let _0xe7fe39=_0xb90887['querySelector'](':scope\x20>\x20ul,\x20:scope\x20>\x20ol');!_0xe7fe39&&(_0xe7fe39=document['createElement'](_0x2ace14),_0xb90887['appendChild'](_0xe7fe39)),_0xe7fe39['appendChild'](_0x21eb50),this['placeCursorInListItem'](_0x21eb50);}['outdentListItem'](_0xc81b79){const _0x3e8642=_0xc81b79['parentNode'];if(!_0x3e8642||_0x3e8642['tagName']!=='UL'&&_0x3e8642['tagName']!=='OL')return;const _0x28b53b=_0x3e8642['parentNode'];if(_0x28b53b&&_0x28b53b['tagName']==='LI'){const _0x5ca9d3=_0x28b53b['parentNode'];_0x5ca9d3['insertBefore'](_0xc81b79,_0x28b53b['nextSibling']),_0x3e8642['children']['length']===0x0&&_0x3e8642['remove'](),this['placeCursorInListItem'](_0xc81b79);}else return;}['exitListOnEmptyBullet'](_0x27cfe2){const _0x15bd73=_0x27cfe2['parentNode'];if(!_0x15bd73)return;const _0xd6c5a1=_0x15bd73['parentNode'];if(_0xd6c5a1&&_0xd6c5a1['tagName']==='LI'){this['outdentListItem'](_0x27cfe2);return;}const _0x165a92=_0x15bd73['parentNode'],_0xbad395=document['createElement']('p');_0xbad395['innerHTML']='<br>',_0x165a92['insertBefore'](_0xbad395,_0x15bd73['nextSibling']),_0x27cfe2['remove']();_0x15bd73['children']['length']===0x0&&_0x15bd73['remove']();const _0xd7141d=window['getSelection'](),_0x532ffc=document['createRange']();_0x532ffc['setStart'](_0xbad395,0x0),_0x532ffc['collapse'](!![]),_0xd7141d['removeAllRanges'](),_0xd7141d['addRange'](_0x532ffc);}['placeCursorInListItem'](_0x4d0441){const _0x2aebcc=window['getSelection'](),_0xde65b1=document['createRange'](),_0x33a0b3=document['createTreeWalker'](_0x4d0441,NodeFilter['SHOW_TEXT'],null,![]),_0x2f9cf1=_0x33a0b3['nextNode']();_0x2f9cf1?_0xde65b1['setStart'](_0x2f9cf1,0x0):_0xde65b1['setStart'](_0x4d0441,0x0),_0xde65b1['collapse'](!![]),_0x2aebcc['removeAllRanges'](),_0x2aebcc['addRange'](_0xde65b1);}['handleLinkClick'](_0x275a39){const _0x112e30=this['isMac']?_0x275a39['metaKey']:_0x275a39['ctrlKey'];if(!_0x112e30)return;let _0x463591=_0x275a39['target'];while(_0x463591&&_0x463591!==this['editor']){if(_0x463591['tagName']==='A'){_0x275a39['preventDefault'](),_0x275a39['stopPropagation']();const _0x5a25d4=_0x463591['getAttribute']('href');if(!_0x5a25d4)return;if(_0x5a25d4['startsWith']('mention:'))return;const _0x378aa8=/^https?:\/\//i['test'](_0x5a25d4);_0x378aa8?window['open'](_0x5a25d4,'_blank','noopener,noreferrer'):window['location']['href']=_0x5a25d4;return;}_0x463591=_0x463591['parentNode'];}}['handleLinkMouseEnter'](_0x22c019){const _0x1c4135=_0x22c019['target'];if(_0x1c4135['tagName']!=='A')return;const _0x5a6a1d=_0x1c4135['getAttribute']('href')||'';if(_0x5a6a1d['startsWith']('mention:'))return;this['linkTooltipTimeout']&&clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=setTimeout(()=>{this['showLinkTooltip'](_0x1c4135);},0x12c);}['handleLinkMouseLeave'](_0x2147b5){const _0x192b6e=_0x2147b5['target'];if(_0x192b6e['tagName']!=='A')return;this['linkTooltipTimeout']&&(clearTimeout(this['linkTooltipTimeout']),this['linkTooltipTimeout']=null),this['hideLinkTooltip']();}['showLinkTooltip'](_0x1ac7a4){!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 _0x2270a0=_0x1ac7a4['getBoundingClientRect'](),_0x4151c3=this['linkTooltip']['getBoundingClientRect']();let _0x21df3b=_0x2270a0['bottom']+0x4,_0x50bfec=_0x2270a0['left']+_0x2270a0['width']/0x2;_0x21df3b+0x1e>window['innerHeight']&&(_0x21df3b=_0x2270a0['top']-0x1e);const _0x469256=0x78;if(_0x50bfec-_0x469256/0x2<0xa)_0x50bfec=_0x469256/0x2+0xa;else _0x50bfec+_0x469256/0x2>window['innerWidth']-0xa&&(_0x50bfec=window['innerWidth']-_0x469256/0x2-0xa);this['linkTooltip']['style']['top']=_0x21df3b+'px',this['linkTooltip']['style']['left']=_0x50bfec+'px',this['linkTooltip']['style']['transform']='translateX(-50%)',this['linkTooltip']['classList']['add']('visible');}['hideLinkTooltip'](){this['linkTooltip']&&this['linkTooltip']['classList']['remove']('visible');}['handleKeydown'](_0x21349d){if(this['mentionState']['active']){if(_0x21349d['key']==='ArrowDown'){_0x21349d['preventDefault'](),this['mentionNavigate'](0x1);return;}if(_0x21349d['key']==='ArrowUp'){_0x21349d['preventDefault'](),this['mentionNavigate'](-0x1);return;}if(_0x21349d['key']==='Enter'||_0x21349d['key']==='Tab'){if(this['mentionState']['filteredUsers']['length']>0x0){_0x21349d['preventDefault'](),this['insertMention'](this['mentionState']['filteredUsers'][this['mentionState']['selectedIndex']]);return;}}if(_0x21349d['key']==='Escape'){_0x21349d['preventDefault'](),this['closeMentionDropdown']();return;}}if(_0x21349d['key']==='Tab'&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x15cf91=this['getContainingListItem']();if(_0x15cf91&&this['isCursorAtStartOfListItem'](_0x15cf91)){_0x21349d['preventDefault']();_0x21349d['shiftKey']?this['outdentListItem'](_0x15cf91):this['indentListItem'](_0x15cf91);this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x21349d['key']==='Enter'&&!_0x21349d['shiftKey']&&(this['isSelectionInTag']('UL')||this['isSelectionInTag']('OL'))){const _0x53128b=this['getContainingListItem']();if(_0x53128b&&this['isEmptyListItem'](_0x53128b)){_0x21349d['preventDefault'](),this['exitListOnEmptyBullet'](_0x53128b),this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));return;}}if(_0x21349d['key']==='Enter'&&!_0x21349d['shiftKey']&&this['isSelectionInTag']('PRE')){_0x21349d['preventDefault']();const _0x2d11c0=window['getSelection']();if(_0x2d11c0['rangeCount']>0x0){const _0x584ea8=_0x2d11c0['getRangeAt'](0x0);_0x584ea8['deleteContents']();const _0x1d46cd=document['createTextNode']('\x0a');_0x584ea8['insertNode'](_0x1d46cd),_0x584ea8['setStartAfter'](_0x1d46cd),_0x584ea8['setEndAfter'](_0x1d46cd),_0x2d11c0['removeAllRanges'](),_0x2d11c0['addRange'](_0x584ea8),this['handleInput']();}return;}(_0x21349d['ctrlKey']||_0x21349d['metaKey'])&&_0x21349d['key']==='b'&&(_0x21349d['preventDefault'](),document['execCommand']('bold',![],null));(_0x21349d['ctrlKey']||_0x21349d['metaKey'])&&_0x21349d['key']==='i'&&(_0x21349d['preventDefault'](),document['execCommand']('italic',![],null));if((_0x21349d['ctrlKey']||_0x21349d['metaKey'])&&_0x21349d['key']==='k'){_0x21349d['preventDefault'](),this['openLinkDialog']();return;}}['handlePaste'](_0x21341c){const _0x506118=_0x21341c['clipboardData'];if(_0x506118&&this['options']['onAddAttachments']){const _0x58185b=this['extractImageFilesFromClipboard'](_0x506118);if(_0x58185b['length']>0x0){_0x21341c['preventDefault'](),this['addAndInsertImages'](_0x58185b);return;}}_0x21341c['preventDefault']();const _0x3fbe44=_0x21341c['clipboardData']['getData']('text/html');if(_0x3fbe44&&_0x3fbe44['trim']()){const _0x3cd16a=this['convertPastedHtmlToMarkdown'](_0x3fbe44);if(_0x3cd16a&&_0x3cd16a['trim']()){this['insertMarkdownAsRichText'](_0x3cd16a);return;}}const _0x5db9eb=_0x21341c['clipboardData']['getData']('text/plain');document['execCommand']('insertText',![],_0x5db9eb);}['convertPastedHtmlToMarkdown'](_0xdf163a){const _0x198d94=document['createElement']('div');_0x198d94['innerHTML']=_0xdf163a;const _0x4aa2cb=_0x198d94['querySelectorAll']('style,\x20script,\x20meta,\x20link,\x20head,\x20title');_0x4aa2cb['forEach'](_0x4646ed=>_0x4646ed['remove']());const _0x37595d=_0x198d94['querySelectorAll']('*');_0x37595d['forEach'](_0x73c488=>{const _0x4bd5f0=Array['from'](_0x73c488['attributes']);_0x4bd5f0['forEach'](_0x513184=>{_0x513184['name']['startsWith']('data-')&&_0x513184['name']!=='data-attachment-name'&&_0x513184['name']!=='data-mention-user-id'&&_0x73c488['removeAttribute'](_0x513184['name']);});}),_0x198d94['querySelectorAll']('font[color]')['forEach'](_0x58c219=>{_0x58c219['replaceWith'](..._0x58c219['childNodes']);}),_0x198d94['querySelectorAll']('span')['forEach'](_0x1861ea=>{_0x1861ea['style']['color']&&_0x1861ea['style']['removeProperty']('color'),!_0x1861ea['getAttribute']('style')&&!_0x1861ea['getAttribute']('data-mention-user-id')&&!_0x1861ea['getAttribute']('data-attachment-name')&&_0x1861ea['replaceWith'](..._0x1861ea['childNodes']);});try{return this['turndownService']['turndown'](_0x198d94['innerHTML']);}catch(_0x1d1943){return console['warn']('Failed\x20to\x20convert\x20HTML\x20to\x20markdown:',_0x1d1943),null;}}['insertMarkdownAsRichText'](_0x328e07){const _0x57905b=window['marked'];if(!_0x57905b){document['execCommand']('insertText',![],_0x328e07);return;}try{const _0x11b607=this['preprocessColorSyntax'](_0x328e07),_0x1c7a40=_0x57905b['parse'](_0x11b607),_0x376ef4=document['createElement']('div');_0x376ef4['innerHTML']=_0x1c7a40,this['processHtmlForEditor'](_0x376ef4),document['execCommand']('insertHTML',![],_0x376ef4['innerHTML']);}catch(_0x14844e){console['warn']('Failed\x20to\x20convert\x20markdown\x20to\x20HTML:',_0x14844e),document['execCommand']('insertText',![],_0x328e07);}}['processHtmlForEditor'](_0x1646a6){const _0x2d118b=_0x1646a6['querySelectorAll']('pre');_0x2d118b['forEach'](_0x39f8d8=>{const _0x6dd161=_0x39f8d8['querySelector']('code');if(_0x6dd161){const _0x4fb700=Array['from'](_0x6dd161['classList'])['find'](_0x1aa9ce=>_0x1aa9ce['startsWith']('language-')),_0x142689=_0x4fb700?_0x4fb700['replace']('language-',''):'',_0x1d7e13=document['createElement']('pre');_0x142689&&_0x1d7e13['setAttribute']('data-language',_0x142689),_0x1d7e13['textContent']=_0x6dd161['textContent'],_0x39f8d8['replaceWith'](_0x1d7e13);}});const _0x1c5ca4=_0x1646a6['querySelectorAll']('a');_0x1c5ca4['forEach'](_0x170950=>{_0x170950['setAttribute']('target','_blank'),_0x170950['setAttribute']('rel','noopener\x20noreferrer');});}['handleDragStart'](_0x3130e7){const _0x40202d=_0x3130e7['target'];if(!_0x40202d||_0x40202d['tagName']!=='IMG')return;if(!_0x3130e7['dataTransfer'])return;const _0x2094b8=_0x40202d['getAttribute']('data-attachment-name')||'';try{_0x3130e7['dataTransfer']['setData'](INTERNAL_DRAG_MIME,_0x2094b8||'1');}catch{}_0x3130e7['dataTransfer']['effectAllowed']='move';}['handleDragOver'](_0x599c1d){if(!this['isExternalFileTransfer'](_0x599c1d['dataTransfer']))return;_0x599c1d['preventDefault'](),_0x599c1d['dataTransfer']['dropEffect']='copy';}['handleDrop'](_0x12a657){if(!this['isExternalFileTransfer'](_0x12a657['dataTransfer']))return;const _0x19a7b5=_0x12a657['dataTransfer'],_0x4f2026=Array['from'](_0x19a7b5['files']||[])['filter'](_0x130446=>_0x130446&&typeof _0x130446['type']==='string'),_0x16405a=_0x4f2026['filter'](_0x478cce=>_0x478cce['type']['startsWith']('image/'));if(_0x16405a['length']===0x0)return;_0x12a657['preventDefault'](),_0x12a657['stopPropagation'](),this['cleanupParentDragState'](),this['moveSelectionToDropPoint'](_0x12a657),this['addAndInsertImages'](_0x16405a);}['cleanupParentDragState'](){let _0x4c65b1=this['editor']['parentElement'];while(_0x4c65b1){_0x4c65b1['classList']&&_0x4c65b1['classList']['contains']('drag-over')&&_0x4c65b1['classList']['remove']('drag-over'),_0x4c65b1=_0x4c65b1['parentElement'];}}['isExternalFileTransfer'](_0x5d633a){if(!_0x5d633a)return![];const _0x5e45d0=Array['from'](_0x5d633a['types']||[]);if(!_0x5e45d0['includes']('Files'))return![];if(_0x5e45d0['includes'](INTERNAL_DRAG_MIME))return![];if(_0x5d633a['files']&&_0x5d633a['files']['length']>0x0)return!![];if(_0x5d633a['items']&&Array['from'](_0x5d633a['items'])['some'](_0x3154fa=>_0x3154fa['kind']==='file'))return!![];return![];}['moveSelectionToDropPoint'](_0x4f392c){const _0x16b83d=_0x4f392c['clientX'],_0x2ef1b3=_0x4f392c['clientY'];let _0x32462a=null;if(document['caretRangeFromPoint'])_0x32462a=document['caretRangeFromPoint'](_0x16b83d,_0x2ef1b3);else{if(document['caretPositionFromPoint']){const _0x5c89a0=document['caretPositionFromPoint'](_0x16b83d,_0x2ef1b3);_0x5c89a0&&(_0x32462a=document['createRange'](),_0x32462a['setStart'](_0x5c89a0['offsetNode'],_0x5c89a0['offset']),_0x32462a['collapse'](!![]));}}if(_0x32462a){const _0x4160e0=window['getSelection']();_0x4160e0['removeAllRanges'](),_0x4160e0['addRange'](_0x32462a);}}['extractImageFilesFromClipboard'](_0x48c74b){const _0x1eed62=Array['from'](_0x48c74b['items']||[]),_0x523710=[];for(const _0x10ded3 of _0x1eed62){if(_0x10ded3['kind']==='file'&&_0x10ded3['type']&&_0x10ded3['type']['startsWith']('image/')){const _0x141371=_0x10ded3['getAsFile']();if(_0x141371)_0x523710['push'](_0x141371);}}return _0x523710;}['addAndInsertImages'](_0x359432){const _0x29add6=_0x359432['map'](_0x11f2ee=>this['prepareAttachmentFile'](_0x11f2ee))['filter'](Boolean);if(_0x29add6['length']===0x0)return;const _0x4b6ed0=_0x29add6['map'](_0x15e701=>_0x15e701['file']);try{this['options']['onAddAttachments'](_0x4b6ed0);}catch(_0x2743e9){console['error']('Failed\x20to\x20add\x20attachments:',_0x2743e9);}for(const {name:_0x506bc8,objectUrl:_0xe8c73d}of _0x29add6){this['insertAttachmentImage'](_0x506bc8,_0xe8c73d);}this['editor']['dispatchEvent'](new Event('input',{'bubbles':!![]}));}['prepareAttachmentFile'](_0x3f1c39){const _0x44c683=this['sanitizeFilename'](_0x3f1c39['name']||this['defaultImageName'](_0x3f1c39['type']));if(!_0x44c683)return null;const _0xa2b761=this['getUniqueAttachmentName'](_0x44c683),_0x24daa0=_0xa2b761===_0x3f1c39['name']?_0x3f1c39:new File([_0x3f1c39],_0xa2b761,{'type':_0x3f1c39['type'],'lastModified':_0x3f1c39['lastModified']}),_0x59efff=URL['createObjectURL'](_0x24daa0);return this['attachmentObjectUrls']['set'](_0xa2b761,_0x59efff),{'name':_0xa2b761,'file':_0x24daa0,'objectUrl':_0x59efff};}['getUniqueAttachmentName'](_0x3179d5){const _0x220775=_0x5f3b59=>{if(this['attachmentObjectUrls']['has'](_0x5f3b59))return!![];if(this['options']['isAttachmentNameTaken'])try{return Boolean(this['options']['isAttachmentNameTaken'](_0x5f3b59));}catch{return![];}return![];};if(!_0x220775(_0x3179d5))return _0x3179d5;const {stem:_0x466af6,ext:_0x311355}=this['splitFilename'](_0x3179d5);for(let _0x96c8a2=0x2;_0x96c8a2<0x3e8;_0x96c8a2++){const _0x7ca768=_0x466af6+'-'+_0x96c8a2+_0x311355;if(!_0x220775(_0x7ca768))return _0x7ca768;}return _0x466af6+'-'+Date['now']()+_0x311355;}['splitFilename'](_0x3f7b02){const _0x43d7c2=_0x3f7b02['lastIndexOf']('.');if(_0x43d7c2<=0x0||_0x43d7c2===_0x3f7b02['length']-0x1)return{'stem':_0x3f7b02,'ext':''};return{'stem':_0x3f7b02['slice'](0x0,_0x43d7c2),'ext':_0x3f7b02['slice'](_0x43d7c2)};}['sanitizeFilename'](_0x592b78){const _0x4f823f=String(_0x592b78||'')['split']('/')['pop']()['split']('\x5c')['pop']();return _0x4f823f['replace'](/[\u0000-\u001F\u007F]/g,'')['trim']();}['defaultImageName'](_0x54fe05){const _0x13b429=this['extensionForMime'](_0x54fe05);return'pasted-image-'+Date['now']()+_0x13b429;}['extensionForMime'](_0x169921){switch(_0x169921){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'](_0x157193,_0x352904){const _0x49cc87=document['createElement']('img');_0x49cc87['src']=_0x352904,_0x49cc87['alt']=_0x157193,_0x49cc87['setAttribute']('data-attachment-name',_0x157193),_0x49cc87['draggable']=!![];const _0x5a50b5=window['getSelection']();let _0xb581b1=![];if(_0x5a50b5&&_0x5a50b5['rangeCount']>0x0){const _0x26e536=_0x5a50b5['getRangeAt'](0x0);_0xb581b1=this['editor']['contains'](_0x26e536['commonAncestorContainer'])||this['editor']===_0x26e536['commonAncestorContainer'];}if(!_0xb581b1){this['editor']['appendChild'](_0x49cc87);const _0x3b5003=document['createRange']();_0x3b5003['setStartAfter'](_0x49cc87),_0x3b5003['collapse'](!![]),_0x5a50b5['removeAllRanges'](),_0x5a50b5['addRange'](_0x3b5003);return;}const _0x5d4c25=_0x5a50b5['getRangeAt'](0x0);_0x5d4c25['deleteContents'](),_0x5d4c25['insertNode'](_0x49cc87),_0x5d4c25['setStartAfter'](_0x49cc87),_0x5d4c25['collapse'](!![]),_0x5a50b5['removeAllRanges'](),_0x5a50b5['addRange'](_0x5d4c25);}['toggleInlineCode'](){const _0x1af98a=window['getSelection']();if(_0x1af98a['rangeCount']===0x0)return;const _0x1164c2=_0x1af98a['getRangeAt'](0x0),_0x8b5f13=_0x1164c2['toString']();if(_0x8b5f13){const _0x2ddcc0=document['createElement']('code');_0x2ddcc0['textContent']=_0x8b5f13,_0x1164c2['deleteContents'](),_0x1164c2['insertNode'](_0x2ddcc0),_0x1164c2['setStartAfter'](_0x2ddcc0),_0x1164c2['setEndAfter'](_0x2ddcc0),_0x1af98a['removeAllRanges'](),_0x1af98a['addRange'](_0x1164c2);}}['insertCodeBlock'](){const _0x34cd92=window['getSelection']();if(_0x34cd92['rangeCount']===0x0)return;const _0x5d785d=_0x34cd92['getRangeAt'](0x0),_0x499bdb=_0x5d785d['toString'](),_0x22cdf2=document['createElement']('pre'),_0x7058e9=document['createElement']('code');_0x7058e9['textContent']=_0x499bdb||'\x0a',_0x22cdf2['appendChild'](_0x7058e9),_0x5d785d['deleteContents'](),_0x5d785d['insertNode'](_0x22cdf2);const _0x282761=document['createElement']('p');_0x282761['innerHTML']='<br>',_0x22cdf2['parentNode']['insertBefore'](_0x282761,_0x22cdf2['nextSibling']);const _0x55ad2e=document['createRange']();!_0x499bdb?(_0x55ad2e['setStart'](_0x7058e9['firstChild'],0x0),_0x55ad2e['setEnd'](_0x7058e9['firstChild'],0x0)):(_0x55ad2e['selectNodeContents'](_0x7058e9),_0x55ad2e['collapse'](![])),_0x34cd92['removeAllRanges'](),_0x34cd92['addRange'](_0x55ad2e);}['updatePlaceholder'](){const _0x226224=this['editor']['textContent']['trim']()!==''||this['editor']['innerHTML']['includes']('<br')||this['editor']['innerHTML']['includes']('<div')||this['editor']['innerHTML']['includes']('<img');_0x226224?this['editor']['classList']['remove']('empty'):this['editor']['classList']['add']('empty');}['setMarkdown'](_0x3f76dc){if(!_0x3f76dc||!_0x3f76dc['trim']()){this['editor']['innerHTML']='',this['updatePlaceholder']();this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']='':this['element']['textContent']='';return;}const _0x321d6b=this['preprocessColorSyntax'](_0x3f76dc),_0x48ddbc=window['marked']['parse'](_0x321d6b);this['editor']['innerHTML']=_0x48ddbc,this['rewriteAttachmentImages'](),this['rewriteMentionLinks'](),this['addLinkHints'](),this['updatePlaceholder'](),this['element']['tagName']==='TEXTAREA'||this['element']['tagName']==='INPUT'?this['element']['value']=_0x3f76dc:this['element']['textContent']=_0x3f76dc;}['rewriteAttachmentImages'](){const _0x21f9f0=this['editor']['querySelectorAll']('img');_0x21f9f0['forEach'](_0x525d81=>{const _0x578355=_0x525d81['getAttribute']('data-attachment-name'),_0x98c117=_0x525d81['getAttribute']('src')||'',_0x28b15f=this['parseAttachmentReference'](_0x98c117)||this['parseTaskAttachmentUrl'](_0x98c117),_0x4919a5=_0x578355||(_0x28b15f?_0x28b15f['name']:null);if(!_0x4919a5)return;_0x525d81['setAttribute']('data-attachment-name',_0x4919a5);const _0x1e371b=this['attachmentObjectUrls']['get'](_0x4919a5)||(this['options']['resolveAttachmentUrl']?this['options']['resolveAttachmentUrl'](_0x4919a5):null);_0x1e371b&&(_0x525d81['src']=_0x1e371b);});}['rewriteMentionLinks'](){const _0x1fad6d=this['editor']['querySelectorAll']('a[href^=\x22mention:\x22]');_0x1fad6d['forEach'](_0x3eac7a=>{const _0x3aba6a=_0x3eac7a['getAttribute']('href')||'',_0x439db6=_0x3aba6a['replace']('mention:',''),_0x572d80=_0x3eac7a['textContent']||'',_0x4d8fbf=document['createElement']('span');_0x4d8fbf['className']='mention',_0x4d8fbf['setAttribute']('data-mention-user-id',_0x439db6),_0x4d8fbf['setAttribute']('contenteditable','false'),_0x4d8fbf['textContent']='@'+_0x572d80;const _0x145f5b=_0x3eac7a['previousSibling'];_0x145f5b&&_0x145f5b['nodeType']===Node['TEXT_NODE']&&_0x145f5b['textContent']['endsWith']('@')&&(_0x145f5b['textContent']=_0x145f5b['textContent']['slice'](0x0,-0x1)),_0x3eac7a['parentNode']['replaceChild'](_0x4d8fbf,_0x3eac7a);});}['addLinkHints'](){if(!this['options']['editable'])return;const _0x44ae12=this['editor']['querySelectorAll']('a');_0x44ae12['forEach'](_0x2b96e2=>{const _0x3f67a8=_0x2b96e2['getAttribute']('href')||'';if(_0x3f67a8['startsWith']('mention:'))return;const _0x32362a=_0x2b96e2['textContent']||_0x3f67a8,_0x16ef25=_0x32362a+'\x20('+(this['linkHintText']||'Ctrl+click\x20to\x20follow')+')';_0x2b96e2['setAttribute']('aria-label',_0x16ef25);});}['preprocessColorSyntax'](_0x2c3e78){if(!_0x2c3e78)return _0x2c3e78;const _0x43c9cb=_0x127a1c=>{return String(_0x127a1c)['replace'](/\{color:(#[0-9A-Fa-f]{3,6})\}([\s\S]*?)\{\/color\}/g,(_0x542265,_0x852044,_0x420ea6)=>{const _0x36b025=_0x43c9cb(_0x420ea6);return'<span\x20style=\x22color:\x20'+_0x852044+'\x22>'+_0x36b025+'</span>';});};return _0x43c9cb(_0x2c3e78);}['parseAttachmentReference'](_0x556db6){if(!_0x556db6||typeof _0x556db6!=='string')return null;if(!_0x556db6['startsWith'](ATTACHMENT_SCHEME)&&!_0x556db6['startsWith'](ATTACHMENT_SCHEME+'//'))return null;const _0x1273de=_0x556db6['replace'](ATTACHMENT_SCHEME+'//','')['replace'](ATTACHMENT_SCHEME,'');if(!_0x1273de)return null;try{return{'name':decodeURIComponent(_0x1273de)};}catch{return{'name':_0x1273de};}}['parseTaskAttachmentUrl'](_0x3e2671){if(!_0x3e2671||typeof _0x3e2671!=='string')return null;const _0x33c2a7=_0x3e2671['match'](/\/tasks\/[^/]+\/attachments\/([^?#]+)/);if(!_0x33c2a7)return null;const _0x1f542a=_0x33c2a7[0x1];try{return{'name':decodeURIComponent(_0x1f542a)};}catch{return{'name':_0x1f542a};}}['updateAttachmentFile'](_0x20213b,_0x10d3e7){const _0x528a54=this['attachmentObjectUrls']['get'](_0x20213b);if(_0x528a54)try{URL['revokeObjectURL'](_0x528a54);}catch{}const _0x518265=URL['createObjectURL'](_0x10d3e7);this['attachmentObjectUrls']['set'](_0x20213b,_0x518265);const _0x1c3809=this['editor']['querySelector']('img[data-attachment-name=\x22'+CSS['escape'](_0x20213b)+'\x22]');return _0x1c3809&&(_0x1c3809['src']=_0x518265),_0x518265;}['getMarkdown'](){const _0x20a79f=this['editor']['innerHTML'];if(!_0x20a79f||_0x20a79f['trim']()===''||_0x20a79f==='<br>')return'';return this['turndownService']['turndown'](_0x20a79f)['replace'](/\u200B/g,'');}['getValue'](){return this['getMarkdown']();}['setValue'](_0x4a449d){this['setMarkdown'](_0x4a449d);}['focus'](){this['editor']['focus']();}['clear'](){this['editor']['innerHTML']='',this['updatePlaceholder']();}['setEditable'](_0x140a5a){this['editor']['contentEditable']=_0x140a5a,this['options']['editable']=_0x140a5a;}['handleMentionInput'](_0x44191c){if(!this['options']['fetchUsers'])return;const _0x3e9a4b=window['getSelection']();if(!_0x3e9a4b||_0x3e9a4b['rangeCount']===0x0){this['closeMentionDropdown']();return;}const _0x456d88=_0x3e9a4b['getRangeAt'](0x0),_0x427dcd=_0x456d88['startContainer'];if(_0x427dcd['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0xb9508d=_0x427dcd['textContent']||'',_0x224766=_0x456d88['startOffset'],_0x5424f4=_0xb9508d['slice'](0x0,_0x224766),_0x1bb2a1=_0x5424f4['lastIndexOf']('@');if(_0x1bb2a1===-0x1){this['closeMentionDropdown']();return;}const _0x44f855=_0x1bb2a1>0x0?_0x5424f4[_0x1bb2a1-0x1]:'\x20';if(!/\s/['test'](_0x44f855)&&_0x1bb2a1!==0x0){this['closeMentionDropdown']();return;}const _0x112ec4=_0x5424f4['slice'](_0x1bb2a1+0x1);if(/[\s\n]/['test'](_0x112ec4)){this['closeMentionDropdown']();return;}this['mentionState']['active']=!![],this['mentionState']['query']=_0x112ec4['toLowerCase'](),this['mentionState']['startOffset']=_0x1bb2a1,this['mentionState']['startNode']=_0x427dcd,this['showMentionDropdown']();}async['showMentionDropdown'](){if(!this['usersCache'])try{const _0xd57e57=await this['options']['fetchUsers']();this['usersCache']=_0xd57e57['users']||_0xd57e57||[];}catch(_0x3542f8){console['error']('Failed\x20to\x20fetch\x20users\x20for\x20@mention:',_0x3542f8),this['closeMentionDropdown']();return;}this['mentionState']['users']=this['usersCache'];const _0x4e7669=this['mentionState']['query'];this['mentionState']['filteredUsers']=this['mentionState']['users']['filter'](_0x30011e=>{const _0x1fc7ba=(_0x30011e['name']||'')['toLowerCase'](),_0x270a79=(_0x30011e['username']||'')['toLowerCase']();return _0x1fc7ba['includes'](_0x4e7669)||_0x270a79['includes'](_0x4e7669);})['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']=_0x32b8ca=>{!this['mentionDropdown']['contains'](_0x32b8ca['target'])&&!this['editor']['contains'](_0x32b8ca['target'])&&this['closeMentionDropdown']();},document['addEventListener']('click',this['mentionClickOutsideHandler']),this['mentionScrollHandler']=()=>{this['mentionState']['active']&&this['positionMentionDropdown']();},window['addEventListener']('scroll',this['mentionScrollHandler'],!![]));const _0x105ffa=this['mentionState']['filteredUsers'];this['mentionDropdown']['innerHTML']=_0x105ffa['map']((_0x4918b2,_0x474f0a)=>{const _0x574fac=_0x474f0a===this['mentionState']['selectedIndex'],_0xf85eca=_0x4918b2['name']||_0x4918b2['username']||'Unknown',_0x51057a=_0x4918b2['username']||'',_0x42eb8d=this['getInitials'](_0xf85eca),_0x3dc7f4=this['getAvatarColorIndex'](_0x51057a||_0x4918b2['id']||_0xf85eca);return'\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22mention-option\x20'+(_0x574fac?'mention-option-selected':'')+'\x22\x20data-index=\x22'+_0x474f0a+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-avatar\x20avatar-color-'+_0x3dc7f4+'\x22>'+this['escapeHtmlForMention'](_0x42eb8d)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22mention-option-name\x22>'+this['escapeHtmlForMention'](_0xf85eca)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x51057a?'<span\x20class=\x22mention-option-username\x22>@'+this['escapeHtmlForMention'](_0x51057a)+'</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'](_0x5912e8=>{_0x5912e8['addEventListener']('mousedown',_0xefe572=>{_0xefe572['preventDefault']();const _0x509567=parseInt(_0x5912e8['dataset']['index'],0xa);this['insertMention'](this['mentionState']['filteredUsers'][_0x509567]);}),_0x5912e8['addEventListener']('mouseenter',()=>{const _0x3a65de=parseInt(_0x5912e8['dataset']['index'],0xa);this['mentionState']['selectedIndex']=_0x3a65de,this['updateMentionSelection']();});}),this['mentionDropdown']['style']['display']='block';}['positionMentionDropdown'](){if(!this['mentionDropdown'])return;const _0x343843=window['getSelection']();if(!_0x343843||_0x343843['rangeCount']===0x0)return;const _0x46974a=_0x343843['getRangeAt'](0x0),_0xcadfb3=_0x46974a['getBoundingClientRect'](),_0x2f572c=0x104,_0x4faaab=Math['min'](0xf0,this['mentionState']['filteredUsers']['length']*0x24+0x8),_0x4c4720=window['innerWidth'],_0x408fd3=window['innerHeight'],_0x378316=_0x408fd3-_0xcadfb3['bottom'],_0xe5dfac=_0xcadfb3['top'],_0x463ee7=_0x378316<_0x4faaab+0xa&&_0xe5dfac>_0x378316;let _0x3158d3,_0x439c35;_0x463ee7?_0x3158d3=_0xcadfb3['top']+window['scrollY']-_0x4faaab-0x4:_0x3158d3=_0xcadfb3['bottom']+window['scrollY']+0x4,_0x439c35=_0xcadfb3['left']+window['scrollX'],_0x439c35+_0x2f572c>_0x4c4720-0xa&&(_0x439c35=_0x4c4720-_0x2f572c-0xa),_0x439c35<0xa&&(_0x439c35=0xa),this['mentionDropdown']['style']['position']='absolute',this['mentionDropdown']['style']['top']=_0x3158d3+'px',this['mentionDropdown']['style']['left']=_0x439c35+'px';}['mentionNavigate'](_0x57964b){const _0x1e8959=this['mentionState']['filteredUsers']['length'];if(_0x1e8959===0x0)return;this['mentionState']['selectedIndex']=(this['mentionState']['selectedIndex']+_0x57964b+_0x1e8959)%_0x1e8959,this['updateMentionSelection']();}['updateMentionSelection'](){if(!this['mentionDropdown'])return;const _0x4b7a66=this['mentionDropdown']['querySelectorAll']('.mention-option');_0x4b7a66['forEach']((_0x479d11,_0x1ff691)=>{_0x1ff691===this['mentionState']['selectedIndex']?(_0x479d11['classList']['add']('mention-option-selected'),_0x479d11['scrollIntoView']({'block':'nearest'})):_0x479d11['classList']['remove']('mention-option-selected');});}['insertMention'](_0x1f6be0){if(!_0x1f6be0)return;const _0x423416=window['getSelection']();if(!_0x423416||_0x423416['rangeCount']===0x0)return;const _0x2d2439=_0x423416['getRangeAt'](0x0),_0xeaa275=this['mentionState']['startNode'];if(!_0xeaa275||_0xeaa275['nodeType']!==Node['TEXT_NODE']){this['closeMentionDropdown']();return;}const _0x48457e=_0xeaa275['textContent']||'',_0x45d8cb=this['mentionState']['startOffset'],_0x44172b=_0x2d2439['startOffset'],_0xfbaa3c=_0x48457e['slice'](0x0,_0x45d8cb),_0x5d1c57=_0x48457e['slice'](_0x44172b),_0x3fea2b=document['createElement']('span');_0x3fea2b['className']='mention',_0x3fea2b['setAttribute']('data-mention-user-id',_0x1f6be0['id']),_0x3fea2b['setAttribute']('contenteditable','false'),_0x3fea2b['textContent']='@'+(_0x1f6be0['name']||_0x1f6be0['username']);const _0x3021aa=document['createTextNode'](_0xfbaa3c),_0x27b203=document['createTextNode']('\x20'+_0x5d1c57),_0x26827d=_0xeaa275['parentNode'];_0x26827d['insertBefore'](_0x3021aa,_0xeaa275),_0x26827d['insertBefore'](_0x3fea2b,_0xeaa275),_0x26827d['insertBefore'](_0x27b203,_0xeaa275),_0x26827d['removeChild'](_0xeaa275);const _0x1986a1=document['createRange']();_0x1986a1['setStart'](_0x27b203,0x1),_0x1986a1['collapse'](!![]),_0x423416['removeAllRanges'](),_0x423416['addRange'](_0x1986a1),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'](_0x29fd4d){const _0x56b9f7=document['createElement']('div');return _0x56b9f7['textContent']=_0x29fd4d,_0x56b9f7['innerHTML'];}['getInitials'](_0xa72cf4){if(!_0xa72cf4)return'?';const _0xaf3b8e=_0xa72cf4['trim']()['split'](/\s+/);if(_0xaf3b8e['length']>=0x2)return(_0xaf3b8e[0x0][0x0]+_0xaf3b8e[_0xaf3b8e['length']-0x1][0x0])['toUpperCase']();return _0xa72cf4['substring'](0x0,0x2)['toUpperCase']();}['getAvatarColorIndex'](_0x40f7ff){if(!_0x40f7ff)return 0x6;let _0x532da6=0x0;for(let _0x41fcd7=0x0;_0x41fcd7<_0x40f7ff['length'];_0x41fcd7++){_0x532da6=_0x40f7ff['charCodeAt'](_0x41fcd7)+((_0x532da6<<0x5)-_0x532da6);}return Math['abs'](_0x532da6)%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 _0x2296d5 of this['attachmentObjectUrls']['values']()){try{URL['revokeObjectURL'](_0x2296d5);}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 _0xb4784a=document['querySelector']('script[src*=\x22monaco-editor\x22][src*=\x22loader.min.js\x22]');if(_0xb4784a)return monacoLoadPromise=new Promise((_0x229c3a,_0x53a910)=>{const _0x399b9f=setInterval(()=>{typeof monaco!=='undefined'&&(clearInterval(_0x399b9f),_0x229c3a());},0x32);setTimeout(()=>{clearInterval(_0x399b9f),_0x53a910(new Error('Monaco\x20loading\x20timeout'));},0x2710);}),monacoLoadPromise;return monacoLoadPromise=new Promise((_0x60ec55,_0x3d76dc)=>{const _0x4b2cdc=document['createElement']('script');_0x4b2cdc['src']='https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs/loader.min.js',_0x4b2cdc['onload']=()=>{require['config']({'paths':{'vs':'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs'}}),require(['vs/editor/editor.main'],()=>{_0x60ec55();});},_0x4b2cdc['onerror']=()=>_0x3d76dc(new Error('Failed\x20to\x20load\x20Monaco\x20Editor')),document['head']['appendChild'](_0x4b2cdc);}),monacoLoadPromise;}function getMonacoTheme(){const _0x33eaf9=document['documentElement']['getAttribute']('data-theme')==='dark';return _0x33eaf9?'vs-dark':'vs';}function isMarkdownFile(_0x28a0a1){if(!_0x28a0a1)return![];const _0x3727f2=_0x28a0a1['split']('.')['pop']()['toLowerCase']();return _0x3727f2==='md'||_0x3727f2==='markdown';}function createMarkdownFileEditor(_0x9165d5){const {container:_0x1fad71,content:content='',readOnly:readOnly=![],height:height='400px',onChange:onChange=null,placeholder:placeholder='Enter\x20markdown\x20content...',enableModeToggle:enableModeToggle=!![],initialMode:initialMode='visual'}=_0x9165d5;_0x1fad71['innerHTML']='';let _0x123be2='visual',_0x6ec4e3=content,_0x7e41f=null,_0x443e00=null,_0x432aa9=![],_0xe176a4=initialMode==='source';const _0x5672dc=document['createElement']('div');_0x5672dc['className']='markdown-file-editor-wrapper',_0x5672dc['style']['height']=height,_0x5672dc['style']['display']='flex',_0x5672dc['style']['flexDirection']='column',_0x5672dc['style']['border']='1px\x20solid\x20var(--color-border)',_0x5672dc['style']['borderRadius']='var(--radius-small)',_0x5672dc['style']['overflow']='hidden';let _0x268f86=null,_0x555e78=null,_0x31c541=null;!readOnly&&enableModeToggle&&(_0x268f86=document['createElement']('div'),_0x268f86['className']='markdown-editor-mode-toggle',_0x268f86['style']['display']='flex',_0x268f86['style']['alignItems']='center',_0x268f86['style']['padding']='4px\x208px',_0x268f86['style']['borderBottom']='1px\x20solid\x20var(--color-border)',_0x268f86['style']['background']='var(--color-surface-secondary)',_0x268f86['style']['gap']='4px',_0x268f86['style']['flexShrink']='0',_0x555e78=document['createElement']('button'),_0x555e78['type']='button',_0x555e78['className']='markdown-mode-btn',_0x555e78['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',_0x555e78['title']='Visual\x20editing\x20mode\x20(WYSIWYG)',_0x31c541=document['createElement']('button'),_0x31c541['type']='button',_0x31c541['className']='markdown-mode-btn',_0x31c541['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',_0x31c541['title']='Source\x20editing\x20mode\x20(Monaco\x20Editor)',_0x268f86['appendChild'](_0x555e78),_0x268f86['appendChild'](_0x31c541),_0x5672dc['appendChild'](_0x268f86));const _0x3716cc=document['createElement']('div');_0x3716cc['className']='markdown-visual-container',_0x3716cc['style']['flex']='1',_0x3716cc['style']['display']='flex',_0x3716cc['style']['flexDirection']='column',_0x3716cc['style']['overflow']='hidden',_0x3716cc['style']['minHeight']='0';const _0x308ccc=document['createElement']('textarea');_0x308ccc['style']['display']='none',_0x308ccc['value']=content,_0x3716cc['appendChild'](_0x308ccc),_0x5672dc['appendChild'](_0x3716cc);const _0x4e5847=document['createElement']('div');_0x4e5847['className']='markdown-source-container',_0x4e5847['style']['flex']='1',_0x4e5847['style']['display']='none',_0x4e5847['style']['overflow']='hidden',_0x4e5847['style']['minHeight']='0',_0x5672dc['appendChild'](_0x4e5847),_0x1fad71['appendChild'](_0x5672dc),_0x7e41f=new window['MarkdownEditor'](_0x308ccc,{'placeholder':placeholder,'editable':!readOnly,'minHeight':'100%','toolbar':!readOnly,'onChange':_0x36336e=>{_0x6ec4e3=_0x36336e,onChange&&onChange(_0x36336e);}});_0x7e41f['container']&&(_0x7e41f['container']['style']['flex']='1',_0x7e41f['container']['style']['display']='flex',_0x7e41f['container']['style']['flexDirection']='column',_0x7e41f['container']['style']['overflow']='hidden');_0x7e41f['editor']&&(_0x7e41f['editor']['style']['flex']='1',_0x7e41f['editor']['style']['overflow']='auto',_0x7e41f['editor']['style']['minHeight']='0',_0x7e41f['editor']['style']['border']='none',_0x7e41f['editor']['style']['borderRadius']='0',_0x7e41f['editor']['style']['padding']='16px',_0x7e41f['editor']['style']['fontSize']='14px',_0x7e41f['editor']['style']['lineHeight']='1.6');_0x7e41f['toolbar']&&(_0x7e41f['toolbar']['style']['borderRadius']='0',_0x7e41f['toolbar']['style']['flexShrink']='0');content&&_0x7e41f['setMarkdown'](content);function _0x36bac4(){if(!_0x555e78||!_0x31c541)return;_0x123be2==='visual'?(_0x555e78['classList']['add']('active'),_0x31c541['classList']['remove']('active')):(_0x555e78['classList']['remove']('active'),_0x31c541['classList']['add']('active'));}async function _0x23077b(){if(_0x432aa9)return;try{await ensureMonacoLoaded(),_0x443e00=monaco['editor']['create'](_0x4e5847,{'value':_0x6ec4e3,'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':!![]}),_0x443e00['onDidChangeModelContent'](()=>{_0x6ec4e3=_0x443e00['getValue'](),onChange&&onChange(_0x6ec4e3);}),_0x432aa9=!![];}catch(_0x523b62){console['error']('Failed\x20to\x20initialize\x20Monaco\x20editor:',_0x523b62);throw _0x523b62;}}async function _0x3de32e(_0x1c2351){if(_0x1c2351===_0x123be2)return;if(_0x123be2==='visual')_0x6ec4e3=_0x7e41f['getMarkdown']();else _0x443e00&&(_0x6ec4e3=_0x443e00['getValue']());_0x123be2=_0x1c2351;if(_0x1c2351==='visual')_0x4e5847['style']['display']='none',_0x3716cc['style']['display']='flex',_0x7e41f['setMarkdown'](_0x6ec4e3),_0x7e41f['focus']();else{_0x3716cc['style']['display']='none',_0x4e5847['style']['display']='block';if(!_0x432aa9)try{await _0x23077b();}catch(_0x237e06){console['error']('Failed\x20to\x20switch\x20to\x20source\x20mode:',_0x237e06),_0x123be2='visual',_0x4e5847['style']['display']='none',_0x3716cc['style']['display']='flex',_0x36bac4();return;}_0x443e00&&(_0x443e00['setValue'](_0x6ec4e3),_0x443e00['focus'](),_0x443e00['layout']());}_0x36bac4();}_0x555e78&&_0x31c541&&(_0x555e78['addEventListener']('click',_0x415fbc=>{_0x415fbc['preventDefault'](),_0x3de32e('visual');}),_0x31c541['addEventListener']('click',_0x51713c=>{_0x51713c['preventDefault'](),_0x3de32e('source');}),_0x36bac4());_0xe176a4&&setTimeout(()=>_0x3de32e('source'),0x0);const _0x3ef114={'getValue':()=>{if(_0x123be2==='visual')return _0x7e41f['getMarkdown']();else{if(_0x443e00)return _0x443e00['getValue']();}return _0x6ec4e3;},'setValue':_0x5aa28a=>{_0x6ec4e3=_0x5aa28a||'';if(_0x123be2==='visual')_0x7e41f['setMarkdown'](_0x6ec4e3);else _0x443e00&&_0x443e00['setValue'](_0x6ec4e3);},'focus':()=>{if(_0x123be2==='visual')_0x7e41f['focus']();else _0x443e00&&_0x443e00['focus']();},'setEditable':_0xb3bd34=>{_0x7e41f['setEditable'](_0xb3bd34),_0x443e00&&_0x443e00['updateOptions']({'readOnly':!_0xb3bd34});},'destroy':()=>{_0x7e41f['destroy'](),_0x443e00&&(_0x443e00['dispose'](),_0x443e00=null),_0x1fad71['innerHTML']='';},'getMode':()=>_0x123be2,'setMode':_0x2be90e=>_0x3de32e(_0x2be90e),'toggleMode':()=>_0x3de32e(_0x123be2==='visual'?'source':'visual'),'_visualEditor':_0x7e41f,'_getSourceEditor':()=>_0x443e00,'_container':_0x1fad71,'_isMarkdownFileEditor':!![],'_hasModeToggle':enableModeToggle};return _0x3ef114;}const markdownFileEditors=new Map();function getOrCreateMarkdownFileEditor(_0xd193f,_0x59db75,_0x58b0f0=![],_0x1dd237='400px',_0x396cbc=null,_0x3a8add={}){const _0x2fbd3d=document['getElementById'](_0xd193f);if(!_0x2fbd3d)return console['error']('Container\x20not\x20found:\x20'+_0xd193f),null;const _0x349445=markdownFileEditors['get'](_0xd193f);if(_0x349445){try{_0x349445['destroy']();}catch(_0x226182){console['warn']('Failed\x20to\x20destroy\x20existing\x20markdown\x20editor:',_0x226182);}markdownFileEditors['delete'](_0xd193f);}const _0x28f9a4=createMarkdownFileEditor({'container':_0x2fbd3d,'content':_0x59db75,'readOnly':_0x58b0f0,'height':_0x1dd237,'onChange':_0x396cbc,..._0x3a8add});return markdownFileEditors['set'](_0xd193f,_0x28f9a4),_0x28f9a4;}function getMarkdownFileEditorValue(_0x2c4090){const _0x352bc1=markdownFileEditors['get'](_0x2c4090);if(!_0x352bc1)return null;return _0x352bc1['getValue']();}function setMarkdownFileEditorValue(_0x3ee1fb,_0x37ff17){const _0x250c6b=markdownFileEditors['get'](_0x3ee1fb);_0x250c6b&&_0x250c6b['setValue'](_0x37ff17||'');}function disposeMarkdownFileEditor(_0x527e20){const _0x3ac5ca=markdownFileEditors['get'](_0x527e20);if(_0x3ac5ca){try{_0x3ac5ca['destroy']();}catch(_0x37f933){console['warn']('Failed\x20to\x20dispose\x20markdown\x20editor:',_0x37f933);}markdownFileEditors['delete'](_0x527e20);}}function hasMarkdownFileEditor(_0x58ecd6){return markdownFileEditors['has'](_0x58ecd6);}function getMarkdownFileEditorMode(_0x1fc566){const _0x21af70=markdownFileEditors['get'](_0x1fc566);if(!_0x21af70||!_0x21af70['getMode'])return null;return _0x21af70['getMode']();}function setMarkdownFileEditorMode(_0x233e2f,_0x44d34e){const _0x45ae85=markdownFileEditors['get'](_0x233e2f);_0x45ae85&&_0x45ae85['setMode']&&_0x45ae85['setMode'](_0x44d34e);}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});